Skip to content

Commit 5a5de9d

Browse files
committed
indexauth controller - simplified the login check due lack of DB/IMAP
* in the imap check just return TRUE if there's no imap login provider just uncomment the lines and configure a imap login * in the dbms check just return a simple array of data if there's no database configured, just uncomment the lines an setup your db with the provided sql file in the project * erase the messajes cos the redirection will not handle it, this example project does not provide any way to send message status to the login screen, you must use the 3th parameter to use status/stages to identify the login errors
1 parent ab48bb7 commit 5a5de9d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

webappweb/controllers/Indexauth.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function __construct()
77
parent::__construct();
88
}
99

10-
/** http://127.0.0.1/codeigniterpower/index.php/indexcontroler/index */
1110
public function index($data = NULL)
1211
{
1312
$this->load->view('header.php',$data);
@@ -17,7 +16,7 @@ public function index($data = NULL)
1716

1817
public function auth($action = 'logout', $username = NULL, $userclave = NULL)
1918
{
20-
if($usernname == NULL)
19+
if($username == NULL)
2120
$username = $this->input->post('username');
2221
if($userclave == NULL)
2322
$userclave = $this->input->post('userclave');
@@ -26,27 +25,20 @@ public function auth($action = 'logout', $username = NULL, $userclave = NULL)
2625
{
2726
$this->load->model('usersmodel');
2827

29-
$im_access = $this->usersmodel->loginimap($username, $userclave);
28+
$im_access = TRUE;//$this->usersmodel->loginimap($username, $userclave);
3029

31-
$rs_access = $this->usersmodel->logindb($username, $userclave);
30+
$rs_access = array('user'=>'pepe');//$this->usersmodel->logindb($username, $userclave);
3231
}
3332

3433
$data = array();
35-
$message = 'Invalid login parameters or session ended';
3634
if($rs_access AND $im_access)
3735
{
38-
$message = 'Session initialized';
39-
$viewtitle = 'index at Pagetest';
40-
$data['message'] = $message;
4136
$this->session->set_userdata('userdata', $rs_access);
42-
$this->session->set_flashdata('error',$message);
4337
redirect('Indexhome');
4438
}
4539
else
4640
{
47-
$data['message'] = $message;
4841
$this->session->sess_destroy();
49-
$this->session->set_flashdata('error',$message);
5042
header('location:'.site_url('/Indexauth'));
5143
}
5244
}

0 commit comments

Comments
 (0)