Skip to content

Commit 5fed1b8

Browse files
committed
Merge branch '4.4.0-alpha' into 4.4-dev
2 parents 83c3fb7 + f131dc9 commit 5fed1b8

File tree

139 files changed

+283
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+283
-180
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE `#__user_mfa` ADD COLUMN `tries` int NOT NULL DEFAULT 0 /** CAN FAIL **/;
2+
ALTER TABLE `#__user_mfa` ADD COLUMN `last_try` datetime /** CAN FAIL **/;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "#__user_mfa" ADD COLUMN "tries" bigint DEFAULT 0 NOT NULL /** CAN FAIL **/;
2+
ALTER TABLE "#__user_mfa" ADD COLUMN "last_try" timestamp without time zone /** CAN FAIL **/;

administrator/components/com_categories/src/View/Categories/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class HtmlView extends BaseHtmlView
8888
* The ordering list for the categories
8989
*
9090
* @var array
91-
* @since __DEPLOY_VERSION__
91+
* @since 4.4.0
9292
*/
9393
protected $ordering = [];
9494

administrator/components/com_content/src/View/Articles/HtmlView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ class HtmlView extends BaseHtmlView
8888
* Is the vote plugin enabled on the site
8989
*
9090
* @var boolean
91-
* @since __DEPLOY_VERSION__
91+
* @since 4.4.0
9292
*/
9393
protected $vote = false;
9494

9595
/**
9696
* Are hits being recorded on the site?
9797
*
9898
* @var boolean
99-
* @since __DEPLOY_VERSION__
99+
* @since 4.4.0
100100
*/
101101
protected $hits = false;
102102

administrator/components/com_privacy/src/Plugin/PrivacyPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class PrivacyPlugin extends CMSPlugin
3636
*
3737
* @var \Joomla\Database\DatabaseDriver
3838
* @since 3.9.0
39-
* @deprecated __DEPLOY_VERSION__ will be removed in 6.0 use $this->getDatabase() instead
39+
* @deprecated 4.4.0 will be removed in 6.0 use $this->getDatabase() instead
4040
*/
4141
protected $db;
4242

administrator/components/com_tags/src/View/Tags/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class HtmlView extends BaseHtmlView
8484
* The ordering list for the tags
8585
*
8686
* @var array
87-
* @since __DEPLOY_VERSION__
87+
* @since 4.4.0
8888
*/
8989
protected $ordering = [];
9090

administrator/components/com_users/config.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,30 @@
329329
default=""
330330
showon="mfaredirectonlogin:1"
331331
/>
332+
333+
<field
334+
name="mfatrycount"
335+
type="number"
336+
label="COM_USERS_CONFIG_MFATRYCOUNT_LABEL"
337+
filter="integer"
338+
min="0"
339+
max="20"
340+
step="1"
341+
default="10"
342+
validate="number"
343+
/>
344+
345+
<field
346+
name="mfatrytime"
347+
type="number"
348+
label="COM_USERS_CONFIG_MFATRYTIME_LABEL"
349+
filter="integer"
350+
min="1"
351+
max="24"
352+
step="1"
353+
default="1"
354+
validate="number"
355+
/>
332356
</fieldset>
333357

334358
<fieldset

administrator/components/com_users/src/Controller/CaptiveController.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ public function validate($cachable = false, $urlparameters = [])
153153
throw new RuntimeException(Text::_('COM_USERS_MFA_INVALID_METHOD'), 500);
154154
}
155155

156+
if (!$model->checkTryLimit($record)) {
157+
// The try limit is reached, show error and return
158+
$captiveURL = Route::_('index.php?option=com_users&view=captive&task=select', false);
159+
$message = Text::_('COM_USERS_MFA_TRY_LIMIT_REACHED');
160+
$this->setRedirect($captiveURL, $message, 'error');
161+
162+
$event = new NotifyActionLog('onComUsersCaptiveValidateTryLimitReached');
163+
$this->app->getDispatcher()->dispatch($event->getName(), $event);
164+
165+
return;
166+
}
167+
156168
// Validate the code
157169
$user = $this->app->getIdentity() ?: $this->getUserFactory()->loadUserById(0);
158170

@@ -210,6 +222,8 @@ function (bool $carry, $result) {
210222
$jNow = Date::getInstance();
211223

212224
$record->last_used = $jNow->toSql();
225+
$record->tries = 0;
226+
$record->last_try = null;
213227
$record->store();
214228

215229
// Flag the user as fully logged in

administrator/components/com_users/src/Controller/MethodController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Joomla\CMS\MVC\Controller\BaseController as BaseControllerAlias;
1919
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
2020
use Joomla\CMS\Router\Route;
21+
use Joomla\CMS\Uri\Uri;
2122
use Joomla\CMS\User\User;
2223
use Joomla\CMS\User\UserFactoryAwareInterface;
2324
use Joomla\CMS\User\UserFactoryAwareTrait;
@@ -205,7 +206,7 @@ public function regenerateBackupCodes($cachable = false, $urlparams = []): void
205206
$redirectUrl = 'index.php?option=com_users&task=method.edit&user_id=' . $userId . '&id=' . $backupCodesRecord->id;
206207
$returnURL = $this->input->getBase64('returnurl');
207208

208-
if (!empty($returnURL)) {
209+
if (!empty($returnURL) && Uri::isInternal(base64_decode($returnURL))) {
209210
$redirectUrl .= '&returnurl=' . $returnURL;
210211
}
211212

@@ -260,7 +261,7 @@ public function delete($cachable = false, $urlparams = []): void
260261
$url = Route::_('index.php?option=com_users&task=methods.display&user_id=' . $userId, false);
261262
$returnURL = $this->input->getBase64('returnurl');
262263

263-
if (!empty($returnURL)) {
264+
if (!empty($returnURL) && Uri::isInternal(base64_decode($returnURL))) {
264265
$url = base64_decode($returnURL);
265266
}
266267

@@ -291,7 +292,7 @@ public function save($cachable = false, $urlparams = []): void
291292
$url = Route::_('index.php?option=com_users&task=methods.display&user_id=' . $userId, false);
292293
$returnURL = $this->input->getBase64('returnurl');
293294

294-
if (!empty($returnURL)) {
295+
if (!empty($returnURL) && Uri::isInternal(base64_decode($returnURL))) {
295296
$url = base64_decode($returnURL);
296297
}
297298

administrator/components/com_users/src/Controller/MethodsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function disable($cachable = false, $urlparams = []): void
103103
$url = Route::_('index.php?option=com_users&task=methods.display&user_id=' . $userId, false);
104104
$returnURL = $this->input->getBase64('returnurl');
105105

106-
if (!empty($returnURL)) {
106+
if (!empty($returnURL) && Uri::isInternal(base64_decode($returnURL))) {
107107
$url = base64_decode($returnURL);
108108
}
109109

@@ -190,7 +190,7 @@ public function doNotShowThisAgain($cachable = false, $urlparams = []): void
190190
$url = Uri::base();
191191
$returnURL = $this->input->getBase64('returnurl');
192192

193-
if (!empty($returnURL)) {
193+
if (!empty($returnURL) && Uri::isInternal(base64_decode($returnURL))) {
194194
$url = base64_decode($returnURL);
195195
}
196196

0 commit comments

Comments
 (0)