|
|
 |
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
 | This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

November 5th, 2009, 05:41 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Error message when I click go back one page after log out
First I log in and log out from admin.
Then when I click go back button of a browser, I get the following error messages.
Also when I visit /index.php/admin/dashboard directly without logging-in I get the same error messages.
Could anyone tell me how to fix the problem please?
Thanks in advance.
Quote:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: userid
Filename: admin/dashboard.php
Line Number: 8
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\codeigniter_shopping\system\librar ies\Exceptions.php:166)
Filename: helpers/url_helper.php
Line Number: 539
|
Last edited by phpcoder101 : November 5th, 2009 at 05:51 PM.
|

November 6th, 2009, 09:54 AM
|
|
Wrox Author
|
|
Join Date: May 2008
Location: Austin, TX, USA.
Posts: 52
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
this was another last-minute thing
Your dashboard controller should start like this:
Code:
class Dashboard extends Controller {
function Dashboard(){
parent::Controller();
session_start();
if (isset($_SESSION['userid']) && $_SESSION['userid'] < 1){
redirect('welcome/verify','refresh');
}
}
what is your email address so I can send you the ZIP archive I have?
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
|

November 6th, 2009, 05:22 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Thanks but I think ...
Thanks. I changed all the files in admin folders, then it works.
When I click "go back" button, it automatically log-in.
However I think once, you log-out, it should require log-in again rather taking you to admin again. I think it is more secure.
If I want to do it, what I should do it?
okada.shin[at]google[dot]com
Thanks in advance.
Last edited by phpcoder101 : November 6th, 2009 at 05:39 PM.
|

November 6th, 2009, 05:43 PM
|
|
Wrox Author
|
|
Join Date: May 2008
Location: Austin, TX, USA.
Posts: 52
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
hmmmmm....
confused...isn't it already knocking you out to welcome/verify if you aren't logged in?
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
|

November 7th, 2009, 03:44 AM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Me too.
I tested with FF and chrome.
I loged in and loged out.
Then when I click "Go Back" button, I can go to admin still.
It should ask to log in again.
I have the following codes in all the files in the admin folder as you suggested.
Code:
...
...
parent::Controller();
session_start();
if (isset($_SESSION['userid']) && $_SESSION['userid'] < 1){
redirect('welcome/verify','refresh');
}
|

November 7th, 2009, 04:30 AM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 25
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Solved.
All the line in admin files have this line.
Code:
if ($_SESSION['userid'] < 1){
redirect('welcome/verify','refresh');
I changed to the following.
Code:
if (!isset($_SESSION['userid']) || $_SESSION['userid'] < 1){
$this->session->set_flashdata('error',"You must log in!");
redirect('welcome/verify','refresh');
Then it does not take you admin any more and take you to index page with flash message "You must log in".

|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |