public function _init() { parent::_init(); /* * * if (!Session::read('user')) $this->redirect('Sessions::add'); alliances::applyFilter('save', function($self, $params, $chain) { //Temporarily store our entity object so that we can manipulate it $record = $params['entity']; //If an id doesn't exist yet, then we know we're saving for the first time. If a //password is provided, we need to hash it var_dump($record->foto); //Write the modified object back to $params $params['entity'] = $record; //Allow the next filter to be run return $chain->next($self, $params, $chain); }); * * */ }
protected function _init() { $this->_render['negotiate'] = true; parent::_init(); self::$actief = array('start' => 'active', 'lijsten' => '', 'beheren' => ''); self::$breadcrumb = array(array('naam' => 'Inloggen')); }
protected function _init() { parent::_init(); $this->_config = (array) Libraries::get('li3_pecl_oauth'); $this->_config += array('host' => $this->request->env('SERVER_NAME'), 'oauth_callback' => $this->request->env('SERVER_NAME') . '/oauth/client', 'namespace' => 'li3_pecl_oauth', 'redirect_success' => 'Client::index', 'redirect_failed' => array('Client::index', 'args' => array('failed' => true))); return Consumer::config($this->_config) ? true : false; }
public function _init() { parent::_init(); if (!Session::read('user')) { $this->redirect('Sessions::add'); } }
protected function _init() { $this->_render['negotiate'] = true; parent::_init(); $login = Auth::check('member'); self::$actief = array('start' => '', 'overzicht' => '', 'lijsten' => 'active', 'beheren' => ''); self::$breadcrumb = array(array('url' => '/permanentielijsten/lijsten', 'naam' => 'Lijsten')); }
protected function _init() { parent::_init(); // 判断其是否从 mobile 端请求过来 if (!empty($_SERVER['HTTP_USER_AGENT']) && HttpUserAgentUtil::is_mobile($_SERVER['HTTP_USER_AGENT'])) { $this->_mobile = true; } }
public function _init() { $this->_render['negotiate'] = true; parent::_init(); if (!Session::read('user')) { $this->redirect('Sessions::add'); } }
protected function _init() { parent::_init(); if ($this->_viewAs) { $this->_viewAs($this->_viewAs); } elseif (isset($this->request->params['backend']) && $this->request->params['backend']) { $this->_viewAs('backend-component'); } }
/** * Define application view paths */ protected function _init() { $this->_render['renderer'] = 'File'; $this->_render['paths']['template'] = '{:library}/views/{:controller}/'; $this->_render['paths']['template'] .= '{:template}.{:type}.php'; $this->_render['paths']['layout'] = '{:library}/views/layouts/default.{:type}.php'; $this->_render['paths']['element'] = '{:library}/views/elements/{:template}.html.php'; parent::_init(); }
protected function _init() { $this->_render['negotiate'] = true; parent::_init(); $login = Auth::check('member'); if (!$login) { return $this->redirect('/login'); } }
protected function _init() { parent::_init(); $isPostsExist = Model::connection()->read("SHOW TABLES LIKE 'posts'") ? true : false; $isUsersExist = Model::connection()->read("SHOW TABLES LIKE 'users'") ? true : false; if ($isPostsExist && $isUsersExist) { $users = Users::first(); self::$_install = empty($users) ? false : true; } }
protected function _init() { $this->_render['negotiate'] = true; parent::_init(); $login = Auth::check('member'); self::$actief = array('start' => '', 'lijsten' => '', 'beheren' => 'active'); self::$breadcrumb = array(array('url' => 'beheren', 'naam' => 'Beheren')); if (!$login) { return $this->redirect('/login'); } }
protected function _init() { parent::_init(); # Check CSRF forgery signature if ($this->request->data and !RequestToken::check($this->request)) { throw new \Exception('Invalid request token.'); } if (isset($this->request->data['security']['token'])) { unset($this->request->data['security']); } # Load active user $current_identity = Auth::check('any'); if (is_object($current_identity)) { $u = $current_identity->getUser(); $this->CURRENT_USER = $u; } $this->set(array('CURRENT_USER' => $this->CURRENT_USER)); }
public function _init() { parent::_init(); $this->_render['paths'] = array('template' => array(LITHIUM_APP_PATH . '/views/{:controller}/{:template}.{:type}.php', LI3_ACTIVITIES_PATH . '/views/{:controller}/{:template}.{:type}.php', '{:library}/views/{:controller}/{:template}.{:type}.php'), 'layout' => array(LITHIUM_APP_PATH . '/views/layouts/{:layout}.{:type}.php', LI3_ACTIVITIES_PATH . '/views/layouts/{:layout}.{:type}.php', '{:library}/views/layouts/{:layout}.{:type}.php'), 'element' => array(LITHIUM_APP_PATH . '/views/elements/{:template}.{:type}.php', LI3_ACTIVITIES_PATH . '/views/elements/{:template}.{:type}.php', '{:library}/views/elements/{:template}.{:type}.php'), 'mustache' => array(LITHIUM_APP_PATH . '/views/mustache/{:template}.{:type}.php', LI3_ACTIVITIES_PATH . '/views/mustache/{:template}.{:type}.php', '{:library}/views/mustache/{:template}.{:type}.php')); }
/** * Override _init to set rendering type to json by default */ public function _init() { $this->_render['type'] = 'json'; parent::_init(); }
protected function _init() { parent::_init(); Consumer::config(array('service' => 'oauth2', 'scheme' => 'https', 'port' => '443', 'host' => 'graph.facebook.com', 'secondary_host' => 'www.facebook.com', 'client_id' => 'your_client_id', 'scope' => 'email,read_stream', 'client_secret' => 'your_client_secret', 'success' => 'http://localhost/facebook/success')); }
/** * Setup controller to use application layout, and plugin view templates * Setup response headers for all actions */ protected function _init() { $this->_render['paths'] = array('template' => '{:library}/views/{:controller}/{:template}.{:type}.php', 'layout' => LITHIUM_APP_PATH . '/views/layouts/default.html.php', 'element' => LITHIUM_APP_PATH . '/views/elements/{:template}.html.php'); parent::_init(); $this->response->cache(false); }
protected function _init() { parent::_init(); Consumer::config(array('host' => $this->request->env('SERVER_NAME'), 'oauth_consumer_key' => '59f87a2f8e430bbad5c84b61ed06304fc9204bcb', 'oauth_consumer_secret' => '4b498c24588bc56685e68f0d2c52ee6becf96ba3', 'request' => $this->request->env('base') . '/oauth/request_token', 'access' => $this->request->env('base') . '/oauth/access_token', 'authorize' => $this->request->env('base') . '/oauth/authorize', 'port' => 30501)); }
protected function _init() { parent::_init(); Provider::config(array('host' => $this->request->env('SERVER_NAME'), 'request' => $this->request->env('base') . '/oauth/request_token', 'access' => $this->request->env('base') . '/oauth/access_token', 'authorize' => $this->request->env('base') . '/oauth/authorize', 'port' => 30501)); }
/** * _init() * * Setup the php library */ public function _init() { parent::_init(); //var_dump(getBaseUrl()); static::$_uploadHandler = new UploadHandler(array('script_url' => Router::match(array('Uploads::deleteAction', 'type' => 'json')), 'upload_dir' => LITHIUM_APP_PATH . '/webroot/upload/files/', 'upload_url' => '/upload/files/', 'param_name' => 'files', 'delete_type' => 'DELETE', 'max_file_size' => null, 'min_file_size' => 1, 'accept_file_types' => '/.+$/i', 'max_number_of_files' => null, 'max_width' => null, 'max_height' => null, 'min_width' => 1, 'min_height' => 1, 'discard_aborted_uploads' => true, 'orient_image' => false, 'image_versions' => array('thumbnail' => array('upload_dir' => LITHIUM_APP_PATH . '/webroot/upload/thumbnails/', 'upload_url' => '/upload/thumbnails/', 'max_width' => 80, 'max_height' => 80)))); }
protected function _init() { $this->_render['negotiate'] = true; parent::_init(); }
protected function _init() { parent::_init(); Consumer::config(array('host' => 'twitter.com', 'oauth_consumer_key' => '', 'oauth_consumer_secret' => '')); }
protected function _init() { parent::_init(); $this->response->encoding = 'UTF-8'; }
/** * adds additional view template folders */ public function _init() { parent::_init(); $this->controller = $this->request->controller; $this->library = $this->request->library; }