当前位置: 首页>>代码示例>>PHP>>正文


PHP Utilities::updateDomains方法代码示例

本文整理汇总了PHP中Utilities::updateDomains方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::updateDomains方法的具体用法?PHP Utilities::updateDomains怎么用?PHP Utilities::updateDomains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utilities的用法示例。


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

示例1: array

if ($deleteGroup != '') {
    $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';
?>
开发者ID:blackmoral,项目名称:blacklistmonitor,代码行数:31,代码来源:editHostGroup.php

示例2: foreach

    $textMessageEmails = "";
    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';
开发者ID:beserious,项目名称:blacklistmonitor,代码行数:31,代码来源:account.php

示例3: class_exists

class_exists('_MySQL', false) or (include 'classes/_MySQL.class.php');
class_exists('_FileCache', false) or (include 'classes/_FileCache.class.php');
$username = array_key_exists('username', $_POST) ? trim($_POST['username']) : '';
$passwd = array_key_exists('passwd', $_POST) ? trim($_POST['passwd']) : '';
$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);
开发者ID:beserious,项目名称:blacklistmonitor,代码行数:31,代码来源:api.php

示例4: array_key_exists

$data = array_key_exists('data', $_POST) ? trim($_POST['data']) : '';
$groupName = array_key_exists('groupName', $_POST) ? trim($_POST['groupName']) : '';
$result = array('status' => '', 'result' => array());
$id = Utilities::validateLogin($username, $passwd, true, $apiKey);
if ($id == 0) {
    $result['status'] = 'invalid login';
    output();
}
switch ($type) {
    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);
开发者ID:blackmoral,项目名称:blacklistmonitor,代码行数:31,代码来源:api.php


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