3 /* Copyright (C) 2007,2009 ReiniUrban
4 * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2)
6 * See http://openid.net/specs/openid-authentication-1_1.html
12 * Preferences are handled in _PassUser
15 // This can only be called from _PassUser, because the parent class
16 // sets the pref methods, before this class is initialized.
17 function _OpenIDPassUser($UserName='', $prefs=false, $file='') {
18 if (!$this->_prefs and isa($this, "_OpenIDPassUser")) {
19 if ($prefs) $this->_prefs = $prefs;
20 if (!isset($this->_prefs->_method))
21 _PassUser::_PassUser($UserName);
23 $this->_userid = $UserName;
27 function userExists() {
28 if (!$this->isValidName($this->_userid)) {
29 return $this->_tryNextUser();
31 $this->_authmethod = 'OpenID';
32 return $this->_tryNextUser();
34 // no quotes and shorter than 128
35 function isValidName() {
36 if (!$this->_userid) return false;
37 return !preg_match('/[\"\']/', $this->_userid) and strlen($this->_userid) < 128;
45 // c-hanging-comment-ender-p: nil
46 // indent-tabs-mode: nil