Wrox Programmer Forums
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2009, 10:56 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by blackhorse66 View Post
in the sample codes claudias, in the root, index.php.

Find error_reporting, change it to

error_reporting(E_ALL & ~E_NOTICE)

I think that will make the Notice message disappeared from the Claudias sample codes.

But for your own real life programming, programming for error_reporting(E_ALL) will be better practice.
Thanks for the reply but unfortunately that did not work for me. I still just get redirected back to my login page. There's a couple more adjustments to my code that I'm going to try but if anyone has any advice, please chime in. Thanks!
 
Old July 17th, 2009, 10:44 AM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

You are not using the original log in code, right? after you change the error reporting, use the original log in code, I think the error will go away.
 
Old July 17th, 2009, 03:20 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by blackhorse66 View Post
You are not using the original log in code, right? after you change the error reporting, use the original log in code, I think the error will go away.
Even with the original login code I just get redirected back to my login page. I do appreciate the response. I'm still trying to figure this out.
 
Old July 17th, 2009, 04:13 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Alright! I got it working by using the built in CI session library rather than native PHP $_SESSION. This thread over at the Codeigniter forums helped tremendously.

However another issue has come up. If I visit one of my admin pages directly, by typing in the URL, for example http://www.mydomain.com/admin/dashboard, it does not redirect to the login page but just shows the page as normal. Not too good for security and defeats the purpose of logging in. Any ideas on why this is happening? Do I need to alter my if statement in my Controller(s):
Code:
if ($this->session->userdata('userid') < 1) {
	redirect('welcome/verify', 'refresh');
}
Any advice is appreciated. Thanks...
 
Old July 17th, 2009, 08:52 PM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

Session Support enabled

In your php.ini is session support disabled?
 
Old July 17th, 2009, 10:16 PM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

By the way, I think the CI's own session code will save the session value as a cookie. so in product web site, you cannot use CI's own session class for the password, or userid etc.

Maybe the author can give the authenticate answer. Everyone else here may be the "students" of the book, the expert may not come to this forum. :)
 
Old July 19th, 2009, 08:23 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by blackhorse66 View Post
By the way, I think the CI's own session code will save the session value as a cookie. so in product web site, you cannot use CI's own session class for the password, or userid etc.

Maybe the author can give the authenticate answer. Everyone else here may be the "students" of the book, the expert may not come to this forum. :)
Yeah I think CI session class will work for me for the site I'll be building based on the knowledge I've gained through the book. It will not be an ecommerce site so I only need authentication for the admin backend.

I'm hoping I can get the good word from Mr. Myer himself !
 
Old August 12th, 2009, 05:30 AM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.mydomain.com/welcome/verify

the first time I time wrong username and password, the notification didn't show out, anyone found this bug?

Last edited by shiroamada; August 13th, 2009 at 05:04 AM..
 
Old August 13th, 2009, 05:04 AM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by shiroamada View Post
http://www.mydomain.com/welcome/verify

the first time I time wrong username and password, the notification didn't show out, anyone found this bug?


I found out how to resolve this problem, after set the flashdata, it must be refresh. Else the second time u type it wrong then it will displayed

$this->session->set_flashdata('error', 'Sorry, your username or password is incorrect!');
redirect('welcome/admin', 'refresh');





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashboard Example with different users mruschetti BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 7 February 9th, 2008 05:18 PM
Dashboard example mruschetti BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 January 5th, 2008 02:41 PM
Login logic problem Gizmo_Gadgethead BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 1st, 2006 06:32 PM
Dashboard reporting tool luxx Excel VBA 0 January 2nd, 2004 12:26 PM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.