Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 7 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | // Mover session_start() y headers al inicio |
3 | ob_start(); |
4 | session_start(); |
5 | // Si el usuario ya está logueado, redirigir según su tipo |
6 | if(isset($_SESSION['user_id'])){ |
7 | if($_SESSION['user_type'] == 'admin'){ |
8 | header('location:views/admin/admin_page.php'); |
9 | }else{ |
10 | header('location:views/home.php'); |
11 | } |
12 | }else{ |
13 | // Si no está logueado, redirigir al login |
14 | header('location:views/auth/login.php'); |
15 | } |
16 | ?> |