Created
April 9, 2015 12:45
-
-
Save ikkez/7e927c7a795e71daa673 to your computer and use it in GitHub Desktop.
F3 Single User Basic Auth Wrap
This file contains hidden or 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 | |
/** | |
* Simple Single User Basic Auth | |
* | |
* Usage: | |
* $auth = new \BasicAuth('admin','e9bGrU8n'); | |
* if ($auth->basic()) { ... } | |
* | |
**/ | |
class BasicAuth extends Auth { | |
function __construct($user,$pass) { | |
parent::__construct('basic', array('id'=>$user, 'pw'=>$pass)); | |
} | |
protected function _basic ($id,$pw,$realm) { | |
return (bool) ($this->args['id'] == $id && $this->args['pw'] == $pw); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment