Added auth on file method
[squirrelmail.git] / plugins / administrator / auth.php
index eb6bd740c2641e2e67239671be107827859be3dd..aab2196d774d52ac3754da507506f6363473d344 100644 (file)
@@ -5,7 +5,11 @@ function adm_check_user() {
     GLOBAL $username;
 
     $auth = FALSE;
     GLOBAL $username;
 
     $auth = FALSE;
-    if ( $adm_id = fileowner('../config/config.php') ) {
+    
+    if ( file_exists( '../plugins/administrator/admins' ) ) {
+        $auths = file( '../plugins/administrator/admins' );
+        $auth = in_array( $username, $auths );
+    }else if ( $adm_id = fileowner('../config/config.php') ) {
         $adm = posix_getpwuid( $adm_id );
         if ( $username == $adm['name'] ) {
             $auth = TRUE;
         $adm = posix_getpwuid( $adm_id );
         if ( $username == $adm['name'] ) {
             $auth = TRUE;