Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Respect closed registration setting in googleauth module
Browse files Browse the repository at this point in the history
Users that don't already exist in the system will not be allowed
to create one by logging in with their google account.
  • Loading branch information
zachmullen committed Jul 9, 2014
1 parent bc6bfc9 commit eb0e75c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/googleauth/controllers/CallbackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ protected function _createOrGetUser($info)
$user = $this->User->getByEmail($info['email']);
if(!$user)
{
// Only create new user this way if registration is not closed.
if(isset(Zend_Registry::get('configGlobal')->closeregistration) &&
Zend_Registry::get('configGlobal')->closeregistration == "1")
{
throw new Zend_Exception('Access to this instance is by invitation '.
'only, please contact an administrator.');
}
$user = $this->User->createUser(
$info['email'], null, $info['firstName'], $info['lastName'], 0, '');
}
Expand Down

0 comments on commit eb0e75c

Please sign in to comment.