Part of the EllisLab Network
   
24 of 36
24
FreakAuth_light authentication library/admin application released!
Posted: 22 March 2007 01:38 PM   [ Ignore ]   [ # 346 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  03-14-2006
danfreak - 22 March 2007 04:06 AM
edwardmolasses - 21 March 2007 06:14 PM

hi there,

I wanted to say thank you for making this extension! I’m quite new to it, so i hope this isn’t a very silly question. I’m having some problems that i think might have something to do with sessions. I’ve installed it and according the installer, everything went okay. I can login okay, but as soon as i go to another page, i’m no longer logged in (for example, i login and then go to change password and it no longer says i am logged in; or i login as the admin, and then click on one of the admin menu options and it sends me back to the login).

andrew.

Hey Andrew, your welcome!
cheers for yous “help summary” in the wiki grin

Well yours is a strange issue!

Well ou said you have cookies enabled, and that your session is written ok in DB.

did you change any setting in the application/config/config.php ?

Dan

hi Dan,

Thanks for answering! Ack, a strange issue doesn’t sound very good! Perhaps it’s some server setting. Could it have something to do with using PHP4 perhaps?

I did make a couple changes to config.php. I set error logging to 4, and i added some global constants at the end which i just use for some standard messages to the user in the rest of my application. So it doesn’t seem like they should interfere with anything.
I have a link here to my error log.
I’ve pasted a couple of the messages from that log that seem suspicious and that i don’t really understand. Do you think there is anything there that might indicate the problem?

thank you!
andrew.

...
DEBUG - 2007-03-22 14:19:08—> Config file loaded: config/freakauth_light.php
DEBUG - 2007-03-22 14:19:08—> Helpers loaded: url, form, array, freakauth_light, html
DEBUG - 2007-03-22 14:19:08—> Database Driver Class Initialized
DEBUG - 2007-03-22 14:19:08—> FreakAuth Class Initialized
DEBUG - 2007-03-22 14:19:08—> Session Class Initialized (db)
ERROR - 2007-03-22 14:19:08—> Severity: Notice —> unserialize() [<a href=‘function.unserialize’>function.unserialize</a>]: Argument is not a string /homepages/34/d160587096/htdocs/test/system/application/libraries/Db_session.php 208
...
DEBUG - 2007-03-22 14:19:08—> Encrypt Class Initialized
ERROR - 2007-03-22 14:19:08—> Severity: Notice —> unserialize() [<a href=‘function.unserialize’>function.unserialize</a>]: Error at offset 0 of 15 bytes /homepages/34/d160587096/htdocs/test/system/libraries/Session.php 187
ERROR - 2007-03-22 14:19:08—> The session cookie data did not contain a valid array. This could be a possible hacking attempt.
DEBUG - 2007-03-22 14:19:08—> Controller Class Initialized
DEBUG - 2007-03-22 14:19:08—> Language file loaded: language/english/freakauth_lang.php
DEBUG - 2007-03-22 14:19:08—> Model Class Initialized
DEBUG - 2007-03-22 14:19:08—> Validation Class Initialized
DEBUG - 2007-03-22 14:19:08—> File loaded: /homepages/34/d160587096/htdocs/test/system/application/views/FreakAuth_light/template/menu.php
DEBUG - 2007-03-22 14:19:08—> File loaded: /homepages/34/d160587096/htdocs/test/system/application/views/FreakAuth_light/template/header.php
DEBUG - 2007-03-22 14:19:08—> File loaded: /homepages/34/d160587096/htdocs/test/system/application/views/FreakAuth_light/content/login.php
DEBUG - 2007-03-22 14:19:08—> File loaded: /homepages/34/d160587096/htdocs/test/system/application/views/FreakAuth_light/template/content.php
DEBUG - 2007-03-22 14:19:08—> File loaded: /homepages/34/d160587096/htdocs/test/system/application/views/FreakAuth_light/template/footer.php
DEBUG - 2007-03-22 14:19:08—> File loaded: /homepages/34/d160587096/htdocs/test/system/application/views/FreakAuth_light/template/container.php
DEBUG - 2007-03-22 14:19:08—> Final output sent to browser
DEBUG - 2007-03-22 14:19:08—> Total execution time: 0.2298

Profile
 
 
Posted: 22 March 2007 01:43 PM   [ Ignore ]   [ # 347 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  512
Joined  12-05-2006

Well I’m aware of this

ERROR - 2007-03-22 14:19:08 --> Severity: Notice --> unserialize() [<a href=’function.unserialize’>function.unserialize</a>]: Argument is not a string /homepages/34/d160587096/htdocs/test/system/application/libraries/Db_session.php 208

But no clue about the other. Never happened to anybody else.

Let me know. I gotta go now!

grin

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 22 March 2007 08:45 PM   [ Ignore ]   [ # 348 ]  
Summer Student
Total Posts:  1
Joined  06-25-2002
edwardmolasses - 21 March 2007 06:14 PM

I can login okay, but as soon as i go to another page, i’m no longer logged in (for example, i login and then go to change password and it no longer says i am logged in; or i login as the admin, and then click on one of the admin menu options and it sends me back to the login).

andrew.

Are you loading any other session libraries? Look in your autoload config file.
Also try using the profiler to see what session ID is being created and queried in the database.

Profile
 
 
Posted: 22 March 2007 10:39 PM   [ Ignore ]   [ # 349 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  493
Joined  02-21-2007
codelearn - 22 March 2007 11:40 AM

Danfreak,

How would I let levels 3 and 4 to access the admin console upon login?

It’s a good idea to let people be redirected where the webmaster decided them to go.
In a recent post you told us that you sorted this out.
Did you change the _login function?

$role= $this->db_session->userdata('role');

  switch (
$role)
  
{
      
case ('superadmin'):
      case (
'admin'):
          
redirect($this->config->item('FAL_admin_login_success_action'), 'location'); //On success redirect user to default page
          
break;
          
      default:
          
redirect($this->config->item('FAL_login_success_action'), 'location'); //On success redirect user to default page
          
break;
  
}

I think we could make $this->config->item(‘FAL_login_success_action’) an array (‘role’=>‘page’) and something like this instead of the switch:

$role_to_page = $this->config->item('FAL_login_success_action');
if (isset(@
$role_to_page[$role]) AND $role_to_page[$role] != '') redirect($role_to_page[$role], 'location');
else
redirect($role_to_page['user'], 'location');


This could be more powerful in terms of customisation.

Profile
 
 
Posted: 23 March 2007 04:17 AM   [ Ignore ]   [ # 350 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  512
Joined  12-05-2006

@edwardmolasses

Do you maybe use global XSS filtering in you config file?

Dan

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 23 March 2007 09:13 AM   [ Ignore ]   [ # 351 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  181
Joined  02-25-2007

@Grahack

Yes, I edited that function to also admit some other roles to access the admin panel. Your way is nice because we can also easily redirect to user profiles and etc.

I may make that change. wink

Profile
 
 
Posted: 23 March 2007 09:33 AM   [ Ignore ]   [ # 352 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  493
Joined  02-21-2007

If you do so please give us your valid code, mine is not tested at all.

Profile
 
 
Posted: 23 March 2007 10:01 AM   [ Ignore ]   [ # 353 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  512
Joined  12-05-2006

Hey grahack, you finally changed your pic!

So happy the previous one was so frightening!

my real one is this: Mr.danfreak…
grin

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 23 March 2007 10:35 AM   [ Ignore ]   [ # 354 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  493
Joined  02-21-2007

Two reasons : the Spring and I’m now a “Junior Member”.

Sorry I have not enough muscles to show on my photo wink

Profile
 
 
Posted: 23 March 2007 10:41 AM   [ Ignore ]   [ # 355 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  512
Joined  12-05-2006
grahack - 23 March 2007 10:35 AM

Two reasons : the Spring and I’m now a “Junior Member”.

Sorry I have not enough muscles to show on my photo wink

...that pic has been taken something like 1566 years ago: I’m 350Kg now + I’m white like a cadaver after all hours spent on FAL big surprise

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 23 March 2007 01:46 PM   [ Ignore ]   [ # 356 ]  
Summer Student
Total Posts:  17
Joined  02-07-2007

hahaha and i was wond’rin why i looked like a vampire since some months. i started to believe lcd/crt removes the color of the skin. or is it because i’m livin more on the night-times? cool climbing btw dan, you should sometime come over to turkey/oludeniz; good places for vacation & climbing.
btw back once more after some bigger hardware crashdown. will check out FAL-latest these days…
cheerz!

Profile
 
 
Posted: 23 March 2007 04:23 PM   [ Ignore ]   [ # 357 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  03-14-2006
ddasinger - 22 March 2007 08:45 PM
edwardmolasses - 21 March 2007 06:14 PM

I can login okay, but as soon as i go to another page, i’m no longer logged in (for example, i login and then go to change password and it no longer says i am logged in; or i login as the admin, and then click on one of the admin menu options and it sends me back to the login).

andrew.

Are you loading any other session libraries? Look in your autoload config file.
Also try using the profiler to see what session ID is being created and queried in the database.

Thanks for the suggestions guys! It was a frustrating couple of days. Thanks Dan, i didn’t have the global xss filtering on though. To answer ddasinger, that was it, thank you so much, i feel very silly now. I had autoloaded the session library as well as freakauth. Everything is working okay now.

Sorry everyone for my very silly mistake, and thanks so much for the help!

Profile
 
 
Posted: 24 March 2007 06:56 PM   [ Ignore ]   [ # 358 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  03-14-2006

hi there again,

Maybe this has been asked before and i’ve missed it looking through this thread, but i wasn’t sure of the best way to add new profile fields to the registration and user profile? Is there a traditional way to do this with freakauth?

I’ve noticed the custom user fields settings in the freakauth_light.php config file which correspond to the FA_user_profile table in the database. So i was thinking that i should add my fields in here and also modify the register.php template, but i wasn’t sure exactly how, is there some sample code for doing this or documentation?

thanks!
andrew.

Profile
 
 
Posted: 25 March 2007 10:58 AM   [ Ignore ]   [ # 359 ]  
Summer Student
Total Posts:  2
Joined  03-22-2007

Hey Dan,

Just wanted to say thanks for making this great library.  It’s great that you’re so active in making this a success.  I’m not sure if you’ve fixed this in your next release, but I found a few places where the template directory was hard-coded instead of using the config variable.  I’ve listed all the values I could find as a line number and what the line should read.  The only change for each line was replacing :

$data ['page'] = 'FreakAuth_light


with

$this->config->item('FAL_template_dir').'

Thanks again for all your excellent work on this library.

controllers/admin/adminhome.php

line 63
: $data['page'] = $this->config->item('FAL_template_dir').'/template_admin/example/example';


controllers/admin/admins.php

line 134
: $this->config->item('FAL_template_dir').'/template_admin/users/list';
line 195: $data['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/detail';
line 262: $data ['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/add';
line 392: $data ['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/edit';


controllers/admin/example.php

line 60
: $data['page'] = $this->config->item('FAL_template_dir').'/template_admin/example/example';
line 92: $data['page'] = $this->config->item('FAL_template_dir').'/template_admin/example/example';


controllers/admin/users.php

line 135
: $data['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/list';
line 197: $data['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/detail';
line 265: $data ['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/add';
line 407: $data ['page'] = $this->config->item('FAL_template_dir').'/template_admin/users/edit';

Profile
 
 
Posted: 26 March 2007 01:49 AM   [ Ignore ]   [ # 360 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  208
Joined  06-12-2006

Hello

Does anyone know how to prevent 2 or more people to log at the same time with the same username and password?

Profile
 
 
   
24 of 36
24
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 66430 Total Logged-in Users: 40
Total Topics: 84793 Total Anonymous Users: 3
Total Replies: 455060 Total Guests: 238
Total Posts: 539853    
Members ( View Memberlist )
Newest Members:  Dylan1978X_franbaguasllogocsaturkeyPeter BryanttherendStudioGeorgiaJZeerfedeghe