Browse Source

Redirect the login and signup pages to the dashboard if the user is already logged in

master
Sven Slootweg 9 years ago
parent
commit
533be57cc6
  1. 6
      public_html/modules/login.php
  2. 6
      public_html/modules/signup.php

6
public_html/modules/login.php

@ -13,6 +13,12 @@
if(!isset($_APP)) { die("Unauthorized."); }
if(!empty($_SESSION['user_id']))
{
flash_notice("You are already logged in.");
redirect("/dashboard");
}
if(!empty($_POST['submit']))
{
if(empty($_POST['username']))

6
public_html/modules/signup.php

@ -13,6 +13,12 @@
if(!isset($_APP)) { die("Unauthorized."); }
if(!empty($_SESSION['user_id']))
{
flash_notice("You are already logged in.");
redirect("/dashboard");
}
if(!empty($_POST['submit']))
{
if(empty($_POST['username']) || !preg_match("/^[a-zA-Z0-9-.]+$/", $_POST['username']))

Loading…
Cancel
Save