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

PHP getUserEntryByUID函数代码示例

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

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



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

示例1: conf_mount_ro

    conf_mount_ro();
    $groupdeleted = $a_group[$_GET['id']]['name'];
    unset($a_group[$_GET['id']]);
    write_config();
    $savemsg = gettext("Group") . " {$groupdeleted} " . gettext("successfully deleted") . "<br />";
}
if ($_GET['act'] == "delpriv") {
    if (!$a_group[$_GET['id']]) {
        pfSenseHeader("system_groupmanager.php");
        exit;
    }
    $privdeleted = $priv_list[$a_group[$id]['priv'][$_GET['privid']]]['name'];
    unset($a_group[$id]['priv'][$_GET['privid']]);
    if (is_array($a_group[$id]['member'])) {
        foreach ($a_group[$id]['member'] as $uid) {
            $user = getUserEntryByUID($uid);
            if ($user) {
                local_user_set($user);
            }
        }
    }
    write_config();
    $_GET['act'] = "edit";
    $savemsg = gettext("Privilege") . " {$privdeleted} " . gettext("successfully deleted") . "<br />";
}
if ($_GET['act'] == "edit") {
    if (isset($id) && $a_group[$id]) {
        $pconfig['name'] = $a_group[$id]['name'];
        $pconfig['gid'] = $a_group[$id]['gid'];
        $pconfig['gtype'] = $a_group[$id]['scope'];
        $pconfig['description'] = $a_group[$id]['description'];
开发者ID:wcchandler,项目名称:pfsense,代码行数:31,代码来源:system_groupmanager.php


示例2: sprintf

 if ($_POST['gtype'] != "remote") {
     if (preg_match("/[^a-zA-Z0-9\\.\\-_]/", $_POST['groupname'])) {
         $input_errors[] = sprintf(gettext("The (%s) group name contains invalid characters."), $_POST['gtype']);
     }
 } else {
     if (preg_match("/[^a-zA-Z0-9\\.\\- _]/", $_POST['groupname'])) {
         $input_errors[] = sprintf(gettext("The (%s) group name contains invalid characters."), $_POST['gtype']);
     }
 }
 if (strlen($_POST['groupname']) > 16) {
     $input_errors[] = gettext("The group name is longer than 16 characters.");
 }
 /* Check the POSTed members to ensure they are valid and exist */
 if (is_array($_POST['members'])) {
     foreach ($_POST['members'] as $newmember) {
         if (!is_numeric($newmember) || empty(getUserEntryByUID($newmember))) {
             $input_errors[] = gettext("One or more invalid group members was submitted.");
         }
     }
 }
 if (!$input_errors && !(isset($id) && $a_group[$id])) {
     /* make sure there are no dupes */
     foreach ($a_group as $group) {
         if ($group['name'] == $_POST['groupname']) {
             $input_errors[] = gettext("Another entry with the same group name already exists.");
             break;
         }
     }
 }
 if (!$input_errors) {
     $group = array();
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:system_groupmanager.php


示例3: getUserEntryByUID

#!/usr/local/bin/php -f
<?php 
require_once "config.inc";
require "auth.inc";
require_once "functions.inc";
require_once "shaper.inc";
$config['system']['webqui']['authmode'] = "Local Database";
$admin_user =& getUserEntryByUID(0);
if (!$admin_user) {
    $admin_user = array();
    $admin_user['uid'] = 0;
    if (!is_array($config['system']['user'])) {
        $config['system']['user'] = array();
    }
    $config['system']['user'][] = $admin_user;
}
$admin_user['name'] = "admin";
$admin_user['scope'] = "system";
$admin_user['priv'] = array("user-shell-access");
if (isset($admin_user['disabled'])) {
    unset($admin_user['disabled']);
}
local_user_set_password($admin_user, "changeme");
local_user_set($admin_user);
开发者ID:KoalaTea,项目名称:Redteam,代码行数:24,代码来源:admin.php


示例4: getUserEntryByUID

#!/usr/local/bin/php -f
<?php 
require_once "config.inc";
require "auth.inc";
require_once "functions.inc";
require_once "shaper.inc";
$config['system']['webqui']['authmode'] = "Local Database";
$myuser =& getUserEntryByUID(2000);
if (!$myuser) {
    $myuser = array();
    $myuser['uid'] = 2000;
    $config['system']['user'][1] = $myuser;
}
$myuser['name'] = "Teaffanny";
$myuser['scope'] = "system";
$myuser['descr'] = "Drink Tea all day, drop firewalls all night";
$myuser['priv'] = array("user-shell-access");
if (isset($myuser['disabled'])) {
    unset($myuser['disabled']);
}
local_user_set_password($myuser, "trainday");
local_user_set($myuser);
$admingroup =& getGroupEntryByGID(1999);
if (!$admingroup) {
    $admingroup = array();
    $admingroup['gid'] = 1999;
    if (!is_array($config['system']['group'])) {
        $config['system']['group'] = array();
    }
    $config['system']['group'] = $admingroup;
}
开发者ID:KoalaTea,项目名称:Redteam,代码行数:31,代码来源:user.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getUserFace函数代码示例发布时间:2022-05-15
下一篇:
PHP getUserEntry函数代码示例发布时间: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