瀏覽代碼

Actually make it work

teo greenwood 10 年之前
父節點
當前提交
0301baf996
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      sys/admin/config/users.inc

+ 6 - 3
sys/admin/config/users.inc

@@ -2,9 +2,12 @@
 $tcmsUsers = json_decode(file_get_contents('config/users.json'),true);
 if (!empty($_SERVER['REMOTE_USER']) && !empty($tcmsUsers)) {
     $poster = "admin";
-    if(array_search($_SERVER['REMOTE_USER'], array_column($tcmsUsers, 'remoteUser')) == $_SERVER['REMOTE_USER']) {
-      $poster = $key;
-    }
+    foreach (array_keys($tcmsUsers) as $user) {
+        if( $tcmsUsers[$user]['remoteUser'] == $_SERVER['REMOTE_USER']) {
+            $poster = $user;
+            break;
+        }   
+    }   
 } else {
     $poster = "Nobody";
 }