diff --git a/Account/Account.php b/Account/Account.php index 6c9ef5834..1c81af972 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -309,7 +309,7 @@ class Account implements ArrayableInterface, \JsonSerializable * @param int $permission Permission to check * @param int $unit Unit Unit to check (null if all are acceptable) * @param string $app App App to check (null if all are acceptable) - * @param int $module Module Module to check (null if all are acceptable) + * @param string $module Module Module to check (null if all are acceptable) * @param int $type Type (e.g. customer) (null if all are acceptable) * @param int $element (e.g. customer id) (null if all are acceptable) * @param int $component (e.g. address) (null if all are acceptable) @@ -318,7 +318,7 @@ class Account implements ArrayableInterface, \JsonSerializable * * @since 1.0.0 */ - public function hasPermission(int $permission, int $unit = null, string $app = null, int $module = null, int $type = null, $element = null, $component = null) : bool + public function hasPermission(int $permission, int $unit = null, string $app = null, string $module = null, int $type = null, $element = null, $component = null) : bool { $app = $app !== null ? strtolower($app) : $app; diff --git a/Auth/LoginReturnType.php b/Auth/LoginReturnType.php index ae26b4705..64323ac02 100644 --- a/Auth/LoginReturnType.php +++ b/Auth/LoginReturnType.php @@ -38,4 +38,5 @@ abstract class LoginReturnType extends Enum /* public */ const TIMEOUTED = -7; /* User received a timeout and can not log in until a certain date */ /* public */ const BANNED = -8; /* User is banned */ /* public */ const INACTIVE = -9; /* User is inactive */ + /* public */ const EMPTY_PASSWORD = -10; /* Empty password in database */ } diff --git a/tests/Auth/LoginReturnTypeTest.php b/tests/Auth/LoginReturnTypeTest.php index 2314ba43f..0a41d7182 100644 --- a/tests/Auth/LoginReturnTypeTest.php +++ b/tests/Auth/LoginReturnTypeTest.php @@ -21,7 +21,7 @@ class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase { public function testEnums() { - self::assertEquals(10, count(LoginReturnType::getConstants())); + self::assertEquals(11, count(LoginReturnType::getConstants())); self::assertEquals(0, LoginReturnType::OK); self::assertEquals(-1, LoginReturnType::FAILURE); self::assertEquals(-2, LoginReturnType::WRONG_PASSWORD); @@ -32,5 +32,6 @@ class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase self::assertEquals(-7, LoginReturnType::TIMEOUTED); self::assertEquals(-8, LoginReturnType::BANNED); self::assertEquals(-9, LoginReturnType::INACTIVE); + self::assertEquals(-10, LoginReturnType::EMPTY_PASSWORD); } }