beforeFilter() 공개 메소드

public beforeFilter ( )
예제 #1
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     $user = $this->Auth->user();
     $this->Auth->allow('view');
     $this->set('user', $user);
 }
예제 #2
0
 /**
  * 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
 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
 function beforeFilter()
 {
     parent::beforeFilter();
     if ('json' == $this->params['url']['ext']) {
         $this->RequestHandler->setContent('json', 'text/x-json');
     }
 }
 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
 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');
     }
 }
 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
 function beforeFilter()
 {
     $this->Auth->allow('index');
     parent::beforeFilter();
     $this->Auth->autoRedirect = false;
     //debug($this->Session->read() );
 }
예제 #12
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->Auth)) {
         $this->Auth->allow('login', 'logout', 'setup');
     }
 }
예제 #13
0
 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';
     }
 }
 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;
 }
 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());
     }
 }
 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);
         }
     }
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow();
     $this->set('logged_user', $this->Auth->user());
     $this->layout = 'cultural';
 }
예제 #24
0
 /**
  * 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
 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);
     }
 }
 /**
  * beforeFilter
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!empty($this->siteConfigs['editor']) && $this->siteConfigs['editor'] != 'none') {
         $this->helpers[] = $this->siteConfigs['editor'];
     }
 }
예제 #29
0
 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());
     }
 }