本文整理汇总了PHP中Utilities::updateIPs方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::updateIPs方法的具体用法?PHP Utilities::updateIPs怎么用?PHP Utilities::updateIPs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::updateIPs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$mysql->runQuery("delete from monitorGroup where id = {$id}");
$mysql->runQuery("delete from monitors where monitorGroupId = {$id}");
echo "<script>window.location='monitorGroup.php';</script>";
exit;
}
if (isset($_POST["submit"])) {
//TODO: make sure blacklists are domains with an ip address on them
if ($id !== 0) {
//update
$mysql->runQuery("\n\t\t\tupdate monitorGroup set groupName = '" . $mysql->escape($groupName) . "',\n\t\t\t\tips = '" . $mysql->escape($ips) . "',\n\t\t\t\tdomains = '" . $mysql->escape($domains) . "'\n\t\t\twhere id = {$id}\n\t\t\t");
} else {
$mysql->runQuery("\n\t\t\tinsert into monitorGroup set groupName = '" . $mysql->escape($groupName) . "',\n\t\t\t\tips = '" . $mysql->escape($ips) . "',\n\t\t\t\tdomains = '" . $mysql->escape($domains) . "'\n\t\t\t");
$id = $mysql->identity;
}
Utilities::updateDomains($domains, $id);
Utilities::updateIPs($ips, $id);
echo "<script>window.location='monitorGroup.php';</script>";
exit;
}
$group = array('groupName' => '', 'ips' => '', 'domains' => '');
$rs = $mysql->runQuery("select * from monitorGroup where id = {$id}");
while ($row = mysqli_fetch_array($rs, MYSQL_ASSOC)) {
$group = $row;
}
include 'header.inc.php';
?>
<?php
include 'accountSubnav.inc.php';
?>
示例2: foreach
foreach ($ta as $e) {
$e = trim($e);
if (Utilities::isValidEmail($e)) {
$textMessageEmails .= "{$e}\n";
}
}
//TODO: make sure blacklists are domains with an ip address on them
if (count($message) == 0) {
//update
$mysql->runQuery("\n\t\t\tupdate users set username = '" . $mysql->escape($username) . "',\n\t\t\tpasswd = '" . $mysql->escape($passwdOld) . "',\n\t\t\tapiKey = '" . $mysql->escape($apiKey) . "',\n\t\t\ttwitterHandle = '" . $mysql->escape($twitterHandle) . "',\n\t\t\ttwitterHandle = '" . $mysql->escape($twitterHandle) . "',\n\t\t\tlastUpdate = '" . date('Y-m-d H:i:s') . "',\n\t\t\ttwitterHandle = '" . $mysql->escape($twitterHandle) . "',\n\t\t\tnoticeEmailAddresses = '" . $mysql->escape(trim($noticeEmailAddresses)) . "',\n\t\t\ttextMessageEmails = '" . $mysql->escape(trim($textMessageEmails)) . "',\n\t\t\tapiCallbackURL = '" . $mysql->escape($apiCallbackURL) . "',\n\t\t\tcheckFrequency = '" . $mysql->escape($checkFrequency) . "',\n\t\t\tdisableEmailNotices = {$disableEmailNotices}\n\t\t\t");
if ($beenChecked == 1) {
$mysql->runQuery("update users set beenChecked = 0");
$message[] = "Check scheduled.";
}
Utilities::updateDomains($domains);
Utilities::updateIPs($ips);
if ($twitterHandle != '') {
$t = new Twitter();
$t->follow($twitterHandle);
}
$message[] = "Account updated.";
}
}
$user = Utilities::getAccount();
if (!$user) {
//invalid account
echo "<script>window.location='login.php?logout=1';</script>";
exit;
}
include 'header.inc.php';
?>
示例3: array_key_exists
$apiKey = array_key_exists('apiKey', $_POST) ? trim($_POST['apiKey']) : '';
$type = array_key_exists('type', $_POST) ? trim($_POST['type']) : '';
$data = array_key_exists('data', $_POST) ? trim($_POST['data']) : '';
$result = array('status' => '', 'result' => array());
$id = Utilities::validateLogin($username, $passwd, true, $apiKey);
if ($id == 0) {
$result['status'] = 'invalid login';
output();
}
switch ($type) {
case 'updateDomains':
Utilities::updateDomains($data);
$result['status'] = 'success';
break;
case 'updateIPs':
Utilities::updateIPs($data);
$result['status'] = 'success';
break;
case 'checkHostStatus':
$result['status'] = 'success';
Utilities::setBlockLists();
$result['result'] = Utilities::checkBlacklists($data);
break;
case 'blacklistStatus':
$localCache = new _FileCache('blacklistmonitor-api', 90);
$cacheKey = md5("{$username}|{$passwd}|{$apiKey}|{$type}|{$data}");
$cacheData = $localCache->get($cacheKey);
if ($cacheData !== false) {
output($cacheData);
}
$mysql = new _MySQL();
示例4:
case 'updateDomains':
if ($groupName == '') {
$result['status'] = 'groupName is required';
break;
}
$id = Utilities::ensureGroupExists($groupName);
Utilities::updateDomains($data, $id);
$result['status'] = 'success';
break;
case 'updateIPs':
if ($groupName == '') {
$result['status'] = 'groupName is required';
break;
}
$id = Utilities::ensureGroupExists($groupName);
Utilities::updateIPs($data, $id);
$result['status'] = 'success';
break;
case 'checkHostStatus':
$result['status'] = 'success';
Utilities::setBlockLists();
$result['result'] = Utilities::checkBlacklists($data);
break;
case 'clearAllHostAndGroupData':
$mysql = new _MySQL();
$mysql->connect(Setup::$connectionArray);
$mysql->runQuery("truncate table monitors");
$mysql->runQuery("truncate table monitorGroup");
$result['status'] = 'success';
break;
case 'blacklistStatus':