当前位置: 首页>>代码示例>>PHP>>正文


PHP need_rbac_auth函数代码示例

本文整理汇总了PHP中need_rbac_auth函数的典型用法代码示例。如果您正苦于以下问题:PHP need_rbac_auth函数的具体用法?PHP need_rbac_auth怎么用?PHP need_rbac_auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了need_rbac_auth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: require_once

/**

 * 编辑活动

 * @author abei<abei1982@qq.com>

 */

require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');



need_manager();

need_rbac_auth('activity_log');



$activity_id = $_GET['id'];

$activity = Table::Fetch('activity',$activity_id);



$condition['activity_id'] = $activity_id;

$count = Table::Count('activity_record', $condition);

list($pagesize, $offset, $pagestring) = pagestring($count, 20);
开发者ID:noikiy,项目名称:mdwp,代码行数:29,代码来源:log.php

示例2: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('user_manager_auth');

$action = $_GET['action'];

//	添加一个角色
if($action == 'add_role'){
	if($_POST){
		$role = $_POST['role'];
		$check = true;
		if(empty($role['name'])){
			$check = false;
			Session::Set('error', '角色名称不能为空');	
		}

		if($check == true){
			$role['create_time'] = time();
			DB::Insert('rbac_auth_role',$role);
			Session::Set('notice', '添加角色成功');	
			redirect( WEB_ROOT . "/manage/user/auth.php");
		}

	}
	include template('manage_user_auth_add_role');
}

