function replace($id, $vector, $cipher, $hash)
 {
     if (!$id || !$vector || !$cipher || !$hash) {
         return false;
     }
     return $this->_db->query("REPLACE INTO " . $this->_tableName . "(id,vector,cipher,field1,field2,field3,field4) VALUES (" . CLOUDWIND_SECURITY_SERVICE::sqlEscape($id) . "," . CLOUDWIND_SECURITY_SERVICE::sqlEscape($vector) . "," . CLOUDWIND_SECURITY_SERVICE::sqlEscape($cipher) . "," . CLOUDWIND_SECURITY_SERVICE::sqlEscape($hash) . ",'',0,0)");
 }
 function replace($type, $tid, $pid)
 {
     if (!$tid || !$type) {
         return false;
     }
     return $this->_db->query("REPLACE INTO " . $this->_tableName . "(id,type,tid,pid,modified_time) VALUES (null," . CLOUDWIND_SECURITY_SERVICE::sqlEscape($type) . "," . intval($tid) . "," . intval($pid) . "," . CloudWind_getConfig('g_timestamp') . ")");
 }
 function replace($id, $setting)
 {
     if (!$id) {
         return false;
     }
     return $this->_db->query("REPLACE INTO " . $this->_tableName . "(id,setting) VALUES (" . CLOUDWIND_SECURITY_SERVICE::sqlEscape($id) . "," . CLOUDWIND_SECURITY_SERVICE::sqlEscape($setting) . ")");
 }
Пример #4
0
 function getSetting()
 {
     $path = $this->_getSettingPath();
     if (is_file($path)) {
         return include CLOUDWIND_SECURITY_SERVICE::escapePath($path);
     }
     return $this->getSettingNoCache();
 }
 function setThreadCheckedByTid($tid)
 {
     $tid = intval($tid);
     if ($tid < 1) {
         return false;
     }
     $this->_db->update("UPDATE " . $this->_tableName . " SET ifcheck = 1 WHERE tid = " . CLOUDWIND_SECURITY_SERVICE::sqlEscape($tid));
     return $this->_db->affected_rows();
 }
Пример #6
0
 function setPostCheckedByPid($pid, $table)
 {
     $pid = intval($pid);
     if (!$this->_checkTable($table) || $pid < 1) {
         return false;
     }
     $this->_db->update("UPDATE " . CLOUDWIND_SECURITY_SERVICE::sqlMetadata($table) . " SET ifshield = 0 WHERE pid = " . CLOUDWIND_SECURITY_SERVICE::sqlEscape($pid));
     return $this->_db->affected_rows();
 }
Пример #7
0
 function getDefendGeneralOperateService()
 {
     static $service = null;
     if (!$service) {
         require_once CLOUDWIND_SECURITY_SERVICE::escapePath(CLOUDWIND_VERSION_DIR . '/service/defend.generaloperate.class.php');
         $service = new CloudWind_Defend_General_Operate();
     }
     return $service;
 }
Пример #8
0
 function getRequest($array)
 {
     CLOUDWIND_SECURITY_SERVICE::gp($array);
     $tmp = array();
     foreach ($array as $key) {
         $tmp[] = $GLOBALS[$key];
     }
     return $tmp;
 }
Пример #9
0
 function _getVersionFactory()
 {
     static $factory = null;
     if (!$factory) {
         require_once CLOUDWIND . '/client/core/public/core.toolkit.class.php';
         require_once CLOUDWIND_SECURITY_SERVICE::escapePath(CLOUDWIND . '/version/' . CLOUDWIND_CLIENT_VERSION . '/service/service.factory.class.php');
         $factory = new CloudWind_Service_Factory();
     }
     return $factory;
 }
 function postUserDefinedData($typeName)
 {
     CloudWind_ipControl();
     if (!$typeName) {
         return false;
     }
     $filePath = CLOUDWIND_VERSION_DIR . '/userdefined/' . $typeName . '.userdefined.php';
     if (!is_file($filePath)) {
         return false;
     }
     require_once CLOUDWIND . '/client/core/public/core.toolkit.class.php';
     require_once CLOUDWIND . '/client/core/public/core.userdefinedbase.class.php';
     require_once CLOUDWIND_SECURITY_SERVICE::escapePath($filePath);
     $className = 'CloudWind_' . ucfirst($typeName) . '_UserDefined';
     if (!class_exists($className)) {
         return false;
     }
     $service = new $className();
     if (!method_exists($service, 'sync')) {
         return false;
     }
     return $service->sync();
 }
Пример #11
0
 function getsByDids($dids)
 {
     $dids = is_array($dids) ? CLOUDWIND_SECURITY_SERVICE::sqlImplode($dids) : $dids;
     $query = $this->_db->query("SELECT did,uid,username,subject,content,postdate FROM " . $this->_tableName . " WHERE did in(" . $dids . ")");
     return $this->_getAllResultFromQuery($query);
 }
 function _postReply($id, $postAudit, $expand)
 {
     if (!isset($expand['tid']) || $expand['tid'] < 1) {
         return false;
     }
     $postVerifyService = $this->getPostVerifyService();
     $postVerifyService->insertPostVerify(2, $expand['tid'], $id);
     $postTable = GetPtable('N', $expand['tid']);
     return $GLOBALS['db']->query("UPDATE " . CLOUDWIND_SECURITY_SERVICE::sqlMetadata($postTable) . " SET ifshield=1 WHERE pid=" . CLOUDWIND_SECURITY_SERVICE::sqlEscape($id));
 }
