Part of the EllisLab Network
   
2 of 3
2
Userlib - User Library
Posted: 08 July 2007 08:03 AM   [ Ignore ]   [ # 11 ]  
Summer Student
Avatar
Total Posts:  13
Joined  04-07-2006
Xikeon - 06 July 2007 05:35 PM

I’m sorry? I don’t really understand what you mean? Why would email as login auth be more secure?

There are normally two things needed to log into a website: login auth and password. If you take the username as login auth and that username is visible on the website, you’re already giving away 50% of the data required to login. Most users have silly passwords so it would be relatively easy to guess at least some of them, or maybe even hack them by brute force if you don’t have a strikes system implemented (this seems unlikely, but who knows).

Emails are usually not shown publicly, so if you use the email instead of the username as login auth, you will effectively hide 100% of the data required to log in and make it almost impossible to guess (the only way is to make the user itself to give you his/her email somehow, which can happen, but then it’s not your responsability).

That’s why using the email is more secure than using the username smile

Either way, looks like a nice class, thanks for sharing, will try it smile

Regards,

 Signature 

Meow!
Need a host? I’m happy with Site5 smile

Profile
 
 
Posted: 13 July 2007 08:41 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Rank
Total Posts:  94
Joined  10-24-2006

Thanks Zeld, you summed it up perfectly smile Sorry I was so slow to respond, but I haven’t had much spare time lately.

Your library does look interesting. I’m about to start making my decision on the development environment for my next project. I’m leaning towards using CI and pulling in some of the Zend Framework libraries I like. If I go that route, I’ll take a bigger look into this smile Have you plopped it up on the wiki yet?

Profile
 
 
Posted: 13 July 2007 02:19 PM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  705
Joined  04-20-2006
Christian Land - 06 July 2007 01:08 AM

Btw. handling the “Forgot Password” function like you do is an open invitation for troublemakers…

Hi,

I do also agree it, it is a real urgent function you need to improve, because of that we can’t use your lib in a real production environement.

You userlib is a very nice idea, i will follow it and waiting for new versions.

Just 1 question, why didn’t you used the build in Mailer class of CI unstead of simple mail functions wich are not portable ?

 Signature 

All CodeIgniter resources in 1 place?
http://www.codeigniterdirectory.com (Did you know we are converting this directory to Linkster?

My website: Création de sites Genève, Too Pixel

Profile
 
 
Posted: 16 July 2007 05:23 AM   [ Ignore ]   [ # 14 ]  
Summer Student
Total Posts:  3
Joined  04-20-2007

Very nice and easy to use library with good documentation in this short topic. My congratulations! smile

But I have a one suggestion: how about adding a logout method? It could be quite useful wink.

Profile
 
 
Posted: 18 July 2007 09:04 AM   [ Ignore ]   [ # 15 ]  
Grad Student
Avatar
Rank
Total Posts:  89
Joined  06-05-2007
Najki - 16 July 2007 05:23 AM

Very nice and easy to use library with good documentation in this short topic. My congratulations! smile

But I have a one suggestion: how about adding a logout method? It could be quite useful wink.

I concur! or do we have to grow our own logout module?

 Signature 

Functional PHP Extension A set of higher-order functions and other primatives written in PHP (3/4 compatible) which let you write php code in a functional style, similar to the way you might in Haskell, Scheme, or ML.

Profile
 
 
Posted: 18 July 2007 01:36 PM   [ Ignore ]   [ # 16 ]  
Summer Student
Total Posts:  3
Joined  04-20-2007

There is, however, a primitive logout function built-in to CodeIgniter, but I was hoping for a solution more compatible with this Userlib.

$this->session->sess_destroy();

Profile
 
 
Posted: 19 July 2007 11:09 AM   [ Ignore ]   [ # 17 ]  
Grad Student
Avatar
Rank
Total Posts:  89
Joined  06-05-2007
Najki - 18 July 2007 01:36 PM

There is, however, a primitive logout function built-in to CodeIgniter, but I was hoping for a solution more compatible with this Userlib.

$this->session->sess_destroy();

Thanks but I use session_destroy(); would there be any issues if I use this?

 Signature 

Functional PHP Extension A set of higher-order functions and other primatives written in PHP (3/4 compatible) which let you write php code in a functional style, similar to the way you might in Haskell, Scheme, or ML.

Profile
 
 
Posted: 19 July 2007 12:00 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Avatar
Rank
Total Posts:  89
Joined  06-05-2007

Hi Mike,

Kick ass library you’ve created. I managed to integrate it with my app in a matter of minutes. I have a question though…my app allows a user once registered to log in to his/her account page.

The problem I have now is does your library support a function that displays the user’s name upon login in? Like say the user was myself Mathew, upon logging in my account page would display “Welcome Mathew!”.

I tried using the getData function but I seem to only invoke variables that I have explicitly hardcoded. Is there any other way to dynamically achieve this by pulling the data from the ‘users’ table? Thanks much appreciated

 Signature 

Functional PHP Extension A set of higher-order functions and other primatives written in PHP (3/4 compatible) which let you write php code in a functional style, similar to the way you might in Haskell, Scheme, or ML.

Profile
 
 
Posted: 24 July 2007 11:19 AM   [ Ignore ]   [ # 19 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  02-14-2007

Love this library - it’s very flexible and has a lot of room for growth!

On tweak I added was some more flexibility in getData - I set it up so that username or select criteria could be left off allowing for a return of all fields of a particular row and/or certain fields from many rows this way I can list one or more users quickly.

function getData( $username = '', $what = '*' )
{
  $where_clause
= (!empty($username)) ? $where_clause = ' WHERE username=\'' . mysql_real_escape_string( $username ) . '\'' : '';
  
$lcheck = $this->CI->db->query( 'SELECT ' . mysql_real_escape_string( $what ) . ' FROM `users` ' . $where_clause);
  if(
$lcheck->num_rows( ) > 0 ) {
   
return $lcheck->result_array( );
  
} else {
   
return 'Username or row does not exist.';
  
}
}

 Signature 

Trying to do it right the first time! whoops guess that didn’t work out so well…

Profile
 
 
Posted: 24 July 2007 11:37 AM   [ Ignore ]   [ # 20 ]  
Grad Student
Avatar
Rank
Total Posts:  89
Joined  06-05-2007
Code Arachn!d - 24 July 2007 11:19 AM

Love this library - it’s very flexible and has a lot of room for growth!

On tweak I added was some more flexibility in getData - I set it up so that username or select criteria could be left off allowing for a return of all fields of a particular row and/or certain fields from many rows this way I can list one or more users quickly.

function getData( $username = '', $what = '*' )
{
  $where_clause
= (!empty($username)) ? $where_clause = ' WHERE username=\'' . mysql_real_escape_string( $username ) . '\'' : '';
  
$lcheck = $this->CI->db->query( 'SELECT ' . mysql_real_escape_string( $what ) . ' FROM `users` ' . $where_clause);
  if(
$lcheck->num_rows( ) > 0 ) {
   
return $lcheck->result_array( );
  
} else {
   
return 'Username or row does not exist.';
  
}
}

Awesome would it be too much trouble to show me how to use this function in my view?(Sorry PHP newb here) a code sample would be nice. Like lets say once the user logged in the ‘view’ will greet him/her by his/her first name?

 Signature 

Functional PHP Extension A set of higher-order functions and other primatives written in PHP (3/4 compatible) which let you write php code in a functional style, similar to the way you might in Haskell, Scheme, or ML.

Profile
 
 
   
2 of 3
2
 
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: 64453 Total Logged-in Users: 24
Total Topics: 80957 Total Anonymous Users: 0
Total Replies: 435678 Total Guests: 186
Total Posts: 516635    
Members ( View Memberlist )