refactoring
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<?php
|
||||
require_once 'functions/init.php';
|
||||
|
||||
require_once 'functions/functions.php';
|
||||
include_once 'functions/account_functions.php';
|
||||
|
||||
// UI Components
|
||||
foreach (glob('components/user/*.php') as $file)
|
||||
require_once $file;
|
||||
|
||||
$msg = '';
|
||||
|
||||
if (isset($_POST['form_id'])) {
|
||||
@@ -86,13 +89,19 @@ if (isset($_POST['form_id'])) {
|
||||
|
||||
include_once 'components/head.php';
|
||||
|
||||
if ($_GET['action'] == 'login')
|
||||
echo login_form(($msg ? $msg : ''));
|
||||
else if ($_GET['action'] == 'signup')
|
||||
echo signup_form(($msg ? $msg : ''));
|
||||
else if ($_GET['action'] == 'logout')
|
||||
logout();
|
||||
else if ($_GET['action'] == 'view' && isset($_GET['user_id']))
|
||||
echo user_view($_GET['user_id']);
|
||||
switch ($_GET['view']) {
|
||||
case 'login':
|
||||
echo login_form(($msg ? $msg : ''));
|
||||
break;
|
||||
case 'signup':
|
||||
echo signup_form(($msg ? $msg : ''));
|
||||
break;
|
||||
case 'logout':
|
||||
logout();
|
||||
break;
|
||||
case 'display':
|
||||
echo (isset($_GET['user_id']) ? user_view($_GET['user_id']) : header('Location: .'));
|
||||
break;
|
||||
}
|
||||
|
||||
include_once 'components/foot.php';
|
||||
|
||||
Reference in New Issue
Block a user