public function actionUc($code) { $get = $post = []; defined('MAGIC_QUOTES_GPC') || define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc()); parse_str(Client::authcode($code, 'DECODE', Yii::$app->uc->key), $get); Yii::trace($get); $get = Client::stripslashes($get); // $timestamp = time(); // if($timestamp - $get['time'] > 3600) { // exit('Authracation has expiried'); // } if (empty($get)) { exit('Invalid Request'); } $postStr = Yii::$app->request->rawBody; $post = XML::unserialize($postStr); Yii::trace($post); if (in_array($get['action'], $this->ucActionList)) { call_user_func([Note::className(), $get['action']], $get, $post); return Note::API_RETURN_SUCCEED; } return Note::API_RETURN_FAILED; }
public static function getcreditsettings($get, $post) { if (!self::API_GETCREDITSETTINGS) { return self::API_RETURN_FORBIDDEN; } $credits = array(); return XML::serialize($credits); }
/** * @return array|string */ public function check_version() { $return = $this->api_post('version', 'check', []); $data = XML::unserialize($return); return is_array($data) ? $data : $return; }