From 8b2d19b30c1eb433602eac85ba40151b5f980a17 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Mon, 21 Mar 2022 16:47:57 +0800 Subject: [PATCH] * Fix bug #20580. --- module/common/model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index 443cc5c95d..a280ff37a4 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -2198,7 +2198,12 @@ EOD; $method = $this->app->rawMethod; } - if(!empty($this->app->user->modifyPassword) and (($module != 'user' or $method != 'deny') and ($module != 'my' or $method != 'changepassword') and ($module != 'user' or $method != 'logout'))) return print(js::locate(helper::createLink('my', 'changepassword', '', '', true))); + $beforeValidMethods = array( + 'user' => array('deny', 'logout'), + 'my' => array('changepassword'), + 'message' => array('ajaxgetmessage'), + ); + if(!empty($this->app->user->modifyPassword) and (!isset($beforeValidMethods[$module]) or !in_array($method, $beforeValidMethods[$module]))) return print(js::locate(helper::createLink('my', 'changepassword', '', '', true))); if($this->isOpenMethod($module, $method)) return true; if(!$this->loadModel('user')->isLogon() and $this->server->php_auth_user) $this->user->identifyByPhpAuth(); if(!$this->loadModel('user')->isLogon() and $this->cookie->za) $this->user->identifyByCookie();