moving administrator check to option block registration. reduces amount of
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 6 Aug 2005 05:52:58 +0000 (05:52 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 6 Aug 2005 05:52:58 +0000 (05:52 +0000)
code loaded during plugin's init. removing trailing linefeed from auth.php

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9915 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/administrator/auth.php
plugins/administrator/setup.php

index 0ba719479d51764b6c9b3a40f45142fbb7229656..606058ad3fedcbc08978ec45f7db046eb84bc3e1 100644 (file)
@@ -63,4 +63,4 @@ function adm_check_user() {
 function adm_array_trim(&$value,$key) {
     $value=trim($value);
 }
-?>
+?>
\ No newline at end of file
index 94af22ac6706459ff1238199ffbc2561e0fee0ea..dd2ae82d8dc2506ea9966aabe0fea5785a022bbc 100644 (file)
@@ -12,9 +12,6 @@
  * @subpackage administrator
  */
 
-/** @ignore */
-require_once(SM_PATH . 'plugins/administrator/auth.php');
-
 /**
  * Init the plugin
  * @access private
@@ -22,10 +19,8 @@ require_once(SM_PATH . 'plugins/administrator/auth.php');
 function squirrelmail_plugin_init_administrator() {
     global $squirrelmail_plugin_hooks;
 
-    if ( adm_check_user() ) {
-        $squirrelmail_plugin_hooks['optpage_register_block']['administrator'] =
-                                  'squirrelmail_administrator_optpage_register_block';
-    }
+    $squirrelmail_plugin_hooks['optpage_register_block']['administrator'] =
+        'squirrelmail_administrator_optpage_register_block';
 }
 
 /**
@@ -33,13 +28,18 @@ function squirrelmail_plugin_init_administrator() {
  * @access private
  */
 function squirrelmail_administrator_optpage_register_block() {
-    global $optpage_blocks;
+    /** add authentication functions */
+    include_once(SM_PATH . 'plugins/administrator/auth.php');
 
-    $optpage_blocks[] = array(
-        'name' => _("Administration"),
-        'url'  => SM_PATH . 'plugins/administrator/options.php',
-        'desc' => _("This module allows administrators to manage SquirrelMail main configuration remotely."),
-        'js'   => false
-    );
+    if ( adm_check_user() ) {
+        global $optpage_blocks;
+
+        $optpage_blocks[] = array(
+            'name' => _("Administration"),
+            'url'  => SM_PATH . 'plugins/administrator/options.php',
+            'desc' => _("This module allows administrators to manage SquirrelMail main configuration remotely."),
+            'js'   => false
+            );
+    }
 }
 ?>
\ No newline at end of file