first commit
This commit is contained in:
135
components/com_users/tmpl/captive/default.php
Normal file
135
components/com_users/tmpl/captive/default.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\Users\Site\Model\CaptiveModel;
|
||||
use Joomla\Component\Users\Site\View\Captive\HtmlView;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* @var HtmlView $this View object
|
||||
* @var CaptiveModel $model The model
|
||||
*/
|
||||
$model = $this->getModel();
|
||||
|
||||
$this->document->getWebAssetManager()
|
||||
->useScript('com_users.two-factor-focus');
|
||||
|
||||
?>
|
||||
<div class="users-mfa-captive card card-body">
|
||||
<h2 id="users-mfa-title">
|
||||
<?php if (!empty($this->renderOptions['help_url'])) : ?>
|
||||
<span class="float-end">
|
||||
<a href="<?php echo $this->renderOptions['help_url'] ?>"
|
||||
class="btn btn-sm btn-secondary"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="icon icon-question-sign" aria-hidden="true"></span>
|
||||
<span class="visually-hidden"><?php echo Text::_('JHELP') ?></span>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif;?>
|
||||
<?php if (!empty($this->title)) : ?>
|
||||
<?php echo $this->title ?> <small> –
|
||||
<?php endif; ?>
|
||||
<?php if (!$this->allowEntryBatching) : ?>
|
||||
<?php echo $this->escape($this->record->title) ?>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($this->getModel()->translateMethodName($this->record->method)) ?>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($this->title)) : ?>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
|
||||
<?php if ($this->renderOptions['pre_message']) : ?>
|
||||
<div class="users-mfa-captive-pre-message text-muted mb-3">
|
||||
<?php echo $this->renderOptions['pre_message'] ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_users&task=captive.validate&record_id=' . ((int) $this->record->id)) ?>"
|
||||
id="users-mfa-captive-form"
|
||||
method="post"
|
||||
class="form-horizontal"
|
||||
>
|
||||
<?php echo HTMLHelper::_('form.token') ?>
|
||||
|
||||
<div id="users-mfa-captive-form-method-fields">
|
||||
<?php if ($this->renderOptions['field_type'] == 'custom') : ?>
|
||||
<?php echo $this->renderOptions['html']; ?>
|
||||
<?php endif; ?>
|
||||
<div class="row mb-3">
|
||||
<?php if ($this->renderOptions['label']) : ?>
|
||||
<label for="users-mfa-code" class="col-sm-3 col-form-label">
|
||||
<?php echo $this->renderOptions['label'] ?>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<div class="col-sm-9 <?php echo $this->renderOptions['label'] ? '' : 'offset-sm-3' ?>">
|
||||
<?php
|
||||
$attributes = array_merge(
|
||||
[
|
||||
'type' => $this->renderOptions['input_type'],
|
||||
'name' => 'code',
|
||||
'value' => '',
|
||||
'placeholder' => $this->renderOptions['placeholder'] ?? null,
|
||||
'id' => 'users-mfa-code',
|
||||
'class' => 'form-control',
|
||||
'autocomplete' => $this->renderOptions['autocomplete'] ?? 'one-time-code'
|
||||
],
|
||||
$this->renderOptions['input_attributes']
|
||||
);
|
||||
|
||||
if (strpos($attributes['class'], 'form-control') === false) {
|
||||
$attributes['class'] .= ' form-control';
|
||||
}
|
||||
?>
|
||||
<input <?php echo ArrayHelper::toString($attributes) ?>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="users-mfa-captive-form-standard-buttons" class="row my-3">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<button class="btn btn-primary me-3 <?php echo $this->renderOptions['submit_class'] ?>"
|
||||
id="users-mfa-captive-button-submit"
|
||||
style="<?php echo $this->renderOptions['hide_submit'] ? 'display: none' : '' ?>"
|
||||
type="submit">
|
||||
<span class="<?php echo $this->renderOptions['submit_icon'] ?>" aria-hidden="true"></span>
|
||||
<?php echo Text::_($this->renderOptions['submit_text']); ?>
|
||||
</button>
|
||||
|
||||
<a href="<?php echo Route::_('index.php?option=com_users&task=user.logout&' . Factory::getApplication()->getFormToken() . '=1') ?>"
|
||||
class="btn btn-danger btn-sm" id="users-mfa-captive-button-logout">
|
||||
<span class="icon icon-lock" aria-hidden="true"></span>
|
||||
<?php echo Text::_('COM_USERS_MFA_LOGOUT'); ?>
|
||||
</a>
|
||||
|
||||
<?php if (count($this->records) > 1) : ?>
|
||||
<div id="users-mfa-captive-form-choose-another" class="my-3">
|
||||
<a href="<?php echo Route::_('index.php?option=com_users&view=captive&task=select') ?>">
|
||||
<?php echo Text::_('COM_USERS_MFA_USE_DIFFERENT_METHOD'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ($this->renderOptions['post_message']) : ?>
|
||||
<div class="users-mfa-captive-post-message">
|
||||
<?php echo $this->renderOptions['post_message'] ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
78
components/com_users/tmpl/captive/select.php
Normal file
78
components/com_users/tmpl/captive/select.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Component\Users\Site\View\Captive\HtmlView;
|
||||
|
||||
/** @var HtmlView $this */
|
||||
|
||||
$shownMethods = [];
|
||||
|
||||
?>
|
||||
<div id="com-users-select">
|
||||
<h2 id="com-users-select-heading">
|
||||
<?php echo Text::_('COM_USERS_MFA_SELECT_PAGE_HEAD'); ?>
|
||||
</h2>
|
||||
<div id="com-users-select-information">
|
||||
<p>
|
||||
<?php echo Text::_('COM_USERS_LBL_SELECT_INSTRUCTIONS'); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="com-users-select-methods p-2">
|
||||
<?php foreach ($this->records as $record) :
|
||||
if (!array_key_exists($record->method, $this->mfaMethods) && ($record->method != 'backupcodes')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$allowEntryBatching = isset($this->mfaMethods[$record->method]) ? $this->mfaMethods[$record->method]['allowEntryBatching'] : false;
|
||||
|
||||
if ($this->allowEntryBatching) {
|
||||
if ($allowEntryBatching && in_array($record->method, $shownMethods)) {
|
||||
continue;
|
||||
}
|
||||
$shownMethods[] = $record->method;
|
||||
}
|
||||
|
||||
$methodName = $this->getModel()->translateMethodName($record->method);
|
||||
?>
|
||||
<a class="com-users-method p-2 border-top border-dark bg-light d-flex flex-row flex-wrap justify-content-start align-items-center text-decoration-none gap-2 text-body"
|
||||
href="<?php echo Route::_('index.php?option=com_users&view=captive&record_id=' . $record->id)?>">
|
||||
<img src="<?php echo Uri::root() . $this->getModel()->getMethodImage($record->method) ?>"
|
||||
alt="<?php echo $this->escape(strip_tags($record->title)) ?>"
|
||||
class="com-users-method-image img-fluid" />
|
||||
<?php if (!$this->allowEntryBatching || !$allowEntryBatching) : ?>
|
||||
<span class="com-users-method-title flex-grow-1 fs-5 fw-bold">
|
||||
<?php if ($record->method === 'backupcodes') : ?>
|
||||
<?php echo $record->title ?>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($record->title) ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<small class="com-users-method-name text-muted">
|
||||
<?php echo $methodName ?>
|
||||
</small>
|
||||
<?php else : ?>
|
||||
<span class="com-users-method-title flex-grow-1 fs-5 fw-bold">
|
||||
<?php echo $methodName ?>
|
||||
</span>
|
||||
<small class="com-users-method-name text-muted">
|
||||
<?php echo $methodName ?>
|
||||
</small>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
23
components/com_users/tmpl/login/default.php
Normal file
23
components/com_users/tmpl/login/default.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/** @var \Joomla\Component\Users\Site\View\Login\HtmlView $this */
|
||||
|
||||
$cookieLogin = $this->user->get('cookieLogin');
|
||||
|
||||
if (!empty($cookieLogin) || $this->user->get('guest')) {
|
||||
// The user is not logged in or needs to provide a password.
|
||||
echo $this->loadTemplate('login');
|
||||
} else {
|
||||
// The user is already logged in.
|
||||
echo $this->loadTemplate('logout');
|
||||
}
|
||||
179
components/com_users/tmpl/login/default.xml
Normal file
179
components/com_users/tmpl/login/default.xml
Normal file
@ -0,0 +1,179 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_LOGIN_VIEW_DEFAULT_TITLE" option="COM_USERS_LOGIN_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key = "Menu_Item:_Login_Form"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_LOGIN_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
|
||||
<!-- Basic options. -->
|
||||
<fieldset name="basic" addruleprefix="Joomla\Component\Users\Site\Rule" label="COM_MENUS_BASIC_FIELDSET_LABEL">
|
||||
<fieldset name="login" label="COM_USERS_FIELD_OPTIONS_LOGIN">
|
||||
<field
|
||||
name="loginredirectchoice"
|
||||
type="radio"
|
||||
label="COM_USERS_FIELD_LOGIN_REDIRECT_CHOICE_LABEL"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="1"
|
||||
>
|
||||
<option value="0">COM_USERS_FIELD_LOGIN_URL</option>
|
||||
<option value="1">COM_USERS_FIELD_LOGIN_MENUITEM</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="login_redirect_url"
|
||||
type="text"
|
||||
label="JFIELD_LOGIN_REDIRECT_URL_LABEL"
|
||||
description="JFIELD_LOGIN_REDIRECT_URL_DESC"
|
||||
validate="LoginUniqueField"
|
||||
field="login_redirect_menuitem"
|
||||
hint="COM_USERS_FIELD_LOGIN_REDIRECT_PLACEHOLDER"
|
||||
message="COM_USERS_FIELD_LOGIN_REDIRECT_ERROR"
|
||||
showon="loginredirectchoice:0"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="login_redirect_menuitem"
|
||||
type="modal_menu"
|
||||
label="COM_USERS_FIELD_LOGIN_REDIRECTMENU_LABEL"
|
||||
description="COM_USERS_FIELD_LOGIN_REDIRECTMENU_DESC"
|
||||
disable="separator,alias,heading,url"
|
||||
showon="loginredirectchoice:1"
|
||||
select="true"
|
||||
new="true"
|
||||
edit="true"
|
||||
clear="true"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_MENU</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="logindescription_show"
|
||||
type="list"
|
||||
label="JFIELD_BASIC_LOGIN_DESCRIPTION_SHOW_LABEL"
|
||||
default="1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="login_description"
|
||||
type="textarea"
|
||||
label="JFIELD_BASIC_LOGIN_DESCRIPTION_LABEL"
|
||||
rows="3"
|
||||
cols="40"
|
||||
filter="safehtml"
|
||||
showon="logindescription_show:1"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="login_image"
|
||||
type="media"
|
||||
label="JFIELD_LOGIN_IMAGE_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="login_image_alt"
|
||||
type="text"
|
||||
label="COM_USERS_FIELD_IMAGE_ALT_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="login_image_alt_empty"
|
||||
type="checkbox"
|
||||
label="COM_USERS_FIELD_IMAGE_ALT_EMPTY_LABEL"
|
||||
description="COM_USERS_FIELD_IMAGE_ALT_EMPTY_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="logout" label="COM_USERS_FIELD_OPTIONS_LOGOUT">
|
||||
<field
|
||||
name="logoutredirectchoice"
|
||||
type="radio"
|
||||
label="COM_USERS_FIELD_LOGOUT_REDIRECT_CHOICE_LABEL"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="1"
|
||||
>
|
||||
<option value="0">COM_USERS_FIELD_LOGIN_URL</option>
|
||||
<option value="1">COM_USERS_FIELD_LOGIN_MENUITEM</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="logout_redirect_url"
|
||||
type="text"
|
||||
label="JFIELD_LOGOUT_REDIRECT_URL_LABEL"
|
||||
field="logout_redirect_menuitem"
|
||||
validate="LogoutUniqueField"
|
||||
hint="COM_USERS_FIELD_LOGIN_REDIRECT_PLACEHOLDER"
|
||||
message="COM_USERS_FIELD_LOGOUT_REDIRECT_ERROR"
|
||||
showon="logoutredirectchoice:0"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="logout_redirect_menuitem"
|
||||
type="modal_menu"
|
||||
label="COM_USERS_FIELD_LOGOUT_REDIRECTMENU_LABEL"
|
||||
description="COM_USERS_FIELD_LOGOUT_REDIRECTMENU_DESC"
|
||||
disable="separator,alias,heading,url"
|
||||
showon="logoutredirectchoice:1"
|
||||
select="true"
|
||||
new="true"
|
||||
edit="true"
|
||||
clear="true"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_MENU</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="logoutdescription_show"
|
||||
type="list"
|
||||
label="JFIELD_BASIC_LOGOUT_DESCRIPTION_SHOW_LABEL"
|
||||
default="1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="logout_description"
|
||||
type="textarea"
|
||||
label="JFIELD_BASIC_LOGOUT_DESCRIPTION_LABEL"
|
||||
rows="3"
|
||||
cols="40"
|
||||
filter="safehtml"
|
||||
showon="logoutdescription_show:1"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="logout_image"
|
||||
type="media"
|
||||
label="JFIELD_LOGOUT_IMAGE_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="logout_image_alt"
|
||||
type="text"
|
||||
label="COM_USERS_FIELD_IMAGE_ALT_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="logout_image_alt_empty"
|
||||
type="checkbox"
|
||||
label="COM_USERS_FIELD_IMAGE_ALT_EMPTY_LABEL"
|
||||
description="COM_USERS_FIELD_IMAGE_ALT_EMPTY_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
||||
129
components/com_users/tmpl/login/default_login.php
Normal file
129
components/com_users/tmpl/login/default_login.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var \Joomla\Component\Users\Site\View\Login\HtmlView $cookieLogin */
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
$usersConfig = ComponentHelper::getParams('com_users');
|
||||
|
||||
?>
|
||||
<div class="com-users-login login">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description', '')) != '') || $this->params->get('login_image') != '') : ?>
|
||||
<div class="com-users-login__description login-description">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->params->get('logindescription_show') == 1) : ?>
|
||||
<?php echo $this->params->get('login_description'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->params->get('login_image') != '') : ?>
|
||||
<?php echo HTMLHelper::_('image', $this->params->get('login_image'), empty($this->params->get('login_image_alt')) && empty($this->params->get('login_image_alt_empty')) ? false : $this->params->get('login_image_alt'), ['class' => 'com-users-login__image login-image']); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description', '')) != '') || $this->params->get('login_image') != '') : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="com-users-login__form form-validate form-horizontal well" id="com-users-login__form">
|
||||
|
||||
<fieldset>
|
||||
<?php echo $this->form->renderFieldset('credentials', ['class' => 'com-users-login__input']); ?>
|
||||
|
||||
<?php if (PluginHelper::isEnabled('system', 'remember')) : ?>
|
||||
<div class="com-users-login__remember">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" id="remember" type="checkbox" name="remember" value="yes">
|
||||
<label class="form-check-label" for="remember">
|
||||
<?php echo Text::_('COM_USERS_LOGIN_REMEMBER_ME'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($this->extraButtons as $button) :
|
||||
$dataAttributeKeys = array_filter(array_keys($button), function ($key) {
|
||||
return substr($key, 0, 5) == 'data-';
|
||||
});
|
||||
?>
|
||||
<div class="com-users-login__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="button"
|
||||
class="btn btn-secondary w-100 <?php echo $button['class'] ?? '' ?>"
|
||||
<?php foreach ($dataAttributeKeys as $key) : ?>
|
||||
<?php echo $key ?>="<?php echo $button[$key] ?>"
|
||||
<?php endforeach; ?>
|
||||
<?php if ($button['onclick']) : ?>
|
||||
onclick="<?php echo $button['onclick'] ?>"
|
||||
<?php endif; ?>
|
||||
title="<?php echo Text::_($button['label']) ?>"
|
||||
id="<?php echo $button['id'] ?>"
|
||||
>
|
||||
<?php if (!empty($button['icon'])) : ?>
|
||||
<span class="<?php echo $button['icon'] ?>"></span>
|
||||
<?php elseif (!empty($button['image'])) : ?>
|
||||
<?php echo HTMLHelper::_('image', $button['image'], Text::_($button['tooltip'] ?? ''), [
|
||||
'class' => 'icon',
|
||||
], true) ?>
|
||||
<?php elseif (!empty($button['svg'])) : ?>
|
||||
<?php echo $button['svg']; ?>
|
||||
<?php endif; ?>
|
||||
<?php echo Text::_($button['label']) ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<div class="com-users-login__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<?php echo Text::_('JLOGIN'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $return = $this->form->getValue('return', '', $this->params->get('login_redirect_url', $this->params->get('login_redirect_menuitem', ''))); ?>
|
||||
<input type="hidden" name="return" value="<?php echo base64_encode($return); ?>">
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="com-users-login__options list-group">
|
||||
<a class="com-users-login__reset list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
|
||||
<?php echo Text::_('COM_USERS_LOGIN_RESET'); ?>
|
||||
</a>
|
||||
<a class="com-users-login__remind list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
|
||||
<?php echo Text::_('COM_USERS_LOGIN_REMIND'); ?>
|
||||
</a>
|
||||
<?php if ($usersConfig->get('allowUserRegistration')) : ?>
|
||||
<a class="com-users-login__register list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=registration'); ?>">
|
||||
<?php echo Text::_('COM_USERS_LOGIN_REGISTER'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
60
components/com_users/tmpl/login/default_logout.php
Normal file
60
components/com_users/tmpl/login/default_logout.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var \Joomla\Component\Users\Site\View\Login\HtmlView $this */
|
||||
?>
|
||||
<div class="com-users-logout logout">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description', '')) != '') || $this->params->get('logout_image') != '') : ?>
|
||||
<div class="com-users-logout__description logout-description">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->params->get('logoutdescription_show') == 1) : ?>
|
||||
<?php echo $this->params->get('logout_description'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->params->get('logout_image') != '') : ?>
|
||||
<?php echo HTMLHelper::_('image', $this->params->get('logout_image'), empty($this->params->get('logout_image_alt')) && empty($this->params->get('logout_image_alt_empty')) ? false : $this->params->get('logout_image_alt'), ['class' => 'com-users-logout__image thumbnail float-end logout-image']); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description', '')) != '') || $this->params->get('logout_image') != '') : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_users&task=user.logout'); ?>" method="post" class="com-users-logout__form form-horizontal well">
|
||||
<div class="com-users-logout__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="icon-backward-2 icon-white" aria-hidden="true"></span>
|
||||
<?php echo Text::_('JLOGOUT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($this->params->get('logout_redirect_url')) : ?>
|
||||
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_url', $this->form->getValue('return', null, ''))); ?>">
|
||||
<?php else : ?>
|
||||
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_menuitem', $this->form->getValue('return', null, ''))); ?>">
|
||||
<?php endif; ?>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
39
components/com_users/tmpl/login/logout.xml
Normal file
39
components/com_users/tmpl/login/logout.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_LOGOUT_VIEW_DEFAULT_TITLE" option="COM_USERS_LOGOUT_VIEW_DEFAULT_OPTION">
|
||||
<help key = "Menu_Item:_Logout"/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_LOGOUT_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the request variables for the layout. -->
|
||||
<fields name="request">
|
||||
<fieldset name="request">
|
||||
<field
|
||||
name="task"
|
||||
type="hidden"
|
||||
default="user.menulogout"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
<fieldset name="basic" label="COM_MENUS_BASIC_FIELDSET_LABEL">
|
||||
<field
|
||||
name="logout"
|
||||
type="modal_menu"
|
||||
label="JFIELD_LOGOUT_REDIRECT_PAGE_LABEL"
|
||||
description="JFIELD_LOGOUT_REDIRECT_PAGE_DESC"
|
||||
disable="separator,alias,heading,url"
|
||||
select="true"
|
||||
new="true"
|
||||
edit="true"
|
||||
clear="true"
|
||||
>
|
||||
<option value="">JOPTION_SELECT_MENU</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
||||
77
components/com_users/tmpl/method/backupcodes.php
Normal file
77
components/com_users/tmpl/method/backupcodes.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\Users\Site\View\Method\HtmlView;
|
||||
|
||||
/** @var HtmlView $this */
|
||||
|
||||
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip');
|
||||
|
||||
$cancelURL = Route::_('index.php?option=com_users&task=methods.display&user_id=' . $this->user->id);
|
||||
|
||||
if (!empty($this->returnURL)) {
|
||||
$cancelURL = $this->escape(base64_decode($this->returnURL));
|
||||
}
|
||||
|
||||
if ($this->record->method != 'backupcodes') {
|
||||
throw new RuntimeException(Text::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||
}
|
||||
|
||||
?>
|
||||
<h2>
|
||||
<?php echo Text::_('COM_USERS_USER_BACKUPCODES') ?>
|
||||
</h2>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<?php echo Text::_('COM_USERS_USER_BACKUPCODES_DESC') ?>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped">
|
||||
<?php for ($i = 0; $i < (count($this->backupCodes) / 2); $i++) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php if (!empty($this->backupCodes[2 * $i])) : ?>
|
||||
<?php // This is a Key emoji; we can hide it from screen readers ?>
|
||||
<span aria-hidden="true">🔑</span>
|
||||
<?php echo $this->backupCodes[2 * $i] ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (!empty($this->backupCodes[1 + 2 * $i])) : ?>
|
||||
<?php // This is a Key emoji; we can hide it from screen readers ?>
|
||||
<span aria-hidden="true">🔑</span>
|
||||
<?php echo $this->backupCodes[1 + 2 * $i] ?>
|
||||
<?php endif ;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<?php echo Text::_('COM_USERS_MFA_BACKUPCODES_RESET_INFO'); ?>
|
||||
</p>
|
||||
|
||||
<a class="btn btn-danger" href="<?php echo Route::_(sprintf("index.php?option=com_users&task=method.regenerateBackupCodes&user_id=%s&%s=1%s", $this->user->id, Factory::getApplication()->getFormToken(), empty($this->returnURL) ? '' : '&returnurl=' . $this->returnURL)) ?>">
|
||||
<span class="icon icon-refresh" aria-hidden="true"></span>
|
||||
<?php echo Text::_('COM_USERS_MFA_BACKUPCODES_RESET'); ?>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo $cancelURL ?>"
|
||||
class="btn btn-secondary">
|
||||
<span class="icon icon-cancel-2 icon-ban-circle"></span>
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</a>
|
||||
181
components/com_users/tmpl/method/edit.php
Normal file
181
components/com_users/tmpl/method/edit.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\Users\Site\View\Method\HtmlView;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/** @var HtmlView $this */
|
||||
|
||||
$cancelURL = Route::_('index.php?option=com_users&task=methods.display&user_id=' . $this->user->id);
|
||||
|
||||
if (!empty($this->returnURL)) {
|
||||
$cancelURL = $this->escape(base64_decode($this->returnURL));
|
||||
}
|
||||
|
||||
$recordId = (int) $this->record->id ?? 0;
|
||||
$method = $this->record->method ?? $this->getModel()->getState('method');
|
||||
$userId = (int) $this->user->id ?? 0;
|
||||
$headingLevel = 2;
|
||||
$hideSubmit = !$this->renderOptions['show_submit'] && !$this->isEditExisting
|
||||
?>
|
||||
<div class="card card-body">
|
||||
<form action="<?php echo Route::_(sprintf("index.php?option=com_users&task=method.save&id=%d&method=%s&user_id=%d", $recordId, $method, $userId)) ?>"
|
||||
class="form form-horizontal" id="com-users-method-edit" method="post">
|
||||
<?php echo HTMLHelper::_('form.token') ?>
|
||||
<?php if (!empty($this->returnURL)) : ?>
|
||||
<input type="hidden" name="returnurl" value="<?php echo $this->escape($this->returnURL) ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($this->renderOptions['hidden_data'])) : ?>
|
||||
<?php foreach ($this->renderOptions['hidden_data'] as $key => $value) : ?>
|
||||
<input type="hidden" name="<?php echo $this->escape($key) ?>" value="<?php echo $this->escape($value) ?>">
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($this->title)) : ?>
|
||||
<?php if (!empty($this->renderOptions['help_url'])) : ?>
|
||||
<span class="float-end">
|
||||
<a href="<?php echo $this->renderOptions['help_url'] ?>"
|
||||
class="btn btn-sm btn-dark"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="icon icon-question-sign" aria-hidden="true"></span>
|
||||
<span class="visually-hidden"><?php echo Text::_('JHELP') ?></span>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif;?>
|
||||
<h<?php echo $headingLevel ?> id="com-users-method-edit-head">
|
||||
<?php echo Text::_($this->title) ?>
|
||||
</h<?php echo $headingLevel ?>>
|
||||
<?php $headingLevel++ ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label"
|
||||
for="com-users-method-edit-title">
|
||||
<?php echo Text::_('COM_USERS_MFA_EDIT_FIELD_TITLE'); ?>
|
||||
</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="com-users-method-edit-title"
|
||||
name="title"
|
||||
value="<?php echo $this->escape($this->record->title) ?>"
|
||||
aria-describedby="com-users-method-edit-help">
|
||||
<p class="form-text" id="com-users-method-edit-help">
|
||||
<?php echo $this->escape(Text::_('COM_USERS_MFA_EDIT_FIELD_TITLE_DESC')) ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="com-users-is-default-method" <?php echo $this->record->default ? 'checked="checked"' : ''; ?> name="default">
|
||||
<label class="form-check-label" for="com-users-is-default-method">
|
||||
<?php echo Text::_('COM_USERS_MFA_EDIT_FIELD_DEFAULT'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($this->renderOptions['pre_message'])) : ?>
|
||||
<div class="com-users-method-edit-pre-message text-muted mt-4 mb-3">
|
||||
<?php echo $this->renderOptions['pre_message'] ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($this->renderOptions['tabular_data'])) : ?>
|
||||
<div class="com-users-method-edit-tabular-container">
|
||||
<?php if (!empty($this->renderOptions['table_heading'])) : ?>
|
||||
<h<?php echo $headingLevel ?> class="h3 border-bottom mb-3">
|
||||
<?php echo $this->renderOptions['table_heading'] ?>
|
||||
</h<?php echo $headingLevel ?>>
|
||||
<?php endif; ?>
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<?php foreach ($this->renderOptions['tabular_data'] as $cell1 => $cell2) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $cell1 ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $cell2 ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->renderOptions['field_type'] == 'custom') : ?>
|
||||
<?php echo $this->renderOptions['html']; ?>
|
||||
<?php endif; ?>
|
||||
<div class="row mb-3 <?php echo $this->renderOptions['input_type'] === 'hidden' ? 'd-none' : '' ?>">
|
||||
<?php if ($this->renderOptions['label']) : ?>
|
||||
<label class="col-sm-3 col-form-label" for="com-users-method-code">
|
||||
<?php echo $this->renderOptions['label']; ?>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<div class="col-sm-9" <?php echo $this->renderOptions['label'] ? '' : 'offset-sm-3' ?>>
|
||||
<?php
|
||||
$attributes = array_merge(
|
||||
[
|
||||
'type' => $this->renderOptions['input_type'],
|
||||
'name' => 'code',
|
||||
'value' => $this->escape($this->renderOptions['input_value']),
|
||||
'id' => 'com-users-method-code',
|
||||
'class' => 'form-control',
|
||||
'aria-describedby' => 'com-users-method-code-help',
|
||||
],
|
||||
$this->renderOptions['input_attributes']
|
||||
);
|
||||
|
||||
if (strpos($attributes['class'], 'form-control') === false) {
|
||||
$attributes['class'] .= ' form-control';
|
||||
}
|
||||
?>
|
||||
<input <?php echo ArrayHelper::toString($attributes) ?>>
|
||||
|
||||
<p class="form-text" id="com-users-method-code-help">
|
||||
<?php echo $this->escape($this->renderOptions['placeholder']) ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<button type="submit" class="btn btn-primary me-3 <?php echo $hideSubmit ? 'd-none' : '' ?> <?php echo $this->renderOptions['submit_class'] ?>">
|
||||
<span class="<?php echo $this->renderOptions['submit_icon'] ?>" aria-hidden="true"></span>
|
||||
<?php echo Text::_($this->renderOptions['submit_text']); ?>
|
||||
</button>
|
||||
|
||||
<a href="<?php echo $cancelURL ?>"
|
||||
class="btn btn-sm btn-danger">
|
||||
<span class="icon icon-cancel-2" aria-hidden="true"></span>
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($this->renderOptions['post_message'])) : ?>
|
||||
<div class="com-users-method-edit-post-message text-muted">
|
||||
<?php echo $this->renderOptions['post_message'] ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
60
components/com_users/tmpl/methods/default.php
Normal file
60
components/com_users/tmpl/methods/default.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\Users\Site\View\Methods\HtmlView;
|
||||
|
||||
/** @var HtmlView $this */
|
||||
?>
|
||||
<div id="com-users-methods-list">
|
||||
<?php if (!$this->get('forHMVC', false)) : ?>
|
||||
<h2 id="com-users-methods-list-head">
|
||||
<?php echo Text::_('COM_USERS_MFA_LIST_PAGE_HEAD'); ?>
|
||||
</h2>
|
||||
<?php endif ?>
|
||||
|
||||
<div id="com-users-methods-reset-container" class="d-flex align-items-center border border-1 rounded-3 p-2 bg-light">
|
||||
<div id="com-users-methods-reset-message" class="flex-grow-1">
|
||||
<?php echo Text::_('COM_USERS_MFA_LIST_STATUS_' . ($this->mfaActive ? 'ON' : 'OFF')) ?>
|
||||
</div>
|
||||
<?php if ($this->mfaActive) : ?>
|
||||
<div>
|
||||
<a href="<?php echo Route::_('index.php?option=com_users&task=methods.disable&' . Factory::getApplication()->getFormToken() . '=1' . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id) ?>"
|
||||
class="btn btn-danger btn-sm">
|
||||
<?php echo Text::_('COM_USERS_MFA_LIST_REMOVEALL'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!count($this->methods)) : ?>
|
||||
<div id="com-users-methods-list-instructions" class="alert alert-info mt-2">
|
||||
<span class="icon icon-info-circle" aria-hidden="true"></span>
|
||||
<?php echo Text::_('COM_USERS_MFA_LIST_INSTRUCTIONS'); ?>
|
||||
</div>
|
||||
<?php elseif ($this->isMandatoryMFASetup) : ?>
|
||||
<div class="alert alert-info my-3">
|
||||
<h3 class="alert-heading">
|
||||
<?php echo Text::_('COM_USERS_MFA_MANDATORY_NOTICE_HEAD') ?>
|
||||
</h3>
|
||||
<p>
|
||||
<?php echo Text::_('COM_USERS_MFA_MANDATORY_NOTICE_BODY') ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php $this->setLayout('list');
|
||||
echo $this->loadTemplate(); ?>
|
||||
</div>
|
||||
50
components/com_users/tmpl/methods/firsttime.php
Normal file
50
components/com_users/tmpl/methods/firsttime.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\Users\Site\View\Methods\HtmlView;
|
||||
|
||||
/** @var HtmlView $this */
|
||||
|
||||
$headingLevel = 2;
|
||||
?>
|
||||
<div id="com-users-methods-list">
|
||||
<?php if (!$this->isAdmin) : ?>
|
||||
<h<?php echo $headingLevel ?> id="com-users-methods-list-head">
|
||||
<?php echo Text::_('COM_USERS_MFA_FIRSTTIME_PAGE_HEAD'); ?>
|
||||
</h<?php echo $headingLevel++ ?>>
|
||||
<?php endif; ?>
|
||||
<div id="com-users-methods-list-instructions" class="alert alert-info">
|
||||
<h<?php echo $headingLevel ?> class="alert-heading">
|
||||
<span class="fa fa-shield-alt" aria-hidden="true"></span>
|
||||
<?php echo Text::_('COM_USERS_MFA_FIRSTTIME_INSTRUCTIONS_HEAD'); ?>
|
||||
</h<?php echo $headingLevel ?>>
|
||||
<p>
|
||||
<?php echo Text::_('COM_USERS_MFA_FIRSTTIME_INSTRUCTIONS_WHATITDOES'); ?>
|
||||
</p>
|
||||
<a href="<?php echo Route::_(
|
||||
'index.php?option=com_users&task=methods.doNotShowThisAgain' .
|
||||
($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') .
|
||||
'&user_id=' . $this->user->id .
|
||||
'&' . Factory::getApplication()->getFormToken() . '=1'
|
||||
)?>"
|
||||
class="btn btn-danger w-100">
|
||||
<?php echo Text::_('COM_USERS_MFA_FIRSTTIME_NOTINTERESTED'); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php $this->setLayout('list');
|
||||
echo $this->loadTemplate(); ?>
|
||||
</div>
|
||||
144
components/com_users/tmpl/methods/list.php
Normal file
144
components/com_users/tmpl/methods/list.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Component\Users\Administrator\Helper\Mfa as MfaHelper;
|
||||
use Joomla\Component\Users\Site\Model\MethodsModel;
|
||||
use Joomla\Component\Users\Site\View\Methods\HtmlView;
|
||||
|
||||
/** @var HtmlView $this */
|
||||
|
||||
/** @var MethodsModel $model */
|
||||
$model = $this->getModel();
|
||||
|
||||
$this->document->getWebAssetManager()->useScript('com_users.two-factor-list');
|
||||
|
||||
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip');
|
||||
|
||||
$canAddEdit = MfaHelper::canAddEditMethod($this->user);
|
||||
$canDelete = MfaHelper::canDeleteMethod($this->user);
|
||||
?>
|
||||
<div id="com-users-methods-list-container">
|
||||
<?php foreach ($this->methods as $methodName => $method) :
|
||||
$methodClass = 'com-users-methods-list-method-name-' . htmlentities($method['name'])
|
||||
. ($this->defaultMethod == $methodName ? ' com-users-methods-list-method-default' : '');
|
||||
?>
|
||||
<div class="com-users-methods-list-method <?php echo $methodClass?> mx-1 my-3 card <?php echo count($method['active']) ? 'border-secondary' : '' ?>">
|
||||
<div class="com-users-methods-list-method-header card-header <?php echo count($method['active']) ? 'border-secondary bg-secondary text-white' : '' ?> d-flex flex-wrap align-items-center gap-2">
|
||||
<div class="com-users-methods-list-method-image pt-1 px-3 pb-2 bg-light rounded-2">
|
||||
<img src="<?php echo Uri::root() . $method['image'] ?>"
|
||||
alt="<?php echo $this->escape($method['display']) ?>"
|
||||
class="img-fluid"
|
||||
>
|
||||
</div>
|
||||
<div class="com-users-methods-list-method-title flex-grow-1 d-flex flex-column">
|
||||
<h2 class="h4 p-0 m-0 d-flex gap-3 align-items-center">
|
||||
<span class="me-1 flex-grow-1">
|
||||
<?php echo $method['display'] ?>
|
||||
</span>
|
||||
<?php if ($this->defaultMethod == $methodName) : ?>
|
||||
<span id="com-users-methods-list-method-default-tag" class="badge bg-info me-1 fs-6">
|
||||
<?php echo Text::_('COM_USERS_MFA_LIST_DEFAULTTAG') ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="com-users-methods-list-method-records-container card-body">
|
||||
<div class="com-users-methods-list-method-info my-1 pb-1 small text-muted">
|
||||
<?php echo $method['shortinfo'] ?>
|
||||
</div>
|
||||
|
||||
<?php if (count($method['active'])) : ?>
|
||||
<div class="com-users-methods-list-method-records pt-2 my-2">
|
||||
<?php foreach ($method['active'] as $record) : ?>
|
||||
<div class="com-users-methods-list-method-record d-flex flex-row flex-wrap justify-content-start border-top py-2">
|
||||
<div class="com-users-methods-list-method-record-info flex-grow-1 d-flex flex-column align-items-start gap-1">
|
||||
<?php if ($methodName === 'backupcodes') : ?>
|
||||
<?php if ($canAddEdit) : ?>
|
||||
<div class="alert alert-info mt-1 w-100">
|
||||
<?php echo Text::sprintf('COM_USERS_MFA_BACKUPCODES_PRINT_PROMPT_HEAD', Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id)) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<h3 class="com-users-methods-list-method-record-title-container mb-1 fs-5">
|
||||
<?php if ($record->default) : ?>
|
||||
<span id="com-users-methods-list-method-default-badge-small"
|
||||
class="text-warning me-1 hasTooltip"
|
||||
title="<?php echo $this->escape(Text::_('COM_USERS_MFA_LIST_DEFAULTTAG')) ?>">
|
||||
<span class="icon icon-star" aria-hidden="true"></span>
|
||||
<span class="visually-hidden"><?php echo $this->escape(Text::_('COM_USERS_MFA_LIST_DEFAULTTAG')) ?></span>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<span class="com-users-methods-list-method-record-title fw-bold">
|
||||
<?php echo $this->escape($record->title); ?>
|
||||
</span>
|
||||
</h3>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="com-users-methods-list-method-record-lastused my-1 d-flex flex-row flex-wrap justify-content-start gap-5 text-muted small w-100">
|
||||
<span class="com-users-methods-list-method-record-createdon">
|
||||
<?php echo Text::sprintf('COM_USERS_MFA_LBL_CREATEDON', $model->formatRelative($record->created_on)) ?>
|
||||
</span>
|
||||
<span class="com-users-methods-list-method-record-lastused-date">
|
||||
<?php echo Text::sprintf('COM_USERS_MFA_LBL_LASTUSED', $model->formatRelative($record->last_used)) ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ($methodName !== 'backupcodes' && ($canAddEdit || $canDelete)) : ?>
|
||||
<div class="com-users-methods-list-method-record-actions my-2 d-flex flex-row flex-wrap justify-content-center align-content-center align-items-start">
|
||||
<?php if ($canAddEdit) : ?>
|
||||
<a class="com-users-methods-list-method-record-edit btn btn-secondary btn-sm mx-1 hasTooltip"
|
||||
href="<?php echo Route::_('index.php?option=com_users&task=method.edit&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id)?>"
|
||||
title="<?php echo Text::_('JACTION_EDIT') ?> <?php echo $this->escape($record->title); ?>">
|
||||
<span class="icon icon-pencil" aria-hidden="true"></span>
|
||||
<span class="visually-hidden"><?php echo Text::_('JACTION_EDIT') ?> <?php echo $this->escape($record->title); ?></span>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($method['canDisable'] && $canDelete) : ?>
|
||||
<a class="com-users-methods-list-method-record-delete btn btn-danger btn-sm mx-1 hasTooltip"
|
||||
href="<?php echo Route::_('index.php?option=com_users&task=method.delete&id=' . (int) $record->id . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id . '&' . Factory::getApplication()->getFormToken() . '=1')?>"
|
||||
title="<?php echo Text::_('JACTION_DELETE') ?> <?php echo $this->escape($record->title); ?>">
|
||||
<span class="icon icon-trash" aria-hidden="true"></span>
|
||||
<span class="visually-hidden"><?php echo Text::_('JACTION_DELETE') ?> <?php echo $this->escape($record->title); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($canAddEdit && (empty($method['active']) || $method['allowMultiple'])) : ?>
|
||||
<div class="com-users-methods-list-method-addnew-container border-top pt-2">
|
||||
<a href="<?php echo Route::_('index.php?option=com_users&task=method.add&method=' . $this->escape(urlencode($method['name'])) . ($this->returnURL ? '&returnurl=' . $this->escape(urlencode($this->returnURL)) : '') . '&user_id=' . $this->user->id)?>"
|
||||
class="com-users-methods-list-method-addnew btn btn-outline-primary btn-sm"
|
||||
>
|
||||
<span class="icon-plus-2" aria-hidden="true"></span>
|
||||
<?php echo Text::sprintf('COM_USERS_MFA_ADD_AUTHENTICATOR_OF_TYPE', $method['display']) ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
39
components/com_users/tmpl/profile/default.php
Normal file
39
components/com_users/tmpl/profile/default.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
?>
|
||||
<div class="com-users-profile profile">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->getCurrentUser()->id == $this->data->id) : ?>
|
||||
<ul class="com-users-profile__edit btn-toolbar float-end">
|
||||
<li class="btn-group">
|
||||
<a class="btn btn-primary" href="<?php echo Route::_('index.php?option=com_users&task=profile.edit&user_id=' . (int) $this->data->id); ?>">
|
||||
<span class="icon-user-edit" aria-hidden="true"></span> <?php echo Text::_('COM_USERS_EDIT_PROFILE'); ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $this->loadTemplate('core'); ?>
|
||||
<?php echo $this->loadTemplate('params'); ?>
|
||||
<?php echo $this->loadTemplate('custom'); ?>
|
||||
</div>
|
||||
11
components/com_users/tmpl/profile/default.xml
Normal file
11
components/com_users/tmpl/profile/default.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_PROFILE_VIEW_DEFAULT_TITLE" option="COM_USERS_PROFILE_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key = "Menu_Item:_User_Profile"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_PROFILE_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
53
components/com_users/tmpl/profile/default_core.php
Normal file
53
components/com_users/tmpl/profile/default_core.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
?>
|
||||
<fieldset id="users-profile-core" class="com-users-profile__core">
|
||||
<legend>
|
||||
<?php echo Text::_('COM_USERS_PROFILE_CORE_LEGEND'); ?>
|
||||
</legend>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
<?php echo Text::_('COM_USERS_PROFILE_NAME_LABEL'); ?>
|
||||
</dt>
|
||||
<dd>
|
||||
<?php echo $this->escape($this->data->name); ?>
|
||||
</dd>
|
||||
<dt>
|
||||
<?php echo Text::_('COM_USERS_PROFILE_USERNAME_LABEL'); ?>
|
||||
</dt>
|
||||
<dd>
|
||||
<?php echo $this->escape($this->data->username); ?>
|
||||
</dd>
|
||||
<dt>
|
||||
<?php echo Text::_('COM_USERS_PROFILE_REGISTERED_DATE_LABEL'); ?>
|
||||
</dt>
|
||||
<dd>
|
||||
<?php echo HTMLHelper::_('date', $this->data->registerDate, Text::_('DATE_FORMAT_LC1')); ?>
|
||||
</dd>
|
||||
<dt>
|
||||
<?php echo Text::_('COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL'); ?>
|
||||
</dt>
|
||||
<?php if ($this->data->lastvisitDate !== null) : ?>
|
||||
<dd>
|
||||
<?php echo HTMLHelper::_('date', $this->data->lastvisitDate, Text::_('DATE_FORMAT_LC1')); ?>
|
||||
</dd>
|
||||
<?php else : ?>
|
||||
<dd>
|
||||
<?php echo Text::_('COM_USERS_PROFILE_NEVER_VISITED'); ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
75
components/com_users/tmpl/profile/default_custom.php
Normal file
75
components/com_users/tmpl/profile/default_custom.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$fieldsets = $this->form->getFieldsets();
|
||||
|
||||
if (isset($fieldsets['core'])) {
|
||||
unset($fieldsets['core']);
|
||||
}
|
||||
|
||||
if (isset($fieldsets['params'])) {
|
||||
unset($fieldsets['params']);
|
||||
}
|
||||
|
||||
$tmp = $this->data->jcfields ?? [];
|
||||
$customFields = [];
|
||||
|
||||
foreach ($tmp as $customField) {
|
||||
$customFields[$customField->name] = $customField;
|
||||
}
|
||||
|
||||
unset($tmp);
|
||||
|
||||
?>
|
||||
<?php foreach ($fieldsets as $group => $fieldset) : ?>
|
||||
<?php $fields = $this->form->getFieldset($group); ?>
|
||||
<?php if (count($fields)) : ?>
|
||||
<fieldset id="users-profile-custom-<?php echo $group; ?>" class="com-users-profile__custom users-profile-custom-<?php echo $group; ?>">
|
||||
<?php if (isset($fieldset->label) && ($legend = trim(Text::_($fieldset->label))) !== '') : ?>
|
||||
<legend><?php echo $legend; ?></legend>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($fieldset->description) && trim($fieldset->description)) : ?>
|
||||
<p><?php echo $this->escape(Text::_($fieldset->description)); ?></p>
|
||||
<?php endif; ?>
|
||||
<dl class="dl-horizontal">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php // Correct the field name so that subform custom fields show up. ?>
|
||||
<?php if ($field->type === 'Subform' && $field->fieldname === 'row') : ?>
|
||||
<?php preg_match("/jform\[com_fields]\[(.*)]/", $field->name, $matches); ?>
|
||||
<?php $field->fieldname = $matches[1]; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (!$field->hidden && $field->type !== 'Spacer') : ?>
|
||||
<dt>
|
||||
<?php echo $field->title; ?>
|
||||
</dt>
|
||||
<dd>
|
||||
<?php if (array_key_exists($field->fieldname, $customFields)) : ?>
|
||||
<?php echo strlen($customFields[$field->fieldname]->value) ? $customFields[$field->fieldname]->value : Text::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
|
||||
<?php elseif (HTMLHelper::isRegistered('users.' . $field->id)) : ?>
|
||||
<?php echo HTMLHelper::_('users.' . $field->id, $field->value); ?>
|
||||
<?php elseif (HTMLHelper::isRegistered('users.' . $field->fieldname)) : ?>
|
||||
<?php echo HTMLHelper::_('users.' . $field->fieldname, $field->value); ?>
|
||||
<?php elseif (HTMLHelper::isRegistered('users.' . $field->type)) : ?>
|
||||
<?php echo HTMLHelper::_('users.' . $field->type, $field->value); ?>
|
||||
<?php else : ?>
|
||||
<?php echo HTMLHelper::_('users.value', $field->value); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
42
components/com_users/tmpl/profile/default_params.php
Normal file
42
components/com_users/tmpl/profile/default_params.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
?>
|
||||
<?php $fields = $this->form->getFieldset('params'); ?>
|
||||
<?php if (count($fields)) : ?>
|
||||
<fieldset id="users-profile-custom" class="com-users-profile__params">
|
||||
<legend><?php echo Text::_('COM_USERS_SETTINGS_FIELDSET_LABEL'); ?></legend>
|
||||
<dl class="dl-horizontal">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php if (!$field->hidden) : ?>
|
||||
<dt>
|
||||
<?php echo $field->title; ?>
|
||||
</dt>
|
||||
<dd>
|
||||
<?php if (HTMLHelper::isRegistered('users.' . $field->id)) : ?>
|
||||
<?php echo HTMLHelper::_('users.' . $field->id, $field->value); ?>
|
||||
<?php elseif (HTMLHelper::isRegistered('users.' . $field->fieldname)) : ?>
|
||||
<?php echo HTMLHelper::_('users.' . $field->fieldname, $field->value); ?>
|
||||
<?php elseif (HTMLHelper::isRegistered('users.' . $field->type)) : ?>
|
||||
<?php echo HTMLHelper::_('users.' . $field->type, $field->value); ?>
|
||||
<?php else : ?>
|
||||
<?php echo HTMLHelper::_('users.value', $field->value); ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
87
components/com_users/tmpl/profile/edit.php
Normal file
87
components/com_users/tmpl/profile/edit.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\Component\Users\Site\View\Profile\HtmlView $this */
|
||||
|
||||
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip');
|
||||
|
||||
// Load user_profile plugin language
|
||||
$lang = $this->getLanguage();
|
||||
$lang->load('plg_user_profile', JPATH_ADMINISTRATOR);
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
?>
|
||||
<div class="com-users-profile__edit profile-edit">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="member-profile" action="<?php echo Route::_('index.php?option=com_users'); ?>" method="post" class="com-users-profile__edit-form form-validate form-horizontal well" enctype="multipart/form-data">
|
||||
<?php // Iterate through the form fieldsets and display each one. ?>
|
||||
<?php foreach ($this->form->getFieldsets() as $group => $fieldset) : ?>
|
||||
<?php $fields = $this->form->getFieldset($group); ?>
|
||||
<?php if (count($fields)) : ?>
|
||||
<fieldset>
|
||||
<?php // If the fieldset has a label set, display it as the legend. ?>
|
||||
<?php if (isset($fieldset->label)) : ?>
|
||||
<legend>
|
||||
<?php echo Text::_($fieldset->label); ?>
|
||||
</legend>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($fieldset->description) && trim($fieldset->description)) : ?>
|
||||
<p>
|
||||
<?php echo $this->escape(Text::_($fieldset->description)); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php // Iterate through the fields in the set and display them. ?>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php echo $field->renderField(); ?>
|
||||
<?php endforeach; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ($this->mfaConfigurationUI) : ?>
|
||||
<fieldset class="com-users-profile__multifactor">
|
||||
<legend><?php echo Text::_('COM_USERS_PROFILE_MULTIFACTOR_AUTH'); ?></legend>
|
||||
<?php echo $this->mfaConfigurationUI ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="com-users-profile__edit-submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary validate" name="task" value="profile.save">
|
||||
<span class="icon-check" aria-hidden="true"></span>
|
||||
<?php echo Text::_('JSAVE'); ?>
|
||||
</button>
|
||||
<button type="submit" class="btn btn-danger" name="task" value="profile.cancel" formnovalidate>
|
||||
<span class="icon-times" aria-hidden="true"></span>
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<input type="hidden" name="option" value="com_users">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
11
components/com_users/tmpl/profile/edit.xml
Normal file
11
components/com_users/tmpl/profile/edit.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_PROFILE_EDIT_DEFAULT_TITLE" option="COM_USERS_PROFILE_EDIT_DEFAULT_OPTION">
|
||||
<help
|
||||
key = "Menu_Item:_Edit_User_Profile"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_PROFILE_EDIT_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
20
components/com_users/tmpl/registration/complete.php
Normal file
20
components/com_users/tmpl/registration/complete.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
<div class="com-users-registration-complete registration-complete">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
61
components/com_users/tmpl/registration/default.php
Normal file
61
components/com_users/tmpl/registration/default.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
?>
|
||||
<div class="com-users-registration registration">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="member-registration" action="<?php echo Route::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="com-users-registration__form form-validate" enctype="multipart/form-data">
|
||||
<?php // Iterate through the form fieldsets and display each one. ?>
|
||||
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
|
||||
<?php if ($fieldset->name === 'captcha' && $this->captchaEnabled) : ?>
|
||||
<?php continue; ?>
|
||||
<?php endif; ?>
|
||||
<?php $fields = $this->form->getFieldset($fieldset->name); ?>
|
||||
<?php if (count($fields)) : ?>
|
||||
<fieldset>
|
||||
<?php // If the fieldset has a label set, display it as the legend. ?>
|
||||
<?php if (isset($fieldset->label)) : ?>
|
||||
<legend><?php echo Text::_($fieldset->label); ?></legend>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->form->renderFieldset($fieldset->name); ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($this->captchaEnabled) : ?>
|
||||
<?php echo $this->form->renderFieldset('captcha'); ?>
|
||||
<?php endif; ?>
|
||||
<div class="com-users-registration__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="com-users-registration__register btn btn-primary validate">
|
||||
<?php echo Text::_('JREGISTER'); ?>
|
||||
</button>
|
||||
<input type="hidden" name="option" value="com_users">
|
||||
<input type="hidden" name="task" value="registration.register">
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
11
components/com_users/tmpl/registration/default.xml
Normal file
11
components/com_users/tmpl/registration/default.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_REGISTRATION_VIEW_DEFAULT_TITLE" option="COM_USERS_REGISTRATION_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key="Menu_Item:_Registration_Form"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_REGISTRATION_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
49
components/com_users/tmpl/remind/default.php
Normal file
49
components/com_users/tmpl/remind/default.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
?>
|
||||
<div class="com-users-remind remind">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form id="user-registration" action="<?php echo Route::_('index.php?option=com_users&task=remind.remind'); ?>" method="post" class="com-users-remind__form form-validate form-horizontal well">
|
||||
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
|
||||
<fieldset>
|
||||
<?php if (isset($fieldset->label)) : ?>
|
||||
<legend><?php echo Text::_($fieldset->label); ?></legend>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->form->renderFieldset($fieldset->name); ?>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
<div class="com-users-remind__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary validate">
|
||||
<?php echo Text::_('JSUBMIT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
11
components/com_users/tmpl/remind/default.xml
Normal file
11
components/com_users/tmpl/remind/default.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_REMIND_VIEW_DEFAULT_TITLE" option="COM_USERS_REMIND_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key = "Menu_Item:_Username_Reminder_Request"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_REMIND_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
49
components/com_users/tmpl/reset/complete.php
Normal file
49
components/com_users/tmpl/reset/complete.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
?>
|
||||
<div class="com-users-reset-complete reset-complete">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_users&task=reset.complete'); ?>" method="post" class="com-users-reset-complete__form form-validate form-horizontal well">
|
||||
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
|
||||
<fieldset>
|
||||
<?php if (isset($fieldset->label)) : ?>
|
||||
<legend><?php echo Text::_($fieldset->label); ?></legend>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->form->renderFieldset($fieldset->name); ?>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
<div class="com-users-reset-complete__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary validate">
|
||||
<?php echo Text::_('JSUBMIT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
49
components/com_users/tmpl/reset/confirm.php
Normal file
49
components/com_users/tmpl/reset/confirm.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
?>
|
||||
<div class="com-users-reset-confirm reset-confirm">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_users&task=reset.confirm'); ?>" method="post" class="com-users-reset-confirm__form form-validate form-horizontal well">
|
||||
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
|
||||
<fieldset>
|
||||
<?php if (isset($fieldset->label)) : ?>
|
||||
<legend><?php echo Text::_($fieldset->label); ?></legend>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->form->renderFieldset($fieldset->name); ?>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
<div class="com-users-reset-confirm__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary validate">
|
||||
<?php echo Text::_('JSUBMIT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
49
components/com_users/tmpl/reset/default.php
Normal file
49
components/com_users/tmpl/reset/default.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
?>
|
||||
<div class="com-users-reset reset">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form id="user-registration" action="<?php echo Route::_('index.php?option=com_users&task=reset.request'); ?>" method="post" class="com-users-reset__form form-validate form-horizontal well">
|
||||
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
|
||||
<fieldset>
|
||||
<?php if (isset($fieldset->label)) : ?>
|
||||
<legend><?php echo Text::_($fieldset->label); ?></legend>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->form->renderFieldset($fieldset->name); ?>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
<div class="com-users-reset__submit control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary validate">
|
||||
<?php echo Text::_('JSUBMIT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
11
components/com_users/tmpl/reset/default.xml
Normal file
11
components/com_users/tmpl/reset/default.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_USERS_RESET_VIEW_DEFAULT_TITLE" option="COM_USERS_RESET_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key="Menu_Item:_Password_Reset"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_USERS_RESET_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
</metadata>
|
||||
Reference in New Issue
Block a user