heroframework /app/controllers/admincp/login.php

Language PHP Lines 46
MD5 Hash bc7569dbf5b2f29ae2f9d14f4846760d Estimated Cost $633 (why?)
Repository https://bitbucket.org/nanomites_webdev/heroframework.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
* Admincp Login Controller 
*
* Log the administrator in and out of the dashboard.
*
* @copyright Electric Function, Inc.
* @author Electric Function, Inc.
* @package Hero Framework
*/

class Login extends CI_Controller {
	function __construct() {
		parent::__construct();
		
		$this->load->model('admincp/notices');
		$this->load->helper('admincp/get_notices');
		$this->load->helper('ssl');
	}
	
	function index() {
		$this->load->view(branded_view('cp/login.php'));
	}
	
	function go() {
		if ($this->user_model->login($this->input->post('username'),$this->input->post('password'))) {
			$this->notices->SetNotice("You have logged in successfully.");
			redirect('/admincp');
			return TRUE;
		}
		else {
			$this->notices->SetError('Your login credentials were incorrect.');
			redirect('/admincp/login');
			return FALSE;
		}
	}
	
	function logout () {
		$this->user_model->logout();
		
		redirect('admincp');
		
		return TRUE;
	}
}
Back to Top