Source for file profile.php
Documentation is available at profile.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
require_once JPATH_ADMINISTRATOR .
'/components/com_users/models/user.php';
* @package Joomla.Administrator
* Method to get the record 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_admin.profile', 'profile', array('control' =>
'jform', 'load_data' =>
$loadData));
// Check for username compliance and parameter set
$usernameCompliant =
true;
$this->setState('user.username.compliant', $isUsernameCompliant);
if (!JComponentHelper::getParams('com_users')->get('change_login_name') &&
$isUsernameCompliant)
$form->setFieldAttribute('username', 'required', 'false');
$form->setFieldAttribute('username', 'readonly', 'true');
$form->setFieldAttribute('username', 'description', 'COM_ADMIN_USER_FIELD_NOCHANGE_USERNAME_DESC');
* Method to get the data that should be injected in the form.
* @return mixed The data for the form.
// Check the session for previously entered form data.
// Load the users plugins.
* Method to get a single record.
* @param integer $pk The id of the primary key.
* @return mixed Object on success, false on failure.
public function getItem($pk =
null)
return parent::getItem($user->get('id'));
* Method to save the form data.
* @param array $data The form data.
* @return boolean True on success.
public function save($data)
unset
($data['sendEmail']);
// Unset the username if it should not be overwritten
$username =
$data['username'];
$isUsernameCompliant =
$this->getState('user.username.compliant');
if (!JComponentHelper::getParams('com_users')->get('change_login_name') &&
$isUsernameCompliant)
unset
($data['username']);
Documentation generated on Tue, 19 Nov 2013 15:11:18 +0100 by phpDocumentor 1.4.3