'trim' was not working as expected and admins file was usable on for one admin without
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 Mar 2005 10:42:41 +0000 (10:42 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 Mar 2005 10:42:41 +0000 (10:42 +0000)
whitespace. specific to 1.5.1cvs and 1.4.5cvs

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

plugins/administrator/auth.php

index 0f394471b75620e0fe1391ecffe254a02d134b37..3aac1a106499393c974df4f54deb53ff1a51c47a 100644 (file)
@@ -32,11 +32,11 @@ function adm_check_user() {
         $auth = FALSE;
     } else if (file_exists(SM_PATH . 'plugins/administrator/admins')) {
         $auths = file(SM_PATH . 'plugins/administrator/admins');
-        array_walk($auths, 'trim');
+        array_walk($auths, 'adm_array_trim');
         $auth = in_array($username, $auths);
     } else if (file_exists(SM_PATH . 'config/admins')) {
         $auths = file(SM_PATH . 'config/admins');
-        array_walk($auths, 'trim');
+        array_walk($auths, 'adm_array_trim');
         $auth = in_array($username, $auths);
     } else if (($adm_id = fileowner(SM_PATH . 'config/config.php')) &&
                function_exists('posix_getpwuid')) {
@@ -49,4 +49,13 @@ function adm_check_user() {
     return ($auth);
 }
 
-?>
+/**
+ * Removes whitespace from array values
+ * @param string $value array value that has to be trimmed
+ * @param string $key array key
+ * @since 1.5.1
+ */
+function adm_array_trim(&$value,$key) {
+    $value=trim($value);
+}
+?>
\ No newline at end of file