| Server IP : 23.111.136.34 / Your IP : 216.73.216.136 Web Server : Apache System : Linux servidor.eurohost.com.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : meusitei ( 1072) PHP Version : 5.6.40 Disable Function : show_source, system, shell_exec, passthru, proc_open MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/meusitei/public_html/central/ajuda/ |
Upload File : |
<?php
/******************************************************************************
* Login <login.php>
*
* Author: Michael McMullen <michael.mcmullen@tutelagesystems.com>
******************************************************************************/
require_once '../System/configuration.php';
class LoginPage extends MasterTemplate
{
var $template = 'admin_login.html';
var $output = array();
function LoginPage()
{
// Call the Master Template Constructor
parent::__construct();
// Add a Crumb
$this->AddBreadCrumb('Welcome', $this->output['webRoot']);
$this->AddBreadCrumb('Login', null);
// Check for a _POST from a form
$this->CheckPost();
// Render the Template
$this->RenderTemplate();
}
function CheckPost()
{
if(isset($_POST['txt_username']))
{
$username = trim($_POST['txt_username']);
$password = md5($_POST['txt_password']);
$user_db = DB_DataObject::factory('users');
$user_db->user_name = $username;
$user_db->user_password = $password;
if($user_db->find(true))
{
// Add administrator to SESSION
$_SESSION['administration'] = $user_db->toArray();
// Redirect to Administration Panel
$this->redirect('administration.php');
}
else
{
$this->output['errors'] = 'Invalid username and/or password';
}
}
}
// Renders the index template (called from master)
function outputBody()
{
$body = new HTML_Template_Flexy($this->config['flexy']);
$body->compile($this->template);
$body->outputObject($this);
}
}
new LoginPage();