diff --git a/lib/authentication/Authenticator.inc b/lib/authentication/Authenticator.inc index e5007ba..03405e7 100644 --- a/lib/authentication/Authenticator.inc +++ b/lib/authentication/Authenticator.inc @@ -1,13 +1,25 @@ fileSystemRoot/lib/users/User.inc"); - /** * $Id$ - * + * * Interface class that performs all authentication functions. + * + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * Licensed under the GNU GPL. For full terms see the file COPYING. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Revision$ * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa @@ -28,7 +40,7 @@ class Authenticator { $aUserDetails = array(); // retrieve the userID - $iUserID = lookupID($default->owl_users_table, "BINARY username", "$sUserName"); + $iUserID = lookupID($default->users_table, "BINARY username", "$sUserName"); if ($iUserID) { $oUser = & User::get($iUserID); @@ -47,10 +59,10 @@ class Authenticator { Session::removeStaleSessions($aUserDetails["userID"]); // Check if Maxsessions has been reached - $iMaxSessions = lookupField($default->owl_users_table, "max_sessions", "id", $iUserID); + $iMaxSessions = lookupField($default->users_table, "max_sessions", "id", $iUserID); $default->log->debug("maxsessions=$iMaxSessions for userID=$iUserID"); $sql = $default->db; - if ($sql->query("SELECT count(*) as count FROM $default->owl_sessions_table WHERE user_id = $iUserID")) { + if ($sql->query("SELECT count(*) as count FROM $default->sessions_table WHERE user_id = $iUserID")) { $sql->next_record(); $default->log->debug("sess count=" . $sql->f("count")); if ($sql->f("count") >= $iMaxSessions) { diff --git a/lib/authentication/DBAuthenticator.inc b/lib/authentication/DBAuthenticator.inc index 837d1ea..c3c952e 100644 --- a/lib/authentication/DBAuthenticator.inc +++ b/lib/authentication/DBAuthenticator.inc @@ -1,19 +1,30 @@ fileSystemRoot/lib/authentication/Authenticator.inc"); - /** * $Id$ - * + * * Perform authentication tasks against the database. * - * Licensed under the GNU GPL. For full terms see the file COPYING. + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * @version $Revision$ + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @version $Revision$ * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa - * @package lib.authentication + * @package lib.authentication */ - class DBAuthenticator extends Authenticator { /** @@ -27,7 +38,7 @@ class DBAuthenticator extends Authenticator { global $default; $sql = $default->db; - if ($sql->query("SELECT * FROM $default->owl_users_table WHERE username = '$userName' AND password = '" . md5($password) . "'")) { + if ($sql->query("SELECT * FROM $default->users_table WHERE username = '$userName' AND password = '" . md5($password) . "'")) { if ($sql->num_rows($sql) == "1") { return true; } else { @@ -55,7 +66,7 @@ class DBAuthenticator extends Authenticator { for ($i=0; $iquery($sQuery)) { $aUserResults = array(); @@ -87,7 +98,7 @@ class DBAuthenticator extends Authenticator { for ($i=0; $iquery($sQuery)) { $aUserResults = array(); diff --git a/lib/authentication/LDAPAuthenticator.inc b/lib/authentication/LDAPAuthenticator.inc index c7d66d1..7015c40 100644 --- a/lib/authentication/LDAPAuthenticator.inc +++ b/lib/authentication/LDAPAuthenticator.inc @@ -1,18 +1,30 @@ fileSystemRoot/lib/authentication/class.AuthLdap.php"); require_once("$default->fileSystemRoot/lib/authentication/Authenticator.inc"); - /** * $Id$ - * + * * Perform authentication tasks against LDAP compliant directory server. + * + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * Licensed under the GNU GPL. For full terms see the file COPYING. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @version $Revision$ + * @version $Revision$ * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa - * @package lib.authentication + * @package lib.authentication */ class LDAPAuthenticator extends Authenticator { @@ -59,7 +71,7 @@ class LDAPAuthenticator extends Authenticator { global $default; if ($this->oLdap->connect()) { // lookup dn from username - must exist in db - $sBindDn = lookupField($default->owl_users_table, "ldap_dn", "username", $sUserName); + $sBindDn = lookupField($default->users_table, "ldap_dn", "username", $sUserName); if ($sBindDn && $sPassword) { if ( $this->oLdap->authBind($sBindDn, $sPassword) ) { return true;