2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 require_once('./includes/auth/auth.php');
25 * Authentication Default
27 * Default authentication scheme to allow Bugdar to manage its own users.
30 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
35 class AuthenticationDefault
extends Authentication
37 // ###################################################################
38 function _setupDatabase()
40 $this->authDb
=& $this->db
;
43 // ###################################################################
44 function _fetchCookieUniqueId()
46 return $this->registry
->input_clean(COOKIE_PREFIX
. 'userid', TYPE_UINT
);
49 // ###################################################################
50 function _fetchCookiePassword()
52 return $this->registry
->in
[COOKIE_PREFIX
. 'authkey'];
55 // ###################################################################
56 function _fetchUserUsingCookies()
58 return $this->db
->query_first("SELECT * FROM " . TABLE_PREFIX
. "user WHERE userid = " . $this->_fetchCookieUniqueId());
61 // ###################################################################
62 function _verifyCookieData()
64 return ($this->authUser
['authkey'] == $this->_fetchCookiePassword());
67 // ###################################################################
68 function _setCookies()
70 $this->registry
->funct
->cookie(COOKIE_PREFIX
. 'userid', $this->authUser
['userid']);
71 $this->registry
->funct
->cookie(COOKIE_PREFIX
. 'authkey', $this->authUser
['authkey']);
74 // ###################################################################
75 function _clearCookies()
77 $this->registry
->funct
->cookie(COOKIE_PREFIX
. 'userid');
78 $this->registry
->funct
->cookie(COOKIE_PREFIX
. 'authkey');
81 // ###################################################################
82 function _fetchBugdarUserFromAuthUser()
84 return $this->authUser
;
88 /*=====================================================================*\
89 || ###################################################################
92 || ###################################################################
93 \*=====================================================================*/