Commit 6eff1dde authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[TASK] Add namespace and password change hook

parent bf0a6935
Pipeline #1480 passed with stages
in 6 minutes and 11 seconds
<?php
namespace T3o\T3omy\Hooks;
/***************************************************************
* Copyright notice
*
* (c) 20167 Stefan Busemann (in2code GmbH)
* (c) 2017 Stefan Busemann (in2code GmbH)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......@@ -27,11 +28,11 @@
***************************************************************/
use In2code\Femanager\Domain\Model\User;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use T3o\T3oSlack\Controller\SlackUserController;
/**
* Hook Functions for \
*/
class Tx_T3omy_Hooks_FeUsers
class FeManagerHooks
{
/**
*/
......@@ -42,7 +43,8 @@ class Tx_T3omy_Hooks_FeUsers
*/
public function __construct()
{
$this->ldap = new Tx_T3oLdap_Utility_UserCreateUpdateDelete();
// @todo make instance of ldap
#$this->ldap = new Tx_T3oLdap_Utility_UserCreateUpdateDelete();
}
/**
......@@ -126,17 +128,17 @@ class Tx_T3omy_Hooks_FeUsers
* @param $_params
* @param bool
*/
public function writePassword($_funcRef, $_params, $felogin)
public function writePassword($_funcRef, $_params, $felogin=false)
{
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($_funcRef, '$_funcRef');
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($_params, '$_params');
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($felogin, '$felogin');
die('halt');
$feUserUid = 0;
$userData = array();
$feUserUid = $_funcRef['user']['uid'];
$userData = $_funcRef['user'];
// set new password
$userData['password']= $_funcRef['newPasswordUnencrypted'];
$createIfNotExists = false;
// @todo add error handling
$result = $this->ldap->updateUser($feUserUid, $userData, $createIfNotExists);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment