_prefs) { if ($prefs) $this->_prefs = $prefs; } if (!isset($this->_prefs->_method)) _PassUser::_PassUser($UserName); elseif (!$this->isValidName($UserName)) { trigger_error(_("Invalid username."),E_USER_WARNING); return false; } $this->_authmethod = 'Db'; //$this->getAuthDbh(); //$this->_auth_crypt_method = @$GLOBALS['DBAuthParams']['auth_crypt_method']; $dbi =& $GLOBALS['request']->_dbi; $dbtype = $dbi->getParam('dbtype'); if ($dbtype == 'ADODB') { include_once("lib/WikiUser/AdoDb.php"); if (check_php_version(5)) return new _AdoDbPassUser($UserName,$this->_prefs); else { $user = new _AdoDbPassUser($UserName,$this->_prefs); eval("\$this = \$user;"); return $user; } } elseif ($dbtype == 'SQL') { include_once("lib/WikiUser/PearDb.php"); if (check_php_version(5)) return new _PearDbPassUser($UserName,$this->_prefs); else { $user = new _PearDbPassUser($UserName,$this->_prefs); eval("\$this = \$user;"); return $user; } } elseif ($dbtype == 'PDO') { include_once("lib/WikiUser/PdoDb.php"); if (check_php_version(5)) return new _PdoDbPassUser($UserName,$this->_prefs); else { $user = new _PdoDbPassUser($UserName,$this->_prefs); eval("\$this = \$user;"); return $user; } } return false; } /* Since we properly quote the username, we allow most chars here. Just " ; and ' is forbidden, max length: 48 as defined in the schema. */ function isValidName ($userid = false) { if (!$userid) $userid = $this->_userid; if (strcspn($userid, ";'\"") != strlen($userid)) return false; if (strlen($userid) > 48) return false; return true; } function mayChangePass() { return !isset($this->_authupdate); } } // $Log: not supported by cvs2svn $ // Revision 1.3 2005/06/10 06:11:56 rurban // special validname method // // Revision 1.2 2004/12/26 17:11:15 rurban // just copyright // // Revision 1.1 2004/11/01 10:43:58 rurban // seperate PassUser methods into seperate dir (memory usage) // fix WikiUser (old) overlarge data session // remove wikidb arg from various page class methods, use global ->_dbi instead // ... // // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>