Skip to content

Commit

Permalink
Merge branch '4.2-dev' into 4.2-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDerumigny committed Feb 27, 2023
2 parents 5d9aa4a + 2a8b6bb commit b3c45bf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion administrator/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ JGLOBAL_STAGE_PROCESS="Process"
JGLOBAL_START_PUBLISH_AFTER_FINISH="Item start publishing date must be before finish publishing date"
JGLOBAL_SUBSLIDER_BLOG_EXTENDED_LABEL="The option below gives the ability to include articles from subcategories in the Blog layout."
JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL="If a field is left blank, global settings will be used."
JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are also used when you select one of the category links, on the first page and/or thereafter, unless they are changed for a specific menu item."
JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are used when you select one of the category links, on the first page and/or thereafter, unless they are changed for a specific menu item."
JGLOBAL_TITLE="Title"
JGLOBAL_TITLE_ALPHABETICAL="Title Alphabetical"
JGLOBAL_TITLE_ASC="Title ascending"
Expand Down
2 changes: 1 addition & 1 deletion api/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ JGLOBAL_STAGE_PROCESS="Process"
JGLOBAL_START_PUBLISH_AFTER_FINISH="Item start publishing date must be before finish publishing date"
JGLOBAL_SUBSLIDER_BLOG_EXTENDED_LABEL="The option below gives the ability to include articles from subcategories in the Blog layout."
JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL="If a field is left blank, global settings will be used."
JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are also used when you select one of the category links, on the first page and/or thereafter, unless they are changed for a specific menu item."
JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are used when you select one of the category links, on the first page and/or thereafter, unless they are changed for a specific menu item."
JGLOBAL_TITLE="Title"
JGLOBAL_TITLE_ALPHABETICAL="Title Alphabetical"
JGLOBAL_TITLE_ASC="Title ascending"
Expand Down
29 changes: 19 additions & 10 deletions plugins/authentication/joomla/joomla.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?php

/**
* @package Joomla.Plugin
* @subpackage Authentication.joomla
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
*/
* @package Joomla.Plugin
* @subpackage Authentication.joomla
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
*/

use Joomla\CMS\Authentication\Authentication;
use Joomla\CMS\Helper\AuthenticationHelper;
Expand Down Expand Up @@ -87,14 +86,24 @@ public function onUserAuthenticate($credentials, $options, &$response)
$response->email = $user->email;
$response->fullname = $user->name;

// Set default status response to success
$_status = Authentication::STATUS_SUCCESS;
$_errorMessage = '';

if ($this->app->isClient('administrator')) {
$response->language = $user->getParam('admin_language');
} else {
$response->language = $user->getParam('language');

if ($this->app->get('offline') && !$user->authorise('core.login.offline')) {
// User do not have access in offline mode
$_status = Authentication::STATUS_FAILURE;
$_errorMessage = Text::_('JLIB_LOGIN_DENIED');
}
}

$response->status = Authentication::STATUS_SUCCESS;
$response->error_message = '';
$response->status = $_status;
$response->error_message = $_errorMessage;
} else {
// Invalid password
$response->status = Authentication::STATUS_FAILURE;
Expand Down

0 comments on commit b3c45bf

Please sign in to comment.