AY's Macbook Pro 3 лет назад
Родитель
Сommit
fc5a0e72c3
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      web/login.system

+ 13 - 0
web/login.system

@@ -103,6 +103,9 @@
                 <div class="oauthonly" style="display:none;">
                     <a class="ts fluid small button oauthbtn subthemecolor" href="system/auth/oauth/login">Sign In via OAuth 2.0</a><br>
                 </div>
+                <div class="ldaponly" style="display:none;">
+                    <a class="ts fluid small button oauthbtn subthemecolor" href="ldapLogin.system">Sign In via LDAP</a><br>
+                </div>
                 <br>
                 <div class="ts fluid input textbox">
                     <input id="username" type="text" placeholder="Username">
@@ -220,6 +223,16 @@
                     }
                 }
             });
+
+            //LDAP related code, check if system is open for ext login
+            $.getJSON("system/auth/ldap/checkldap",function(data){
+                if (data.enabled == true && window.location.pathname.toLowerCase() != "/ldaplogin.system"){
+                    $(".ldaponly").show();
+                }else{
+                    $(".ldaponly").hide();
+                }
+            });
+
             if(get('redirect') != undefined){
                 $(".section.signin").attr("href","system/auth/oauth/login?redirect=" + redirectionAddress);
             }