OSDN Git Service

CHANGE: 言語(language)となっていたディレクトリ・定数・変数・翻訳・ドキュメントをロケール(locale)に修正。
[nucleus-jp/nucleus-next.git] / nucleus / plugins / securityenforcer / index.php
index 758c19a..5417cc3 100644 (file)
@@ -1,84 +1,90 @@
-<?php\r
-\r
-/*\r
-\r
-Admin area for NP_SecurityEnforcer\r
-\r
-*/\r
-\r
-       // if your 'plugin' directory is not in the default location,\r
-       // edit this variable to point to your site directory\r
-       // (where config.php is)\r
-       $strRel = '../../../';\r
-\r
-       include($strRel . 'config.php');\r
-       if (!$member->isAdmin())\r
-               doError('Insufficient Permissions.');\r
-               \r
-       include_libs('PLUGINADMIN.php');\r
-\r
-       // some functions\r
-       \r
-       function SE_unlockLogin($login) {\r
-               sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($login)."'");\r
-       }\r
-       \r
-               \r
-       // checks\r
-       \r
-\r
-       \r
-       // create the admin area page\r
-       $oPluginAdmin = new PluginAdmin('SecurityEnforcer');\r
-       // add styles to the <HEAD>\r
-       $oPluginAdmin->start('');\r
-       \r
-       // if form to unlock is posted\r
-       if(postVar('action') == 'unlock') {\r
-               if (!$manager->checkTicket()) \r
-                       doError('Invalid Ticket');\r
-               $logins = postVar('unlock');\r
-               $message = '';\r
-               if(is_array($logins)) {\r
-                       foreach ($logins as $entity) {\r
-                               SE_unlockLogin($entity);\r
-                               $message .= '<br />' . $entity . _SECURITYENFORCER_ADMIN_UNLOCKED;\r
-                       }\r
-               }\r
-       }               \r
-       $plug =& $oPluginAdmin->plugin;\r
-\r
-       // page title\r
-       echo '<h2>'._SECURITYENFORCER_ADMIN_TITLE.'</h2>';\r
-       \r
-       // error output\r
-       if($message) { echo "<p><strong>"; echo $message; echo "</strong></p>"; }\r
-               \r
-       // generate table from all entries in the database\r
-       echo '<h3>'._SECURITYENFORCER_LOCKED_ENTITIES.'</h3>';\r
-       echo '<form action="' . $oPluginAdmin->plugin->getAdminURL() . '" method="POST">';\r
-       echo '<input type="hidden" name="action" value="unlock" />';\r
-       $manager->addTicketHidden();\r
-       echo '<table>';\r
-       echo '<tr><th>'._SECURITYENFORCER_ENTITY.'</th><th>'._SECURITYENFORCER_UNLOCK.'?</th></tr>';\r
-       echo '<tr><td colspan="2" class="submit"><input type="submit" value="'._SECURITYENFORCER_UNLOCK.'" /></td></tr>';\r
-       // do query to get all entries, loop\r
-       $result = sql_query("SELECT * FROM ".sql_table("plug_securityenforcer")." WHERE fails >= ".$plug->max_failed_login);\r
-       if(sql_num_rows($result)) {\r
-               while($row = sql_fetch_assoc($result)) {\r
-                       echo '<tr>';\r
-                               echo '<td>'.i18n::hsc($row['login']).'</td>';\r
-                               echo '<td><input type="checkbox" name="unlock[]" value="'.i18n::hsc($row['login']).'" />'._SECURITYENFORCER_UNLOCK.'</td>';\r
-                       echo '</tr>';\r
-               }\r
-       }\r
-       else {\r
-               echo '<tr><td colspan="2"><strong>'._SECURITYENFORCER_ADMIN_NONE_LOCKED.'</strong></td></tr>';\r
-       }\r
-       echo '<tr><td colspan="2" class="submit"><input type="submit" value="'._SECURITYENFORCER_UNLOCK.'" /></td></tr>';\r
-       echo '</table>';\r
-       echo '</form>';\r
-       \r
-       $oPluginAdmin->end();\r
-\r
-?>\r
+<?php
+
+/*
+ * Admin area for NP_SecurityEnforcer
+ */
+
+/*
+ * if your 'plugin' directory is not in the default location,
+ * edit this variable to point to your site directory
+ * (where config.php is)
+ */
+$strRel = '../../../';
+
+include($strRel . 'config.php');
+if (!$member->isAdmin())
+{
+       doError('Insufficient Permissions.');
+}
+       
+include_libs('PLUGINADMIN.php');
+
+// some functions
+function SE_unlockLogin($login)
+{
+       sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($login)."'");
+}
+       
+// create the admin area page
+$oPluginAdmin = new PluginAdmin('SecurityEnforcer');
+// add styles to the <HEAD>
+$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 .= '<br />' . $entity . _SECURITYENFORCER_ADMIN_UNLOCKED;
+               }
+       }
+}
+$plug =& $oPluginAdmin->plugin;
+
+// page title
+echo '<h2>'._SECURITYENFORCER_ADMIN_TITLE.'</h2>';
+
+// error output
+if ( isset($message) )
+{
+       echo "<p><strong>{$message}</strong></p>\n";
+}
+
+// generate table from all entries in the database
+echo '<h3>'._SECURITYENFORCER_LOCKED_ENTITIES.'</h3>';
+echo '<form action="' . $oPluginAdmin->plugin->getAdminURL() . '" method="POST">';
+echo '<input type="hidden" name="action" value="unlock" />';
+$manager->addTicketHidden();
+echo '<table>';
+echo '<tr><th>'._SECURITYENFORCER_ENTITY.'</th><th>'._SECURITYENFORCER_UNLOCK.'?</th></tr>';
+echo '<tr><td colspan="2" class="submit"><input type="submit" value="'._SECURITYENFORCER_UNLOCK.'" /></td></tr>';
+// do query to get all entries, loop
+$result = sql_query("SELECT * FROM ".sql_table("plug_securityenforcer")." WHERE fails >= ".$plug->max_failed_login);
+if ( sql_num_rows($result) )
+{
+       while( $row = sql_fetch_assoc($result) )
+       {
+               echo '<tr>';
+               echo '<td>'.ENTITY::hsc($row['login']).'</td>';
+               echo '<td><input type="checkbox" name="unlock[]" value="'.ENTITY::hsc($row['login']).'" />'._SECURITYENFORCER_UNLOCK.'</td>';
+               echo '</tr>';
+       }
+}
+else
+{
+       echo '<tr><td colspan="2"><strong>'._SECURITYENFORCER_ADMIN_NONE_LOCKED.'</strong></td></tr>';
+}
+echo '<tr><td colspan="2" class="submit"><input type="submit" value="'._SECURITYENFORCER_UNLOCK.'" /></td></tr>';
+echo '</table>';
+echo '</form>';
+
+$oPluginAdmin->end();