Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
88b1f4f
Restore com_admin profile view
SharkyKZ Jan 9, 2020
a0cbf6e
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jan 20, 2020
bfe5c1b
Restore language strings
SharkyKZ Jan 20, 2020
c87ff58
Remove help site field
SharkyKZ Jan 20, 2020
0db0188
Simplify layout
SharkyKZ Jan 20, 2020
8e6202a
Line length
SharkyKZ Jan 20, 2020
c0ed5f9
Add return URL
SharkyKZ Jan 20, 2020
6ada37f
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jan 21, 2020
406dfe3
Fix redirects
SharkyKZ Jan 21, 2020
333dcf9
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ May 22, 2020
25f0836
Move to src directory
SharkyKZ May 22, 2020
1090da9
Correct link
SharkyKZ May 22, 2020
4ed8a91
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ May 27, 2020
11def1e
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ May 28, 2020
5a9b25f
Fix TFA
SharkyKZ May 28, 2020
5e4a61d
Add back com_admin.profile context
SharkyKZ May 28, 2020
907882c
CS
SharkyKZ May 28, 2020
f67eaa2
CS
SharkyKZ May 28, 2020
0962a33
CS
SharkyKZ May 28, 2020
da295c1
Use com_users form
SharkyKZ May 28, 2020
7228688
Restore string
SharkyKZ May 28, 2020
f62f63b
Revert "Restore string"
SharkyKZ May 29, 2020
d57531c
Revert "Use com_users form"
SharkyKZ May 29, 2020
aeb13ee
Use com_admin form
SharkyKZ May 29, 2020
099bbf8
Map com_admin.profile context
SharkyKZ May 29, 2020
c8648bf
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ May 29, 2020
902f545
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ May 31, 2020
276cc88
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jun 1, 2020
336bfe7
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jun 2, 2020
766657a
Missing strings
SharkyKZ Jun 2, 2020
a5b6729
Rename strings
SharkyKZ Jun 2, 2020
444be62
Missing string
SharkyKZ Jun 2, 2020
cb6a904
Alpha sort
SharkyKZ Jun 2, 2020
af4a85e
TFA switcher
SharkyKZ Jun 2, 2020
7b70895
Cleanup
SharkyKZ Jun 2, 2020
182856a
Add password meter
SharkyKZ Jun 2, 2020
3c7f806
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jun 2, 2020
5f70302
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jun 5, 2020
81f273c
Merge remote-tracking branch 'upstream/4.0-dev' into j4/com_admin
SharkyKZ Jun 18, 2020
e9b959c
Remove unused string
SharkyKZ Jun 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions administrator/components/com_admin/forms/profile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset
name="user_details"
label="COM_ADMIN_PROFILE_FIELDSET_USER_DETAILS_LABEL"
>
<field
name="name"
type="text"
label="COM_ADMIN_PROFILE_HEADING_NAME"
required="true"
size="30"
/>

<field
name="username"
type="text"
label="COM_ADMIN_PROFILE_FIELD_USERNAME_LABEL"
required="true"
size="30"
/>

<field
name="password"
type="password"
label="JGLOBAL_PASSWORD"
autocomplete="new-password"
class="validate-password-strength"
filter="raw"
validate="password"
strengthmeter="true"
force="on"
size="30"
/>

<field
name="password2"
type="password"
label="COM_ADMIN_PROFILE_FIELD_PASSWORD2_LABEL"
autocomplete="new-password"
class="validate-passwordExtra"
filter="raw"
message="COM_ADMIN_PROFILE_FIELD_PASSWORD1_MESSAGE"
size="30"
validate="equals"
field="password"
/>

<field
name="email"
type="email"
label="JGLOBAL_EMAIL"
class="validate-email"
required="true"
size="30"
validate="email"
/>

<field
name="registerDate"
type="calendar"
label="COM_ADMIN_PROFILE_FIELD_REGISTERDATE_LABEL"
class="readonly"
readonly="true"
translateformat="true"
showtime="true"
size="22"
filter="user_utc"
/>

<field
name="lastvisitDate"
type="calendar"
label="COM_ADMIN_PROFILE_FIELD_LASTVISIT_LABEL"
class="readonly"
readonly="true"
translateformat="true"
showtime="true"
size="22"
filter="user_utc"
/>

<field
name="id"
type="number"
label="JGLOBAL_FIELD_ID_LABEL"
class="readonly"
default="0"
readonly="true"
filter="unset"
/>

</fieldset>

<fields name="params">

<fieldset
name="settings"
label="COM_ADMIN_PROFILE_FIELDSET_SETTINGS_LABEL"
>
<field
name="admin_style"
type="templatestyle"
label="COM_ADMIN_PROFILE_FIELD_BACKEND_TEMPLATE_LABEL"
client="administrator"
filter="uint"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>

<field
name="admin_language"
type="language"
label="COM_ADMIN_PROFILE_FIELD_BACKEND_LANGUAGE_LABEL"
client="administrator"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>

<field
name="language"
type="language"
label="COM_ADMIN_PROFILE_FIELD_FRONTEND_LANGUAGE_LABEL"
client="site"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>

<field
name="editor"
type="plugins"
label="COM_ADMIN_PROFILE_FIELD_EDITOR_LABEL"
folder="editors"
useaccess="true"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>

<field
name="timezone"
type="timezone"
label="COM_ADMIN_PROFILE_FIELD_TIMEZONE_LABEL"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>
</fieldset>
</fields>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Admin\Administrator\Controller;

\defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;

/**
* User profile controller class.
*
* @since 1.6
*/
class ProfileController extends FormController
{
/**
* Method to check if you can edit a record.
*
* Extended classes can override this if necessary.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = [], $key = 'id')
{
return isset($data['id']) && $data['id'] == $this->app->getIdentity()->id;
}

/**
* Overrides parent save method to check the submitted passwords match.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 3.2
*/
public function save($key = null, $urlVar = null)
{
$result = parent::save();

if ($this->getTask() !== 'apply')
{
$return = base64_decode($this->input->get('return', '', 'BASE64'));

if ($return !== '' && Uri::isInternal($return))
{
// Redirect to return URL.
$this->setRedirect(Route::_($return, false));
}
else
{
// Redirect to the main page.
$this->setRedirect(Route::_('index.php', false));
}
}

return $result;
}

/**
* Method to cancel an edit.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since 1.6
*/
public function cancel($key = null)
{
$result = parent::cancel($key);
$return = base64_decode($this->input->get('return', '', 'BASE64'));

if ($return !== '' && Uri::isInternal($return))
{
// Redirect to return URL.
$this->setRedirect(Route::_($return, false));
}
else
{
// Redirect to the main page.
$this->setRedirect(Route::_('index.php', false));
}

return $result;
}
}
Loading