Created
January 6, 2019 22:11
-
-
Save ProdigyView/88033d93d22d1c8462ff7182feabd08b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function validateToken(string $token, string $privileges = '', array $tokens, int $current_time) : bool { | |
if(!isset($tokens[$token])) { | |
return false; | |
} | |
if(hasExpired($token, $tokens, $current_time)) { | |
return false; | |
} | |
return checkPrivileges($token,$privileges, $tokens); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment