本文整理汇总了PHP中Admin\Controller\CommonController::_initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonController::_initialize方法的具体用法?PHP CommonController::_initialize怎么用?PHP CommonController::_initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Controller\CommonController
的用法示例。
在下文中一共展示了CommonController::_initialize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
public function _initialize()
{
parent::_initialize();
$this->opname = "信息类别";
$this->dbname = 'infotype';
//$this->selname = 'uv_infotype';
}
示例2: _initialize
public function _initialize()
{
parent::_initialize();
$this->dbname = "user";
$this->opname = "用户";
$this->selname = "uv_gettel";
}
示例3: _initialize
/**
* 对应权限如下:
* view 查看 | add 添加 | edit 编辑 | delete 删除 | order 排序
*
* TODO 现在时间上来不及完善此功能,暂时先屏蔽
*/
public function _initialize()
{
parent::_initialize();
//权限判断
if (session('roleid') != 1 && ACTION_NAME != 'index' && strpos(ACTION_NAME, 'public_') === false) {
$category_priv_db = M('category_priv');
$tmp = explode('_', ACTION_NAME);
$action = strtolower($tmp[0]);
unset($tmp);
if (!in_array($action, array('view', 'add', 'edit', 'delete', 'order', 'export', 'import'))) {
$action = 'view';
}
$catid = I('get.catid', 0, 'intVal');
$roleid = session('roleid');
$info = $category_priv_db->where(array('catid' => $catid, 'roleid' => $roleid, 'is_admin' => 1, 'action' => $action))->count();
if (!$info) {
//兼容iframe加载
if (IS_GET && strpos(ACTION_NAME, '_iframe') !== false) {
exit('<style type="text/css">body{margin:0;padding:0}</style><div style="padding:6px;font-size:12px">您没有权限操作该项</div>');
}
//普通返回
if (IS_AJAX && IS_GET) {
exit('<div style="padding:6px">您没有权限操作该项</div>');
} else {
$this->error('您没有权限操作该项');
}
}
}
}
示例4: _initialize
public function _initialize()
{
parent::_initialize();
$this->dbname = 'authrule';
$this->opname = "权限管理";
//123123213123123Test
}
示例5: _initialize
/**
* 权限控制,默认为查看 view
*/
public function _initialize()
{
parent::_initialize();
//权限判断
if (user_info('roleid') != 1 && strpos(ACTION_NAME, 'public_') === false) {
$category_priv_db = M('category_priv');
$tmp = explode('_', ACTION_NAME, 1);
$action = strtolower($tmp[0]);
unset($tmp);
$auth = dict('auth', 'Category');
//权限列表
if (!in_array($action, array_keys($auth))) {
$action = 'view';
}
$catid = I('get.catid', 0, 'intval');
$roleid = user_info('roleid');
$info = $category_priv_db->where(array('catid' => $catid, 'roleid' => $roleid, 'action' => $action))->count();
if (!$info) {
//兼容iframe加载
if (IS_GET && strpos(ACTION_NAME, '_iframe') !== false) {
exit('<style type="text/css">body{margin:0;padding:0}</style><div style="padding:6px;font-size:12px">您没有权限操作该项</div>');
}
//普通返回
if (IS_AJAX && IS_GET) {
exit('<div style="padding:6px">您没有权限操作该项</div>');
} else {
$this->error('您没有权限操作该项');
}
}
}
}
示例6: _initialize
public function _initialize()
{
$cate = new CategoryApi();
$catelist = $cate->get_catelist(0, 1);
$this->assign('clist', $catelist);
parent::_initialize();
}
示例7: _initialize
public function _initialize()
{
parent::_initialize();
$this->opname = "信息发布";
$this->dbname = 'infopublish';
$this->selname = 'uv_getinfopublish';
// $this->GetKeys();
}
示例8:
function _initialize()
{
parent::_initialize();
}
示例9: _initialize
protected function _initialize()
{
parent::_initialize();
}