Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 Next > End >>
Lost Password - No Username Required
Date: 2006/06/22 03:29 By: emagin Status: CB Doc subscriber  
Karma: 1  
Fresh Joomlapolitan

Posts: 24
graphgraph
I am having a lot of trouble with users registering twice on our site when the user forgets their password.

The trouble is that they can't ever remember their username AND the email, but they can always remember their email address.

How can I (safely) remove the requirement for a username, and just do a match on the email. By 'safely' I don't mean security, this is a basic community site, I just mean without screwing something up.

Thanks for your help!
Click here to see the profile of this user The topic has been locked.

Re:Lost Password - No Username Required
Date: 2006/07/09 12:07 By: maranate Status: User  
Karma: 0  
Junior Joomlapolitan

Posts: 34
graphgraph
I'd like to know this as well. There are a lot of sites out there that have "forgot username" and "forgot password" options, OR you just have to enter your email address as the user name.
Christina
Click here to see the profile of this user The topic has been locked.

Re:Lost Password - No Username Required
Date: 2006/07/09 12:07 By: maranate Status: User  
Karma: 0  
Junior Joomlapolitan

Posts: 34
graphgraph
I'd like to know this as well. There are a lot of sites out there that have "forgot username" and "forgot password" options, OR you just have to enter your email address as the user name.
Christina
Click here to see the profile of this user The topic has been locked.

Re:Lost Password - No Username Required
Date: 2006/08/02 07:49 By: JJRO Status: User  
Karma: 1  
Fresh Joomlapolitan

Posts: 2
graphgraph
I found this on joomla.org forum:
http://forum.joomla.org/index.php/topic,50531.new.html#new
>>CLIP<<
Eh ... if I'm not mistaken, on comprofiler.html.php, comment out the lines:


<tr>
<td><?php echo _PROMPT_UNAME; ?></td>
<td><input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" /></td>
</tr>


Remember that "<!--" starts a block quote and "-->" ends it.

On comprofiler.php, replace:



if (!($user_id = $database->loadResult()) || !$checkusername || !$confirmEmail) {
mosRedirect(sefRelToAbs("index.php?option=$option&task=lostPassword"),_ERROR_PASS );
}


by



if (!$user_id || !$confirmEmail) {
mosRedirect(sefRelToAbs("index.php?option=$option&task=lostPassword"),_ERROR_PASS );
}

Ok, here's the code for the beginning of section "function sendNewPass" from the comprofiler.php. Notice the remarked code and the correspondent substitutions. Hopefully that is all ...


Code:

  function sendNewPass$option ) {         global $database$Itemid;         global $ueConfig,$_PLUGINS;         // ensure no malicous sql gets past         // $checkusername = trim( mosGetParam( $_POST, 'checkusername', '') );         $confirmEmail trimmosGetParam$_POST'confirmEmail''') );         //$database->setQuery( "SELECT id FROM #__users"         //. "\nWHERE username='$checkusername' AND email='$confirmEmail'"         //);         $database->setQuery"SELECT id FROM #__users                               WHERE email='$confirmEmail'"«»);         $user_id $database->loadResult();         $database->setQuery"SELECT username FROM #__users                               WHERE email='$confirmEmail'"«»);         $checkusername $database->loadResult();         //if (!($user_id = $database->loadResult()) || !$checkusername || !$confirmEmail) {         //      mosRedirect(sefRelToAbs("index.php?option=$option&task=lostPassword"«») ,_ERROR_PASS );         //}         if (!$user_id  || !$confirmEmail) {                 mosRedirect(sefRelToAbs("index.php?option=$option&task=lostPassword"«»),_ERROR_PASS );         } (...)



Haven't tried it... but probably will.
Unless someone else tries it first and it crashes their site

Post edited by: JJRO, at: 2006/08/02 02:23

Post edited by: JJRO, at: 2006/08/02 02:24
Click here to see the profile of this user The topic has been locked.

Re:Lost Password - No Username Required
Date: 2006/08/02 07:59 By: JJRO Status: User  
Karma: 1  
Fresh Joomlapolitan

Posts: 2
graphgraph
I tried it and it's working FINE!!

Hope it works for others!

Post edited by: JJRO, at: 2006/08/02 03:15
Click here to see the profile of this user The topic has been locked.

Re:Lost Password - No Username Required
Date: 2006/08/23 01:35 By: Radianation Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 15
graphgraph
It works for me as well, but your snippet of the code has some non-standard characters present so I had to go back to the original post to get it working. Regardless, Thank you!
Click here to see the profile of this user The topic has been locked.

<< Start < Prev 1 2 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC4)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC4, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers and now also to all registered joomlapolitans.

CB Login