beforeFilter() public method

public beforeFilter ( )
コード例 #1
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $user = $this->Auth->user();
     $this->Auth->allow('view');
     $this->set('user', $user);
 }
コード例 #2
0
ファイル: PagesController.php プロジェクト: kiang/olc_baker
 /**
  * Displays a view
  *
  * @param mixed What page to display
  * @access public
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->Auth)) {
         $this->Auth->allow('display');
     }
 }
コード例 #3
0
ファイル: users_controller.php プロジェクト: kondrat/ta
 function beforeFilter()
 {
     $this->Auth->allow('logout', 'reg', 'password_reset', 'view', 'acoset', 'aroset', 'permset', 'buildAcl');
     parent::beforeFilter();
     $this->Auth->autoRedirect = false;
     //debug($this->Session->read() );
 }
コード例 #4
0
ファイル: front_controller.php プロジェクト: bskahan/newd
 function beforeFilter()
 {
     parent::beforeFilter();
     if ('json' == $this->params['url']['ext']) {
         $this->RequestHandler->setContent('json', 'text/x-json');
     }
 }
コード例 #5
0
 function beforeFilter()
 {
     parent::beforeFilter();
     if (!empty($this->Auth)) {
         $this->Auth->allowedActions = array();
     }
 }
コード例 #6
0
 public function beforeFilter()
 {
     $this->RequestHandler->respondAs('json');
     $this->response->disableCache();
     $this->Auth->allow(array('view'));
     parent::beforeFilter();
 }
コード例 #7
0
ファイル: UsersController.php プロジェクト: nimarni/templeGET
 public function beforeFilter()
 {
     parent::beforeFilter();
     //親(Appcontroller)をふまえた上
     // ユーザー自身による登録とログアウトを許可する
     $this->Auth->allow('add', 'logout');
 }
コード例 #8
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!empty($this->Auth)) {
         $this->Auth->allow('display', 'ckeditor');
     }
 }
コード例 #9
0
 function beforeFilter()
 {
     parent::beforeFilter();
     if (!empty($this->Auth)) {
         $this->Auth->allowedActions = array('how_it_works', 'fetch_specific_content');
     }
 }
コード例 #10
0
 /**
  * beforeFilter
  * 
  * @return oid
  * @access public
  */
 function beforeFilter()
 {
     parent::beforeFilter();
     if ($this->params['prefix'] == 'admin') {
         $this->set('usePermission', true);
     }
 }
コード例 #11
0
ファイル: groups_controller.php プロジェクト: kondrat/ta
 function beforeFilter()
 {
     $this->Auth->allow('index');
     parent::beforeFilter();
     $this->Auth->autoRedirect = false;
     //debug($this->Session->read() );
 }
コード例 #12
0
ファイル: MembersController.php プロジェクト: rungrr/drugs
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->Auth)) {
         $this->Auth->allow('login', 'logout', 'setup');
     }
 }
コード例 #13
0
ファイル: article_controller.php プロジェクト: rainsun/nForum
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!isset($this->params['name'])) {
         $this->error(ECode::$BOARD_NONE);
     }
     try {
         $boardName = $this->params['name'];
         if (preg_match("/^\\d+\$/", $boardName)) {
             throw new BoardNullException();
         }
         $this->_board = Board::getInstance($boardName);
     } catch (BoardNullException $e) {
         $this->error(ECode::$BOARD_UNKNOW);
     }
     if (isset($this->params['url']['mode'])) {
         $mode = (int) trim($this->params['url']['mode']);
         if (!$this->_board->setMode($mode)) {
             $this->error(ECode::$BOARD_NOPERM);
         }
     }
     if (!$this->_board->hasReadPerm(User::getInstance())) {
         if (!$this->ByrSession->isLogin) {
             $this->requestLogin();
         }
         $this->error(ECode::$BOARD_NOPERM);
     }
     $this->_board->setOnBoard();
     $this->ByrSession->Cookie->write("XWJOKE", "hoho", false);
 }
