namespace WHMCS\Module\Addon\OnestreamReseller; use WHMCS\Module\Addon\OnestreamReseller\Api\Client; class Config { public static function loadModuleConfig() { $KIGSc = \Illuminate\Database\Capsule\Manager::table("tbladdonmodules")->where("module", "onestreamreseller")->get(); return $KIGSc; } public static function loadProductConfig($ES3kR, $jYagT) { $KIGSc = \Illuminate\Database\Capsule\Manager::table("tblproducts")->where("servertype", $jYagT)->where("id", $ES3kR)->get(); return $KIGSc[0] ?? null; } public static function getConfiguredPanels() { goto TmfK1; T0reJ: foreach ($ncuFu as $oXPn9 => $uEvQa) { goto fdWhB; fdWhB: if (!empty($uEvQa["panel_url"])) { goto IMTqJ; } goto fnpwj; fnpwj: unset($ncuFu[$oXPn9]); goto WZXhw; WZXhw: IMTqJ: goto SHH6v; SHH6v: Cdozu: goto olRxL; olRxL: } goto K7bH0; TmfK1: $PSV3g = self::loadModuleConfig(); goto k1qrz; t1Mh3: foreach ($PSV3g as $GxTYB) { goto uCKbo; T4VAm: Y94hk: goto dhVkB; uCKbo: $Z3Pbj = []; goto fKOSz; fKOSz: if (!preg_match("/^s(\d+)_(.*)/", $GxTYB->setting, $Z3Pbj)) { goto HnA02; } goto AFJBa; f7fMb: HnA02: goto T4VAm; y2UgE: $y5w_Q = $Z3Pbj[2]; goto M5LGN; M5LGN: $ncuFu[$Lw7wg][$y5w_Q] = $GxTYB->value; goto f7fMb; AFJBa: $Lw7wg = $Z3Pbj[1]; goto y2UgE; dhVkB: } goto YTrb6; K7bH0: gjOSf: goto u4Bqb; u4Bqb: return $ncuFu; goto sNt3R; k1qrz: $ncuFu = []; goto t1Mh3; YTrb6: re5F0: goto T0reJ; sNt3R: } public static function getApiClient($f5GUT, $rUudc = null) { goto cqjDh; D313c: return null; goto QSYnS; vxyOW: $e6bpw = $ncuFu[$f5GUT]; goto Q_jAH; hsMdJ: $fOamM = new Client($PSV3g); goto Pc8J0; Q_jAH: $PSV3g = ["url" => $e6bpw["panel_url"], "x-api-key" => $e6bpw["api_token"], "x-auth-user" => $rUudc ?: $e6bpw["user_token"]]; goto hsMdJ; QSYnS: QUzkT: goto vxyOW; mCXXC: if (!empty($ncuFu[$f5GUT])) { goto QUzkT; } goto D313c; cqjDh: $ncuFu = self::getConfiguredPanels(); goto mCXXC; Pc8J0: return $fOamM; goto anl86; anl86: } public static function getAdminUserName() { goto GU0cQ; O79pa: if (empty($QuBKh)) { goto JuDee; } goto D6O0D; GU0cQ: $QuBKh = \Illuminate\Database\Capsule\Manager::table("tbladmins")->where("disabled", "=", 0)->first(); goto O79pa; RVtZf: JuDee: goto W_rgT; D6O0D: return $QuBKh->username; goto RVtZf; W_rgT: exit("No admin exist. Why So?"); goto ixqme; ixqme: } }
© 2023 Quttera Ltd. All rights reserved.