The Joomla! Forum ™





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
PostPosted: Fri Oct 09, 2009 6:35 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sat Aug 08, 2009 12:50 pm
Posts: 113
Location: India ,chennai
Forgot Your Username with security question and answer with joomla 1.5


You do not have the required permissions to view the files attached to this post.

_________________
M.Arjun


Top
 Profile  
 
PostPosted: Fri Oct 09, 2009 6:38 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sat Aug 08, 2009 12:50 pm
Posts: 113
Location: India ,chennai
Insert this code in

components\com_user\views\remind\tmpl\default.php


<div class="content_title"><span class="blue">Forgot </span><span class="dark_blue">Your Username</span></div>
<div style="margin-left:40px; margin-top:20px; width:500px;">
<form action="index.php?option=com_user&amp;task=remindusername&Itemid=213" method="post" name="josForm" id="josForm" class="form-validate" style="padding:0; margin:0;" onSubmit="return ValidateForm()">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="contentpane">
<tr>
<td colspan="2">
<font color="#0099FF">
<?php
/*if(isset($this->username))
{
echo "YOUR USERNAME : ".$this->username;
}*/

echo $_GET['msg'];
?>

</font> </td>
</tr>
<tr>
<td style="padding-top:30px" width="140">
<div align="left">
<label id="" for="security" class="page-content-2">
<span class="astriek">* </span>
<?php echo JText::_('Security Question'); ?></label>
</div> </td>
<td style="padding-top:30px">
<div align="left">
<?php echo $this->lists['security'];?> </div> </td>
</tr>
<tr>
<td style="padding-top:30px">
<label id="" for="answer" class="page-content-2">
<span class="astriek">* </span><?php echo JText::_( 'Your Answer' ); ?> </label> </td>
<td style="padding-top:30px">
<input title="Please Enter Your Answer" class="inputbox req val textbox_bg" type="text" id="answer" name="answer" value="<?php echo JRequest::getVar('answer');?>" maxlength="100" style="width:275px; "/> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><span class="astriek">* </span>Email Id </td>
<td><input id="email" name="email" type="text" class="required validate-email textbox_bg" style="width:275px; " maxlength="100" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="Submit" style="margin-left:230px;" value="<?php echo JText::_('Submit'); ?>" /> </td>
</tr>
</table>

<?php echo JHTML::_( 'form.token' ); ?>
</form>
</div>

_________________
M.Arjun


Last edited by arjuninfo on Fri Oct 09, 2009 6:44 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Oct 09, 2009 6:42 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sat Aug 08, 2009 12:50 pm
Posts: 113
Location: India ,chennai
then goto

components\com_user\controller.php


function remindusername()
{
$db =& JFactory::getDBO();

// Check for request forgeries
JRequest::checkToken() or jexit( 'Invalid Token' );

// Get the input
$email = JRequest::getVar('email', null, 'post', 'string');

$security = JRequest::getVar('security', null, 'post', 'string');

$answer =JRequest::getVar('answer', null, 'post', 'string');


// Get the model
$model = &$this->getModel('Remind');

$query = "SELECT username FROM jos_users WHERE email='".$email."' AND security='".$security."' AND answer='".$answer."'";

$db->setQuery($query);
$member_info = $db->loadObjectList();


/* print "<pre>";
print_r($member_info);


if(!empty($member_info)){
print 'if';
}
else
{
print 'else';
}exit();*/

if(($model->remindUsername($email) === false) && (empty($member_info)))
{

$message = JText::sprintf('USERNAME_REMINDER_FAILED', $model->getError());
$this->setRedirect('index.php?option=com_user&view=remind&Itemid=212&msg=Please enter a correct answer', $message);
return false;


}

$message = JText::sprintf('USERNAME_REMINDER_SUCCESS', $email);
$this->setRedirect('index.php?option=com_user&view=remind&Itemid=212&msg=Please check your mail for username details', $message);


}



function _sendMail(&$user, $password)

_________________
M.Arjun


Top
 Profile  
 
PostPosted: Fri Oct 09, 2009 10:32 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10890
Location: Ireland
Mod Note: Moved to Core Hacks Forum

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Mon Mar 14, 2011 10:56 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Mar 14, 2011 9:59 am
Posts: 1
Hello Arjun

Thanks for nice post.

Can you please tell me how can i add question and database fields?

Currently security question form display in forget username page but not comes on registration page. :'(

Can you please provide full code?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 



Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group