public function ini()
 {
     $this->enableAPIOauth = false;
     \Model::setCondition(array());
     //to enable test
     if (getHeaderVariable('X-TEST-HEADER')) {
         $_SESSION['userLevel'] = getHeaderVariable('userLevelSession');
         $_SESSION['userID'] = getHeaderVariable('userID');
         $GLOBALS['registry']->userInfo = array('User_ID' => getHeaderVariable('User_ID'));
         if (getHeaderVariable('X-TEST_SECRET_KEY') == TEST_SECRET_KEY) {
             $this->enableAPIOauth = false;
         }
     }
     $GLOBALS['registry']->apiAuth->allow = array('usersApi:loginUser', 'usersApi:addEditUser');
 }
 public function ini()
 {
     Model::setCondition(array());
     $this->layout = 'index';
     $this->authSetting->loginAction = array('controller' => 'users', 'action' => 'login', 'mainURL' => HTTP_MAIN_HOST_PATH);
     $this->authSetting->redirectAction = array('controller' => 'users', 'action' => 'viewUsers', 'mainURL' => HTTP_MAIN_HOST_PATH);
     $this->authSetting->allow = array('users:login', 'users:logOut', 'error:error404', 'error:notExists', 'users:forgetPassword', 'users:resetPassword');
     // , 'users:doLogin', 'users:forgetPassword','users:removeSession' ,'portfolios:getAjaxPortfolio','services:getAjaxService'
     $this->allowPages = array(array('controller' => 'users', 'action' => 'editProfile'));
     /*
               //$this->getUserPermission();
               $this->verifyAccess();
               $current = array(
               'controller' => $this->controller,
               'action' => $this->action
               );
               if (!in_array($current, $GLOBALS ['registry']->permission ['pagesArray'])) {
               redirectTo($this->authSetting->redirectAction);
               }
     */
 }