isAdmin()) { doError('Insufficient Permissions.'); } include_libs('PLUGINADMIN.php'); // some functions function SE_unlockLogin($login) { DB::execute('DELETE FROM '.sql_table('plug_securityenforcer').' WHERE login='.DB::quoteValue($login)); } // create the admin area page $oPluginAdmin = new PluginAdmin('SecurityEnforcer'); // add styles to the $oPluginAdmin->start(''); // if form to unlock is posted if ( postVar('action') == 'unlock' ) { if ( !$manager->checkTicket() ) { doError('Invalid Ticket'); } $logins = postVar('unlock'); $message = ''; if( is_array($logins) ) { foreach ( $logins as $entity ) { SE_unlockLogin($entity); $message .= '
' . $entity . _SECURITYENFORCER_ADMIN_UNLOCKED; } } } $plug =& $oPluginAdmin->plugin; // page title echo '

'._SECURITYENFORCER_ADMIN_TITLE.'

'; // error output if ( isset($message) ) { echo "

{$message}

\n"; } // generate table from all entries in the database echo '

'._SECURITYENFORCER_LOCKED_ENTITIES.'

'; echo '
'; echo ''; $manager->addTicketHidden(); echo ''; echo ''; echo ''; // do query to get all entries, loop $result = DB::getResult("SELECT * FROM ".sql_table("plug_securityenforcer")." WHERE fails >= ".$plug->max_failed_login); if ( $result->rowCount() ) { foreach ( $result as $row ) { echo ''; echo ''; echo ''; echo ''; } } else { echo ''; } echo ''; echo '
'._SECURITYENFORCER_ENTITY.''._SECURITYENFORCER_UNLOCK.'?
'.Entity::hsc($row['login']).''._SECURITYENFORCER_UNLOCK.'
'._SECURITYENFORCER_ADMIN_NONE_LOCKED.'
'; echo '
'; $oPluginAdmin->end();