TYPO3 CMS  TYPO3_7-6
AbstractAuthenticationService.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Sv;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
24 {
30  public $pObj;
31 
37  public $mode;
38 
44  public $login = [];
45 
51  public $authInfo = [];
52 
58  public $db_user = [];
59 
65  public $db_groups = [];
66 
72  public $writeAttemptLog = false;
73 
79  public $writeDevLog = false;
80 
90  public function initAuth($mode, $loginData, $authInfo, $pObj)
91  {
92  $this->pObj = $pObj;
93  // Sub type
94  $this->mode = $mode;
95  $this->login = $loginData;
96  $this->authInfo = $authInfo;
97  $this->db_user = $this->getServiceOption('db_user', $authInfo['db_user'], false);
98  $this->db_groups = $this->getServiceOption('db_groups', $authInfo['db_groups'], false);
99  $this->writeAttemptLog = $this->pObj->writeAttemptLog;
100  $this->writeDevLog = $this->pObj->writeDevLog;
101  }
102 
111  public function compareUident(array $user, array $loginData, $passwordCompareStrategy = '')
112  {
113  return $this->pObj->compareUident($user, $loginData, $passwordCompareStrategy);
114  }
115 
130  public function writelog($type, $action, $error, $details_nr, $details, $data, $tablename = '', $recuid = '', $recpid = '')
131  {
132  if ($this->writeAttemptLog) {
133  $this->pObj->writelog($type, $action, $error, $details_nr, $details, $data, $tablename, $recuid, $recpid);
134  }
135  }
136 
145  public function fetchUserRecord($username, $extraWhere = '', $dbUserSetup = '')
146  {
147  $dbUser = is_array($dbUserSetup) ? $dbUserSetup : $this->db_user;
148  $user = $this->pObj->fetchUserRecord($dbUser, $username, $extraWhere);
149  return $user;
150  }
151 }
writelog($type, $action, $error, $details_nr, $details, $data, $tablename='', $recuid='', $recpid='')
getServiceOption($optionName, $defaultValue='', $includeDefaultConfig=true)
fetchUserRecord($username, $extraWhere='', $dbUserSetup='')
compareUident(array $user, array $loginData, $passwordCompareStrategy='')