Part of the EllisLab Network
   
8 of 36
8
FreakAuth_light authentication library/admin application released!
Posted: 11 February 2007 06:04 AM   [ Ignore ]   [ # 106 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  152
Joined  01-21-2007

As far as Im aware it does a duplicate check on the username on registration… not sure if it checks for email already in the database

Profile
 
 
Posted: 11 February 2007 09:00 AM   [ Ignore ]   [ # 107 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  152
Joined  01-21-2007

Dan… when not logged in and trying to access a section that I have protected I get this:

Severity: Notice

Message: Undefined variable: check

Filename: libraries/Freakauth_light.php

Line Number: 140

Profile
 
 
Posted: 11 February 2007 05:12 PM   [ Ignore ]   [ # 108 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  514
Joined  12-05-2006
ACSparks - 10 February 2007 11:01 PM

Is there anything in the library to prevent duplicate user registrations based on either username or email?  I am looking through the code, but don’t see anything to prevent this yet.

Both get checked when a news user registers, ot when you add a new user from the admin panel. What has not been implemented is that an user can take an admin username. It will be sorted in relaase 1.0.3-alpha.

@3beem.com

Check out the solution to your problem here.

 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: 11 February 2007 09:21 PM   [ Ignore ]   [ # 109 ]  
Grad Student
Rank
Total Posts:  44
Joined  09-20-2006

seems, that my admin account cant login to the system, as administrative pages (adm) are totally seperated from the user system… which is different from the regular approach of showing a special menu to admin and a normal one to the user. is there a way to let admins also login trough the users login box? that is why i had trouble of the usage of FreakAuth… still, insisting on this, to patch it into my needs.

Profile
 
 
Posted: 12 February 2007 12:22 PM   [ Ignore ]   [ # 110 ]  
Grad Student
Rank
Total Posts:  84
Joined  10-26-2006

Hi Dan,

  I testing your system, but I’m getting a lot of trouble trying to make my own login page…  Can you please give us some documentation about how to do this??

Thanks

RA

 Signature 


RA

rafael apocalypse
ideiadigital.org

Profile
 
 
Posted: 13 February 2007 04:38 AM   [ Ignore ]   [ # 111 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  514
Joined  12-05-2006
obsesif - 11 February 2007 09:21 PM

seems, that my admin account cant login to the system, as administrative pages (adm) are totally seperated from the user system… which is different from the regular approach of showing a special menu to admin and a normal one to the user.

To show a custom menu ONLY to admins you should write something like this in your controller:

if ($this->freakauth_light->isAdmin() OR $this->freakauth_light->isSuperAdmin())
{
$data[
'admin_menu'] = $your_admin_menu//YOUR CODE HERE
}

//------------------------------------------
//your other $data[] variables here


//------------------------------------------

$this->load->vars($data);

$this->load->view('your_view');
obsesif - 11 February 2007 09:21 PM

is there a way to let admins also login trough the users login box? that is why i had trouble of the usage of FreakAuth… still, insisting on this, to patch it into my needs.

Sure, but you should hack the login method of the auth controller + hack the validation callback functions in auth controller.

 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: 13 February 2007 04:49 AM   [ Ignore ]   [ # 112 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  514
Joined  12-05-2006
rafael apocalypse - 12 February 2007 12:22 PM

Hi Dan,

  I testing your system, but I’m getting a lot of trouble trying to make my own login page…  Can you please give us some documentation about how to do this??

Thanks

RA

The documentation is here

For configuring the system have a look at the file system/application/config/freakauth_light.php (is pretty commented)

For understanding how to customise your views, open the files in system/application/views/FreakAuth_light/template look at their content and try to understand it.

 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: 13 February 2007 09:49 PM   [ Ignore ]   [ # 113 ]  
Summer Student
Avatar
Total Posts:  4
Joined  02-13-2007

What is the purpose of the simplepie helper?  I see it fetches feeds, but how is this relevant to the auth application?

Profile
 
 
Posted: 14 February 2007 02:44 AM   [ Ignore ]   [ # 114 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  514
Joined  12-05-2006

It’s absolutely unrelevant, and you can delete it along with the simplepie plugin.

I’ll take it out in next release.

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: 14 February 2007 07:35 AM   [ Ignore ]   [ # 115 ]  
Summer Student
Total Posts:  5
Joined  01-08-2007

First, thank you Danfreak for this cool app !
It is really easy to install !

As i’m quite new to CI and PHP, i’d like to know the best way to see wether a user is logged or not…

is it acceptable to do like this in a template view :

<?php
    
if (isValidUser())
    
{
    
echo "Hello world!, you're logged in !";
    
}
    
else
    
{
    
echo "Hello world! Please register";
    
}
?>

If not… what should i do to display some information when a user is logged or not in a single template view ?

Thanks for your help

Profile
 
 
Posted: 14 February 2007 08:56 AM   [ Ignore ]   [ # 116 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  514
Joined  12-05-2006
fdestors - 14 February 2007 07:35 AM

First, thank you Danfreak for this cool app !
It is really easy to install !

As i’m quite new to CI and PHP, i’d like to know the best way to see wether a user is logged or not…

is it acceptable to do like this in a template view :

<?php
    
if (isValidUser())
    
{
    
echo "Hello world!, you're logged in !";
    
}
    
else
    
{
    
echo "Hello world! Please register";
    
}
?>

If not… what should i do to display some information when a user is logged or not in a single template view ?

Thanks for your help

Yes, you should exactly do like this!

to display the something like: [ welcome USERNAME / logout ] or [welcome GUEST - login]

simply put this in your view:

<?=loginAnchor()?>

I’m actually working on next release that will fix the bugs found so far, merge admin and user table, be independent from mod_rewrite + some other stuff.

 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: 14 February 2007 06:38 PM   [ Ignore ]   [ # 117 ]  
Research Assistant
RankRankRank
Total Posts:  915
Joined  07-10-2006

Dan… stroll over to http://www.sqlrecipes.com/article_4.html. It’s an attempt to achieve fine-grained RBAC based on the specs. Read through the comments, a download url is provided by the author. It might give you some ideas.

Profile
 
 
Posted: 14 February 2007 07:42 PM   [ Ignore ]   [ # 118 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  277
Joined  02-07-2007

Hey guys, dunno if this has been brought up and fixed already - but I thought I would post my own…

I get an SQL query error when I log in as an Admin and try to access the ‘Manage Admin’ panel.

The error was here on line 55 of admins.php (assuming no additions have been made, it is in the admin function:

$msg = 'You do\'nt have the credentials to access this page';

The patched fix for me was very simple:

$msg = 'You do not have the credentials to access this page'; (taking out the quote escape).

Hope that helps anyone.

Profile
 
 
Posted: 14 February 2007 11:41 PM   [ Ignore ]   [ # 119 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  277
Joined  02-07-2007

Hey danfreak,

I absolutely love your Auth system! I have been wanting to implement a redirect and flash message for users (whom are already logged in) that attempt to re-visit the Login page.

I used your other flash messages as examples to construct mine, but it just doesn’t seem to work. I was hoping a fresh pair of the designer’s eyes would direct me towards getting it to work.

(All other flash messages work, for example the ones in the Admin panel, displaying login success and no access permissions…).

What it does, exactly, is perform a isValidUser() and if the viewing user is logged in (not guest) is set the flash message and redirect to the home page (where the
$this->db_session->flashdata(‘flashMessage’) displays the set flash based on its key, which I made sure was ‘flashMessage’) ELSE it displays the normal login form to the ‘guest’ user.

Here is the code I altered to try and implement this functionality… This is excerpted from auth.php beginning on line: 65.
 

 

/**
     * Displays the login form.
     */
     

    
function index()

    
{
        
if($this->freakauth_light->isValidUser())
        
{
            
// Display user name and an 'already logged in' flash message...
            
$msg = $this->db_session->userdata('username').', you have already logged in!';
        
$this->db_session->set_flashdata('flashMessage', $msg, 1);

            
        
redirect ('login', 'location');       

        
}
        
else
        
{        
            $this
->login();
        
}        

    }

I know, in essence - it doesn’t really matter if the user keeps re-logging themselves in, and I have no idea if there could be any exploits with it, but for the ‘slick-ness’ factor I have been wanting it wink

Regards,

Iksander

Profile
 
 
Posted: 15 February 2007 03:57 AM   [ Ignore ]   [ # 120 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  514
Joined  12-05-2006
Iksander - 14 February 2007 11:41 PM

Here is the code I altered to try and implement this functionality… This is excerpted from auth.php beginning on line: 65.
 

 

/**
     * Displays the login form.
     */
     

    
function index()

    
{
        
if($this->freakauth_light->isValidUser())
        
{
            
// Display user name and an 'already logged in' flash message...
            
$msg = $this->db_session->userdata('username').', you have already logged in!';
        
$this->db_session->set_flashdata('flashMessage', $msg, 1);

            
        
redirect ('login', 'location');      // <--- error this page does not exists it should be redirect ('auth/login', 'location');

        
}
        
else
        
{        
            $this
->login();
        
}        

    }

I know, in essence - it doesn’t really matter if the user keeps re-logging themselves in, and I have no idea if there could be any exploits with it, but for the ‘slick-ness’ factor I have been wanting it wink

Regards,

Iksander

It should work!

just change it to

//if an user, admin or superadmin is already logged in   
        
if($this->freakauth_light->isValidUser() OR $this->freakauth_light->isAdmin())
        
{
         
// Display user name and an 'already logged in' flash message...
        
$msg = $this->db_session->userdata('username').', you have already logged in!';
        
$this->db_session->set_flashdata('flashMessage', $msg, 1);

        
//redirects to homepage    
        
redirect ('', 'location');       

        
}
        
else
        
{        
            $this
->login();
        
}

I should include this in next release!

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
 
 
   
8 of 36
8
 
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: 77568 Total Logged-in Users: 17
Total Topics: 101557 Total Anonymous Users: 3
Total Replies: 544401 Total Guests: 197
Total Posts: 645958    
Members ( View Memberlist )
Newest Members:  ColeJLinskitnealsemperjrawhallshiusbozzlynobluffkatiejameshsmith101dddougal