Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Added compatability with reentrant login methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmfcmf committed Jul 29, 2013
1 parent 961694e commit 6a4bef0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Listener/UsersUiHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,14 @@ public function uiEdit(Zikula_Event $event)
public function validateEdit(Zikula_Event $event)
{
if (!$this->request->isPost()) {
// Validation is only appropriate for a post, otherwise it is probably a hack attempt.
// Check if we got here by a reentrant login method.
$sessionVars = $this->request->getSession()->get('Users_Controller_User_login', array(), 'Zikula_Users');
$getReentrantToken = $this->request->query->get('reentranttoken', null);
if (!isset($sessionVars['reentranttoken']) || !isset($getReentrantToken) || $getReentrantToken != $sessionVars['reentranttoken']) {
// Not reentrant login method, it is probably a hack attempt.
throw new Zikula_Exception_Forbidden();
}
}

// If there is no 'acceptedpolicies_uid' in the POST, then there is no attempt to update the acceptance of policies,
// So there is nothing to validate.
Expand Down

0 comments on commit 6a4bef0

Please sign in to comment.