Skip to content
Permalink
Browse files Browse the repository at this point in the history
fix: Fix to certauth pains
  • Loading branch information
iglocska committed Sep 8, 2017
1 parent eef0f84 commit be111a4
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -133,17 +133,19 @@ public function getUser(CakeRequest $request)
// If $sync is true, allow the creation of the user from the certificate
$sync = Configure::read('CertAuth.syncUser');
if ($sync) {
self::getRestUser();
if (!self::getRestUser()) return false;
}

// find and fill user with model
$userModelKey = empty(Configure::read('CertAuth.userModelKey')) ? 'email' : Configure::read('CertAuth.userModelKey');
$userDefaults = Configure::read('CertAuth.userDefaults');
$this->User = ClassRegistry::init('User');
$existingUser = $this->User->find('first', array(
'conditions' => array($userModelKey => self::$user[$userModelKey]),
'recursive' => false
));
if (!empty(self::$user[$userModelKey])) {
$existingUser = $this->User->find('first', array(
'conditions' => array($userModelKey => self::$user[$userModelKey]),
'recursive' => false
));
}
if ($existingUser) {
if ($sync) {
if (!isset(self::$user['org_id']) && isset(self::$user['org'])) {
Expand Down

0 comments on commit be111a4

Please sign in to comment.