public function install() { $this->_hooks = array('displayCarrierList', 'actionValidateOrder', 'displayAdminOrder', 'displayBackOfficeHeader', 'displayFooter'); $installRes = parent::install(); if (!$installRes) { return false; } $wys = Paczkomat::paczkomatUżytkownika("*****@*****.**"); $wysPaczk = Paczkomat::pobierzDanePaczkomatu($wys['glowny']); $refl = new ReflectionClass($this); foreach ($this->_konf as $name => $value) { $defName = str_replace("KONFIG_", "DOM_", $name); if ($refl->hasConstant($defName)) { Configuration::updateValue(self::KONFIG_PREFIX . $value, $refl->getConstant($defName)); } } foreach (array(self::KONFIG_PACZKOMAT_WYSYLKOWY => base64_encode(serialize($wysPaczk['paczkomat']))) as $key => $value) { Configuration::updateValue(self::KONFIG_PREFIX . $key, $value); } return $installRes; }
protected function ajax_saveAccountAction() { $login = pSQL($_POST["login"]); $pass = pSQL($_POST["pass"]); if (Validate::isEmail($login)) { if (Paczkomat::sprawdzKonto($login)) { if (Configuration::get($this->name . "_wys_paczkomat") == "") { $pacz = Paczkomat::paczkomatUżytkownika($login); if ($pacz['result'] == "ok" && $pacz['glowny'] != '') { $sendMachine = Paczkomat::pobierzDanePaczkomatu($pacz['glowny']); Configuration::updateValue($this->name . "_wys_paczkomat", base64_encode(serialize($sendMachine['paczkomat']))); } } if ($pass != "") { Configuration::updateValue($this->name . "_login", $login); Configuration::updateValue($this->name . "_haslo", $pass); $this->jsonResponse(array("result" => "ok", "message" => "Login i hasło zostały zapisane")); } else { $this->jsonResponse(array("result" => "error", "message" => "Hasło nie może być puste")); } } else { $this->jsonResponse(array("result" => "error", "message" => "Podany e-mail nie jest zarejestrowanym loginem w systemie Paczkomaty 24/7")); } } else { $this->jsonResponse(array("result" => "error", "message" => "Login musi być podany w postaci adresu e-mail")); } }