コード例 #14
0
 function beforeFilter()
 {
     parent::beforeFilter();
     if (Configure::read('Wildflower.htmlCache') and $this->params['action'] == 'view') {
         $this->helpers[] = 'HtmlCache';
     }
 }
コード例 #15
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     //$this->Auth->allow('add');
     // ユーザー自身による登録とログアウトを許可する
     $this->Auth->allow('add', 'logout');
 }
コード例 #16
0
 function beforeFilter()
 {
     parent::beforeFilter();
     Configure::write('debug', 0);
     $this->layout = 'ajax';
     $this->autoRender = false;
 }
コード例 #17
0
 function beforeFilter()
 {
     parent::beforeFilter();
     // $this->Auth->allow('*');
     //$this->set('menuTab', 'kelas');
     //$this->set('menuTabChild', 'kuis');
 }
コード例 #18
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if ($this->Auth->user() && $this->action != 'admin_dashboard') {
         $this->redirect($this->Auth->redirectUrl());
     }
 }
コード例 #19
0
 function beforeFilter()
 {
     $this->logo_dir_path = WWW_ROOT . 'img' . DS . 'logo' . DS;
     $this->logo_dir = '/img' . DS . 'logo' . DS;
     $this->set('title_for_layout', __('Configurazione', true));
     return parent::beforeFilter();
 }
コード例 #20
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow('add', 'login', 'logout');
     $this->Auth->autoRedirect = false;
     //$this->Auth->allow(array('*'));
 }
コード例 #21
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if ($this->action == 'admin_edit') {
         $this->Security->disabledFields = array('alias');
     }
 }
コード例 #22
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     // Allow users to register and logout.
     //  $this->Auth->allow('*');
     $this->Auth->allow(array('index', 'fileUpload', 'service_order_form_new', 'techregistration', 'shipping_and_returns', 'packagesignup', 'customerSignup', 'troubleshoot', 'tariffplan', 'whytotalcable', 'contactus', 'newses', 'reseller', 'shipping', 'package', 'terms_and_conditions', 'refer', 'channels', 'registration', 'musical_night', 'seat_booking', 'area_channels', 'hazaro_konthe_sonar_bangla'));
     // database name must be thum_img,small_img
     $this->img_config = array('ch_signature' => array('image_ratio_crop' => true, 'image_resize' => true, 'image_x' => 421, 'image_y' => 295), 'c_signature' => array('image_ratio_crop' => true, 'image_resize' => true, 'image_x' => 421, 'image_y' => 295), 'file' => array(), 'id_card' => array(), 'money_order' => array(), 'parent_dir' => 'card_holder_signature', 'target_path' => array('ch_signature' => WWW_ROOT . 'card_holder_signature' . DS, 'c_signature' => WWW_ROOT . 'customer_signature' . DS, 'file' => WWW_ROOT . 'Customer_attachment' . DS, 'id_card' => WWW_ROOT . 'Customer_id_card' . DS, 'money_order' => WWW_ROOT . 'Customer_money_order' . DS));
     if ($this->Auth->loggedIn()) {
         $isloggedin = true;
     } else {
         $isloggedin = false;
     }
     $admin_logout = false;
     $admin_title = "My Profile";
     $this->set(compact('isloggedin', 'admin_title', 'admin_logout'));
     // create the folder if it does not exist
     if (!is_dir($this->img_config['parent_dir'])) {
         mkdir($this->img_config['parent_dir']);
     }
     foreach ($this->img_config['target_path'] as $img_dir) {
         if (!is_dir($img_dir)) {
             mkdir($img_dir);
         }
     }
 }
コード例 #23
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow();
     $this->set('logged_user', $this->Auth->user());
     $this->layout = 'cultural';
 }
