summaryrefslogtreecommitdiff
path: root/lib/plugins/authmysql/auth.php
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2013-05-10 14:35:28 +0200
committerGuy Brand <gb@unistra.fr>2013-05-10 14:35:28 +0200
commit83f133d10eda8c1c6b6429c08b2d0722ca88ca17 (patch)
tree0377662d2335a0e2160175d5be3b95a92f6bb332 /lib/plugins/authmysql/auth.php
parentbc250e0ee2ec4fba891b53aa4f1814ce648ac71a (diff)
parent2a5a1456564635ddbca06edbc902e7f820d2a97b (diff)
downloadrpg-83f133d10eda8c1c6b6429c08b2d0722ca88ca17.tar.gz
rpg-83f133d10eda8c1c6b6429c08b2d0722ca88ca17.tar.bz2
Merge branch master into stable
Diffstat (limited to 'lib/plugins/authmysql/auth.php')
-rw-r--r--lib/plugins/authmysql/auth.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/plugins/authmysql/auth.php b/lib/plugins/authmysql/auth.php
index 7d303726b..5f6e86c71 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) {
@@ -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";
}