0 użytkowników i 1 Gość przegląda ten wątek.
if (Tools::isSubmit('SubmitLogin')){ $passwd = trim(Tools::getValue('passwd')); $email = trim(Tools::getValue('email')); if (empty($email)) $errors[] = Tools::displayError('e-mail address is required'); elseif (!Validate::isEmail($email)) $errors[] = Tools::displayError('invalid e-mail address'); elseif (empty($passwd)) $errors[] = Tools::displayError('password is required'); elseif (Tools::strlen($passwd) > 32) $errors[] = Tools::displayError('password is too long'); elseif (!Validate::isPasswd($passwd)) $errors[] = Tools::displayError('invalid password'); else { $customer = new Customer(); $authentication = $customer->getByemail(trim($email), trim($passwd)); /* Handle brute force attacks */ sleep(1); if (!$authentication OR !$customer->id) $errors[] = Tools::displayError('authentication failed'); else { $cookie->id_customer = intval($customer->id); $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->logged = 1; $cookie->passwd = $customer->passwd; $cookie->email = $customer->email; if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0)) $cookie->id_cart = intval(Cart::lastNoneOrderedCart(intval($customer->id))); Module::hookExec('authentication'); if ($back = Tools::getValue('back')) Tools::redirect($back); Tools::redirect('my-account.php'); <<--- TUTAJ zmien na index.php } }}