Documentation TYPO3 par Ameos

class.tx_sv_authbase.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2004-2005 René Fritz <r.fritz@colorcube.de>
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00050 require_once(PATH_t3lib.'class.t3lib_svbase.php');
00051 
00052 
00053 
00054 
00062 class tx_sv_authbase extends t3lib_svbase       {
00063 
00064         var $pObj;                      // Parent object
00065 
00066         var $mode;                      // Subtype of the service which is used to call the service.
00067 
00068         var $login = array();           // Submitted login form data
00069         var $authInfo = array();        // Various data
00070 
00071         var $db_user = array();         // User db table definition
00072         var $db_groups = array();       // Usergroups db table definition
00073 
00074         var $writeAttemptLog = false;   // If the writelog() functions is called if a login-attempt has be tried without success
00075         var $writeDevLog = false;       // If the t3lib_div::devLog() function should be used
00076 
00077 
00087         function initAuth($mode, $loginData, $authInfo, &$pObj) {
00088 
00089                 $this->pObj = &$pObj;
00090 
00091                 $this->mode = $mode;    // sub type
00092                 $this->login = $loginData;
00093                 $this->authInfo = $authInfo;
00094 
00095                 $this->db_user = $this->getServiceOption('db_user', $authInfo['db_user'], FALSE);
00096                 $this->db_groups = $this->getServiceOption('db_groups', $authInfo['db_groups'], FALSE);
00097 
00098                 $this->writeAttemptLog = $this->pObj->writeAttemptLog;
00099                 $this->writeDevLog       = $this->pObj->writeDevLog;
00100         }
00101 
00110         function compareUident($user, $loginData, $security_level='') {
00111                 return $this->pObj->compareUident($user, $loginData, $security_level);
00112         }
00113 
00129         function writelog($type,$action,$error,$details_nr,$details,$data,$tablename='',$recuid='',$recpid='')  {
00130                 if($this->writeAttemptLog) {
00131                         $this->pObj->writelog($type,$action,$error,$details_nr,$details,$data,$tablename,$recuid,$recpid);
00132                 }
00133         }
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144         /*************************
00145          *
00146          * create/update user - EXPERIMENTAL
00147          *
00148          *************************/
00149 
00158         function fetchUserRecord($username, $extraWhere='', $dbUserSetup='')    {
00159 
00160                 $dbUser = is_array($dbUserSetup) ? $dbUserSetup : $this->db_user;
00161                 $user = $this->pObj->fetchUserRecord($dbUser, $username, $extraWhere);
00162 
00163                 return $user;
00164         }
00165 }
00166 
00167 ?>


Généré par Les spécialistes TYPO3 avec  doxygen 1.4.6