4 * This function tell other modules what users have access
11 * @subpackage administrator
17 function adm_check_user() {
19 require_once(SM_PATH
. 'functions/global.php');
21 if ( !sqgetGlobalVar('username',$username,SQ_SESSION
) ) {
25 /* This needs to be first, for all non_options pages */
26 if (strpos('options.php', $PHP_SELF)) {
28 } else if (file_exists(SM_PATH
. 'plugins/administrator/admins')) {
29 $auths = file(SM_PATH
. 'plugins/administrator/admins');
30 $auth = in_array("$username\n", $auths);
31 } else if (file_exists(SM_PATH
. 'config/admins')) {
32 $auths = file(SM_PATH
. 'config/admins');
33 $auth = in_array("$username\n", $auths);
34 } else if ($adm_id = fileowner(SM_PATH
. 'config/config.php')) {
35 $adm = posix_getpwuid( $adm_id );
36 $auth = ($username == $adm['name']);