コード例 #24
0
ファイル: PagesController.php プロジェクト: sianto1997/XLabs
 /**
  * Displays a view
  *
  * @return void
  * @throws NotFoundException When the view file could not be found
  *	or MissingViewException in debug mode.
  */
 function beforeFilter()
 {
     parent::beforeFilter();
     $this->layout = 'homepage';
     //allows pages without auth so you dont have 2 login :):):):):):)
     $this->Auth->allow('display');
 }
コード例 #25
0
ファイル: EventsController.php プロジェクト: vman747/MISP
 public function beforeFilter()
 {
     parent::beforeFilter();
     // what pages are allowed for non-logged-in users
     $this->Auth->allow('xml');
     $this->Auth->allow('csv');
     $this->Auth->allow('nids');
     $this->Auth->allow('hids_md5');
     $this->Auth->allow('hids_sha1');
     $this->Auth->allow('text');
     $this->Auth->allow('dot');
     $this->Auth->allow('restSearch');
     $this->Auth->allow('stix');
     // TODO Audit, activate logable in a Controller
     if (count($this->uses) && $this->{$this->modelClass}->Behaviors->attached('SysLogLogable')) {
         $this->{$this->modelClass}->setUserData($this->activeUser);
     }
     // convert uuid to id if present in the url, and overwrite id field
     if (isset($this->params->query['uuid'])) {
         $params = array('conditions' => array('Event.uuid' => $this->params->query['uuid']), 'recursive' => 0, 'fields' => 'Event.id');
         $result = $this->Event->find('first', $params);
         if (isset($result['Event']) && isset($result['Event']['id'])) {
             $id = $result['Event']['id'];
             $this->params->addParams(array('pass' => array($id)));
             // FIXME find better way to change id variable if uuid is found. params->url and params->here is not modified accordingly now
         }
     }
     // if not admin or own org, check private as well..
     if (!$this->_isSiteAdmin()) {
         $this->paginate = Set::merge($this->paginate, array('conditions' => array("OR" => array(array('Event.org =' => $this->Auth->user('org')), "AND" => array(array('Event.distribution >' => 0), Configure::read('MISP.unpublishedprivate') ? array('Event.published =' => 1) : array())))));
     }
 }
コード例 #26
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     // We're doing a backend request, require backend access
     $this->requireBackend();
     $this->set('at_backendpanel', true);
 }
コード例 #27
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     // Update current semester, if needed
     if (date('m') < 5) {
         // Winter semester
         $this->currentSemester = date('Y') . '01';
     } elseif (date('m') < 9) {
         // Summer semester
         $this->currentSemester = date('Y') . '05';
     } else {
         // Autumn semester
         $this->currentSemester = date('Y') . '09';
     }
     if ($this->Session->read('Registration.semester') != '') {
         $this->registrationSemester = $this->Session->read('Registration.semester');
     } else {
         $this->registrationSemester = '201501';
         $this->Session->write('Registration.semester', $this->registrationSemester);
     }
     // If unregistration is still possible for current semester, add it to the registration semesters list
     if (!in_array($this->currentSemester, $this->registrationSemesters) && $this->deadlines[$this->currentSemester]['drop_fee'] >= date('Ymd')) {
         $this->registrationSemesters[] = $this->currentSemester;
         sort($this->registrationSemesters);
     }
 }
コード例 #28
0
 /**
  * beforeFilter
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!empty($this->siteConfigs['editor']) && $this->siteConfigs['editor'] != 'none') {
         $this->helpers[] = $this->siteConfigs['editor'];
     }
 }
コード例 #29
0
ファイル: ArticlesController.php プロジェクト: rungrr/drugs
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->Auth)) {
         $this->Auth->allow('index', 'view');
     }
 }
コード例 #30
0
 /**
  * beforeFilter
  * @return void
  * @access public
  */
 function beforeFilter()
 {
     parent::beforeFilter();
     if ($this->params['prefix'] == 'admin') {
         $this->set('usePermission', $this->UserGroup->checkOtherAdmins());
     }
 }