Source for file remind.php
Documentation is available at remind.php
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Remind model class for Users.
* Method to get the username remind request form.
* @param array $data An optional array of data for the form to interogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
* @return JForm A JForm object on success, false on failure
public function getForm($data =
array(), $loadData =
true)
$form =
$this->loadForm('com_users.remind', 'remind', array('control' =>
'jform', 'load_data' =>
$loadData));
* Override preprocessForm to load the user plugin group instead of content.
* @param object A form object.
* @param mixed The data expected for the form.
* @throws Exception if there is an error in the form event.
protected function preprocessForm(JForm $form, $data, $group =
'user')
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
// Get the application object.
$params =
$app->getParams('com_users');
if ($data instanceof
Exception)
// Check the validation results.
// Get the validation messages from the form.
foreach ($form->getErrors() as $formError)
$this->setError($formError->getMessage());
// Find the user id for the given email address.
$query =
$db->getQuery(true)
->from($db->quoteName('#__users'))
->where($db->quoteName('email') .
' = ' .
$db->quote($data['email']));
$user =
$db->loadObject();
catch
(RuntimeException $e)
// Make sure the user isn't blocked.
// Assemble the login link.
$itemid =
$itemid !==
null ?
'&Itemid=' .
$itemid :
'';
$link =
'index.php?option=com_users&view=login' .
$itemid;
$mode =
$config->get('force_ssl', 0) ==
2 ?
1 : -
1;
// Put together the email template data.
$data['fromname'] =
$config->get('fromname');
$data['mailfrom'] =
$config->get('mailfrom');
$data['sitename'] =
$config->get('sitename');
$data['link_text'] =
JRoute::_($link, false, $mode);
$data['link_html'] =
JRoute::_($link, true, $mode);
'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT',
'COM_USERS_EMAIL_USERNAME_REMINDER_BODY',
// Send the password reset request email.
$return =
JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $user->email, $subject, $body);
Documentation generated on Tue, 19 Nov 2013 15:11:47 +0100 by phpDocumentor 1.4.3