瀏覽代碼

posix functions can be disabled or unavailable

tokul 21 年之前
父節點
當前提交
85a08c5ef9
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      plugins/administrator/auth.php

+ 2 - 1
plugins/administrator/auth.php

@@ -36,7 +36,8 @@ function adm_check_user() {
     } else if (file_exists(SM_PATH . 'config/admins')) {
         $auths = file(SM_PATH . 'config/admins');
         $auth = in_array("$username\n", $auths);
-    } else if ($adm_id = fileowner(SM_PATH . 'config/config.php')) {
+    } else if ($adm_id = fileowner(SM_PATH . 'config/config.php') &&
+               function_exists('posix_getpwuid')) {
         $adm = posix_getpwuid( $adm_id );
         $auth = ($username == $adm['name']);
     } else {