本文整理汇总了PHP中is_superadmin函数的典型用法代码示例。如果您正苦于以下问题:PHP is_superadmin函数的具体用法?PHP is_superadmin怎么用?PHP is_superadmin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_superadmin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
if (!$this->ion_auth->logged_in()) {
redirect("login");
}
if (!$this->ion_auth->is_admin() && $this->only_admin === true) {
redirect("");
}
$this->view["user"] = $this->ion_auth->user()->row();
$this->view["message"] = $this->session->flashdata('message');
$this->view["permits"] = $this->ion_auth->is_admin() || is_superadmin($this->ion_auth->user()->row()->id);
}
开发者ID:jincongho,项目名称:clienthub,代码行数:13,代码来源:MY_Controller.php
示例2: __construct
public function __construct()
{
parent::__construct();
$this->load->database();
if (!$this->ion_auth->logged_in()) {
redirect("login");
}
if (!$this->ion_auth->is_admin() && !is_superadmin($this->ion_auth->user()->row()->id)) {
redirect("");
}
$this->header->output();
$this->load->library('form_validation');
$this->load->library('upload');
$this->load->library('image_lib');
$this->load->helper('url');
$this->load->model("Clientdbmodel");
}
开发者ID:jincongho,项目名称:clienthub,代码行数:17,代码来源:general.php
示例3: ok_to_impersonate
function ok_to_impersonate($euid, $uid)
{
global $dbh;
// It's harmless to impersonate yourself ;)
if ($euid == $uid && $euid > 0 && $uid > 0) {
return true;
} else {
// Domain default users can be impersonated by admins
// responsible for those domains, and the superadmin.
// Only the superadmin can impersonate the system default
// user (@.).
if (is_a_domain_default_user($euid) || get_config_value("enable_privacy_invasion") == "Y") {
if (is_superadmin($uid)) {
return true;
} else {
if (is_a_domain_default_user($euid)) {
$domain_id = get_domain_id(get_user_name($euid));
return is_admin_for_domain($uid, $domain_id);
} else {
if (!is_superadmin($euid)) {
$sth = $dbh->prepare("SELECT email FROM users WHERE maia_user_id = ?");
$res = $sth->execute(array($euid));
if (PEAR::isError($sth)) {
die($sth->getMessage());
}
while ($row = $res->fetchRow()) {
$domain_id = get_domain_id("@" . get_domain_from_email($row["email"]));
if (is_admin_for_domain($uid, $domain_id)) {
$sth->free();
return true;
}
}
$sth->free();
return false;
} else {
return false;
}
}
}
// Impersonating other users is an invasion of privacy,
// even for administrators, unless explicitly overridden above.
} else {
return false;
}
}
}
开发者ID:tenshi3,项目名称:maia_mailguard,代码行数:46,代码来源:user_management.php
示例4: checkAuth
/**
* check authorization for user
* @param string $menu
* @param int $id_group
* @return boolean
*/
private function checkAuth($menu, $id_group)
{
$CI =& get_instance();
$CI->load->database();
if ($menu == 'home' || $menu == 'dashboard' || $menu == '' && $menu == 'profile') {
return true;
}
if (is_superadmin()) {
$data = $CI->db->from('auth_menu')->where('LCASE(file)', strtolower($menu))->where('id_auth_group', $id_group)->join('auth_menu_group', 'auth_menu_group.id_auth_menu=auth_menu.id_auth_menu', 'left')->count_all_results();
} else {
$data = $CI->db->from('auth_menu')->where('LCASE(file)', strtolower($menu))->where('id_auth_group', $id_group)->where('is_superadmin', 0)->join('auth_menu_group', 'auth_menu_group.id_auth_menu=auth_menu.id_auth_menu', 'left')->count_all_results();
}
if ($data > 0) {
return true;
} else {
return false;
}
}
开发者ID:xemmex,项目名称:codeigniter3-custom-cms,代码行数:24,代码来源:FAT_Hooks.php
示例5: __construct
public function __construct()
{
parent::__construct();
$this->load->database();
if (!$this->ion_auth->logged_in()) {
redirect("login");
}
if (!$this->ion_auth->is_admin() && !is_superadmin($this->ion_auth->user()->row()->id)) {
redirect("");
}
$this->header->css[] = "assets/css/clientsdata.css";
$this->header->js[] = "assets/js/jquery-ui-1.8.23.custom.min.js";
$this->header->js[] = "assets/js/jqueryui/jquery.ui.core.min.js";
$this->header->js[] = "assets/js/jqueryui/jquery.ui.mouse.min.js";
$this->header->js[] = "assets/js/jqueryui/jquery.ui.widget.min.js";
$this->header->js[] = "assets/js/jqueryui/jquery.ui.sortable.min.js";
$this->header->output();
$this->load->model('Clientdbmodel');
$this->load->library("form_validation");
}
开发者ID:jincongho,项目名称:clienthub,代码行数:20,代码来源:clientsdata.php
示例6: CountAllAdmin
/**
* count records
* @param string $param
* @return int total records
*/
function CountAllAdmin($param = array())
{
if (!is_superadmin()) {
$this->db->where('is_superadmin', 0);
}
if (is_array($param) && isset($param['search_value']) && $param['search_value'] != '') {
$this->db->group_start();
$i = 0;
foreach ($param['search_field'] as $row => $val) {
if ($val['searchable'] == 'true') {
if ($i == 0) {
$this->db->like('LCASE(`' . $val['data'] . '`)', strtolower($param['search_value']));
} else {
$this->db->or_like('LCASE(`' . $val['data'] . '`)', strtolower($param['search_value']));
}
$i++;
}
}
$this->db->group_end();
}
$total_records = $this->db->from('auth_user')->join('auth_group', 'auth_group.id_auth_group=auth_user.id_auth_group', 'left')->count_all_results();
return $total_records;
}
开发者ID:xemmex,项目名称:codeigniter3-custom-cms,代码行数:28,代码来源:Admin_model.php
示例7: exit
<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
get_key("project_");
$typeid = $_GET['typeid'];
$projectid = $_GET['projectid'];
$modid = $_GET['modid'];
pro_mana_view($typeid, $_USER->id);
$sql = "SELECT * FROM " . DB_TABLEPRE . "project_model WHERE mid = '" . $modid . "'";
$mod = $db->fetch_one_array($sql);
//创建权限
global $db;
$manat = $db->fetch_one_array("SELECT tid FROM " . DB_TABLEPRE . "project_type where (keyuser like '%" . get_realname($_USER->id) . "%' or keyuser='' or manauser like '%" . get_realname($_USER->id) . "%') and tid=" . $typeid);
if (!is_superadmin() && $manat['tid'] == '') {
$sql = "SELECT mid FROM " . DB_TABLEPRE . "project_model WHERE mid = '" . $modid . "' and (keyuser like '%" . get_realname($_USER->id) . "%' or keyuser='' or manauser like '%" . get_realname($_USER->id) . "%')";
$mana = $db->fetch_one_array($sql);
if ($mana['mid'] == '') {
show_msg('对不起,您没有使用的权限,不可用!', 'home.php?mid=8');
}
}
empty($do) && ($do = 'list');
if ($do == 'list') {
//列表信息
$wheresqltype = '';
$wheresql = '';
$page = max(1, getGP('page', 'G', 'int'));
$pagesize = $_CONFIG->config_data('pagenum');
$offset = ($page - 1) * $pagesize;
$url = 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=' . $_GET['type'];
if ($title = getGP('title', 'G')) {
$wheresqltype .= " AND a.title LIKE '%{$title}%' ";
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_modlist.php
示例8: is_superadmin
$smarty->assign("msid", $msid);
$smarty->assign("sid", $sid);
$smarty->assign('banner_title', $banner_title);
$smarty->assign('use_logo', $use_logo);
$smarty->assign('use_icons', $use_icons);
$smarty->assign('logo_file', $logo_file);
$smarty->assign('logo_width', $logo_width);
$smarty->assign('logo_height', $logo_height);
$smarty->assign('logo_url', $logo_url);
$smarty->assign('logo_alt_text', $logo_alt_text);
$smarty->assign('enable_false_negative_management', $enable_false_negative_management);
$smarty->assign('system_enable_user_autocreation', $enable_user_autocreation);
$smarty->assign('enable_stats_tracking', $enable_stats_tracking);
$smarty->assign('cols', $cols);
$smarty->assign('admin', $admin);
$smarty->assign('username', $username);
$smarty->assign('showmenu', $showmenu);
$smarty->assign('super', is_superadmin($uid));
$smarty->assign("lang", $lang);
$smarty->assign("is_a_visitor", $is_a_visitor);
// added by JacobLeaver, response to ticket
$smarty->assign("php_errors", isset($php_errors) ? $php_errors : "");
// some default values, which can be overridden
$smarty->assign("page_css", "");
$smarty->assign("page_javascript", "");
$message = isset($message) ? $message : "";
$message .= isset($_SESSION["message"]) ? $_SESSION["message"] : "";
$_SESSION["message"] = "";
// unset message, we don't want to display more than once.
// if page is to be redirected again, reassign it.
$smarty->assign("message", $message);
开发者ID:einheit,项目名称:mailguard_legacy,代码行数:31,代码来源:smarty.php
示例9: get_postname
</span></td>
<td class="info"><?php
echo $row['loginip'];
?>
</td>
<td class="info"><?php
echo get_postname($row['positionid']);
?>
</td>
<td class="info"><?php
echo get_realdepaname($row['departmentid']);
?>
</td>
<td class="action" >
<?php
if ($row['flag'] != '1' || is_superadmin() != '') {
?>
<a href="admin.php?ac=<?php
echo $ac;
?>
&fileurl=<?php
echo $fileurl;
?>
&do=add&id=<?php
echo $row['id'];
?>
">编辑</a>
<?php
}
?>
</td>
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:user.php
示例10:
<dt><div class="spheric ui-corner-all-16"><img src="template/default/new/images/01.png"></div>
<span class="month_view_schedule_time"><a href="admin.php?ac=<?php
echo $ac;
?>
&fileurl=<?php
echo $fileurl;
?>
&do=views&id=<?php
echo $row['id'];
?>
"><?php
echo $row['title'];
?>
</a></span>
<?php
if ($row['uid'] == $_USER->id || is_superadmin()) {
?>
<em class="none"><a href="admin.php?ac=<?php
echo $ac;
?>
&fileurl=<?php
echo $fileurl;
?>
&do=add&id=<?php
echo $row['id'];
?>
" title="修改日志" class="month_view_edit_schedule "></a><a href="admin.php?ac=<?php
echo $ac;
?>
&fileurl=<?php
echo $fileurl;
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:bloglist.php
示例11: delete
/**
* delete page
*/
public function delete()
{
$this->layout = 'none';
if ($this->input->post() && $this->input->is_ajax_request()) {
$post = $this->input->post();
$json = array();
if ($post['ids'] != '') {
$array_id = array_map('trim', explode(',', $post['ids']));
if (count($array_id) > 0) {
foreach ($array_id as $row => $id) {
$record = $this->Quiz_model->GetQuiz($id);
if ($record) {
if ($id == id_auth_user()) {
$json['error'] = alert_box('You can\'t delete Your own account.', 'danger');
break;
} else {
if (is_superadmin()) {
if ($record['image'] != '' && file_exists(UPLOAD_DIR . 'admin/' . $record['image'])) {
unlink(UPLOAD_DIR . 'admin/' . $record['image']);
@unlink(UPLOAD_DIR . 'admin/tmb_' . $record['image']);
@unlink(UPLOAD_DIR . 'admin/sml_' . $record['image']);
}
$this->Quiz_model->DeleteRecord($id);
// insert to log
$data_log = array('id_user' => id_auth_user(), 'id_group' => id_auth_group(), 'action' => 'Delete User Quiz', 'desc' => 'Delete User Quiz; ID: ' . $id . ';');
insert_to_log($data_log);
// end insert to log
$json['success'] = alert_box('Data has been deleted', 'success');
$this->session->set_flashdata('flash_message', $json['success']);
} else {
$json['error'] = alert_box('You don\'t have permission to delete this record(s). Please contact the Quizistrator.', 'danger');
break;
}
}
} else {
$json['error'] = alert_box('Failed. Please refresh the page.', 'danger');
break;
}
}
}
}
header('Content-type: application/json');
exit(json_encode($json));
}
redirect($this->class_path_name);
}
开发者ID:xemmex,项目名称:codeigniter3-custom-cms,代码行数:49,代码来源:Quiz.php
示例12: get_display_language
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
require_once "core.php";
require_once "maia_db.php";
require_once "authcheck.php";
require_once "display.php";
$display_language = get_display_language($euid);
require_once "./locale/{$display_language}/db.php";
require_once "./locale/{$display_language}/display.php";
require_once "./locale/{$display_language}/adminviruses.php";
require_once "smarty.php";
// Only the superadministrator should be here.
if (!is_superadmin($uid)) {
header("Location: index.php" . $sid);
exit;
}
// Cancel any impersonations currently in effect
// by resetting EUID = UID and forcing a reload
// of this page.
if ($uid != $euid) {
$euid = $uid;
$_SESSION["euid"] = $uid;
header("Location: adminviruses.php" . $sid);
exit;
}
$select = "SELECT virus_name, virus_alias, virus_id " . "FROM maia_viruses, maia_virus_aliases " . "WHERE maia_viruses.id = maia_virus_aliases.virus_id " . "ORDER BY virus_alias ASC";
$sth = $dbh->query($select);
$smarty->assign('numrows', $sth->numrows());
开发者ID:einheit,项目名称:mailguard_legacy,代码行数:31,代码来源:adminviruses.php
示例13: array
$outputFileName = 'data/excel/' . $datename . '.xls';
$content = array();
$archive = array("名称", "有效期(开始)", "有效期(结束)", "发布范围(部门)", "参与人", "负责人", "备注", "完成时间", "发布人", "类型", "内容");
$content[] = $archive;
$wheresql = '';
if ($title = getGP('title', 'P')) {
$wheresql .= " AND title LIKE '%{$title}%'";
}
//时间
$vstartdate = getGP('vstartdate', 'P');
$venddate = getGP('venddate', 'P');
if ($vstartdate != '' && $venddate != '') {
$wheresql .= " AND (startdate>='" . $vstartdate . "' and enddate<='" . $venddate . "')";
}
$vuidtype = getGP('vuidtype', 'P');
if (!is_superadmin() && $ischeck != '1' && $ischeck != '2' && $vuidtype == '') {
$wheresql .= " AND uid = {$_USER->id}";
}
if ($vuidtype != '') {
if ($vuidtype == '-1') {
$wheresql .= get_subordinate($_USER->id, 'uid');
} else {
$wheresql .= " and uid='" . $vuidtype . "'";
}
}
if ($ischeck == '1' && $vuidtype == '') {
$wheresql .= " AND participation LIKE '%" . get_realname($_USER->id) . "%' ";
}
if ($ischeck == '2' && $vuidtype == '') {
$wheresql .= " AND person LIKE '%" . get_realname($_USER->id) . "%' ";
}
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_plan.php
示例14: pro_mana_view
function pro_mana_view($typeid = 0, $user = 0)
{
if (!is_superadmin()) {
global $db;
$mana = $db->fetch_one_array("SELECT tid FROM " . DB_TABLEPRE . "project_type where (keyuser like '%" . get_realname($user) . "%' or keyuser='' or manauser like '%" . get_realname($user) . "%') and tid=" . $typeid);
if ($mana['tid'] == '') {
show_msg('对不起,您没有使用的权限,不可用!', 'home.php?mid=8');
}
}
}
开发者ID:haogm123,项目名称:ydoa,代码行数:10,代码来源:function_project.php
示例15: delete
/**
* delete page
*/
public function delete()
{
$this->layout = 'none';
if ($this->input->post() && $this->input->is_ajax_request()) {
$post = $this->input->post();
$json = array();
if ($post['ids'] != '') {
$array_id = array_map('trim', explode(',', $post['ids']));
if (count($array_id) > 0) {
foreach ($array_id as $row => $id) {
$record = $this->Menu_model->GetMenu($id);
if ($record) {
if ($record['is_superadmin'] && !is_superadmin()) {
$json['error'] = alert_box('You don\'t have permission to delete this record(s). Please contact the Menuistrator.', 'danger');
break;
} else {
/*if (!$this->Menu_model->checkUserHaveRightsMenu(id_auth_group(),$id)) {
$json['error'] = alert_box('You don\'t have permission to delete this record(s). Please contact the Menuistrator.','danger');
break;
} else {*/
$this->Menu_model->DeleteRecord($id);
// insert to log
$data_log = array('id_user' => id_auth_user(), 'id_group' => id_auth_group(), 'action' => 'Delete Admin Menu', 'desc' => 'Delete Admin Menu; ID: ' . $id . ';');
insert_to_log($data_log);
// end insert to log
$json['success'] = alert_box('Data has been deleted', 'success');
$this->session->set_flashdata('flash_message', $json['success']);
//}
}
} else {
$json['error'] = alert_box('Failed. Please refresh the page.', 'danger');
break;
}
}
}
}
header('Content-type: application/json');
exit(json_encode($json));
}
redirect($this->class_path_name);
}
开发者ID:xemmex,项目名称:codeigniter3-custom-cms,代码行数:44,代码来源:Menu.php
示例16: MenusData
/**
* get all auth menu
* @param int $id_parent
* @return array data
*/
function MenusData($id_parent = 0)
{
if (!is_superadmin()) {
$this->db->where('is_superadmin', 0);
}
$data = $this->db->where('parent_auth_menu', $id_parent)->order_by('position', 'asc')->order_by('auth_menu.id_auth_menu', 'asc')->get('auth_menu')->result_array();
foreach ($data as $row => $val) {
$data[$row]['children'] = $this->MenusData($val['id_auth_menu']);
}
return $data;
}
开发者ID:xemmex,项目名称:codeigniter3-custom-cms,代码行数:16,代码来源:Menu_model.php
示例17: folder_fit
function folder_fit($file = null, $size = null, $profile = null)
{
if (!$file && !$size || !$profile) {
return false;
}
$is_admin = is_superadmin();
if (empty($_SESSION['profile_folder_max_size']) && !$is_admin) {
return false;
}
$folder = $_SESSION['upload_root_path'] . $profile;
$max = $_SESSION['profile_folder_max_size'] * 1048576;
if (!empty($file)) {
if (!is_file($file)) {
return false;
}
$size = filesize($file);
}
if (folder_size($folder, false) + $size > $max && !$is_admin) {
return false;
}
return true;
}
开发者ID:Pluxopolis,项目名称:BoZoN,代码行数:22,代码来源:core.php
示例18: crm_menu_my
if ($aa != 0) {
echo '<h3 class="f14"><span class="switchs cu on" title="展开与收缩"></span>' . $row[menuname] . '</h3>';
//crm_menu_tow($row[menuid]);
crm_menu_my($row[menuid]);
//echo $row[menuid]."++<br>";
//echo "<span class='cu' title='点击操作'></span><a href=javascript:_MP(".$row[menuid].",'".$row[menuurl]."'); hidefocus='true' style='outline:none;'>".$row[menuname]."</a>";
}
}
} else {
//自写
$aa = get_pp($row[menuname]);
//echo $row[menuname]."++".$aa."**<br>";
if (is_superadmin()) {
echo "<h3 class='f14'><span class='cu' title='点击操作'></span><a href=javascript:_MP(" . $row[menuid] . ",'" . $row[menuurl] . "'); hidefocus='true' style='outline:none;'>" . $row[menuname] . "</a></h3>";
}
if ($aa != 0 and $row[menutype] != '1' and !is_superadmin()) {
//if($row[menutype]!='1'){
echo "<h3 class='f14'><span class='cu' title='点击操作'></span><a href=javascript:_MP(" . $row[menuid] . ",'" . $row[menuurl] . "'); hidefocus='true' style='outline:none;'>" . $row[menuname] . "</a></h3>";
}
}
}
}
?>
<script type="text/javascript">
$(".switchs").each(function(i){
var ul = $(this).parent().next();
$(this).click(
function(){
if(ul.is(':visible')){
ul.hide();
$(this).removeClass('on');
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:lmenu.php
示例19: getGP
} else {
$wheresql .= " AND type='1'";
}
if ($cid = getGP('cid', 'P')) {
$wheresql .= " AND cid='" . $cid . "'";
}
if ($number = getGP('number', 'P')) {
$wheresql .= " AND number='" . $number . "'";
}
if ($title = getGP('title', 'P')) {
$wheresql .= " AND title LIKE'%" . $title . "%'";
}
//权限判断
$un = getGP('un', 'P');
$ui = getGP('ui', 'P');
if (!is_superadmin() && $ui == '') {
$wheresql .= " and (uid='" . $_USER->id . "' or user='" . get_realname($_USER->id) . "')";
}
if ($ui != '') {
$wheresql .= " and (uid in(" . $ui . ") or user in('" . str_replace(",", "','", $un) . "'))";
}
$vstartdate = getGP('vstartdate', 'P');
$venddate = getGP('venddate', 'P');
if ($vstartdate != '' && $venddate != '') {
$wheresql .= " AND (date>='" . $vstartdate . "' and date<='" . $venddate . "')";
}
//处理表单数据
$fromkeywordarr = getGP('fromkeyword', 'P', 'array');
$kinputname = getGP('kinputname', 'P', 'array');
$arrcid = array();
$nums = 0;
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_care.php
示例20: serialize
$content = serialize($idarr);
$title = '删除任务信息';
get_logadd($id, $content, $title, 33, $_USER->id);
show_msg('删除任务信息成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
} elseif ($do == 'excel') {
$datename = "duty_" . get_date('YmdHis', PHP_TIME);
$outputFileName = 'data/excel/' . $datename . '.xls';
//生成数据
$content = array();
$archive = array("任务编号", "任务名称", "执行人", "任务开始时间", "任务结束时间", "任务描述", "备注", "任务状态", "任务分配人");
$content[] = $archive;
$wheresql = '';
//根据条件导出
$ischeck = getGP('ischeck', 'P');
$vuidtype = getGP('vuidtype', 'P');
if (!is_superadmin() && $ischeck == '' && $vuidtype == '') {
$wheresql = "and (user='" . get_realname($_USER->id) . "' or uid='" . $_USER->id . "')";
}
if ($vuidtype != '') {
if ($ischeck == '1') {
if ($vuidtype == '-1') {
$wheresql .= get_subordinate($_USER->id, 'uid');
} else {
$wheresql .= " and uid='" . $vuidtype . "'";
}
} elseif ($ischeck == '2') {
$wheresql .= get_suborname($_USER->id, 'user');
} else {
if ($vuidtype == '-1') {
$wheresql .= get_subordinate($_USER->id, 'uid');
} else {
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_duty.php
注:本文中的is_superadmin函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论