Пример #13
0
 function sqlMetadata($data, $tlists = array())
 {
     if (empty($tlists) || !CLOUDWIND_SECURITY_SERVICE::inArray($data, $tlists)) {
         $data = str_replace(array('`', ' '), '', $data);
     }
     return ' `' . $data . '` ';
 }
Пример #14
0
<?php

/**
 * 云搜索后台管理
 * @author L.IuHu.I@2011 developer.liuhui@gmail.com
 */
require_once R_P . 'lib/cloudwind/cloudwind.class.php';
$_service = CloudWind::getPlatformCheckServerService();
if ($_service->checkCloudWind() < 9) {
    ObHeader($admin_file . '?adminjob=yunbasic');
}
if (!$_service->getSiteScale()) {
    Showmsg('亲,您的站点现在没有搜索负载压力,过段时间再开启云搜索吧亲~');
}
if (!$db_yunsearch_search) {
    if ($_POST['step'] == 2) {
        CLOUDWIND_SECURITY_SERVICE::gp(array('db_yunsearch_search'), 'P', 2);
        setConfig('db_yunsearch_search', $db_yunsearch_search);
        updatecache_c();
        Showmsg('云搜索设置成功 ');
    }
    ifcheck($db_yunsearch_search, 'yunsearch_search');
}
$yunManageUrl = $_service->getYunSearchManageUrl();
include PrintEot('yunsearch');
Пример #15
0
<?php

require_once R_P . 'lib/cloudwind/cloudwind.class.php';
$_service = CloudWind::getPlatformCheckServerService();
if ($_service->checkCloudWind() < 9) {
    ObHeader($admin_file . '?adminjob=yunbasic');
}
CLOUDWIND_SECURITY_SERVICE::gp(array('step'));
if ($step == 'reset') {
    $bool = CloudWind::resetCloudwind();
    $message = $bool ? '重置云服务成功' : '重置云服务失败';
    Showmsg($message);
}
list($bbsname, $bbsurl, $bbsversion, $cloudversion) = $_service->getSiteInfo();
list($fsockopen, $parse_url, $isgethostbyname, $gethostbyname) = $_service->getFunctionsInfo();
list($searchHost, $searchIP, $searchPort, $searchPing) = $_service->getSearchHostInfo();
list($defendHost, $defendIp, $defendPort, $defendPing) = $_service->getDefendHostInfo();
$description = $_service->getBaseDescription();
$showReset = true;
include PrintEot('yuncheckserver');
Пример #16
0
function CloudWind_unlink($fileName)
{
    return @unlink(CLOUDWIND_SECURITY_SERVICE::escapePath($fileName));
}
Пример #17
0
 function countLogsByTypeAndTime($tableName, $starttime, $endtime)
 {
     if (!in_array($tableName, $this->_logTableNames)) {
         return false;
     }
     $result = $this->_db->get_one("SELECT count(*) as count FROM " . CLOUDWIND_SECURITY_SERVICE::sqlMetadata($tableName) . " WHERE modified_time >= " . CLOUDWIND_SECURITY_SERVICE::sqlEscape($starttime) . " AND modified_time <= " . CLOUDWIND_SECURITY_SERVICE::sqlEscape($endtime));
     return $result && $result['count'] > 0 ? $result['count'] : 0;
 }
Пример #18
0
 function getsByUserIds($userId)
 {
     $userId = is_array($userId) ? CLOUDWIND_SECURITY_SERVICE::sqlImplode($userId) : $userId;
     $query = $this->_db->query("SELECT uid,username,regdate FROM " . $this->_tableName . " WHERE uid in(" . $userId . ")");
     return $this->_getAllResultFromQuery($query);
 }
Пример #19
0
 function _Limit($start, $num = false)
 {
     return CLOUDWIND_SECURITY_SERVICE::sqlLimit($start, $num);
 }
