本文整理汇总了PHP中updatenotify_set函数的典型用法代码示例。如果您正苦于以下问题:PHP updatenotify_set函数的具体用法?PHP updatenotify_set怎么用?PHP updatenotify_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatenotify_set函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$reqdfieldsn = array(gettext("Old password"), gettext("Password"), gettext("Password (confirmed)"));
$reqdfieldst = explode(" ", "password password password");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
// Validate old password.
if ($_POST['password_old'] !== $a_user[$cnid]['password']) {
$input_errors[] = gettext("The old password is not correct.");
}
// Validate new password.
if ($_POST['password_new'] !== $_POST['password_confirm']) {
$input_errors[] = gettext("The confimed password does not match. Please ensure the passwords match exactly.");
}
if (empty($input_errors)) {
$a_user[$cnid]['password'] = $_POST['password_new'];
write_config();
updatenotify_set("userdb_user", UPDATENOTIFY_MODE_MODIFIED, $a_user[$cnid]['uuid']);
// Write syslog entry and send an email to the administrator
$message = sprintf("The user %s has changed his password via user portal.", Session::getUserName());
write_log($message);
if (0 == @email_validate_settings()) {
$subject = sprintf(gettext("Notification email from host: %s"), system_get_hostname());
@email_send($config['system']['email']['from'], $subject, $message, $error);
}
$savemsg = gettext("The administrator has been notified to apply your changes.");
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont">
示例2: header
}
header("Location: disks_raid_gvinum.php");
exit;
}
}
if (!is_array($config['gvinum']['vdisk'])) {
$config['gvinum']['vdisk'] = array();
}
array_sort_key($config['gvinum']['vdisk'], "name");
$a_raid =& $config['gvinum']['vdisk'];
if ($_GET['act'] === "del") {
unset($errormsg);
if ($a_raid[$_GET['id']]) {
// Check if disk is mounted.
if (0 == disks_ismounted_ex($a_raid[$_GET['id']]['devicespecialfile'], "devicespecialfile")) {
updatenotify_set("raid_gvinum", UPDATENOTIFY_MODE_DIRTY, $a_raid[$_GET['id']]['uuid']);
header("Location: disks_raid_gvinum.php");
exit;
} else {
$errormsg = sprintf(gettext("The RAID volume is currently mounted! Remove the <a href='%s'>mount point</a> first before proceeding."), "disks_mount.php");
}
}
}
function gvinum_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
$retval |= disks_raid_gvinum_configure($data);
break;
示例3: do_input_validation_type
do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
if (empty($input_errors)) {
$iscsiinit = array();
$iscsiinit['uuid'] = $_POST['uuid'];
$iscsiinit['name'] = $_POST['name'];
$iscsiinit['targetname'] = $_POST['targetname'];
$iscsiinit['targetaddress'] = $_POST['targetaddress'];
$iscsiinit['initiatorname'] = $_POST['initiatorname'];
if (isset($uuid) && FALSE !== $cnid) {
$a_iscsiinit[$cnid] = $iscsiinit;
$mode = UPDATENOTIFY_MODE_MODIFIED;
} else {
$a_iscsiinit[] = $iscsiinit;
$mode = UPDATENOTIFY_MODE_NEW;
}
updatenotify_set("iscsiinitiator", $mode, $iscsiinit['uuid']);
write_config();
header("Location: disks_manage_iscsi.php");
exit;
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
<ul id="tabnav">
<li class="tabinact"><a href="disks_manage.php"><span><?php
echo gettext("Management");
?>
</span></a></li>
示例4: get_std_save_message
$savemsg = get_std_save_message($retval);
if ($retval == 0) {
updatenotify_delete("ftpd_mod_ban");
}
}
if (!isset($config['ftpd']['mod_ban']['rule']) || !is_array($config['ftpd']['mod_ban']['rule'])) {
$config['ftpd']['mod_ban']['rule'] = array();
}
$a_rule =& $config['ftpd']['mod_ban']['rule'];
if (isset($_GET['act']) && $_GET['act'] === "del") {
if ($_GET['uuid'] === "all") {
foreach ($a_rule as $rulek => $rulev) {
updatenotify_set("ftpd_mod_ban", UPDATENOTIFY_MODE_DIRTY, $a_rule[$rulek]['uuid']);
}
} else {
updatenotify_set("ftpd_mod_ban", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
}
header("Location: services_ftp_mod.php");
exit;
}
function ftpd_mod_ban_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
if (is_array($config['ftpd']['mod_ban']['rule'])) {
$index = array_search_ex($data, $config['ftpd']['mod_ban']['rule'], "uuid");
示例5: array
}
}
if (empty($input_errors)) {
$host = array();
$host['uuid'] = $_POST['uuid'];
$host['name'] = $_POST['name'];
$host['address'] = $_POST['address'];
$host['descr'] = $_POST['descr'];
if (isset($uuid) && FALSE !== $cnid) {
$a_hosts[$cnid] = $host;
$mode = UPDATENOTIFY_MODE_MODIFIED;
} else {
$a_hosts[] = $host;
$mode = UPDATENOTIFY_MODE_NEW;
}
updatenotify_set("hosts", $mode, $host['uuid']);
write_config();
header("Location: system_hosts.php");
exit;
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont">
<form action="system_hosts_edit.php" method="post" name="iform" id="iform">
<?php
if (!empty($input_errors)) {
print_input_errors($input_errors);
}
示例6: updatenotify_set
$raid['type'] = 1;
$raid['device'] = $_POST['device'];
$raid['desc'] = "Software gmirror RAID 1";
$raid['devicespecialfile'] = "/dev/mirror/{$raid['name']}";
if (isset($id) && $a_raid[$id]) {
$a_raid[$id] = $raid;
$mode = UPDATENOTIFY_MODE_MODIFIED;
} else {
$a_raid[] = $raid;
if ($_POST['init']) {
$mode = UPDATENOTIFY_MODE_NEW;
} else {
$mode = UPDATENOTIFY_MODE_MODIFIED;
}
}
updatenotify_set("raid_gmirror", $mode, $raid['uuid']);
write_config();
header("Location: disks_raid_gmirror.php");
exit;
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
<ul id="tabnav">
<li class="tabinact"><a href="disks_raid_gconcat.php"><span><?php
echo gettext("JBOD");
?>
</span></a></li>
示例7: array
}
if (!$input_errors) {
$route = array();
$route['uuid'] = $_POST['uuid'];
$route['interface'] = $_POST['interface'];
$route['network'] = $osn;
$route['gateway'] = $_POST['gateway'];
$route['descr'] = $_POST['descr'];
if (isset($uuid) && FALSE !== $cnid) {
$a_routes[$cnid] = $route;
$mode = UPDATENOTIFY_MODE_MODIFIED;
} else {
$a_routes[] = $route;
$mode = UPDATENOTIFY_MODE_NEW;
}
updatenotify_set("routes", $mode, $route['uuid']);
write_config();
header("Location: system_routes.php");
exit;
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont">
<form action="system_routes_edit.php" method="post" name="iform" id="iform">
<?php
if ($input_errors) {
print_input_errors($input_errors);
}
示例8: do_input_validation_type
do_input_validation_type($_POST, $reqdfields, $reqdfieldsn, $reqdfieldst, $input_errors);
if (empty($input_errors)) {
$param = array();
$param['enable'] = isset($_POST['enable']) ? true : false;
$param['uuid'] = $_POST['uuid'];
$param['name'] = $pconfig['name'];
$param['value'] = $pconfig['value'];
$param['comment'] = $pconfig['comment'];
if (isset($uuid) && FALSE !== $index) {
$loader_param_list[$index] = $param;
$mode = UPDATENOTIFY_MODE_MODIFIED;
} else {
$loader_param_list[] = $param;
$mode = UPDATENOTIFY_MODE_NEW;
}
updatenotify_set("loaderconf", $mode, $param['uuid']);
write_config();
header("Location: system_loaderconf.php");
exit;
}
}
include "fbegin.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
<ul id="tabnav">
<li class="tabinact"><a href="system_advanced.php"><span><?php
echo gettext("Advanced");
?>
</span></a></li>
示例9: array
}
if ($_POST['disks_rescan']) {
$do_action = true;
$disks_rescan = true;
}
}
if (!isset($do_action)) {
$do_action = false;
}
if (!is_array($config['disks']['disk'])) {
$config['disks']['disk'] = array();
}
array_sort_key($config['disks']['disk'], "name");
$a_disk_conf =& $config['disks']['disk'];
if ($_GET['act'] === "del") {
updatenotify_set("device", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
header("Location: disks_manage.php");
exit;
}
function diskmanagement_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
if (is_array($config['disks']['disk'])) {
$index = array_search_ex($data, $config['disks']['disk'], "uuid");
if (false !== $index) {
示例10: array
$cfg['geli']['vdisk'][$index]['fstype'] = 'zfs';
}
}
}
}
}
if (isset($_GET['zfs']['autosnapshots'])) {
$pconfig['zfs']['autosnapshots'] = $_GET['zfs']['autosnapshots'];
}
if (isset($_POST['leave_autosnapshots'])) {
$cfg['zfs']['autosnapshots'] = !empty($config['zfs']['autosnapshots']) ? $config['zfs']['autosnapshots'] : array();
}
$config['zfs'] = $cfg['zfs'];
$config['disks'] = $cfg['disks'];
$config['geli'] = $cfg['geli'];
updatenotify_set('zfs_import_config', UPDATENOTIFY_MODE_UNKNOWN, true);
write_config();
header('Location: disks_zfs_config_current.php');
exit;
}
}
$health = true;
if (!empty($zfs['extra']) && !empty($zfs['extra']['pools']) && !empty($zfs['extra']['pools']['pool'])) {
$health &= (bool) (!array_search_ex('DEGRADED', $zfs['extra']['pools']['pool'], 'health'));
$health &= (bool) (!array_search_ex('FAULTED', $zfs['extra']['pools']['pool'], 'health'));
}
if (!$health) {
$message_box_type = 'warning';
$message_box_text = gettext('Your ZFS system is not healthy.');
$message_box_text .= ' ';
$message_box_text .= gettext('It is not recommanded to import non healthy pools nor virtual devices that are part of a non healthy pool.');
示例11: array
}
}
if (empty($input_errors)) {
$iscsitarget_ag = array();
$iscsitarget_ag['uuid'] = $_POST['uuid'];
$iscsitarget_ag['tag'] = $_POST['tag'];
$iscsitarget_ag['comment'] = $_POST['comment'];
$iscsitarget_ag['agauth'] = $auths;
if (isset($uuid) && FALSE !== $cnid) {
$a_iscsitarget_ag[$cnid] = $iscsitarget_ag;
$mode = UPDATENOTIFY_MODE_MODIFIED;
} else {
$a_iscsitarget_ag[] = $iscsitarget_ag;
$mode = UPDATENOTIFY_MODE_NEW;
}
updatenotify_set("iscsitarget_ag", $mode, $iscsitarget_ag['uuid']);
write_config();
header("Location: services_iscsitarget_ag.php");
exit;
}
}
function expand_ipv6addr($v6addr)
{
if (strlen($v6addr) == 0) {
return null;
}
$v6str = $v6addr;
// IPv4 mapped address
$pos = strpos($v6str, ".");
if ($pos !== false) {
$pos = strrpos($v6str, ":");
示例12: array
if (empty($input_errors)) {
$vdevice = array();
$vdevice['uuid'] = $_POST['uuid'];
$vdevice['name'] = $_POST['name'];
$vdevice['type'] = $_POST['type'];
$vdevice['device'] = $_POST['device'];
$vdevice['aft4k'] = isset($_POST['aft4k']);
$vdevice['desc'] = $_POST['desc'];
if (isset($uuid) && FALSE !== $cnid) {
$mode = UPDATENOTIFY_MODE_MODIFIED;
$a_vdevice[$cnid] = $vdevice;
} else {
$mode = UPDATENOTIFY_MODE_NEW;
$a_vdevice[] = $vdevice;
}
updatenotify_set("zfsvdev", $mode, $vdevice['uuid']);
write_config();
header("Location: disks_zfs_zpool_vdevice.php");
exit;
}
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
document.iform.name.disabled = !enable_change;
document.iform.type.disabled = !enable_change;
document.iform.device.disabled = !enable_change;
document.iform.aft4k.disabled = !enable_change;
}
示例13: array
}
}
}
}
if (!is_array($config['system']['firewall']['rule'])) {
$config['system']['firewall']['rule'] = array();
}
array_sort_key($config['system']['firewall']['rule'], "ruleno");
$a_rule =& $config['system']['firewall']['rule'];
if ($_GET['act'] === "del") {
if ($_GET['uuid'] === "all") {
foreach ($a_rule as $rulek => $rulev) {
updatenotify_set("firewall", UPDATENOTIFY_MODE_DIRTY, $a_rule[$rulek]['uuid']);
}
} else {
updatenotify_set("firewall", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
}
header("Location: system_firewall.php");
exit;
}
function firewall_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['system']['firewall']['rule'], "uuid");
if (false !== $cnid) {
示例14: array
}
}
}
if (!isset($config['system']['hosts']) || !is_array($config['system']['hosts'])) {
$config['system']['hosts'] = array();
}
if (!isset($config['system']['hostsacl']['rule']) || !is_array($config['system']['hostsacl']['rule'])) {
$config['system']['hostsacl']['rule'] = array();
}
array_sort_key($config['system']['hosts'], "name");
$a_hosts = $config['system']['hosts'];
if (is_array($config['system']['hostsacl']['rule'])) {
$pconfig['hostsacl'] = implode("\n", $config['system']['hostsacl']['rule']);
}
if (isset($_GET['act']) && $_GET['act'] === "del") {
updatenotify_set("hosts", UPDATENOTIFY_MODE_DIRTY, $_GET['uuid']);
header("Location: system_hosts.php");
exit;
}
function hosts_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['system']['hosts'], "uuid");
if (FALSE !== $cnid) {
unset($config['system']['hosts'][$cnid]);
示例15: isset
$pooldata['uuid'] = $_POST['uuid'];
$pooldata['name'] = $_POST['name'];
$pooldata['vdevice'] = $_POST['vdevice'];
$pooldata['root'] = $_POST['root'];
$pooldata['mountpoint'] = $_POST['mountpoint'];
$pooldata['force'] = isset($_POST['force']) ? true : false;
$pooldata['hastpool'] = !empty($hastpool) ? true : false;
$pooldata['desc'] = $_POST['desc'];
if (isset($uuid) && FALSE !== $cnid) {
$mode = UPDATENOTIFY_MODE_MODIFIED;
$a_pool[$cnid] = $pooldata;
} else {
$mode = UPDATENOTIFY_MODE_NEW;
$a_pool[] = $pooldata;
}
updatenotify_set("zfszpool", $mode, $pooldata['uuid']);
write_config();
header("Location: disks_zfs_zpool.php");
exit;
}
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
document.iform.name.disabled = !enable_change;
document.iform.vdevice.disabled = !enable_change;
document.iform.root.disabled = !enable_change;
//document.iform.mountpoint.disabled = !enable_change;
document.iform.force.disabled = !enable_change;