瀏覽代碼

[Web] Prevent user sync for mismatched authsource

FreddleSpl0it 5 月之前
父節點
當前提交
e65478076b
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      data/conf/phpfpm/crons/keycloak-sync.php
  2. 1 1
      data/conf/phpfpm/crons/ldap-sync.php

+ 1 - 1
data/conf/phpfpm/crons/keycloak-sync.php

@@ -196,7 +196,7 @@ while (true) {
         logMsg("err", "Could not create user " . $user['email']);
         continue;
       }
-    } else if ($row && intval($iam_settings['periodic_sync']) == 1) {
+    } else if ($row && intval($iam_settings['periodic_sync']) == 1 && $row['authsource'] == "keycloak") {
       if ($mapper_key === false){
         logMsg("warning", "No matching attribute mapping found for user " . $user['email']);
         continue;

+ 1 - 1
data/conf/phpfpm/crons/ldap-sync.php

@@ -168,7 +168,7 @@ foreach ($response as $user) {
       logMsg("err", "Could not create user " . $user[$iam_settings['username_field']][0]);
       continue;
     }
-  } else if ($row && intval($iam_settings['periodic_sync']) == 1) {
+  } else if ($row && intval($iam_settings['periodic_sync']) == 1 && $row['authsource'] == "ldap") {
     if ($mapper_key === false){
       logMsg("warning", "No matching attribute mapping found for user " . $user[$iam_settings['username_field']][0]);
       continue;