Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'core/init.php';
- include 'includes/overall/header.php';
- logged_in_redirect();
- //require_once('core/functions/recaptchalib.php');
- if(empty($_POST) == false) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if(empty($username) || empty($password)) {
- $errors[] = 'Musisz wypełnić nazwe użytkownika i hasło!';
- } else if(user_exists($username) == false) {
- $errors[] = 'Ten uĹĽytkownik nie istnieje';
- } else if(user_active($username) == false) {
- $errors[] = 'Nie aktywowales konta!';
- } else {
- $login = login($username, $password);
- if($login == false) {
- $errors[] = 'Nazwe użytkownika i hasło jest niepoprawne';
- }
- }
- if(empty($errors) == false) {
- echo '<h2>Logowanie nie powiodło się...</h2>';
- echo output_errors($errors);
- } else {
- $_SESSION['user_id'] = $login;
- header('Location: index.php');
- exit();
- }
- } else {
- ?>
- <h2>Login</h2>
- <form action="" method="post" role="form">
- <div class="form-group">
- <label>Login</label>
- <input name="username" type="text" class="form-control" tabindex="1">
- </div>
- <div class="form-group">
- <label>Hasło</label>
- <input name="password" type="password" class="form-control" tabindex="2">
- </div>
- <button type="submit" class="btn btn-default">Wyślij</button>
- <a href="forgot.php"><button type="button" class="btn btn-info">Zapomnialem hasla</button></a>
- </form>
- <?php
- }
- include 'includes/overall/footer.php';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement