Пример #1
0
 public function postActivation(ConnectionInterface $con = null)
 {
     DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::ADMIN_PASSWORD, "thelia2");
     DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::ADMIN_USERNAME, "thelia2");
     DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::CUSTOMER_EMAIL, "*****@*****.**");
     DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::CUSTOMER_PASSWORD, "thelia");
 }
Пример #2
0
 public function editConfiguration()
 {
     if (null !== ($response = $this->checkAuth(AdminResources::MODULE, [DemoTheliaNet::DOMAIN_NAME], AccessManager::UPDATE))) {
         return $response;
     }
     $form = $this->createForm('demothelianet.configuration.form');
     $error_message = null;
     try {
         $validateForm = $this->validateForm($form);
         $data = $validateForm->getData();
         DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::ADMIN_USERNAME, $data["admin_username"]);
         DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::ADMIN_PASSWORD, $data["admin_password"]);
         DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::CUSTOMER_EMAIL, $data["customer_email"]);
         DemoTheliaNet::setConfigValue(DemoTheliaNetConfigValue::CUSTOMER_PASSWORD, $data["customer_password"]);
         return $this->redirectToConfigurationPage();
     } catch (FormValidationException $e) {
         $error_message = $this->createStandardFormValidationErrorMessage($e);
     }
     if (null !== $error_message) {
         $this->setupFormErrorContext('configuration', $error_message, $form);
         $response = $this->render("module-configure", ['module_code' => 'DemoTheliaNet']);
     }
     return $response;
 }
Пример #3
0
 protected function buildForm()
 {
     $this->formBuilder->add("admin_password", "text", array("label" => "The Admin Password", "label_attr" => ["for" => "password"], "required" => false, "constraints" => array(), "data" => DemoTheliaNet::getConfigValue(DemoTheliaNetConfigValue::ADMIN_PASSWORD, null)))->add("admin_username", "text", array("label" => "The Admin Username", "label_attr" => ["for" => "username"], "required" => false, "constraints" => array(), "data" => DemoTheliaNet::getConfigValue(DemoTheliaNetConfigValue::ADMIN_USERNAME, null)))->add("customer_password", "text", array("label" => "The Customer Password", "label_attr" => ["for" => "username"], "required" => false, "constraints" => array(), "data" => DemoTheliaNet::getConfigValue(DemoTheliaNetConfigValue::CUSTOMER_PASSWORD, null)))->add("customer_email", "text", array("label" => "The Customer Email", "label_attr" => ["for" => "username"], "required" => false, "constraints" => array(), "data" => DemoTheliaNet::getConfigValue(DemoTheliaNetConfigValue::CUSTOMER_EMAIL, null)));
 }
Пример #4
0
 public function onLoginJavascriptInitionlization(HookRenderEvent $event)
 {
     $password = DemoTheliaNet::getConfigValue(DemoTheliaNetConfigValue::CUSTOMER_PASSWORD, null);
     $email = DemoTheliaNet::getConfigValue(DemoTheliaNetConfigValue::CUSTOMER_EMAIL, null);
     $event->add($this->render("assets/js/login_information_js.html", ['password' => $password, 'email' => $email]));
 }