initial commit
This commit is contained in:
38
production/admin/login.php
Normal file
38
production/admin/login.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
include '../php/classes/page.php';
|
||||
$page = new Page();
|
||||
$page->init_user();
|
||||
|
||||
# validate the login info if the user is trying to login
|
||||
if(isset($_POST['login']))
|
||||
{
|
||||
if($page->user()->login($_POST['username'],$_POST['password']))
|
||||
{
|
||||
$page->addMessage('Login successful.');
|
||||
$page->content("admin/index.php");
|
||||
}
|
||||
else
|
||||
{
|
||||
$page->addError('Invalid username/password combination. Please try again.');
|
||||
$page->display('menu',false);
|
||||
$page->content('admin/login.php');
|
||||
}
|
||||
}
|
||||
# if the user is already logged in
|
||||
else if($page->user()->check_role('admin'))
|
||||
$page->content('admin/index.php');
|
||||
else
|
||||
{
|
||||
$page->addMessage('You must login to use the administrator pages.');
|
||||
$page->display('menu',false);
|
||||
$page->content('admin/login.php');
|
||||
}
|
||||
|
||||
$page->attr('title','Discipling the Nations: Administrator Area');
|
||||
$page->menu('admin/menu.php');
|
||||
$page->addCSSFile('admin.css');
|
||||
|
||||
$page->process();
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user