Browse Source

Check if the auth module supports check_password() method before using it

Benjamin Collet 1 year ago
parent
commit
44c6a04b61
1 changed files with 2 additions and 2 deletions
  1. 2 2
      classes/pref/prefs.php

+ 2 - 2
classes/pref/prefs.php

@@ -922,7 +922,7 @@ class Pref_Prefs extends Handler_Protected {
 	static function isdefaultpassword() {
 		$authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]);
 
-		if ($authenticator && $authenticator->check_password($_SESSION["uid"], "password")) {
+		if ($authenticator && function_exists($authenticator->check_password) $authenticator->check_password($_SESSION["uid"], "password")) {
 			return true;
 		}
 
@@ -1125,4 +1125,4 @@ class Pref_Prefs extends Handler_Protected {
 
 		return "";
 	}
-}
+}