本文整理汇总了PHP中config_lock函数的典型用法代码示例。如果您正苦于以下问题:PHP config_lock函数的具体用法?PHP config_lock怎么用?PHP config_lock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了config_lock函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
if ($_POST['enable'] && !($_POST['guest'] || $_POST['local'])) {
$input_errors[] = gettext("You must select at least one authentication method.");
}
if (!$input_errors) {
$config['afp']['enable'] = $_POST['enable'] ? true : false;
$config['afp']['afpname'] = $_POST['afpname'];
$config['afp']['guest'] = $_POST['guest'] ? true : false;
$config['afp']['local'] = $_POST['local'] ? true : false;
$config['afp']['noddp'] = $_POST['noddp'] ? true : false;
write_config();
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
$retval |= rc_update_service("afpd");
$retval |= rc_update_service("mdnsresponder");
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
include "fbegin.inc";
?>
<script type="text/javascript">
<!--
function enable_change(enable_change) {
var endis = !(document.iform.enable.checked || enable_change);
document.iform.afpname.disabled = endis;
document.iform.guest.disabled = endis;
示例2: delete_from_whitelist
function delete_from_whitelist($srcip)
{
config_lock();
$whitelist = split("\n", file_get_contents("/var/db/whitelist.txt"));
$fd = fopen("/var/db/whitelist.txt", "w");
foreach ($whitelist as $wl) {
if ($wl != "") {
if (!stristr($wl, $srcip)) {
fwrite($fd, "{$wl}\n");
}
}
}
fclose($fd);
mwexec("/sbin/pfctl -q -t spamd -T delete {$srcip}");
mwexec("/sbin/pfctl -q -t whitelist -T replace -f /var/db/whitelist.txt");
config_unlock();
}