MDL-9399 auth/ldap: Manage 2 new config settings for NTLM SSO
authormartinlanghoff <martinlanghoff>
Wed, 14 Nov 2007 22:07:16 +0000 (22:07 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 14 Nov 2007 22:07:16 +0000 (22:07 +0000)
Changes in the forms and forms handling to set and edit NTLM SSO
related config options.

auth/ldap/auth.php
auth/ldap/config.html

index 384157d75c4c1ab21a807fca6388f961ef6b0852..8dde37fa4d8e2b02dbc8d7ab5361b19cb0ec8c94 100644 (file)
@@ -1803,6 +1803,10 @@ class auth_plugin_ldap extends auth_plugin_base {
             {$config->changepasswordurl = ''; }
         if (!isset($config->removeuser))
             {$config->removeuser = 0; }
+        if (!isset($config->ntlmsso_enabled))
+            {$config->ntlmsso_enabled = 0; }
+        if (!isset($config->ntlmsso_subnet))
+            {$config->ntlmsso_subnet = ''; }
 
         // save settings
         set_config('host_url', $config->host_url, 'auth/ldap');
@@ -1833,6 +1837,8 @@ class auth_plugin_ldap extends auth_plugin_base {
         set_config('passtype', $config->passtype, 'auth/ldap');
         set_config('changepasswordurl', $config->changepasswordurl, 'auth/ldap');
         set_config('removeuser', $config->removeuser, 'auth/ldap');
+        set_config('ntlmsso_enabled', (int)$config->ntlmsso_enabled, 'auth/ldap');
+        set_config('ntlmsso_subnet', $config->ntlmsso_subnet, 'auth/ldap');
 
         return true;
     }
index 30036f8a62950cee77b248a0c63029eb2f5be3dc..55fe2debd0db178ff4d0ce36bf842ba40175dbfc 100644 (file)
         {$config->changepasswordurl = ''; }
     if (!isset($config->removeuser))
         {$config->removeuser = 0; }
+    if (!isset($config->ntlmsso_enabled))
+        {$config->ntlmsso_enabled = 0; }
+    if (!isset($config->ntlmsso_subnet))
+        {$config->ntlmsso_subnet = ''; }
 
     $yesno = array( get_string('no'), get_string('yes') );
 
@@ -439,6 +443,32 @@ if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
     </td>
 </tr>
 
+<tr>
+   <td colspan="2">
+        <h4><?php print_string('auth_ntlmsso', 'auth') ?> </h4>
+   </td>
+</tr>
+
+<tr valign="top">
+    <td align="right"><label for="ntlmsso_enabled"><?php print_string('auth_ntlmsso_enabled_key','auth') ?></label></td>
+    <td>
+    <?php
+       choose_from_menu($yesno, 'ntlmsso_enabled', $config->ntlmsso_enabled, '0');
+    ?>
+    </td>
+    <td>
+    <?php print_string('auth_ntlmsso_enabled','auth') ?>
+    </td>
+</tr>
+<tr valign="top">
+    <td align="right"><label for="ntlmsso_subnet"><?php print_string('auth_ntlmsso_subnet_key','auth') ?></label></td>
+    <td><input name="ntlmsso_subnet" id="ntlmsso_subnet" type="text" size="30" value="<?php p($config->ntlmsso_subnet) ?>"
+    </td>
+    <td>
+    <?php print_string('auth_ntlmsso_subnet','auth') ?>
+    </td>
+</tr>
+
 <?php
 
 $help  = get_string('auth_ldapextrafields','auth');