/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function preExecute() { $this->checkBasicAuth(); } protected function sendHeadersAndExit () { } protected function checkBasicAuth() { if($this->getUser()->isAuthenticated() && $this->getUser()->hasAttribute('user_id')) return true; { $this->sendHeadersAndExit(); } $group = ParameterPeer::get('contributeur_groupe_id'); if ( !$member = MemberPeer::authCheckTrickSpace($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $group) ) { $this->sendHeadersAndExit(); } else { $this->getUser()->setAttribute('member_id', $member->getId()); $this->getUser()->setAuthenticated(true); } }