Переглянути джерело

Added auth on file method

philippe_mingo 23 роки тому
батько
коміт
1ca01f3a12
2 змінених файлів з 6 додано та 1 видалено
  1. 1 0
      plugins/administrator/.cvsignore
  2. 5 1
      plugins/administrator/auth.php

+ 1 - 0
plugins/administrator/.cvsignore

@@ -0,0 +1 @@
+admins

+ 5 - 1
plugins/administrator/auth.php

@@ -5,7 +5,11 @@ function adm_check_user() {
     GLOBAL $username;
     GLOBAL $username;
 
 
     $auth = FALSE;
     $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 );
         $adm = posix_getpwuid( $adm_id );
         if ( $username == $adm['name'] ) {
         if ( $username == $adm['name'] ) {
             $auth = TRUE;
             $auth = TRUE;