Пример #20
0
if (empty($action)) {
    if ($_POST['step'] == 2) {
        CLOUDWIND_SECURITY_SERVICE::gp(array('db_yundefend_shield', 'db_yundefend_shieldpost', 'db_yundefend_shielduser'), 'P', 2);
        setConfig('db_yundefend_shield', $db_yundefend_shield);
        setConfig('db_yundefend_shieldpost', $db_yundefend_shieldpost);
        setConfig('db_yundefend_shielduser', $db_yundefend_shielduser);
        updatecache_c();
        Showmsg('云盾设置成功 ');
    }
    ifcheck($db_yundefend_shield, 'yundefend_shield');
    ifcheck($db_yundefend_shieldpost, 'yundefend_shieldpost');
    ${'yundefend_shielduser_' . intval($db_yundefend_shielduser)} = 'checked="checked"';
    $dundescribe = $_service->getDunDescribe();
    $current['config'] = 'current';
} elseif ($action == 'verify') {
    CLOUDWIND_SECURITY_SERVICE::gp(array('page'));
    $page = $page > 1 ? intval($page) : 1;
    $postVerifyService = CloudWind::getDefendPostVerifyService();
    if ($_POST['step'] == 2) {
        CLOUDWIND_SECURITY_SERVICE::gp(array('ids'));
        foreach ($ids as $key => $operate) {
            list($tid, $pid) = explode("_", $key);
            $postVerifyService->verify($operate, $tid, $pid);
        }
        Showmsg('云盾审核成功 ', $basename . "&action=verify&page=" . $page);
    }
    $total = $postVerifyService->countPostVerify();
    $lists = $total ? $postVerifyService->getPostVerify($page, 100) : array();
    $current['verify'] = 'current';
}
include PrintEot('yundefend');
Пример #21
0
 function getsByForumIds($forumIds)
 {
     $forumIds = is_array($forumIds) ? CLOUDWIND_SECURITY_SERVICE::sqlImplode($forumIds) : $forumIds;
     $query = $this->_db->query("SELECT fid,name,descrip FROM " . $this->_tableName . " WHERE fid in(" . $forumIds . ")");
     return $this->_getAllResultFromQuery($query);
 }
Пример #22
0
 function sendUserInfo($cloud_information)
 {
     if (!CLOUDWIND_SECURITY_SERVICE::isArray($cloud_information) || SCR == 'yi') {
         return false;
     }
     list($operate, $leaveTime, $tid, $fid) = $cloud_information ? $cloud_information : array('', '');
     if (!in_array($operate, array('index', 'read', 'thread')) || $operate == SCR) {
         return false;
     }
     $user = CloudWind::getOnlineUserInfo();
     $viewTime = CloudWind_getConfig('g_timestamp') - $leaveTime ? CloudWind_getConfig('g_timestamp') - $leaveTime : '';
     CloudWind::yunUserDefend('view' . $operate, $user['uid'], $user['username'], $leaveTime, $viewTime, 101, '', '', '', array('uniqueid' => $tid . '-' . $fid));
     return true;
 }
 function _getVerifySettingPath()
 {
     return CLOUDWIND_SECURITY_SERVICE::escapePath(CloudWind_getConfig('g_cachedir') . 'cloudwind_logsettings.php');
 }
Пример #24
0
 function getsAttachsIds($aids)
 {
     $aids = is_array($aids) ? CLOUDWIND_SECURITY_SERVICE::sqlImplode($aids) : $aids;
     $query = $this->_db->query("SELECT * FROM " . $this->_tableName . " WHERE aid in(" . $aids . ")");
     return $this->_getAllResultFromQuery($query);
 }
Пример #25
0
    if (!$_checkService->checkHost()) {
        Showmsg('无法连接云服务,请检查网络是否为本地环境', $basename . '&step=1');
    }
    if (!$_checkService->getServerStatus()) {
        list($fsockopen, $parse_url, $isgethostbyname, $gethostbyname) = $_checkService->getFunctionsInfo();
        list($searchHost, $searchIP, $searchPort, $searchPing) = $_checkService->getSearchHostInfo();
        list($defendHost, $defendIp, $defendPort, $defendPing) = $_checkService->getDefendHostInfo();
    } else {
        $step = 3;
    }
} elseif ($step == 3) {
    if (!$_checkService->getServerStatus()) {
        Showmsg('环境检测末通过,请联系论坛空间提供商解决');
    }
} elseif ($step == 4) {
    CLOUDWIND_SECURITY_SERVICE::gp(array('siteurl', 'sitename', 'bossname', 'bossphone', 'search', 'defend'));
    if (!$siteurl || !$sitename || !$bossname || !$bossphone) {
        Showmsg('站点信息请填写完整', $basename . '&step=3');
    }
    if (!($marksite = $_checkService->markSite())) {
        Showmsg('云服务验证失败,请重试', $basename . '&step=3');
    }
    if (!CloudWind::yunApplyPlatform($siteurl, $sitename, $bossname, $bossphone, $marksite)) {
        $marksite = $_checkService->markSite(false);
        Showmsg('申请云服务失败,请检查网络或重试', $basename . '&step=3');
    }
    is_null($db_yun_model) && $_checkService->setYunMode(array());
    $_checkService->initServices($search, $defend);
    $step = 5;
} else {
    $yundescribe = $_checkService->getYunDescribe();
 function getsByColonyIds($ids)
 {
     $ids = is_array($ids) ? CLOUDWIND_SECURITY_SERVICE::sqlImplode($ids) : $ids;
     $query = $this->_db->query("SELECT id,classid,cname FROM " . $this->_tableName . " WHERE id in(" . $ids . ")");
     return $this->_getAllResultFromQuery($query);
 }