Example #1
0
 function apply($siteurl, $sitename, $bossname, $bossphone, $marksite)
 {
     if (!$siteurl || !$sitename || !$marksite) {
         return false;
     }
     return $this->_sendPost(array('siteurl' => $siteurl, 'sitename' => $sitename, 'charset' => CloudWind_getConfig('g_charset'), 'bossname' => $bossname, 'bossphone' => $bossphone, 'marksite' => $marksite));
 }
 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') . ")");
 }
Example #3
0
 function checkSegment($startTime, $endTime)
 {
     $startTime = intval($startTime);
     $endTime = intval($endTime);
     $startTime = $startTime > 0 ? $startTime : 0;
     $endTime = $endTime > 0 ? $endTime : CloudWind_getConfig('g_timestamp');
     return array($startTime, $endTime);
 }
 function _factory($type)
 {
     $factory = $this->_getGeneralFactory();
     if (!$type || !in_array($type, CloudWind_getConfig('search_types'))) {
         exit('forbiden for version type');
     }
     $method = 'getGeneral' . ucfirst($type) . 'Service';
     if (!method_exists($factory, $method)) {
         exit('forbiden for version type');
     }
     return $factory->{$method}();
 }
Example #5
0
 function _convertCharset($text)
 {
     static $charset = null;
     if (!in_array(CloudWind_getConfig('g_charset'), array('utf8', 'utf-8'))) {
         if (!$charset) {
             require_once CLOUDWIND . '/client/core/public/core.factory.class.php';
             $factory = new CloudWind_Core_Factory();
             $charset = $factory->getChineseService(CloudWind_getConfig('g_charset'), 'utf8');
         }
         return $charset->Convert($text);
     }
     return $text;
 }
Example #6
0
function CloudWind_buildSecutiryCode($string, $action = 'ENCODE')
{
    $action != 'ENCODE' && ($string = base64_decode($string));
    $code = '';
    $key = substr(md5(CloudWind_getConfig('yun_hash')), 8, 18);
    $keyLen = strlen($key);
    $strLen = strlen($string);
    for ($i = 0; $i < $strLen; $i++) {
        $k = $i % $keyLen;
        $code .= $string[$i] ^ $key[$k];
    }
    return $action != 'DECODE' ? base64_encode($code) : $code;
}
 function __construct()
 {
     if (!isset($this->_service['parse']) || !$this->_service['parse']) {
         $this->_service['parse'] = new CloudWind_Platform_Aggregate_SQLParseExtension();
     }
     if (!isset($this->_service['operate']) || !$this->_service['operate']) {
         $yunModel = CloudWind_getConfig('yun_model');
         $this->_service['operate'] = $yunModel['search_model'] == 100 ? new CloudWind_Platform_Aggregate_OperateLog() : new CloudWind_Platform_Aggregate_SyncOperateLog();
     }
     if ($this->_doubleModel && (!isset($this->_service['operate_normal']) || !isset($this->_service['operate_sync']) || !$this->_service['operate_normal'] || !$this->_service['operate_sync'])) {
         $this->_service['operate_normal'] = new CloudWind_Platform_Aggregate_OperateLog();
         $this->_service['operate_sync'] = new CloudWind_Platform_Aggregate_SyncOperateLog();
     }
 }
 function syncUser()
 {
     $yunModel = CloudWind_getConfig('yun_model');
     if (!CloudWind_getConfig('yundefend_shield') || $yunModel['userdefend_model'] != 100) {
         return true;
     }
     $setting = $this->getPlatformSettings();
     $service = $this->getDefendSyncService();
     if (!($data = $service->getUserDefends())) {
         return true;
     }
     $data = $this->_sendPost(array('data' => $data, 'uniqueid' => $setting['uniqueid'], 'identifier' => $setting['identifier']), 'batch');
     return true;
 }
