summaryrefslogtreecommitdiff
path: root/conf/mysql.conf.php.example
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2006-01-24 20:06:25 +0100
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2006-01-24 20:06:25 +0100
commitdfdd92d5662e73b29998dacc0aa2f79437dfd82f (patch)
tree0e2e47eed14754594622cf9ed64462c15fb9840b /conf/mysql.conf.php.example
parent6ab04157718c5e3a08b08d27bf325c9c2ce660b4 (diff)
downloadrpg-dfdd92d5662e73b29998dacc0aa2f79437dfd82f.tar.gz
rpg-dfdd92d5662e73b29998dacc0aa2f79437dfd82f.tar.bz2
MySQL modify user patch
This patch changed the function modifyUser(). Before this update each data change was applied by deleting and re-adding the complete user entry. The new function uses the UPDATE SQL statement. Furthermore all human readable error messages were removed. The calling procedure is in charge now to inform the user about failures. Internal debug messages were added. They can be enabled in the configuration file. Last but not least the module retrieves the database version now to handle incompatible features between different MySQL versions. darcs-hash:20060124190625-7ef76-f6dffabf230155aa51bf3c8569c31fd444634407.gz
Diffstat (limited to 'conf/mysql.conf.php.example')
-rw-r--r--conf/mysql.conf.php.example31
1 files changed, 29 insertions, 2 deletions
diff --git a/conf/mysql.conf.php.example b/conf/mysql.conf.php.example
index fe0664903..66fcf5f13 100644
--- a/conf/mysql.conf.php.example
+++ b/conf/mysql.conf.php.example
@@ -28,6 +28,11 @@ $conf['auth']['mysql']['user'] = '';
$conf['auth']['mysql']['password'] = '';
$conf['auth']['mysql']['database'] = '';
+/* This option enables debug messages in the mysql module. It is
+ * mostly usefull for system admins.
+ */
+$conf['auth']['mysql']['debug'] = 0;
+
/* Normally password encryptionis done by DokuWiki (recommended) but for
* some reasons it might be usefull to let the database do the encryption.
* Set 'encryptPass' to '1' and the cleartext password is forwarded to
@@ -48,7 +53,9 @@ $conf['auth']['mysql']['TablesToLock']= array("users", "users AS u","groups", "g
* following patters will be replaced:
* %{user} user name
*/
-$conf['auth']['mysql']['getUserID'] = "SELECT uid AS id FROM users WHERE login='%{user}'";
+$conf['auth']['mysql']['getUserID'] = "SELECT uid AS id
+ FROM users
+ WHERE login='%{user}'";
/* This statement should return the database index of a given group name.
* The module will access the index with the name 'id' so a alias might be
@@ -56,7 +63,9 @@ $conf['auth']['mysql']['getUserID'] = "SELECT uid AS id FROM users WHERE login
* following patters will be replaced:
* %{group} group name
*/
-$conf['auth']['mysql']['getGroupID'] = "SELECT gid AS id FROM groups WHERE name='%{group}'";
+$conf['auth']['mysql']['getGroupID'] = "SELECT gid AS id
+ FROM groups
+ WHERE name='%{group}'";
/* This statement is used to grant or deny access to the wiki. The result should
* be a table with exact one line containing at least the password of the user.
@@ -137,6 +146,24 @@ $conf['auth']['mysql']['addUser'] = "INSERT INTO users
SUBSTRING_INDEX('%{name}',' ', 1),
SUBSTRING_INDEX('%{name}',' ', -1))";
+/* This statements should modify a user entry in the database. The statements
+ * UpdateLogin, UpdatePass, UpdateEmail and UpdateName will be added to
+ * updateUser on demand. Only changed parameters will be used.
+ * Following patterns will be replaced:
+ * %{user} user's login name
+ * %{pass} password (encrypted or clear text, depends on 'encryptPass')
+ * %{email} email address
+ * %{name} user's full name
+ * %{uid} user id that should be updated
+ */
+$conf['auth']['mysql']['updateUser'] = "UPDATE users SET";
+$conf['auth']['mysql']['UpdateLogin'] = "login='%{user}'";
+$conf['auth']['mysql']['UpdatePass'] = "pass='%{pass}'";
+$conf['auth']['mysql']['UpdateEmail'] = "email='%{email}'";
+$conf['auth']['mysql']['UpdateName'] = "firstname=SUBSTRING_INDEX('%{name}',' ', 1),
+ lastname=SUBSTRING_INDEX('%{name}',' ', -1)";
+$conf['auth']['mysql']['UpdateTarget']= "WHERE uid=%{uid}";
+
/* This statement should remove a user fom the database.
* Following patterns will be replaced:
* %{user} user's login name