Advertisement
napolux

Slim Example

Jul 23rd, 2012
1,620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. require_once 'libs/Slim/Extras/HttpDigestAuth.php';
  2.  
  3. class HttpDigestAuthCustom extends HttpDigestAuth {
  4.        
  5.     protected $route;
  6.    
  7.     public function __construct($username, $password, $realm = 'Protected Area', $route = '') {
  8.         $this->route = $route;
  9.         parent::__construct($username, $password, $realm);        
  10.     }
  11.    
  12.     public function call() {
  13.         if(strpos($this->app->request()->getPathInfo(), $this->route) !== false) {
  14.             parent::call();
  15.             return;
  16.         }
  17.         $this->next->call();
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement