Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final public function login()
- {
- global $template, $autoLoader, $_CONFIG, $core, $engine;
- if(isset($_POST['login']))
- {
- $username = $this->postItems['username'];
- $password = $this->postItems['username'];
- $password = md5(sha1($password));
- $template->form->setData();
- unset($template->form->error);
- if($this->nameTaken($template->form->log_username))
- {
- if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
- {
- if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))
- {
- $this->turnOn($template->form->log_username);
- $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
- $template->form->unsetData();
- header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
- exit;
- }
- else
- {
- $template->form->error = '<div class="my-notify-error">
- </i> <b>Details do not match please try again to log into {hotelname}!</b></div>';
- $engine->query("INSERT INTO cms_login_logs (`username`,`password`,`when`,`ip_tried`,`worked`) VALUES ('" . $username . "','" . $this->postItems['login'] . "','" . date("l jS of F Y H:i:s") . "','" . $_SERVER['REMOTE_ADDR'] . "','1');");
- return;
- }
- }
- else
- {
- $template->form->error = '<div class="my-notify-error"><b>Oops! Sorry, it appears this user is banned from {hotelname}.</b><br /></div>';
- return;
- }
- }
- else
- {
- $template->form->error = '<div class="my-notify-error"></i><b>Oops! {hotelname}'s system did not locate that username, try again!</b></div>';
- return;
- }
- }
- }
- <div class="row forms row-centerd">
- <div class="col-md-4 col-centerd">
- <?php echo $template->form->error; ?>
- <form method="post" action="index" accept-charset="UTF-8">
- <label for="username">Username:</label>
- <input class="form-control" required="required" autofocus="autofocus" name="log_username" type="text" id="username">
- <label for="Pasword">Password:</label>
- <input class="form-control" required="required" name="log_password" type="password" id+"password">
- <input name="remember" type="checkbox" value="1">
- <label for="Onthouden" style="margin-top:20px;display:inline-block;">Remember me?</label>
- <input class="btn-lg btn-success login" style="margin-top:10px;" name="login" type="submit" value="Login" id="button">
- </form>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement