本文整理汇总了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'];
示例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();
示例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);
示例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;
}