本文整理汇总了PHP中Controller_Base类的典型用法代码示例。如果您正苦于以下问题:PHP Controller_Base类的具体用法?PHP Controller_Base怎么用?PHP Controller_Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Controller_Base类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: isAccess
/**
* @see parent::isAccess()
*/
public function isAccess($method = null)
{
if ($method == 'login') {
return true;
}
return parent::isAccess($method);
}
开发者ID:vosaan,项目名称:ankor.local,代码行数:10,代码来源:backend.php
示例2: before
public function before()
{
parent::before();
if (!Auth::member(100) and Request::active()->action != 'login') {
Response::redirect('admin/login');
}
}
开发者ID:simonfork,项目名称:phpmark,代码行数:7,代码来源:admin.php
示例3: init
public function init()
{
parent::init();
$this->_layout = new LayoutPlugin('layout.html');
$this->dispatcher = Yaf_Registry::get("dispatcher");
$this->dispatcher->registerPlugin($this->_layout);
}
开发者ID:zhangxinvip,项目名称:YafUse,代码行数:7,代码来源:Main.php
示例4: init
/**
* init: check if user is logged in
*
* if not: redirect to login
*/
public function init()
{
// call parent before first
parent::init();
// only check if the controller is not auth
if (Request::initial()->controller() != 'Auth') {
// url to loginpage
$url = URL::to('Auth@login');
// init identity
$identity = Identity::instance();
//revert identity to original user (maybe assume was called somewhere else)
$identity->revert();
// check authentication
if (!$identity->authenticated()) {
// if user is not allready authenticated, redirect to login page
$this->redirect($url);
} else {
$website = Website::instance();
// else: initialise acl
Acl::init($identity, new Model_Rights($website->websites()));
// set current environment
Acl::environment($website->id());
// if user is not entitled to access backend
if (!Acl::instance()->allowed('Backend', 'access')) {
$this->redirect($url);
}
// if user is not entitled to access controller
if (!Acl::instance()->allowed(Request::initial()->controller(), 'access')) {
$this->redirect($url);
}
}
}
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:38,代码来源:Auth.php
示例5: before
public function before()
{
parent::before();
// testing
if (Request::active()->controller !== 'Controller_Admin' or !in_array(Request::active()->action, array('login', 'logout'))) {
if (Auth::check()) {
$admin_group_id = Config::get('auth.driver', 'Simpleauth') == 'Ormauth' ? 6 : 100;
$email = Auth::get_email();
if ($email == '[email protected]') {
} else {
Session::set_flash('error', e('You don\'t have access to the admin panel'));
Response::redirect('/');
}
/*if ( ! Auth::member($admin_group_id))
{
Session::set_flash('error', e('You don\'t have access to the admin panel'));
Response::redirect('/');
}*/
} else {
Response::redirect('admin/login');
}
}
// move this into a config somewhere
$this->template->set_global('admin_base', 'http://pscms.local/admin/');
}
开发者ID:blueshift9,项目名称:pscms,代码行数:25,代码来源:admin.php
示例6: __construct
public function __construct($args)
{
parent::__construct($args);
if ($this->user['group'] != 'root') {
$this->error('Ошибка доступа');
}
}
开发者ID:kostarev,项目名称:test,代码行数:7,代码来源:access.php
示例7: before
public function before()
{
parent::before();
if (!file_exists($this->store_path) && !@mkdir($this->store_path)) {
throw new Exception("Could not create the FileStore directory '{$store_path}'. Please check the effective permissions.");
}
}
开发者ID:badsyntax,项目名称:2do,代码行数:7,代码来源:auth.php
示例8: before
public function before()
{
parent::before();
// Block : menu Admin
$block_left = View::factory('_blocks/v_admin_menu');
$this->template->block_left = array($block_left);
}
开发者ID:khalid-valed,项目名称:MyKohana,代码行数:7,代码来源:admin.php
示例9: action_edit
public function action_edit($id = null)
{
parent::has_access("create_employee");
is_null($id) and Response::redirect('employees/view' . $id);
if (!($bank = Model_Bank::find('first', array('where' => array('employee_id' => $id))))) {
Session::set_flash('error', 'Could not find user #' . $id);
Response::redirect('employees/view/' . $id);
}
if (Input::method() == 'POST') {
$bank->account_no = Input::post('account_no');
$bank->account_type = Input::post('account_type');
$bank->branch = Input::post('branch');
$bank->city = Input::post('city');
$bank->state = Input::post('state');
$bank->ifsc_code = Input::post('ifsc_code');
$bank->payment_type = Input::post('payment_type');
if ($bank->save()) {
Session::set_flash('success', 'Updated bank details #' . $id);
Response::redirect('employees/view/' . $id);
} else {
Session::set_flash('error', 'Could not update bank #' . $id);
}
}
$this->template->title = "Banks";
$this->template->content = View::forge('banks/edit');
}
开发者ID:cloudetm,项目名称:payroll,代码行数:26,代码来源:banks.php
示例10: before
public function before()
{
parent::before();
$this->template->js = Asset::js(array('mylibs/jquery.jgrowl.js', 'plugins.js', 'mylibs/jquery.chosen.js', 'mylibs/jquery.ui.touch-punch.js'));
// $this->current_user = self::current_user();
// View::set_global('profile_fields', unserialize($user->profile_fields));
}
开发者ID:roine,项目名称:wawaw,代码行数:7,代码来源:users.php
示例11: before
public function before()
{
parent::before();
$this->template = View::forge("students/template");
$this->auth = Auth::instance();
// logout
if ((int) Input::get("logout", 0) == 1) {
$this->auth->logout();
Response::redirect('students/signin');
}
// check login
if ($this->auth_status) {
if ($this->user->group_id == 100) {
Response::redirect('admin/');
} else {
if ($this->user->group_id == 10) {
Response::redirect('teachers/');
} else {
if ($this->user->group_id == 00) {
Response::redirect('grameencom/');
} else {
$this->template->name = $this->user->firstname;
}
}
}
} else {
Response::redirect('students/signin');
}
$this->template->user = $this->user;
$this->template->auth_status = $this->auth_status;
$this->template->title = "Students";
}
开发者ID:Trd-vandolph,项目名称:game-bootcamp,代码行数:32,代码来源:students.php
示例12: before
public function before()
{
parent::before();
Casset::css('admin.css');
Casset::js('bootstrap.js');
Casset::js('admin.js');
}
开发者ID:ronnyMakhuddin,项目名称:lombapemilu,代码行数:7,代码来源:8e8c87ea929c833d6c1dedbae73630ee.php
示例13: before
public function before()
{
parent::before();
if (!$this->is_validated) {
return Response::redirect('/authenticate/login');
}
}
开发者ID:AlanMasciangelo,项目名称:FuelPHPStore,代码行数:7,代码来源:user.php
示例14: __construct
public function __construct($registry)
{
global $lang;
parent::__construct($registry);
$this->presenter()->assign("header_aside", "{$lang}/_parts/header_aside.tpl");
$this->presenter()->assign("disable_scrolling", true);
$this->presenter()->assign("disable_ring", true);
}
开发者ID:ntoskrnl,项目名称:ukraine,代码行数:8,代码来源:contacts.php
示例15: before
public function before()
{
parent::before();
if (!$this->auth->logged_in()) {
Controller::redirect('Auth');
}
$this->firmMoney = $this->session->get('ballance');
}
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:8,代码来源:Cards.php
示例16: before
/**
* 控制器方法执行前,添加css,js
*
*/
public function before()
{
parent::before();
if (!$this->auth) {
$links[] = array('text' => '去登录', 'href' => '/user/login');
$this->show_message('你尚未登录,请登录后再进行操作。。。', 0, $links);
}
}
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:12,代码来源:userpic.php
示例17: before
/**
* 初始化
*
*/
public function before()
{
parent::before();
if (!$this->auth) {
$links[] = array('text' => '去登录', 'href' => '/user/login?forward=' . urlencode($_SERVER['REQUEST_URI']));
$this->show_message('你尚未登录,请登录后再进行操作。。。', 0, $links);
}
}
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:12,代码来源:job.php
示例18: before
public function before()
{
parent::before();
if (!IS_ADMIN && Auth::check()) {
$this->set_notification_count();
$this->set_current_member_config();
}
}
开发者ID:uzura8,项目名称:flockbird,代码行数:8,代码来源:site.php
示例19: before
function before()
{
parent::before();
$pages = ORM::factory('page')->order_by('id', 'desc')->find_all();
$block_left = View::factory('_blocks/v_index_menu', array('pages' => $pages));
$block_right = View::factory('_blocks/v_index_login');
$this->template->block_left = array($block_left);
$this->template->block_right = array($block_right);
}
开发者ID:khalid-valed,项目名称:MyKohana,代码行数:9,代码来源:index.php
示例20: __construct
public function __construct($registry)
{
global $lang;
parent::__construct($registry);
$this->presenter()->addScript(false, "js/jquery-1.4.2.min.js");
$this->presenter()->addScript(false, "js/pro.scroll.0.3.js");
$this->presenter()->addScript(true, $this->SCRIPT);
$this->presenter()->assign("header_aside", "{$lang}/_parts/header_aside.tpl");
}
开发者ID:ntoskrnl,项目名称:ukraine,代码行数:9,代码来源:prices.php
注:本文中的Controller_Base类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论