Only connect and bind to the ldap server if we haven't done that before.
[freeradius.git] / dialup_admin / lib / ldap / change_passwd.php3
index 48dc4a0..2a962bf 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 require_once('../lib/ldap/functions.php3');
-       $ds = @ldap_connect($config[ldap_server]);
+       if (!isset($ds))
+               $ds = @ldap_connect($config[ldap_server]);
        if ($ds){
-               $r = @da_ldap_bind($ds,$config);
+               if (!isset($r))
+                       $r = @da_ldap_bind($ds,$config);
                if ($r){
                        if (is_file("../lib/crypt/$config[general_encryption_method].php3")){
                                include("../lib/crypt/$config[general_encryption_method].php3");