diff --git a/src/Auth/LoginAttempts.php b/src/Auth/LoginAttempts.php index f1dba96..bc40fc9 100644 --- a/src/Auth/LoginAttempts.php +++ b/src/Auth/LoginAttempts.php @@ -1,6 +1,7 @@ created + self::LIFETIME; } - public function getExpiresAt(): bool { + public function getExpiresAt(): DateTime { return DateTime::fromUnixTimeSeconds($this->created + self::LIFETIME); } diff --git a/src/Users/Roles.php b/src/Users/Roles.php index 5983012..84fc093 100644 --- a/src/Users/Roles.php +++ b/src/Users/Roles.php @@ -37,7 +37,7 @@ class Roles { $query .= ' WHERE role_id IN (SELECT role_id FROM msz_users_roles WHERE user_id = ?)'; } if($hasHidden) - $query .= sprintf(' %s role_hidden %s 0', ++$args > 0 ? 'AND' : 'WHERE', $hidden ? '=' : '<>'); + $query .= sprintf(' %s role_hidden %s 0', ++$args > 1 ? 'AND' : 'WHERE', $hidden ? '=' : '<>'); $args = 0; $stmt = $this->cache->get($query); diff --git a/src/Users/Users.php b/src/Users/Users.php index 1a39704..f84ea73 100644 --- a/src/Users/Users.php +++ b/src/Users/Users.php @@ -7,11 +7,11 @@ use Index\Data\DbTools; use Index\Data\IDbConnection; class Users { - private IDbConnection $dbConn; + //private IDbConnection $dbConn; private DbStatementCache $cache; public function __construct(IDbConnection $dbConn) { - $this->dbConn = $dbConn; + //$this->dbConn = $dbConn; $this->cache = new DbStatementCache($dbConn); }