function getAccount($req, $hash, $apiId, $sign) { $af = new AccountManager(); $db = SystemConfig::GetDatabaseInstance(); $db->Query("SELECT `AccountId` FROM `Authorized` WHERE `Hash`=?", $hash); $accountId = $db->Assoc('AccountId'); $acc = $af->GetAccountById($accountId); if ($acc) { $db->Query("SELECT `Secret` FROM `Apps` WHERE `Id`=?d", $api); $key = $db->Assoc('Secret'); $acc = encrypt(toXml($acc), $key); return api_response(array('Account' => $acc)); } }