elseif($action == 'del'){
	$role_id = $_GET['id'];
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:auth.php

示例3: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('order_index');

$t_con = array(
	'begin_time < '.time(),
	'end_time > '.time(),
);
$teams = DB::LimitQuery('team', array('condition'=>$t_con));
$t_id = Utility::GetColumn($teams, 'id');

$condition = array(
	'team_id' => $t_id,
	'team_id > 0',
);
/* filter */
$uemail = strval($_GET['uemail']);
if ($uemail) {
	$field = strpos($uemail, '@') ? 'email' : 'username';
	//$field = is_numeric($uemail) ? 'id' : $field;
	$uuser = Table::Fetch('user', $uemail, $field);
	if($uuser) $condition['user_id'] = $uuser['id'];
	else $uemail = null;
}
$id = abs(intval($_GET['id'])); if ($id) $condition['id'] = $id;
$team_id = abs(intval($_GET['team_id']));
if ($team_id && in_array($team_id, $t_id)) {
	$condition['team_id'] = $team_id;
} else { $team_id = null; 
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:index.php

示例4: require_once

<?php 
/**
 * 统一送U币功能
 * @author abei <abei1982@qq.com>
 */
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('credit_song');
if($_POST){
	$date = $_POST['date'];
	$score = $_POST['score'];
	
	if(empty($date) or empty($score)){
		Session::Set('error', '时间和积分不能为空');
	}else{
		ZCredit::SongMultiByDate($score, strtotime($date));
		
		Session::Set('notice', '送分成功');
		redirect( WEB_ROOT . "/manage/credit/song.php");
	}
}

$cond = array(
	'action'=>'multi',			
);
$logList = DB::LimitQuery('credit',array('condition'=>$cond,'order'=>'order by id desc'));

include template('manage_credit_song');
?>
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:song.php

示例5: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_store_edit_create');

$id = abs(intval($_GET['id']));
$store = Table::Fetch('store', $id);

if ( $_POST && $id==$_POST['id'] && $store) {
	$table = new Table('store', $_POST);
	$table->SetStrip('location', 'other');
	$table->region = abs(intval($table->region));
	$table->city_id = abs(intval($table->city_id));
	$table->open = (strtoupper($table->open)=='Y') ? 'Y' : 'N';
	
	$table->store_logo = upload_image('store_logo',$store['store_logo'],'team');
	$table->store_bg = upload_image('store_bg',$store['store_bg'],'team');
	$table->store_banner = upload_image('store_banner',$store['store_banner'],'team');
	$table->store_small_logo = upload_image('store_small_logo',$store['store_small_logo'],'team');
	$table->image = upload_image('image',$store['image'],'team');
	
	$up_array = array(
			'name', 'brand', 'city_id', 'longlat', 'region', 'partner_id',
		'type', 'telphone', 'address', 'create_time', 'businesszone',
		'location', 'other', 'open', 'longlat','head', 'contact','jtxl','yysj','mcard_bizer_no',
		'store_logo','store_bg','store_banner','store_small_logo','car_yh','image'
			);

	$flag = $table->update( $up_array );
	if ( $flag ) {
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:edit.php

示例6: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('coupon_consume');

$daytime = strtotime(date('Y-m-d'));
$condition = array(
	'consume' => 'Y',
);

/* fiter */
$tid = strval($_GET['tid']);
$coupon = strval($_GET['coupon']);
$uname = strval($_GET['uname']);
/**
 * 添加分店搜索
 * @author <abei>
 */
$store = strval($_GET['store']);
if($store){
	$condition['store_id'] = $store;
}


if ($tid) { $condition['team_id'] = $tid; } else { $tid = null; }
if ($coupon) {
	$condition[] = "id like '%".mysql_escape_string($coupon)."%'";
}
if ($uname) {
	$ucon = array( "email like '%".mysql_escape_string($uname)."%' OR username like '%".$uname."%'");
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:consume.php

示例7: render

		$goods = Table::Fetch('goods', $id);
		if (!$goods) json('无数据', 'alert');
	}
	$html = render('manage_ajax_dialog_goodsedit');
	json($html, 'dialog');
}
elseif ( 'remove' == $action ) {
	need_rbac_auth('credit_goods',true);
	$goods = Table::Fetch('goods', $id);
	if (!$goods) json('无数据', 'alert');
	Table::Delete('goods', $id);
	Session::Set('notice', '删除商品成功');
	json(null, 'refresh');
}
elseif ( 'disable' == $action ) {
	need_rbac_auth('credit_goods',true);
	$goods = Table::Fetch('goods', $id);
	if (!$goods) json('无数据', 'alert');
	
	$enable = ($goods['enable'] == 'Y') ? 'N' : 'Y';
	$enablestring = ($goods['enable']=='Y') ? '禁用' : '启用';
	Table::UpdateCache('goods', $id, array(
		'enable' => $enable,
	));
	Session::Set('notice', "{$enablestring}兑换商品成功");
	json(null, 'refresh');
}
elseif ( 'view' == $action ) {
	
  	$credit = Table::Fetch('credit', $id);
        $goods_id = Utility::GetColumn($credit, 'detail_id');
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:ajax.php

示例8: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('partner_readycalculate');

$condition = array('fid'=>0, 'last_account+cycle_calculate*3600*24 <= '.time(),);

/* filter */
$ptitle = strval($_GET['ptitle']);
if ($ptitle ) {
	$condition[] = "title LIKE '%".mysql_escape_string($ptitle)."%'";
}
$group_id = strval($_GET['group_id']);
if ($group_id) {
	$condition['group_id'] = $group_id;
}
$city_id = strval($_GET['city_id']);
if ($group_id) {
	$condition['city_id'] = $city_id;
}
$open = strval($_GET['open']);
if ($open) {
	$condition['open'] = $open;
}
/* filter end */

$count = Table::Count('partner', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$partners = DB::LimitQuery('partner', array(
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:readycalculate.php

示例9: require_once

<?php



require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');



need_manager();

need_rbac_auth('activity_state');



$activity_id = $_GET['id'];

$activity = Table::Fetch('activity',$activity_id);



if($_POST){

	$state = $_POST['state'];

	DB::Update('activity',$activity_id,array('state'=>$state));

	

	Session::Set('notice', '设置活动状态成功!');

	redirect( WEB_ROOT . "/manage/activity/index.php");
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:state.php

示例10: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('coupon_paycard');
$usage = array( 'Y' => '已用', 'N' => '未用' );
$condition = array();

/* filter */
if (strval($_GET['tid'])!=='') {
	$tid = abs(intval($_GET['tid']));
	$condition['id'] = $tid;
}
if (strval($_GET['state'])) {
	$state = strval($_GET['state']);
	$condition['consume'] = $state;
}
/* end */

$count = Table::Count('paycard', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 50);
if ( strval($_GET['download'])) { $offset = 0; $pagesize = 100000; }

$cards = DB::LimitQuery('paycard', array(
	'condition' => $condition,
	'size' => $pagesize,
	'offset' => $offset,
	'order' => 'ORDER BY consume DESC, expire_time DESC',
));
$user_ids = Utility::GetColumn($cards, 'user_id');
$users = Table::Fetch('user', $user_ids);
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:paycard.php

示例11: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('mltad_search');
/**
$now = time();
$condition = array();
$count = Table::Count('search_log', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$searchItemList = DB::LimitQuery('search_log', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
	'offset' => $offset,
));
 */
 
$sql = "SELECT name,count(id) as num,is_top,id FROM `search_log` group by `name` LIMIT 100";
$result = DB::GetQueryResult($sql,false); 



$selector = 'search';
include template('manage_mltad_search');
开发者ID:noikiy,项目名称:mdwp,代码行数:26,代码来源:search.php

示例12: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('credit_setting');

if (is_post()){
	$action = strval($_POST['action']);

	if ( 'charge' == $action ) {
		$username = strval($_POST['username']);
		$credit = intval($_POST['credit']);
		if (is_numeric($username)) $u = Table::Fetch('user', $username);
		elseif (strpos($username, '@')) $u = Table::Fetch('user', $username, 'email');
		else $u = Table::Fetch('user', $username, 'username');
		if ($u && $credit) {
			ZCredit::Create($credit, $u['id'], 'charge', 0);
            log_admin('credit', $u['username'].'用户积分充值',$u);
			redirect(null, '用户积分充值成功!');
		}
	}
	else if ( 'settings' == $action ) {
		$INI['credit']['register'] = abs(intval($_POST['credit']['register']));
		$INI['credit']['login'] = abs(intval($_POST['credit']['login']));
		$INI['credit']['invite'] = abs(intval($_POST['credit']['invite']));
		$INI['credit']['buy'] = abs(intval($_POST['credit']['buy']));
		$INI['credit']['pay'] = 0 + ($_POST['credit']['pay']);
		$INI['credit']['charge'] = 0 + ($_POST['credit']['charge']);
        $INI['credit']['comment'] = abs(intval($_POST['credit']['comment']));
		configure_save('credit');
        log_admin('credit', '设置积分规则',$_POST);
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:settings.php

示例13: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();

$name = $_GET['name'];
need_rbac_auth('mltad_delete');

DB::Delete("search_log",array('name'=>$name));

Session::Set('notice', '删除成功');
redirect( WEB_ROOT . "/manage/mltad/search.php");
开发者ID:noikiy,项目名称:mdwp,代码行数:12,代码来源:delete.php

示例14: json

         Session::Set('notice', "邮件地址:{$subscribe['email']}退订成功");
     }
     json(null, 'refresh');
 } else {
     if ('smssubscriberemove' == $action) {
         need_auth('admin');
         $subscribe = Table::Fetch('smssubscribe', $id);
         if ($subscribe) {
             log_admin('misc', '手机号码退订:' . $subscribe['mobile'], $subscribe);
             ZSMSSubscribe::Unsubscribe($subscribe['mobile']);
             Session::Set('notice', "手机号码:{$subscribe['mobile']}退订成功");
         }
         json(null, 'refresh');
     } else {
         if ('partnerremove' == $action) {
             need_rbac_auth('partner_delete', true);
             $partner = Table::Fetch('partner', $id);
             $count = Table::Count('team', array('partner_id' => $id));
             if ($partner && $count == 0) {
                 Table::Delete('partner', $id);
                 Session::Set('notice', "商户:{$id} 删除成功");
                 json(null, 'refresh');
             }
             if ($count > 0) {
                 json('商户有团购项目,删除失败', 'alert');
             }
             json('商户删除失败', 'alert');
         } else {
             if ('storeremove' == $action) {
                 need_auth('market');
                 $store = Table::Fetch('store', $id);
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:manage.php

示例15: require_once

<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');

need_manager();
need_rbac_auth('user_manager_index');

if (is_post()) {
	if ($_POST['action'] == 'authorization') {
		$user_id = $_POST['id'];
		$roles = $_POST['role'];
		
		DB::Delete('rbac_manage_role_relation',array('user_id'=>$user_id));
		
		foreach($roles as $role){
			$arr = array('user_id'=>$user_id,'role_id'=>$role,'create_time'=>time());
			DB::Insert('rbac_manage_role_relation',$arr);
		}
	}
	Session::Set('notice', '管理员授权成功');
	redirect($_SERVER['HTTP_REFERERE']);
}

/* build condition */
$condition = array('manager'=>'Y',);
$count = Table::Count('user', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$users = DB::LimitQuery('user', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:manager.php


注:本文中的need_rbac_auth函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。