whitespace around an admin-username.
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8748
7612ce4b-ef26-0410-bec9-
ea0150e637f0
An alternative method, but less secure, is to add a file called
admins into the plugin folder with the names of the users that
An alternative method, but less secure, is to add a file called
admins into the plugin folder with the names of the users that
-you want to allow the use of the plugin. admins file must have
-empty line after administrator's username. If administrator name
-ends of end-of-file symbol instead of line feed, it will be
-ignored.
+you want to allow the use of the plugin.
Use this plugin at your own risk, and always remember to make a
backup of your config.php file before use.
Use this plugin at your own risk, and always remember to make a
backup of your config.php file before use.
$auth = FALSE;
} else if (file_exists(SM_PATH . 'plugins/administrator/admins')) {
$auths = file(SM_PATH . 'plugins/administrator/admins');
$auth = FALSE;
} else if (file_exists(SM_PATH . 'plugins/administrator/admins')) {
$auths = file(SM_PATH . 'plugins/administrator/admins');
- $auth = in_array("$username\n", $auths);
+ array_walk($auths, 'trim');
+ $auth = in_array($username, $auths);
} else if (file_exists(SM_PATH . 'config/admins')) {
$auths = file(SM_PATH . 'config/admins');
} else if (file_exists(SM_PATH . 'config/admins')) {
$auths = file(SM_PATH . 'config/admins');
- $auth = in_array("$username\n", $auths);
+ array_walk($auths, 'trim');
+ $auth = in_array($username, $auths);
} else if (($adm_id = fileowner(SM_PATH . 'config/config.php')) &&
function_exists('posix_getpwuid')) {
$adm = posix_getpwuid( $adm_id );
} else if (($adm_id = fileowner(SM_PATH . 'config/config.php')) &&
function_exists('posix_getpwuid')) {
$adm = posix_getpwuid( $adm_id );
-?>
\ No newline at end of file