コード例 #1
0
 public function onDispatch(\Zend\Mvc\MvcEvent $e)
 {
     $install = setupUtility::checkInstall();
     if ($install == true) {
         return $this->redirect()->toRoute('install');
     }
     //get doctrine service
     $this->serviceLocatorStr = 'doctrine';
     $this->sm = $this->getServiceLocator();
     $this->doctrineService = $this->sm->get($this->serviceLocatorStr);
     //get translate service
     $this->translator = Utility::translate();
     //check login
     $user = Utility::checkLogin();
     if (!is_object($user) && $user == 0) {
         $this->redirect()->toRoute('frontend/child', array('controller' => 'login'));
     }
     //start acl
     //        $acl = new myAcl();
     //        $currentRoute  =  $this->getModuleCurrentRoute($e);
     //        $isOk = $acl->checkRole(UtilityRoleLevel::convertUserTypeToRole($user->userType)['role'],$currentRoute);
     //        if(!$isOk || $isOk == '' || $isOk == null){
     //           return $this->redirect()->toRoute('frontend/child', array('controller' => 'login'));
     //        }
     //end check login
     //end acl
     $this->init();
     return parent::onDispatch($e);
 }
コード例 #2
0
ファイル: Module.php プロジェクト: binnguyen/kaffacoffee
 public function onBootstrap(Event $e)
 {
     $app = $e->getApplication();
     Utility::setSM($app->getServiceManager());
     TransactionUtility::setSM($app->getServiceManager());
     UnitCalcUtility::setSM($app->getServiceManager());
     DropboxUtility::setSM($app->getServiceManager());
     setupUtility::setSM($app->getServiceManager());
 }
コード例 #3
0
 public function onDispatch(\Zend\Mvc\MvcEvent $e)
 {
     //check install
     $install = setupUtility::checkInstall();
     if ($install == true) {
         return $this->redirect()->toRoute('install');
     }
     //end check install
     $service_locator_str = 'doctrine';
     $this->sm = $this->getServiceLocator();
     $CategoriesTable = $this->sm->get($service_locator_str);
     $this->modelUsers = new userModel($CategoriesTable);
     $this->translator = Utility::translate();
     $this->layout('layout/login');
     //$this->layout('layout/login');
     return parent::onDispatch($e);
 }
コード例 #4
0
 public function onDispatch(\Zend\Mvc\MvcEvent $e)
 {
     $install = setupUtility::checkInstall();
     if ($install == true) {
         return $this->redirect()->toRoute('install');
     }
     //get doctrine service
     $this->serviceLocatorStr = 'doctrine';
     $this->sm = $this->getServiceLocator();
     $this->doctrineService = $this->sm->get($this->serviceLocatorStr);
     //get translate service
     $this->translator = Utility::translate();
     //check login
     $user = Utility::checkLogin();
     if (!is_object($user) && $user == 0) {
         $this->redirect()->toRoute('admin/child', array('controller' => 'login'));
     }
     if (!Utility::checkRole($user->userType, ROLE_ADMIN)) {
         $this->redirect()->toRoute('frontend/child', array('controller' => 'login'));
     }
     $this->init();
     return parent::onDispatch($e);
 }
コード例 #5
0
 public function installstep3Action()
 {
     if (!setupUtility::checkConfigFile()) {
         return $this->redirect()->toRoute('install');
     }
     if (setupUtility::checkConfigFile() && setupUtility::checkDataBase() && setupUtility::checkHaveAdmin() && setupUtility::checkHaveConfig()) {
         return $this->redirect()->toRoute('frontend/child', array('controller' => 'login'));
     }
     $installForm3 = new InstallForm3();
     $request = $this->getRequest();
     if ($request->isPost()) {
         $isSample = $this->params()->fromPost('issample');
         if ($isSample == 1) {
             $this->flashMessenger()->addSuccessMessage("Data sample inserted");
             setupUtility::insertSampleData();
         }
         $lang = $this->params()->fromPost('lang');
         setupUtility::setLang($lang);
         return $this->redirect()->toRoute('frontend/child', array('controller' => 'login'));
     }
     return new ViewModel(array('title' => $this->translator->translate('Install Step 3'), 'form' => $installForm3));
 }