• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP need_permission函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager(true)) {
    need_permission('modify', 'team/edit');
}
$id = abs(intval($_GET['id']));
if (!$id || !($team = Table::Fetch('team', $id))) {
    Utility::Redirect(WEB_ROOT . '/team/create.php');
}
if ($_POST) {
    $insert = array('title', 'market_price', 'team_price', 'end_time', 'begin_time', 'expire_time', 'min_number', 'max_number', 'summary', 'notice', 'per_number', 'product', 'image', 'detail', 'userreview', 'systemreview', 'image1', 'image2', 'flv', 'delivery', 'mobile', 'address', 'fare', 'express', 'credit', 'user_id', 'city_id', 'group_id', 'partner_id');
    $table = new Table('team', $_POST);
    $table->SetStrip('summary', 'detail', 'systemreview', 'notice');
    $table->begin_time = strtotime($_POST['begin_time']);
    $table->end_time = strtotime($_POST['end_time']);
    $table->expire_time = strtotime($_POST['expire_time']);
    $table->image = upload_image('upload_image', $team['image'], 'team');
    $table->image1 = upload_image('upload_image1', $team['image1'], 'team', 380);
    $table->image2 = upload_image('upload_image2', $team['image2'], 'team', 380);
    $error_tip = array();
    if (!$error_tip) {
        if ($table->update($insert)) {
            if ($_POST['charity_id'] != 0) {
                if ($_POST['deal_charity_id'] != "") {
                    $dealcharity['id'] = $_POST['deal_charity_id'];
                }
                $dealcharity['charity_id'] = $_POST['charity_id'];
                $dealcharity['value'] = str_replace('%', '', $_POST['charityvalue']);
                $dealcharity['deal_id'] = $_POST['id'];
                $dcTable = new Table('deals_charity', $dealcharity);
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:edit.php


示例2: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/invite');
}
$memail = strval($_GET['memail']);
$oemail = strval($_GET['oemail']);
$condition = array('credit > 0', 'pay' => 'N');
if ($memail) {
    $muser = Table::Fetch('user', $memail, 'email');
    if ($muser) {
        $condition['user_id'] = $muser['id'];
    }
}
if ($oemail) {
    $ouser = Table::Fetch('user', $oemail, 'email');
    if ($ouser) {
        $condition['other_user_id'] = $ouser['id'];
    }
}
$count = Table::Count('invite', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$invites = DB::LimitQuery('invite', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$team_ids = Utility::GetColumn($invites, 'team_id');
$teams = Table::Fetch('team', $team_ids);
$user_ids = Utility::GetColumn($invites, 'user_id');
$user_ido = Utility::GetColumn($invites, 'other_user_id');
$user_ids = array_merge($user_ids, $user_ido);
$users = Table::Fetch('user', $user_ids);
include template('manage_misc_invite');
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:invite.php


示例3: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/subscribe');
}
$like = strval($_GET['like']);
$cs = strval($_GET['cs']);
/* build condition */
$condition = array();
if ($like) {
    $condition[] = "email like '%" . mysql_escape_string($like) . "%'";
}
if ($cs) {
    $cscity = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => $cs), 'one' => true));
    if ($cscity) {
        $condition['city_id'] = $cscity['id'];
    } else {
        $cs = null;
    }
}
/* end */
$count = Table::Count('subscribe', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 50);
$subscribes = DB::LimitQuery('subscribe', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$city_ids = Utility::GetColumn($subscribes, 'city_id');
$cities = Table::Fetch('category', $city_ids);
include template('manage_misc_subscribe');
开发者ID:jowino,项目名称:bd786110cact,代码行数:28,代码来源:subscribe.php


示例4: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'team/success');
}
$now = time();
$condition = array('system' => 'Y', "end_time < {$now}", "now_number >= min_number");
$count = Table::Count('team', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$cities = Table::Fetch('category', Utility::GetColumn($teams, 'city_id'));
$selector = 'success';
include template('manage_team_index');
开发者ID:jowino,项目名称:bd786110cact,代码行数:14,代码来源:success.php


示例5: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/sms');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
        $table->SetPK('id', 1);
    }
    $flag = $table->update(array('value'));
    Session::Set('notice', 'Update information done.');
    Utility::Redirect(WEB_ROOT . '/manage/system/sms.php');
}
include template('manage_system_sms');
开发者ID:jowino,项目名称:bd786110cact,代码行数:22,代码来源:sms.php


示例6: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/bulletin');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    /* end */
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
        $table->SetPK('id', 1);
    }
    $flag = $table->update(array('value'));
    Session::Set('notice', 'Update information is done.');
    Utility::Redirect(WEB_ROOT . '/manage/system/bulletin.php');
}
include template('manage_system_bulletin');
开发者ID:jowino,项目名称:bd786110cact,代码行数:23,代码来源:bulletin.php


