本文整理汇总了PHP中CheckPurview函数的典型用法代码示例。如果您正苦于以下问题:PHP CheckPurview函数的具体用法?PHP CheckPurview怎么用?PHP CheckPurview使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckPurview函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
}
$diyid = empty($diyid) ? 0 : intval($diyid);
/*----------------
function __SaveEdit()
-----------------*/
if ($dopost == "save") {
$public = isset($public) && is_numeric($public) ? $public : 0;
$name = htmlspecialchars($name, ENT_COMPAT, "GB2312");
$query = "UPDATE `#@__diyforms` SET name = '{$name}', listtemplate='{$listtemplate}', viewtemplate='{$viewtemplate}', posttemplate='{$posttemplate}', public='{$public}' WHERE diyid='{$diyid}' ";
$dsql->ExecuteNoneQuery($query);
ShowMsg("成功更改一个自定义表单!", "diy_main.php");
exit;
} else {
if ($dopost == "delete") {
@set_time_limit(0);
CheckPurview('c_Del');
$row = $dsql->GetOne("SELECT * FROM #@__diyforms WHERE diyid='{$diyid}'");
if (empty($job)) {
$job = "";
}
//确认提示
if ($job == "") {
$wintitle = "自定义表单管理-删除自定义表单";
$wecome_info = "<a href='diy_main.php'>自定义表单管理</a>::删除自定义表单";
$win = new OxWindow();
$win->Init("diy_edit.php", "js/blank.js", "POST");
$win->AddHidden("job", "yes");
$win->AddHidden("dopost", $dopost);
$win->AddHidden("diyid", $diyid);
$win->AddTitle("!将删除所有与该自定义表单相关的文件和数据<br />你确实要删除 \"" . $row['name'] . "\" 这个自定义表单?");
$winform = $win->GetWindow("ok");
示例2: dirname
<?php
/**
* 系统权限组编辑
*
* @version $Id: sys_group_edit.php 1 22:28 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('sys_Group');
if (empty($dopost)) {
$dopost = "";
}
if ($dopost == 'save') {
if ($rank == 10) {
ShowMsg('超级管理员的权限不允许更改!', 'sys_group.php');
exit;
}
$purview = "";
if (is_array($purviews)) {
foreach ($purviews as $p) {
$purview .= "{$p} ";
}
$purview = trim($purview);
}
$dsql->ExecuteNoneQuery("UPDATE `#@__admintype` SET typename='{$typename}',purviews='{$purview}' WHERE CONCAT(`rank`)='{$rank}'");
ShowMsg('成功更改用户组的权限!', 'sys_group.php');
exit;
示例3: dirname
<?php
/**
* 配送方式设置
*
* @version $Id: shops_delivery.php 1 15:46 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('shops_Delivery');
require_once DEDEINC . '/datalistcp.class.php';
if (!isset($do)) {
$do = '';
}
if ($do == 'add') {
if (empty($dname) || strlen($dname) > 100) {
ShowMsg("请填写配送方式名称!", "-1");
exit;
}
$price = preg_replace("#[^.0-9]#", "", $price);
if ($price < 0.01) {
$price = '0.00';
}
$des = cn_substrR($des, 255);
$InQuery = "INSERT INTO #@__shops_delivery(`dname`,`price`,`des`) VALUES ('{$dname}','{$price}','{$des}');";
$result = $dsql->ExecuteNoneQuery($InQuery);
if ($result) {
ShowMsg("成功添加一个配送方式!", "shops_delivery.php");
示例4: dirname
<?php
/**
* 自定义表单列表
*
* @version $Id: diy_list.php 1 18:31 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('c_New');
$diyid = isset($diyid) && is_numeric($diyid) ? $diyid : 0;
$action = isset($action) && in_array($action, array('post', 'list', 'edit', 'check', 'delete')) ? $action : '';
if (empty($diyid)) {
showMsg("非法操作!", 'javascript:;');
exit;
}
require_once DEDEINC . '/diyform.cls.php';
$diy = new diyform($diyid);
if ($action == 'post') {
if (empty($do)) {
$postform = $diy->getForm('post', '', 'admin');
include DEDEADMIN . '/templets/diy_post.htm';
} else {
if ($do == 2) {
$dede_fields = empty($dede_fields) ? '' : trim($dede_fields);
$dede_fieldshash = empty($dede_fieldshash) ? '' : trim($dede_fieldshash);
if (!empty($dede_fields)) {
if ($dede_fieldshash != md5($dede_fields . $cfg_cookie_encode)) {
示例5: dirname
<?php
require_once dirname(__FILE__) . "/config.php";
CheckPurview('sys_Data');
if (empty($dopost)) {
$dopost = '';
}
if ($dopost == "viewinfo") {
echo "[<a href='#' onclick='javascript:HideObj(\"_mydatainfo\")'><u>关闭</u></a>]\r\n<xmp>";
if (empty($tablename)) {
echo "没有指定表名!";
} else {
$dsql->SetQuery("SHOW CREATE TABLE " . $dsql->dbName . "." . $tablename);
$dsql->Execute('me');
$row2 = $dsql->GetArray('me', MYSQL_BOTH);
$ctinfo = $row2[1];
echo trim($ctinfo);
}
echo '</xmp>';
exit;
} else {
if ($dopost == "opimize") {
echo "[<a href='#' onclick='javascript:HideObj(\"_mydatainfo\")'><u>关闭</u></a>]\r\n<xmp>";
if (empty($tablename)) {
echo "没有指定表名!";
} else {
$rs = $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `{$tablename}` ");
if ($rs) {
echo "执行优化表: {$tablename} OK!";
} else {
echo "执行优化表: {$tablename} 失败,原因是:" . $dsql->GetError();
示例6: dirname
<?php
/**
* 系统密码提示问
*
* @version $Id: sys_safe.php 1 22:28 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('sys_Safe');
$safeconfigfile = DEDEDATA . "/safe/inc_safe_config.php";
if (empty($dopost)) {
$dopost = "";
}
if ($dopost == "save") {
$configstr = $shortname = "";
$gdopen = empty($gdopen) ? "" : $gdopen;
$codetype = empty($codetype) ? 1 : $codetype;
$gdtype = empty($gdtype) ? 1 : $gdtype;
$gdstyle = empty($gdstyle) ? "" : $gdstyle;
$gd_wwidth = empty($gd_wwidth) ? 0 : $gd_wwidth;
$gd_wheight = empty($gd_wheight) ? 0 : $gd_wheight;
$codelen = empty($codelen) ? 4 : $codelen;
$gdfaq_reg = empty($gdfaq_reg) ? 0 : $gdfaq_reg;
$gdfaq_send = empty($gdfaq_send) ? 0 : $gdfaq_send;
$gdfaq_msg = empty($gdfaq_msg) ? 0 : $gdfaq_msg;
if (is_array($gdopen)) {
$configstr = "\$safe_gdopen = '" . implode(",", $gdopen) . "';\r\n";
示例7: dirname
<?php
/**
* 导出采集规则
*
* @version $Id: co_edit_text.php 1 14:31 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('co_Export');
if (empty($dopost)) {
$dopost = '';
}
if ($dopost != 'done') {
require_once DEDEADMIN . "/inc/inc_catalog_options.php";
$totalcc = $channelid = $usemore = 0;
if (!empty($nid)) {
$mrow = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` WHERE nid='{$nid}' AND isdown='1' ");
$totalcc = $mrow['dd'];
$rrow = $dsql->GetOne("SELECT channelid,usemore FROM `#@__co_note` WHERE nid='{$nid}' ");
$channelid = $rrow['channelid'];
$usemore = $rrow['usemore'];
} else {
$mrow = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__co_htmls` WHERE isdown='1' ");
$totalcc = $mrow['dd'];
}
include DedeInclude("templets/co_export.htm");
exit;
示例8: dirname
<?php
/**
* 会员信息管理
*
* @version $Id: member_info_main.php 1 14:08 2010年7月19日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('sys_Log');
require_once DEDEINC . "/datalistcp.class.php";
require_once DEDEINC . "/common.func.php";
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$sql = $where = "";
$dtime = empty($dtime) ? 0 : $dtime;
$ischeck = empty($ischeck) ? "" : $ischeck;
$dopost = empty($dopost) ? "" : $dopost;
if ($type == "feed") {
$table = "#@__member_feed";
$id = "aid";
$tpl = DEDEADMIN . "/templets/member_feed_main.htm";
} else {
$table = "#@__member_msg";
$id = "id";
$tpl = DEDEADMIN . "/templets/member_mood_main.htm";
}
if (in_array($ischeck, array('-1', '1'))) {
$type = array('-1' => '0', '1' => '1');
示例9: ShowMsg
if ($rs == 1) {
$dsql->ExecuteNoneQuery("DELETE FROM #@__uploads WHERE aid='" . $myrow['aid'] . "'");
}
}
ShowMsg('成功删除选定的文件!', $backurl);
exit;
}
} else {
if ($dopost == 'save') {
if ($aid == "") {
exit;
}
//检查是否有修改权限
$myrow = $dsql->GetOne("SELECT * FROM #@__uploads WHERE aid='" . $aid . "'");
if ($myrow['mid'] != $cuserLogin->getUserID()) {
CheckPurview('sys_Upload');
}
//检测文件类型
$addquery = "";
if (is_uploaded_file($upfile)) {
if ($mediatype == 1) {
$sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp");
if (!in_array($upfile_type, $sparr)) {
ShowMsg("你上传的不是图片类型的文件!", "javascript:history.go(-1);");
exit;
}
} else {
if ($mediatype == 2) {
$sparr = array("application/x-shockwave-flash");
if (!in_array($upfile_type, $sparr)) {
ShowMsg("你上传的不是Flash类型的文件!", "javascript:history.go(-1);");
示例10: dirname
<?php
/**
* 模块管理
*
* @version $Id: module_main.php 1 14:17 2010年7月20日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('sys_module');
require_once dirname(__FILE__) . "/../include/dedemodule.class.php";
require_once dirname(__FILE__) . "/../include/oxwindow.class.php";
if (empty($action)) {
$action = '';
}
require_once DEDEDATA . "/admin/config_update.php";
$mdir = DEDEDATA . '/module';
$mdurl = $updateHost . 'dedecms/module_' . $cfg_soft_lang . '/modulelist.txt';
function TestWriteAble($d)
{
$tfile = '_dedet.txt';
$d = preg_replace("#\\/\$#", '', $d);
$fp = @fopen($d . '/' . $tfile, 'w');
if (!$fp) {
return FALSE;
} else {
fclose($fp);
$rs = @unlink($d . '/' . $tfile);
示例11: require_once
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('plus_站内新闻发布');
if(empty($dopost)) $dopost = "";
$aid = ereg_replace("[^0-9]","",$aid);
$dsql = new DedeSql(false);
if($dopost=="del")
{
$dsql->SetQuery("Delete From #@__mynews where aid='$aid';");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功删除一条站内新闻!","mynews_main.php");
exit();
}
else if($dopost=="editsave")
{
$dsql->SetQuery("Update #@__mynews set title='$title',typeid='$typeid',writer='$writer',senddate='".GetMKTime($sdate)."',body='$body' where aid='$aid';");
$dsql->ExecuteNoneQuery();
$dsql->Close();
ShowMsg("成功更改一条站内新闻!","mynews_main.php");
exit();
}
$myNews = $dsql->GetOne("Select #@__mynews.*,#@__arctype.typename From #@__mynews left join #@__arctype on #@__arctype.ID=#@__mynews.typeid where #@__mynews.aid='$aid';");
require_once(dirname(__FILE__)."/templets/mynews_edit.htm");
ClearAllLink();
?>
示例12: dirname
<?php
/**
* 圈子公告管理
*
* @version $Id: group_notice.php 1 15:34 2011-1-21 tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
require_once DEDEINC . '/datalistcp.class.php';
CheckPurview('group_Edit');
$id = isset($id) && is_numeric($id) ? $id : 0;
$gid = isset($gid) && is_numeric($gid) ? $gid : 0;
$action = isset($action) ? trim($action) : '';
$keyword = isset($keyword) ? trim($keyword) : '';
$keyword = stripslashes($keyword);
$keyword = preg_replace("#[\"\r\n\t\\*\\?\\(\\)\$%']#", " ", trim($keyword));
$keyword = addslashes($keyword);
$username = isset($username) ? trim($username) : '';
$username = stripslashes($username);
$username = preg_replace("#[\"\r\n\t\\*\\?\\(\\)\$%']#", " ", trim($username));
$username = addslashes($username);
if ($gid < 1) {
ShowMsg("含有非法操作!.", "-1");
exit;
}
if ($action == "del") {
if ($id > 0) {
示例13: dirname
<?php
/**
* 自定义表单列表管理
*
* @version $Id: diy_main.php 1 18:31 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once dirname(__FILE__) . "/config.php";
CheckPurview('c_List');
require_once DEDEINC . "/datalistcp.class.php";
require_once DEDEINC . "/common.func.php";
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$sql = "Select `diyid`,`name`,`table` From #@__diyforms order by diyid asc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN . "/templets/diy_main.htm");
$dlist->SetSource($sql);
$dlist->display();
$dlist->Close();
示例14: require_once
<?php
require_once(dirname(__FILE__)."/config.php");
$t1 = ExecTime();
CheckPurview('sys_MakeHtml');
require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
if($dopost=="view")
{
$pv = new PartView();
$templet = str_replace("{style}",$cfg_df_style,$templet);
$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
$pv->Display();
$pv->Close();
}
else if($dopost=="make")
{
header("Content-Type: text/html; charset={$cfg_ver_lang}");
$homeFile = dirname(__FILE__)."/".$position;
$homeFile = str_replace("\\","/",$homeFile);
$homeFile = str_replace("//","/",$homeFile);
$fp = fopen($homeFile,"w") or die("你指定的文件名有问题,无法创建文件");
fclose($fp);
if($saveset==1)
{
$dsql = new DedeSql(false);
$dsql->SetQuery("update #@__homepageset set templet='$templet',position='$position' ");
$dsql->ExecuteNoneQuery();
$dsql->Close();
}
$templet = str_replace("{style}",$cfg_df_style,$templet);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
示例15: require
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('plus_投票模块');
if(empty($dopost)) $dopost = "";
//////////////////////////////////////////
if($dopost=="save")
{
//$ismore,$votename
$starttime = GetMkTime($starttime);
$endtime = GetMkTime($endtime);
$voteitems = "";
$j=0;
for($i=1;$i<=15;$i++)
{
if(!empty(${"voteitem".$i})){
$j++;
$voteitems .= "<v:note id=\\'$j\\' count=\\'0\\'>".${"voteitem".$i}."</v:note>\r\n";
}
}
$dsql = new DedeSql(false);
$inQuery = "
insert into #@__vote(votename,starttime,endtime,totalcount,ismore,votenote)
Values('$votename','$starttime','$endtime','0','$ismore','$voteitems');
";
$dsql->SetQuery($inQuery);
if(!$dsql->ExecuteNoneQuery())
{
$dsql->Close();
ShowMsg("增加投票失败,请检查数据是否非法!","-1");
exit();
}