- md5
- ee0a750b9b8904cb0d9294fb9dbb85d5
- sha1
- a1e2e847d4eb5e9b0608ed4610608f7092cebbd3
- sha256
- e400ca4189aeaca7faf4374788dd019038d1bd85eeaddd87c0d62bf9f8ea4181
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* @package Joomla.Administrator
* @subpackage com_users
* @since 1.5
*/
class UsersViewUser extends JViewLegacy
{
protected $form;
protected $item;
protected $grouplist;
protected $groups;
protected $state;
/**
* Display the view
*
* @since 1.5
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->grouplist = $this->get('Groups');
$this->groups = $this->get('AssignedGroups');
$this->state = $this->get('State');
$this->tfaform = $this->get('Twofactorform');
$this->otpConfig = $this->get('otpConfig');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->form->setValue('password', null);
$this->form->setValue('password2', null);
parent::display($tpl);
$this->addToolbar();
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$canDo = JHelperContent::getActions('com_users');
$isNew = ($this->item->id == 0);
$isProfile = $this->item->id == $user->id;
JToolbarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_USER_TITLE' : ($isProfile ? 'COM_USERS_VIEW_EDIT_PROFILE_TITLE' : 'COM_USERS_VIEW_EDIT_USER_TITLE')), 'user ' . ($isNew ? 'user-add' : ($isProfile ? 'user-profile' : 'user-edit')));
if ($canDo->get('core.edit') || $canDo->get('core.create'))
{
JToolbarHelper::apply('user.apply');
JToolbarHelper::save('user.save');
}
if ($canDo->get('core.create') && $canDo->get('core.manage'))
{
JToolbarHelper::save2new('user.save2new');
}
if (empty($this->item->id))
{
JToolbarHelper::cancel('user.cancel');
}
else
{
JToolbarHelper::cancel('user.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_USERS_USER_MANAGER_EDIT');
}
}
The same content is in 5 releases, Joomla 3.3.2 to 3.3.6. See them all, or every version of this file.