Example #9
0
 function userDefend($operate, $uid, $username, $accesstime, $viewtime, $status = 0, $reason = "", $content = "", $behavior = array(), $expand = array())
 {
     if (0 == CloudWind_getConfig('yundefend_shield') || !($setting = $this->getPlatformSettings()) || $setting['dunstatus'] == 100) {
         return DEFEND_SUCCESS;
     }
     $data = $this->_dataEncode(array('operate' => $operate, 'status' => $status, 'uid' => $uid, 'username' => $username, 'localtime' => $GLOBALS['timestamp'], 'bbsurl' => $GLOBALS['db_bbsurl'], 'bbsname' => $GLOBALS['db_bbsname'], 'charset' => $GLOBALS['db_charset'], 'ip' => CloudWind_getIp(), 'refere' => $_SERVER['REQUEST_URI'], 'useragent' => $_SERVER['HTTP_USER_AGENT'], 'uniqueid' => $setting['uniqueid'], 'identifier' => $setting['identifier'], 'method' => $_SERVER['REQUEST_METHOD'], 'accesstime' => $accesstime, 'viewtime' => $viewtime, 'reason' => $reason, 'content' => $content, 'expand' => $expand, 'behavior' => $behavior, 'version' => WIND_VERSION, 'os' => ''));
     $yunModel = CloudWind_getConfig('yun_model');
     if (isset($yunModel['userdefend_model']) && $yunModel['userdefend_model'] == 100) {
         $defendOperateService = $this->getDefendGeneralOperateService();
         $defendOperateService->insertUserDefend($data);
     } else {
         $this->_sendRequest($this->_buildRequestUrl('user') . '&data=' . $data, '', 5);
     }
     return DEFEND_SUCCESS;
 }
 function postAudit($id, $postAudit, $type, $expand)
 {
     if ($postAudit != 100 || CloudWind_getConfig('yundefend_shieldpost') == 0) {
         return DEFEND_SUCCESS;
     }
     switch ($type) {
         case 'thread':
             $this->_postThread($id, $postAudit, $expand);
             break;
         case 'diary':
             $this->_postDiary($id, $postAudit, $expand);
             break;
         case 'reply':
             $this->_postReply($id, $postAudit, $expand);
             break;
         default:
             break;
     }
     return DEFEND_SUCCESS;
 }
 function getHostConnectTime($host)
 {
     $time_start = $this->getMicrotime();
     $result = $this->_sendPost($host, 'testsite', array('siteurl' => CloudWind_getConfig('g_bbsurl')));
     $time_end = $this->getMicrotime();
     return number_format($time_end - $time_start, 4);
 }
Example #12
0
 function proxyEntry()
 {
     print_r($this->getProxyIframe(CloudWind_getConfig('g_charset')));
     exit;
 }
 function getIpLists($iplists)
 {
     $iplists = $iplists ? explode("|", $iplists) : CloudWind_getConfig('g_whiteips');
     return array_merge(array('110.75.164.x', '110.75.168.x', '110.75.171.x', '110.75.172.x', '110.75.173.x', '110.75.174.x', '110.75.175.x', '110.75.176.x', '110.75.167.x'), $iplists);
 }
Example #14
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');
 }
 function _sendSearchPost($data, $timeout = 5)
 {
     $setting = $this->getPlatformSettings();
     return $this->sendPost("http://" . trim($this->getYunDunHost(), "/") . "/defend.php?a=userdefined", array('data' => $data, 'charset' => CloudWind_getConfig('g_charset'), 'uniqueid' => $setting['uniqueid'], 'identifier' => $setting['identifier']), $timeout);
 }
Example #17
0
 function _initPostInfo()
 {
     $filepath = D_P . 'data/bbscache/cloudwind_postinfo.php';
     if (!is_file($filepath) || CloudWind_filemtime($filepath) + 300 <= CloudWind_getConfig('g_timestamp')) {
         $postInfo = $this->_initPostInfoNoCache();
         $postInfo && CloudWind_writeover($filepath, "<?php\r\n\$postInfo=" . CloudWind_varExport($postInfo) . ";\r\n?>");
     } else {
         require $filepath;
     }
     return $postInfo;
 }
 function getCloudWindCode()
 {
     return md5(CloudWind_getConfig('g_bbsurl') . "\t" . CloudWind_getConfig('g_charset') . "\t" . CloudWind_getConfig('g_windversion') . "\t" . CLOUDWIND_VERSION);
 }
Example #19
0
 function getVersionId()
 {
     return CloudWind_getConfig('g_timestamp');
 }
 function getSiteUrl()
 {
     return CloudWind_getConfig('g_bbsurl') ? CloudWind_getConfig('g_bbsurl') : 'http://' . $_SERVER['HTTP_HOST'];
 }