示例#1
0
 public static function getAppOutPut($collect)
 {
     $data = array();
     $sign = ACloudSysCoreCommon::getSiteSign();
     $data['src'] = $collect->getSrc();
     $data['url'] = ACloudSysCoreCommon::getGlobal('g_siteurl', $_SERVER['SERVER_NAME']);
     $data['sn'] = ACloudSysCoreCommon::getSiteUnique();
     $data['fid'] = $collect->getFid();
     $data['uid'] = $collect->getUid();
     $data['tid'] = $collect->getTid();
     $data[$sign] = ACloudVerCoreApp::getSyncData($sign);
     $data['charset'] = ACloudSysCoreCommon::getGlobal('g_charset', 'gbk');
     $data['username'] = $collect->getUsername();
     $data['title'] = $collect->getTitle();
     $data['_ua'] = ACloudSysCoreCommon::getSiteUserAgent();
     $data['_shr'] = base64_encode(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
     $data['_sqs'] = base64_encode(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
     $data['_ssn'] = base64_encode(isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '');
     $data['_t'] = ACloudSysCoreCommon::getGlobal('timestamp') + 86400;
     $data['_v'] = rand(1000, 9999);
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     $url = sprintf("http://%s/?%s", ACloudSysCoreDefine::ACLOUD_HOST_APP, ACloudSysCoreHttp::httpBuildQuery($data));
     $output = "<script type=\"text/javascript\">(function(d,t){var url=\"{$url}\";var g=d.createElement(t);g.async=1;g.src=url;d.body.insertBefore(g,d.body.firstChild);}(document,\"script\"));</script>";
     return $output;
 }
 public function aseControl($data)
 {
     if (!is_array($data) || !isset($data['ciphertext']) || !$data['ciphertext']) {
         return false;
     }
     $keysService = ACloudSysCoreCommon::loadSystemClass('keys', 'config.service');
     $keys = $keysService->getKey123(1);
     if (!$keys || strlen($keys['key1']) != 128 || strlen($keys['key2']) != 128 || strlen($keys['key3']) != 128) {
         return false;
     }
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreAes");
     $aesService = new ACloudSysCoreAes();
     $key = $aesService->encrypt($keys['key3'], $keys['key2'], 256);
     if (!$key) {
         return false;
     }
     $plaintext = $aesService->strcode($data['ciphertext'], $key, 'DECODE');
     if (!$plaintext) {
         return false;
     }
     $params = ACloudSysCoreHttp::splitHttpQuery($plaintext);
     if (!is_array($params)) {
         return false;
     }
     $tmp = ACloudSysCoreCommon::arrayIntersectAssoc($params, $data);
     if (is_array($tmp) && count($tmp) > 0 && count($tmp) == count($params) && $tmp['securecode'] === $data['securecode']) {
         return true;
     }
     return false;
 }
示例#3
0
 public static function createHttpQuery($params)
 {
     if (!$params || !is_array($params)) {
         return '';
     }
     ksort($params);
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     return ACloudSysCoreHttp::httpBuildQuery($params);
 }
 public function getSearchData($params = array())
 {
     list($keyword, $type, $fid, $username) = ACloudSysCoreS::gp(array("keyword", "type", "fid", "username"));
     $data = array();
     $data['k'] = $keyword;
     $data['type'] = $type;
     $data['fid'] = intval($fid);
     $data['username'] = $username;
     $data['charset'] = ACloudSysCoreCommon::getGlobal('g_charset', Wekit::app()->charset);
     $data['url'] = ACloudSysCoreCommon::getGlobal('g_siteurl', $_SERVER['SERVER_NAME']);
     $data['sv'] = 'svp9';
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     return ACloudSysCoreHttp::httpBuildQuery(array_merge($data, $params));
 }
 public function getLink($data = array())
 {
     $params = $this->buildPostParams();
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreVerify");
     $params['accesssign'] = ACloudSysCoreVerify::createSignWithOAuth($params);
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     return sprintf("http://%s/index.php?%s", ACloudSysCoreDefine::ACLOUD_HOST_API, ACloudSysCoreHttp::httpBuildQuery(array_merge($params, $data)));
 }
 public function getNetWorkInterflow()
 {
     require_once Wind::getRealPath("ACLOUD:system.core.ACloudSysCoreHttp");
     $result = ACloudSysCoreHttp::sendPost($this->buildPostParams('env.interflow', array()));
     return is_object($result) && $result->code == 100 ? true : false;
 }