diff options
author | Anika Henke <anika@selfthinker.org> | 2013-06-02 23:14:12 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2013-06-02 23:14:12 +0100 |
commit | 20beef63b4694afdc3d6c434c3d27c982b6a986b (patch) | |
tree | 9800833361010fe16a2f25a2b2e75a1b569f39f8 /lib/plugins/authmysql/auth.php | |
parent | bc1e9ee1b1fffcb554afced8504270032c97341f (diff) | |
parent | 21c9604e66bcb42ab5267e9873738a6e22250103 (diff) | |
download | rpg-20beef63b4694afdc3d6c434c3d27c982b6a986b.tar.gz rpg-20beef63b4694afdc3d6c434c3d27c982b6a986b.tar.bz2 |
Merge remote-tracking branch 'origin/master' into loggedin-class
Diffstat (limited to 'lib/plugins/authmysql/auth.php')
-rw-r--r-- | lib/plugins/authmysql/auth.php | 20 |
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"; } |