]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
Add a new config directive, ldap_write_server. If it is set then when we update the...
authorkkalev <kkalev>
Mon, 9 Sep 2002 13:27:48 +0000 (13:27 +0000)
committerkkalev <kkalev>
Mon, 9 Sep 2002 13:27:48 +0000 (13:27 +0000)
connect to that one instead of the ldap_server. That way we can read from the fast read-only replicas and
write to a slower master.

Changelog
conf/admin.conf
lib/ldap/change_attrs.php3
lib/ldap/change_info.php3
lib/ldap/change_passwd.php3
lib/ldap/create_user.php3
lib/ldap/defaults.php3
lib/ldap/delete_user.php3

index 085a1d4cb78722b4b66bbacc46da7daef4f1f2a8..a5ce87f59bac56b8887bc219b8bad9f44b988627 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -47,6 +47,9 @@ Ver 1.59:
 * Only connect and bind to the ldap server if we haven't done that before.
 * Remove previous change. It was causing problems
 * In the user test page ignore comments from the auth.request file
+* Add a new config directive, ldap_write_server. If it is set then when we update the directory we try to
+  connect to that one instead of the ldap_server. That way we can read from the fast read-only replicas and
+  write to a slower master.
 Ver 1.55:
 * Update the FAQ about missing attributes from the user/group edit pages and add a few comments
   in the configuration files
index d6276f2afa15be273c42d38573a950802e56348b..700b5cb2e2124c5513477744a46faf50364ef984 100644 (file)
@@ -79,6 +79,13 @@ nas3_port_num: 210
 nas3_community: public
 
 ldap_server: ldap.%{general_domain}
+#
+# There are many cases where we have a small write master and
+# a lot of fast read only replicas. If that is the case uncomment
+# ldap_write_server and point it to the write master. It will be
+# used only when writing to the directory, not when reading
+#
+#ldap_write_server: master.%{general_domain}
 ldap_base: dc=company,dc=com
 ldap_binddn: cn=Directory Manager
 ldap_bindpw: XXXXXXX
index 937d70cf49ffa42fa0f7cefd1f251005e9f202f1..2c2aa239bb4f2abc15635d8fdbcfb43d5b99f393 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 require_once('../lib/ldap/functions.php3');
-       $ds = @ldap_connect($config[ldap_server]);
+       if ($config[ldap_write_server])
+               $ds = @ldap_connect($config[ldap_write_server]);
+       else
+               $ds = @ldap_connect($config[ldap_server]);
        if ($ds){
                $r = @da_ldap_bind($ds,$config);
                if ($r){
index d41a4145f2cedf9afa5427b1c8edb39cff2ea891..bb41a9a737f595feb0983d234267f13a65d633a6 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 require_once('../lib/ldap/functions.php3');
-       $ds = @ldap_connect($config[ldap_server]);
+       if ($config[ldap_write_server])
+               $ds = @ldap_connect($config[ldap_write_server]);
+       else
+               $ds = @ldap_connect($config[ldap_server]);
        if ($ds){
                $r = @da_ldap_bind($ds,$config);
                if ($r){
index 48dc4a0964e8d38c48a261410a7fb13e0889ee12..8ec3108f8238dbf25ffd9e152d919a967141b9ad 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 require_once('../lib/ldap/functions.php3');
-       $ds = @ldap_connect($config[ldap_server]);
+       if ($config[ldap_write_server])
+               $ds = @ldap_connect($config[ldap_write_server]);
+       else
+               $ds = @ldap_connect($config[ldap_server]);
        if ($ds){
                $r = @da_ldap_bind($ds,$config);
                if ($r){
index d64fe0e9ea4162ac204559e6e7541d0f2f5b548b..0a4d10d7144910e9eef6ebadd2bb7c79022ff9c9 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 require_once('../lib/ldap/functions.php3');
-       $ds = @ldap_connect($config[ldap_server]);
+       if ($config[ldap_write_server])
+               $ds = @ldap_connect($config[ldap_write_server]);
+       else
+               $ds = @ldap_connect($config[ldap_server]);
        if ($ds){
                $r = @da_ldap_bind($ds,$config);
                if ($r){
index b104471e653ffdce2078272fb72673fb475a16b9..4169d8a43a050f2b536d58e1e82f2981e5434dd8 100644 (file)
@@ -5,7 +5,7 @@ if ($config[ldap_default_dn] != ''){
        $regular_profile_attr = $config[ldap_regular_profile_attr];
        $ds=@ldap_connect("$config[ldap_server]");  // must be a valid ldap server!
        if ($ds) {
-               $r=@da_ldap_bind($ds,$config);
+                       $r=@da_ldap_bind($ds,$config);
                        $sr=@ldap_search($ds,"$config[ldap_default_dn]", 'objectclass=*');
                        if ($info = @ldap_get_entries($ds, $sr)){
                                $dn = $info[0]['dn'];
index 052ab7885d7d748a81bd63e92f9bed61427f0060..627c805e0236e29775137770e28f4143266c6412 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 require_once('../lib/ldap/functions.php3');
-$ds = @ldap_connect($config[ldap_server]);
+if ($config[ldap_write_server])
+       $ds = @ldap_connect($config[ldap_write_server]);
+else
+       $ds = @ldap_connect($config[ldap_server]);
 if ($ds){
        $r = @da_ldap_bind($ds,$config);
        if ($r){