예제 #1
0
 public function testGuestUserAccountAccess()
 {
     $user = $this->auth->getCredentials('john', 'pa$$');
     $this->assertFalse($this->acl->isAllowed($user->role, App_Resources::ADMIN_SECTION));
     $this->assertTrue($this->acl->isAllowed($user->role, App_Resources::ACCOUNT_FREE));
     $this->assertFalse($this->acl->isAllowed($user->role, App_Resources::ACCOUNT_PAID));
     $this->assertTrue($this->acl->isAllowed($user->role, App_Resources::PUBLICPAGE));
 }
예제 #2
0
 /**
  * Incerca sa efectueze autentificarea
  */
 public function identificareAction(){
     
 	if($this->getRequest()->isPost()){
 		$auth = new App_Auth_Authenticator();
 		if($auth->getCredentials($this->_getParam('username'),$this->_getParam('password')))
 		{
             // User autentificat
 			$this->_redirect('/');
 		}
 		else
 		{
             $this->_redirect('/autentificare/login');
 			echo "Utilizatorul <b>".$this->_getParam('username')."</b> cu parola <b>".$this->_getParam('password')."</b> a esuat autentificarea . ";
 		} 
 	}        
 }
예제 #3
0
 public function testCanDetectValidUserLogin()
 {
     $this->assertTrue($this->auth->getCredentials($this->regularUser, $this->regularPass) instanceof stdClass);
 }