示例7: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'team/down');
}
$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
if ($team['delivery'] == 'express') {
    $oc = array('state' => 'pay');
    $orders = DB::LimitQuery('order', array('condition' => $oc));
    $xls[] = "User\tTel\tAddr";
    foreach ($orders as $o) {
        $xls[] = "{$o['realname']}\t'{$o['mobile']}\t{$o['address']}";
    }
    $xls = join("\n", $xls);
    header('Content-Disposition: attachment; filename="team' . $id . '.xls"');
    die(mb_convert_encoding($xls, 'GBK', 'UTF-8'));
} else {
    $cc = array('team_id' => $id);
    $coupons = DB::LimitQuery('coupon', array('condition' => $cc));
    $users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
    $xls[] = "User\tContact\t{$INI['system']['couponname']} Serial\t{$INI['system']['couponname']} Password";
    foreach ($coupons as $o) {
        $u = $users[$o['user_id']];
        $xls[] = "{$u['email']}\t'{$u['mobile']}\t'{$o['id']}\t{$o['secret']}";
    }
    $xls = join("\n", $xls);
    header('Content-Disposition: attachment; filename="team' . $id . '.xls"');
    die(mb_convert_encoding($xls, 'GBK', 'UTF-8'));
}
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:down.php


示例8: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', '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);
$uemail = strval($_GET['uemail']);
if ($uemail) {
    $uuser = Table::Fetch('user', $uemail, 'email');
    if ($uuser) {
        $condition['user_id'] = $uuser['id'];
    } else {
        $uemail = null;
    }
}
$count = Table::Count('order', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$orders = DB::LimitQuery('order', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$pay_ids = Utility::GetColumn($orders, 'pay_id');
$pays = Table::Fetch('pay', $pay_ids);
$user_ids = Utility::GetColumn($orders, 'user_id');
$users = Table::Fetch('user', $user_ids);
$team_ids = Utility::GetColumn($orders, 'team_id');
$teams = Table::Fetch('team', $team_ids);
include template('manage_order_index');
开发者ID:jowino,项目名称:bd786110cact,代码行数:29,代码来源:index.php


示例9: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'partner/create');
}
if ($_POST) {
    $table = new Table('partner', $_POST);
    $table->SetStrip('location', 'other');
    $table->create_time = time();
    $table->user_id = $login_user_id;
    $table->password = ZPartner::GenPassword($table->password);
    $table->insert(array('user_name', 'user_id', 'city_id', 'title', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password'));
    Utility::Redirect(WEB_ROOT . '/manage/partner/index.php');
}
include template('manage_partner_create');
开发者ID:jowino,项目名称:bd786110cact,代码行数:16,代码来源:create.php


示例10: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'misc/feedback');
}
$action = strval($_GET['action']);
$id = abs(intval($_GET['id']));
$r = udecode($_GET['r']);
$cate = strval($_GET['cate']);
$like = strval($_GET['like']);
if ($action == 'r') {
    Table::Delete('feedback', $id);
    Utility::Redirect($r);
} else {
    if ($action == 'm') {
        Table::UpdateCache('feedback', $id, array('user_id' => $login_user_id));
        Utility::Redirect($r);
    }
}
$condition = array();
if ($cate) {
    $condition['category'] = $cate;
}
if ($like) {
    $condition[] = "content like '%" . mysql_escape_string($like) . "%'";
}
$count = Table::Count('feedback', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$asks = DB::LimitQuery('feedback', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$user_ids = Utility::GetColumn($asks, 'user_id');
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:feedback.php


示例11: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/page');
}
$pages = array('help_tour' => 'Tour ' . $INI['system']['abbreviation'], 'help_faqs' => 'FAQ', 'help_zuitu' => 'What is ' . $INI['system']['abbreviation'], 'help_api' => 'Develope API', 'about_us' => 'About ' . $INI['system']['abbreviation'], 'about_job' => 'Job', 'about_terms' => 'Terms&Conditions', 'about_privacy' => 'Privacy');
$id = strval($_GET['id']);
$n = Table::Fetch('page', $id);
if ($_POST) {
    $table = new Table('page', $_POST);
    $table->SetStrip('value');
    if ($n) {
        $table->SetPk('id', $id);
        $table->update(array('id', 'value'));
    } else {
        $table->insert(array('id', 'value'));
    }
}
$value = $n['value'];
include template('manage_system_page');
开发者ID:jowino,项目名称:bd786110cact,代码行数:21,代码来源:page.php


示例12: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'charity/charity');
}
$condition = array();
$count = Table::Count('charity', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$charities = DB::LimitQuery('charity', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
include template('manage_system_charity');
开发者ID:jowino,项目名称:bd786110cact,代码行数:11,代码来源:charity.php


示例13: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'system/_city');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    /* hot city convert */
    $cityname = preg_split('/[\\s,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $hotcity = array();
    foreach ($cityname as $one) {
        $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => $one), 'one' => 'true'));
        if ($city) {
            $hotcity[$city['ename']] = $city['name'];
        }
    }
    if (!$hotcity) {
        $hotcity = array('sg' => 'Singapore');
    }
    /* merget */
    $_POST['hotcity'] = $hotcity;
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    /* end */
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
        $table->SetPK('id', 1);
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:_city.php


