function verifying($data) { if (!is_array($data) || count($data) < 7) { return false; } $keysService = $this->getKeysService(); $key6 = $keysService->getKey6(2); require_once ACLOUD_PATH . '/system/core/sys.core.verify.php'; if ($key6 && strlen($key6) == 128 && ACloud_Sys_Core_Verify::verifyWithOAuth($data, $key6)) { return true; } return false; }
function apiControl($data) { $appsService = ACloud_Sys_Core_Common::loadSystemClass('apps', 'config.service'); if (!$data || !is_array($data) || !isset($data['app_id']) || !$data['app_id']) { return false; } $app = $appsService->getApp($data['app_id']); if (!$app || strlen($app['app_token']) != 128) { return false; } require_once ACLOUD_PATH . '/system/core/sys.core.verify.php'; if (ACloud_Sys_Core_Verify::verifyWithOAuth($data, $app['app_token'])) { return true; } return false; }
function identifyKey($data) { $result = ACloud_Sys_Core_Http::sendPost($this->buildPostParams('start.identifykey', $data)); if (!is_object($result) || $result->code != ACLOUD_HTTP_OK || $result->info->verifycode !== $data['verifycode']) { return array(false, 'responce is error'); } $info = array('sign' => $result->info->sign, 'verifycode' => $result->info->verifycode, 'rand' => $result->info->rand, 'identifytime' => $result->info->identifytime, 'footprint' => $result->info->footprint, 'step' => $result->info->step, 'verify' => $result->info->verify); $keysService = ACloud_Sys_Core_Common::loadSystemClass('keys', 'config.service'); $key6 = $keysService->getKey6(2); if (!$key6 || strlen($key6) != 128) { return array(false, 'key is invalided'); } if (ACloud_Sys_Core_Verify::verifyWithOAuth($info, $key6)) { return array(true, 'identify key success'); } return array(false, 'identify key fail'); }