summaryrefslogtreecommitdiff
path: root/lib/plugins/authmysql/auth.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-07-30 10:50:52 +0200
committerChristopher Smith <chris@jalakai.co.uk>2013-07-30 10:50:52 +0200
commitaf07997c5ff7cc096965159d90158e3710d2d019 (patch)
treedefaf770e77a679436eb56291185905b547640d0 /lib/plugins/authmysql/auth.php
parentbdac741579f8c6f00248d5d3ec635d4c2e08fb1e (diff)
parent7d8a6abbb21979fd77dca10275ebb8e01a04b6e4 (diff)
downloadrpg-af07997c5ff7cc096965159d90158e3710d2d019.tar.gz
rpg-af07997c5ff7cc096965159d90158e3710d2d019.tar.bz2
Merge branch 'master' into configmgr_improvements
Conflicts: inc/auth.php inc/template.php lib/plugins/authad/lang/zh/settings.php lib/plugins/authldap/lang/en/settings.php lib/plugins/authldap/lang/zh/settings.php lib/plugins/authmysql/lang/zh/settings.php lib/plugins/config/settings/config.class.php lib/plugins/usermanager/admin.php
Diffstat (limited to 'lib/plugins/authmysql/auth.php')
-rw-r--r--lib/plugins/authmysql/auth.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/plugins/authmysql/auth.php b/lib/plugins/authmysql/auth.php
index 7d303726b..036644a67 100644
--- a/lib/plugins/authmysql/auth.php
+++ b/lib/plugins/authmysql/auth.php
@@ -97,6 +97,15 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
), false
);
$this->cando['getUserCount'] = $this->_chkcnf(array('getUsers'), false);
+
+ if($this->getConf('debug') >= 2) {
+ $candoDebug = '';
+ foreach($this->cando as $cd => $value) {
+ if($value) { $value = 'yes'; } else { $value = 'no'; }
+ $candoDebug .= $cd . ": " . $value . " | ";
+ }
+ $this->_debug("authmysql cando: " . $candoDebug, 0, __LINE__, __FILE__);
+ }
}
/**
@@ -816,6 +825,10 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
* @return int|bool insert id or 0, false on error
*/
protected function _modifyDB($query) {
+ if($this->getConf('debug') >= 2) {
+ msg('MySQL query: '.hsc($query), 0, __LINE__, __FILE__);
+ }
+
if($this->dbcon) {
$result = @mysql_query($query, $this->dbcon);
if($result) {
@@ -830,7 +843,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
/**
* Locked a list of tables for exclusive access so that modifications
* to the database can't be disturbed by other threads. The list
- * could be set with $conf['auth']['mysql']['TablesToLock'] = array()
+ * could be set with $conf['plugin']['authmysql']['TablesToLock'] = array()
*
* If aliases for tables are used in SQL statements, also this aliases
* must be locked. For eg. you use a table 'user' and the alias 'u' in
@@ -848,11 +861,12 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin {
*/
protected function _lockTables($mode) {
if($this->dbcon) {
- if(is_array($this->getConf('TablesToLock'))) {
+ $ttl = $this->getConf('TablesToLock');
+ if(is_array($ttl) && !empty($ttl)) {
if($mode == "READ" || $mode == "WRITE") {
$sql = "LOCK TABLES ";
$cnt = 0;
- foreach($this->getConf('TablesToLock') as $table) {
+ foreach($ttl as $table) {
if($cnt++ != 0) $sql .= ", ";
$sql .= "$table $mode";
}