示例14: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'coupon/expire');
}
$daytime = strtotime(date('Y-m-d'));
$condition = array('consume' => 'N', 'expire_time < ' . $daytime);
$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$coupons = DB::LimitQuery('coupon', array('condition' => $condition, 'order' => 'ORDER BY expire_time ASC', 'size' => $pagesize, 'offset' => $offset));
$users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
$teams = Table::Fetch('team', Utility::GetColumn($coupons, 'team_id'));
$selector = 'index';
include template('manage_coupon_expire');
开发者ID:jowino,项目名称:bd786110cact,代码行数:15,代码来源:expire.php


示例15: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'coupon/consume');
}
$daytime = strtotime(date('Y-m-d'));
$condition = array('consume' => 'Y');
$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$coupons = DB::LimitQuery('coupon', array('condition' => $condition, 'order' => 'ORDER BY consume_time DESC', 'size' => $pagesize, 'offset' => $offset));
$users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
$teams = Table::Fetch('team', Utility::GetColumn($coupons, 'team_id'));
$selector = 'index';
include template('manage_coupon_consume');
开发者ID:jowino,项目名称:bd786110cact,代码行数:15,代码来源:consume.php


示例16: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'charityedit');
}
if ($_POST) {
    $temp = $_POST;
    $temp['image'] = upload_image('upload_image', null, 'charity');
    $id = abs(intval($_REQUEST['id']));
    $charity = Table::Fetch('charity', $id);
    $table = new Table('charity', $temp);
    $table->letter = strtoupper($table->letter);
    $uarray = array('name', 'description', 'image');
    if (!$_POST['name']) {
        Session::Set('error', 'Can not leave blank for Name');
        Utility::Redirect(null);
    }
    if ($charity) {
        if ($flag = $table->update($uarray)) {
            Session::Set('notice', 'Edit charity done');
        } else {
            Session::Set('error', 'Edit charity failed');
        }
    } else {
        if ($flag = $table->insert($uarray)) {
            Session::Set('notice', 'Create new charity done');
        } else {
            Session::Set('error', 'Create new charity failed');
        }
    }
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:charityedit.php


示例17: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'user/usergroup');
}
$cs = strval($_GET['cs']);
$count = Table::Count('user_group');
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$groups = DB::LimitQuery('user_group', array('order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
include template('manage_user_usergroup');
开发者ID:jowino,项目名称:bd786110cact,代码行数:11,代码来源:usergroup.php


示例18: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'system/city');
}
$system = Table::Fetch('system', 1);
if ($_POST) {
    unset($_POST['commit']);
    /* hot city convert */
    //$cityname = preg_split('/[\s,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $cityname = preg_split('/[,]+/', $_POST['hotcity'], -1, PREG_SPLIT_NO_EMPTY);
    $hotcity = array();
    foreach ($cityname as $one) {
        $city = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => trim($one)), 'one' => 'true'));
        if ($city) {
            $hotcity[$city['ename']] = $city['name'];
        }
    }
    if (!$hotcity) {
        $hotcity = array('sg' => 'Singapore');
    }
    /* merget */
    $_POST['hotcity'] = $hotcity;
    $INI = Config::MergeINI($INI, $_POST);
    unset($INI['db']);
    unset($INI['sn']);
    /* end */
    $value = Utility::ExtraEncode($INI);
    $table = new Table('system', array('value' => $value));
    if ($system) {
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:city.php


示例19: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('access', 'order/unpay');
}
$condition = array('state' => 'unpay');
$uemail = strval($_GET['uemail']);
if ($uemail) {
    $uuser = Table::Fetch('user', $uemail, 'email');
    if ($uuser) {
        $condition['user_id'] = $uuser['id'];
    } else {
        $uemail = null;
    }
}
$count = Table::Count('order', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$orders = DB::LimitQuery('order', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$pay_ids = Utility::GetColumn($orders, 'pay_id');
$pays = Table::Fetch('pay', $pay_ids);
$user_ids = Utility::GetColumn($orders, 'user_id');
$users = Table::Fetch('user', $user_ids);
$team_ids = Utility::GetColumn($orders, 'team_id');
$teams = Table::Fetch('team', $team_ids);
include template('manage_order_unpay');
开发者ID:jowino,项目名称:bd786110cact,代码行数:26,代码来源:unpay.php


示例20: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
if (!need_manager()) {
    need_permission('modify', 'misc/askedit');
}
$id = abs(intval($_GET['id']));
$ask = Table::Fetch('ask', $id);
if (!$ask) {
    Utility::Redirect(WEB_ROOT . '/manage/misc/ask.php');
}
if ($_POST && $id == $_POST['id']) {
    $table = new Table('ask', $_POST);
    $table->update(array('comment', 'content'));
    Utility::Redirect(udecode($_GET['r']));
}
$team = Table::Fetch('team', $ask['team_id']);
$user = Table::Fetch('user', $ask['user_id']);
include template('manage_misc_askedit');
开发者ID:jowino,项目名称:bd786110cact,代码行数:19,代码来源:askedit.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP need_rbac_auth函数代码示例发布时间:2022-05-15
下一篇:
PHP need_manager函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap