Skip to content

Commit

Permalink
closes #746
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jun 7, 2023
1 parent 4124b97 commit 05223cd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

## 4.9.1

+ [#746](https://github.com/luyadev/luya-module-admin/issues/746) Remove WhichBrowser/Parser because of missing PHP 8.2 support.
+ [#745](https://github.com/luyadev/luya-module-admin/pull/745) Fixed bug in exception when image could not find the file.

## 4.9.0 (8. March 2023)
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"yiisoft/yii2-queue": "^2.0",
"flowjs/flow-php-server": "^1.0",
"bizley/jwt": "^3.3",
"whichbrowser/parser": "^2.0",
"robthree/twofactorauth": "^1.7"
},
"require-dev": {
Expand Down
7 changes: 2 additions & 5 deletions src/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use luya\helpers\Html;
use luya\helpers\Url;
use luya\validators\StrengthValidator;
use WhichBrowser\Parser;
use Yii;
use yii\base\InvalidArgumentException;
use yii\helpers\Json;
Expand Down Expand Up @@ -436,23 +435,21 @@ public function getDevices()
*/
public static function generateTokenEmail($token, $title, $text)
{
$result = new Parser(Yii::$app->request->userAgent);
return Yii::$app->view->render('@admin/views/mail/_token.php', [
'url' => Url::domain(Url::base(true)),
'token' => $token,
'browser' => $result->toString(),
'browser' => "-",
'title' => $title,
'text' => $text,
]);
}

public static function generateResetEmail($url, $title, $text)
{
$result = new Parser(Yii::$app->request->userAgent);
return Yii::$app->view->render('@admin/views/mail/_reset.php', [
'url' => Url::domain(Url::base(true)),
'token' => Html::a(Module::t('reset_email_btn_label'), $url),
'browser' => $result->toString(),
'browser' => "-",
'title' => $title,
'text' => $text,
]);
Expand Down
3 changes: 1 addition & 2 deletions src/models/UserDevice.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace luya\admin\models;

use WhichBrowser\Parser;
use Yii;
use yii\behaviors\TimestampBehavior;

Expand Down Expand Up @@ -44,7 +43,7 @@ public static function generateUserAgentChecksum($userAgent)

public function getUserAgentName()
{
return (new Parser($this->user_agent))->toString();
return '-';
}

public function getIsCurrentDevice()
Expand Down
4 changes: 0 additions & 4 deletions src/views/aws/userhistorysummary/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use luya\admin\models\StorageFile;
use luya\admin\Module;
use luya\helpers\Html;
use WhichBrowser\Parser;
use yii\helpers\VarDumper;

/**
Expand Down Expand Up @@ -104,9 +103,6 @@
<td><?= Yii::$app->formatter->asRelativeTime($login->timestamp_create); ?></td>
<td class="text-right">
<?= $login->ip; ?>
<?php if (!empty($login->user_agent)): ?>
<span class="badge badge-secondary"><?= (new Parser($login->user_agent))->toString(); ?></span>
<?php endif; ?>
</td>
<?php ?>
</tr>
Expand Down

0 comments on commit 05223cd

Please sign in to comment.