Skip to content

Commit

Permalink
Merge 98b2b77 into aba4f4e
Browse files Browse the repository at this point in the history
  • Loading branch information
fxleblanc committed Apr 1, 2016
2 parents aba4f4e + 98b2b77 commit c14f3c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controller/OrganizationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ public function add()
*/
public function submit()
{
if ($this->request->Session()->read('create_organization_redirect')) {
$this->request->Session()->delete('create_organization_redirect');
}

$organization = $this->Organizations->newEntity();

$organization->editIsValidated(false);
Expand Down
4 changes: 4 additions & 0 deletions src/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ public function login()
'Memberships'
];

if ($this->request->Session()->read('create_organization_redirect')) {
return $this->redirect(['controller' => 'Organizations', 'action' => 'submit']);
}
if ($this->request->Session()->read('actionRef') && $this->request->Session()->read('controllerRef')
&& !in_array($this->request->Session()->read('actionRef'), $actionRefs)
&& !in_array($this->request->Session()->read('controllerRef'), $controllerRefs)
Expand Down Expand Up @@ -372,6 +375,7 @@ public function registerIndustry()
if ($this->request->data['isMember'] == "1") {
return $this->redirect(['controller' => 'Memberships', 'action' => 'add']);
}
$this->request->session()->write('create_organization_redirect', true);
return $this->redirect(['action' => 'login']);
} else {
$this->Flash->error(
Expand Down

0 comments on commit c14f3c4

Please sign in to comment.