@@ -19,7 +19,6 @@ discard block |
||
19 | 19 | use Application\Controller\Traits\ControllerTranslatorTrait; |
20 | 20 | use Application\Controller\Traits\ControllerActiontitlesTrait; |
21 | 21 | use Application\Controller\Traits\ControllerToolbarTrait; |
22 | - |
|
23 | 22 | use Admin\Module as AdminModule; |
24 | 23 | use Admin\Form\RequestPasswordResetForm; |
25 | 24 | use Admin\Form\ResetPasswordForm; |
@@ -28,14 +27,11 @@ discard block |
||
28 | 27 | use Admin\Form\UserDataForm; |
29 | 28 | use Admin\Form\UserProfileForm; |
30 | 29 | use Admin\Model\UserProfile; |
31 | - |
|
32 | 30 | use Zend\Crypt\Password\Bcrypt; |
33 | 31 | use Zend\Stdlib\ResponseInterface as Response; |
34 | - |
|
35 | 32 | use Zend\View\Model\ViewModel; |
36 | 33 | use Zend\Mvc\MvcEvent; |
37 | 34 | use Zend\ServiceManager\ServiceLocatorInterface; |
38 | - |
|
39 | 35 | use ZfcUser\Controller\UserController; |
40 | 36 | use ZfcUser\Controller\Plugin\ZfcUserAuthentication; |
41 | 37 |
@@ -377,8 +377,8 @@ discard block |
||
377 | 377 | $request = $this->getRequest(); |
378 | 378 | //$service = $this->getUserService(); |
379 | 379 | $service = \Application\Module::getService('zfcuser_user_service'); |
380 | - $form = new RequestPasswordResetForm(null, $options); |
|
381 | - $translator = $this->getTranslator(); |
|
380 | + $form = new RequestPasswordResetForm(null, $options); |
|
381 | + $translator = $this->getTranslator(); |
|
382 | 382 | |
383 | 383 | // if password reset is disabled |
384 | 384 | if (!$config['zfcuser']['enable_passwordreset']) { |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $redirect = false; |
392 | 392 | } |
393 | 393 | |
394 | - $redirectUrl = $this->url()->fromRoute('userrequestpasswordreset') . ($redirect ? '?redirect=' . rawurlencode($redirect) : ''); |
|
394 | + $redirectUrl = $this->url()->fromRoute('userrequestpasswordreset').($redirect ? '?redirect='.rawurlencode($redirect) : ''); |
|
395 | 395 | |
396 | 396 | if (!$request->isPost()) { |
397 | 397 | return array( |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | sprintf($translator->translate("password reset email has been sent to user '%s'"), $identity) |
440 | 440 | ); |
441 | 441 | |
442 | - return $this->redirect()->toUrl($this->url()->fromRoute($config["zfcuser_registration_redirect_route"]) . ($redirect ? '?redirect='. rawurlencode($redirect) : '')); |
|
442 | + return $this->redirect()->toUrl($this->url()->fromRoute($config["zfcuser_registration_redirect_route"]).($redirect ? '?redirect='.rawurlencode($redirect) : '')); |
|
443 | 443 | |
444 | 444 | } |
445 | 445 | |
@@ -465,8 +465,8 @@ discard block |
||
465 | 465 | $request = $this->getRequest(); |
466 | 466 | //$service = $this->getUserService(); |
467 | 467 | $service = \Application\Module::getService('zfcuser_user_service'); |
468 | - $form = new ResetPasswordForm(null, $options); |
|
469 | - $translator = $this->getTranslator(); |
|
468 | + $form = new ResetPasswordForm(null, $options); |
|
469 | + $translator = $this->getTranslator(); |
|
470 | 470 | |
471 | 471 | // if password reset is disabled |
472 | 472 | if (!$config['zfcuser']['enable_passwordreset']) { |
@@ -479,9 +479,9 @@ discard block |
||
479 | 479 | $redirect = false; |
480 | 480 | } |
481 | 481 | |
482 | - $redirectUrl = $this->url()->fromRoute(static::ROUTE_LOGIN) . ($redirect ? '?redirect=' . rawurlencode($redirect) : ''); |
|
482 | + $redirectUrl = $this->url()->fromRoute(static::ROUTE_LOGIN).($redirect ? '?redirect='.rawurlencode($redirect) : ''); |
|
483 | 483 | |
484 | - if (!$request->isPost() ) { |
|
484 | + if (!$request->isPost()) { |
|
485 | 485 | |
486 | 486 | $user = false; |
487 | 487 | $userId = (int) $this->params()->fromRoute('user_id'); |
@@ -490,14 +490,14 @@ discard block |
||
490 | 490 | $userTable = \Application\Module::getService('zfcuser_user_mapper'); |
491 | 491 | $user = $userTable->findById($userId); |
492 | 492 | |
493 | - if (!$user ) { |
|
493 | + if (!$user) { |
|
494 | 494 | $this->flashMessenger()->addWarningMessage( |
495 | 495 | sprintf($translator->translate("invalid request"), '') |
496 | 496 | ); |
497 | 497 | return $this->redirect()->toUrl($redirectUrl); |
498 | 498 | } |
499 | 499 | |
500 | - if (empty($resetToken) || ($resetToken != $user->getToken()) ) { |
|
500 | + if (empty($resetToken) || ($resetToken != $user->getToken())) { |
|
501 | 501 | $this->flashMessenger()->addWarningMessage( |
502 | 502 | sprintf($translator->translate("invalid request"), '') |
503 | 503 | ); |
@@ -526,23 +526,23 @@ discard block |
||
526 | 526 | $userTable = \Application\Module::getService('zfcuser_user_mapper'); |
527 | 527 | $user = $userTable->findByEmail($userId); |
528 | 528 | |
529 | - if (!$user ) { |
|
529 | + if (!$user) { |
|
530 | 530 | $this->flashMessenger()->addWarningMessage( |
531 | 531 | sprintf($translator->translate("invalid request"), $userId) |
532 | 532 | ); |
533 | 533 | return $this->redirect()->toUrl($redirectUrl); |
534 | 534 | } |
535 | 535 | |
536 | - if (empty($resetToken) || ($resetToken != $user->getToken()) ) { |
|
536 | + if (empty($resetToken) || ($resetToken != $user->getToken())) { |
|
537 | 537 | $this->flashMessenger()->addWarningMessage( |
538 | 538 | sprintf($translator->translate("invalid request"), $resetToken) |
539 | 539 | ); |
540 | 540 | return $this->redirect()->toUrl($redirectUrl); |
541 | 541 | } |
542 | 542 | |
543 | - $form->setData((array)$this->params()->fromPost()); |
|
543 | + $form->setData((array) $this->params()->fromPost()); |
|
544 | 544 | |
545 | - if (!$form->isValid() ) { |
|
545 | + if (!$form->isValid()) { |
|
546 | 546 | |
547 | 547 | return array( |
548 | 548 | 'user' => $user, |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | ); |
569 | 569 | return $this->redirect()->toUrl( |
570 | 570 | $this->url()->fromRoute($config["zfcuser_registration_redirect_route"]) |
571 | - . ($redirect ? '?redirect='. rawurlencode($redirect) : '') |
|
571 | + . ($redirect ? '?redirect='.rawurlencode($redirect) : '') |
|
572 | 572 | ); |
573 | 573 | |
574 | 574 | } |
@@ -603,11 +603,11 @@ discard block |
||
603 | 603 | return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute()); |
604 | 604 | } |
605 | 605 | |
606 | - $form = new UserDataForm(); |
|
607 | - $translator = $this->getTranslator(); |
|
606 | + $form = new UserDataForm(); |
|
607 | + $translator = $this->getTranslator(); |
|
608 | 608 | |
609 | 609 | /** @var \Admin\Entity\User $oIdentity */ |
610 | - $oIdentity = $this->zfcUserAuthentication()->getIdentity(); |
|
610 | + $oIdentity = $this->zfcUserAuthentication()->getIdentity(); |
|
611 | 611 | /** @var \Admin\Model\UserData $oUser */ |
612 | 612 | $oUser = new \Admin\Model\UserData(); |
613 | 613 | |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | |
617 | 617 | $form->bind($oUser); |
618 | 618 | |
619 | - if (!$this->getRequest()->isPost() ) { |
|
619 | + if (!$this->getRequest()->isPost()) { |
|
620 | 620 | |
621 | 621 | return new ViewModel( |
622 | 622 | array( |
@@ -629,10 +629,10 @@ discard block |
||
629 | 629 | |
630 | 630 | } |
631 | 631 | |
632 | - $data = (array)$this->params()->fromPost(); |
|
632 | + $data = (array) $this->params()->fromPost(); |
|
633 | 633 | $form->setData($data); |
634 | 634 | |
635 | - if (!$form->isValid() ) { |
|
635 | + if (!$form->isValid()) { |
|
636 | 636 | |
637 | 637 | $this->flashMessenger()->addWarningMessage( |
638 | 638 | $translator->translate("user data could not be changed") |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | $translator->translate("user data has been changed") |
659 | 659 | ); |
660 | 660 | |
661 | - if ($this->getRequest()->isXmlHttpRequest() ) { |
|
661 | + if ($this->getRequest()->isXmlHttpRequest()) { |
|
662 | 662 | return new ViewModel( |
663 | 663 | array( |
664 | 664 | 'showForm' => false, |
@@ -688,19 +688,19 @@ discard block |
||
688 | 688 | return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute()); |
689 | 689 | } |
690 | 690 | |
691 | - $form = new UserProfileForm(); |
|
692 | - $translator = $this->getTranslator(); |
|
691 | + $form = new UserProfileForm(); |
|
692 | + $translator = $this->getTranslator(); |
|
693 | 693 | /** |
694 | 694 | * @var \Zend\Http\PhpEnvironment\Request|\Zend\Http\Request $request |
695 | 695 | */ |
696 | 696 | $request = $this->getRequest(); |
697 | - $user = $this->zfcUserAuthentication()->getIdentity(); |
|
698 | - $userId = (int) $user->getId(); |
|
697 | + $user = $this->zfcUserAuthentication()->getIdentity(); |
|
698 | + $userId = (int) $user->getId(); |
|
699 | 699 | $profile = new UserProfile; |
700 | 700 | $profile->load($userId); |
701 | 701 | $form->bind($profile); |
702 | 702 | |
703 | - if (!$this->getRequest()->isPost() ) { |
|
703 | + if (!$this->getRequest()->isPost()) { |
|
704 | 704 | |
705 | 705 | return array( |
706 | 706 | 'showForm' => true, |
@@ -711,10 +711,10 @@ discard block |
||
711 | 711 | |
712 | 712 | } |
713 | 713 | |
714 | - $data = (array)$this->params()->fromPost(); |
|
714 | + $data = (array) $this->params()->fromPost(); |
|
715 | 715 | $form->setData($data); |
716 | 716 | |
717 | - if (!$form->isValid() ) { |
|
717 | + if (!$form->isValid()) { |
|
718 | 718 | |
719 | 719 | $this->flashMessenger()->addWarningMessage( |
720 | 720 | $translator->translate("user profile data could not be changed") |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $translator->translate("user profile data has been changed") |
736 | 736 | ); |
737 | 737 | |
738 | - if ($request->isXmlHttpRequest() ) { |
|
738 | + if ($request->isXmlHttpRequest()) { |
|
739 | 739 | $response = array( |
740 | 740 | 'showForm' => false, |
741 | 741 | 'user' => $user, |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\Aclresource; |
24 | 23 | use Admin\Model\AclresourceTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new Aclresource()); |
45 | - $tableGateway = new TableGateway('aclresource', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new AclresourceTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('aclresource', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new AclresourceTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\Aclrole; |
24 | 23 | use Admin\Model\AclroleTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new Aclrole()); |
45 | - $tableGateway = new TableGateway('aclrole', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new AclroleTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('aclrole', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new AclroleTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\Acl; |
24 | 23 | use Admin\Model\AclTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new Acl()); |
45 | - $tableGateway = new TableGateway('acl', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new AclTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('acl', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new AclTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\Applications; |
24 | 23 | use Admin\Model\ApplicationsTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new Applications()); |
45 | - $tableGateway = new TableGateway('applications', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new ApplicationsTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('applications', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new ApplicationsTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\Clients; |
24 | 23 | use Admin\Model\ClientsTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new Clients()); |
45 | - $tableGateway = new TableGateway('clients', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new ClientsTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('clients', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new ClientsTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\Settings; |
24 | 23 | use Admin\Model\SettingsTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new Settings()); |
45 | - $tableGateway = new TableGateway('settings', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new SettingsTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('settings', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new SettingsTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\UserProfile; |
24 | 23 | use Admin\Model\UserProfileTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new UserProfile()); |
45 | - $tableGateway = new TableGateway('userprofile', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new UserProfileTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('userprofile', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new UserProfileTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use Zend\Db\TableGateway\TableGateway; |
20 | 20 | use Zend\ServiceManager\FactoryInterface; |
21 | 21 | use Zend\ServiceManager\ServiceLocatorInterface; |
22 | - |
|
23 | 22 | use Admin\Model\User; |
24 | 23 | use Admin\Model\UserTable; |
25 | 24 |
@@ -39,11 +39,11 @@ |
||
39 | 39 | */ |
40 | 40 | public function createService(ServiceLocatorInterface $serviceLocator) |
41 | 41 | { |
42 | - $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | - $resultSetPrototype = new ResultSet(); |
|
42 | + $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter'); |
|
43 | + $resultSetPrototype = new ResultSet(); |
|
44 | 44 | $resultSetPrototype->setArrayObjectPrototype(new User()); |
45 | - $tableGateway = new TableGateway('user', $dbAdapter, null, $resultSetPrototype); |
|
46 | - $table = new UserTable($tableGateway); |
|
45 | + $tableGateway = new TableGateway('user', $dbAdapter, null, $resultSetPrototype); |
|
46 | + $table = new UserTable($tableGateway); |
|
47 | 47 | return $table; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | \ No newline at end of file |