public function ContactsAction() { if (!Request::isPosted('adress')) { if ($this->company->web == '') { $this->company->web = 'http://'; } $this->company->email = User::GetName(); $this->render('contacts', ['company' => $this->company]); } else { $this->company->adress = Request::post('adress'); $this->company->email = Request::post('email'); $this->company->web = Request::post('web'); $this->company->phone = Request::post('phone'); if ($this->company->web == 'http://') { $this->company->web = ''; } if ($this->company->adress == '' and $this->company->web == '') { Site::Message('Укажите Ваш почтовый адрес или хотя-бы Web-сайт'); $this->render('contacts', ['company' => $this->company]); } else { $this->company->save(); $this->GroupAction(); } } }
public function IndexAction() { if (!Request::isPosted('email')) { $this->Render(); } else { $email = Request::post('email', '', 'mail'); $pass1 = Request::post('pass1', '', 'safe'); $pass2 = Request::post('pass2', '', 'safe'); if ($email == '') { Site::Message('Вы не указали Ваш e-mail, или такого адреса не существует'); $this->Render(); } elseif (UserModel::isExists($email, 'login')) { Site::Message('Похоже пользователь с таким почтовым ящиком уже существует.<br>Возможно Вы регистрировались раньше, если вы забыли пароль, Вы можете восстановить его.'); $this->Render(); } elseif ($pass1 == '') { Site::Message('Вы забыли придумать пароль'); $this->Render(); } elseif (strlen($pass1) < 6) { Site::Message('Пароль короче 6-ти символов =('); $this->Render(); } elseif ($pass1 != $pass2) { Site::Message('Введенные Вами пароли не совпадают, где-то ошиблись, попробуйте ещё раз'); $this->Render(); } else { UserModel::Registration($email, $pass1); User::LoginByPass($email, $pass1); Site::Message('Ваш профиль успешно создан!'); $this->Route('newcompany'); } } }
public function AdressAction() { if (!Request::isPosted('adress')) { if ($this->company->web == '') { $this->company->web = 'http://'; } $this->Render('contacts', ['company' => $this->company]); } else { $this->company->adress = Request::post('adress'); $this->company->email = Request::post('email'); $this->company->web = Request::post('web'); $this->company->phone = Request::post('phone'); if ($this->company->web == 'http://') { $this->company->web = ''; } if ($this->company->adress == '' and $this->company->web == '') { Site::Message('Укажите Ваш почтовый адрес или хотя-бы Web-сайт'); $this->Render('contacts', ['company' => $this->company]); } else { $this->company->save(); Site::Message('Профиль компании успешно обновлён'); $this->Route('profile'); } } }
public function IndexAction() { if (User::isLogged()) { Site::Message('Вы уже вошли в систему'); $this->Route(); } elseif (Request::isPosted('loguser')) { User::LoginByPass(Request::post('loguser', '', 'mail'), Request::post('logpass', '', 'safe')); if (!User::isLogged()) { Site::Error('Неверный логин или пароль'); $this->Render(); } else { Site::Message('Вы успешно вошли в систему'); if (!User::admin()) { $this->Route('profile'); } else { $this->Route(); } } } else { $this->Render(); } }