From b23559224cef22053cfc3b63a65bfeb1296a8eb7 Mon Sep 17 00:00:00 2001 From: "m.fu" Date: Tue, 3 Nov 2009 23:08:53 +0000 Subject: Fixed #588208 by ikogan : fixed the colon detection Fixed #611020 by fasdalf@fasdalf.ru : group file not updated when adding user --- CHANGELOG.txt | 3 +++ HTPasswdSync.module | 20 +++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8ae0a91..957d342 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,9 @@ $Id$ Fixed #588208 by ikogan : username shall not contain colon +v1.4 bug fix release +Fixed #588208 by ikogan : fixed the colon detection +Fixed #611020 by fasdalf@fasdalf.ru : group file not updated when adding user v1.3 bug fix release Fixed #588208 by ikogan : username with t are concidered invalid diff --git a/HTPasswdSync.module b/HTPasswdSync.module index cfb6b27..ae27095 100644 --- a/HTPasswdSync.module +++ b/HTPasswdSync.module @@ -2,6 +2,10 @@ // $Id$ /* * $Log$ + * Revision 1.1.2.7 2009/11/03 23:08:53 mfu + * Fixed #588208 by ikogan : fixed the colon detection + * Fixed #611020 by fasdalf@fasdalf.ru : group file not updated when adding user + * * Revision 1.1.2.6 2009/10/19 21:50:42 mfu * Fixed #588208 by ikogan : username shall not contain colon * @@ -194,7 +198,7 @@ * @return */ function _htpasswdsync_updategroup() { - + firep("called _htpasswdsync_updategroup"); $file = _htpasswdsync_grpfilename(); $groups = array(); @@ -207,6 +211,8 @@ // get role name $res = db_fetch_object(db_query('SELECT name FROM {role} WHERE rid = %d', $rid)); $name = $res->name; + firep($rid, "rid"); + firep($res->name, "$res->name"); //empty group $groups[$name] = ""; @@ -215,9 +221,13 @@ $res = db_query('SELECT name FROM {users} u, {users_roles} ur WHERE ur.rid = %d AND ur.uid = u.uid AND status = 1', $rid); while ($r = db_fetch_object($res)) { $groups[$name] .= " ". $r->name; + firep($r->name, "$r->name"); + firep($groups, "$groups"); } - } _htpasswdsync_write_htfile($groups, $file); + } + _htpasswdsync_write_htfile($groups, $file); + firep("end _htpasswdsync_updategroup"); } /* generate the htpasswd content from the database @@ -228,7 +238,7 @@ * @return */ function _htpasswdsync_updatepasswd() { - + firep("called _htpasswdsync_updatepasswd"); $file = _htpasswdsync_passfilename(); $passwords = array(); @@ -247,6 +257,7 @@ } } _htpasswdsync_write_htfile($passwords, $file); + firep("end _htpasswdsync_updatepasswd"); } @@ -387,6 +398,9 @@ function htpasswdsync_user($op, &$edit, &$account, $category = NULL) { case "validate": _htpasswdsync_validate($edit, $account); break; + case "load": + _htpasswdsync_updategroup(); + break; } } // function htpasswdsync_user() -- cgit v1.2.3