/**
  * Regression test for File_Passwd.staticAuth method
  * @access public
  */
 function teststaticAuth()
 {
     foreach ($GLOBALS['_EXT_'] as $ext) {
         $pwfile = 'passwd.' . strToLower($ext) . '.txt';
         $option = $ext == 'Authdigest' ? 'realm1' : ($ext == 'Smb' ? 'nt' : 'des');
         $error = File_Passwd::staticAuth($ext, $pwfile, 'mike', 123, $option);
         $this->assertTrue($error);
         if (PEAR::isError($error)) {
             echo "File_Passwd_{$ext}::staticAuth() " . $error->getMessage() . "\n";
         }
     }
 }
 /**
  * Authenticate an user
  *
  * @param   string  username
  * @param   string  password
  * @return  mixed   boolean|PEAR_Error
  */
 function fetchData($user, $pass)
 {
     return File_Passwd::staticAuth('Cvs', $this->pwfile, $user, $pass);
 }
Beispiel #3
0
 /**
  * Authenticate an user
  *
  * @param   string  username
  * @param   string  password
  * @return  mixed   boolean|PEAR_Error
  */
 function fetchData($user, $pass)
 {
     $this->log('Auth_Container_File::fetchData() called.', AUTH_LOG_DEBUG);
     return File_Passwd::staticAuth($this->options['type'], $this->pwfile, $user, $pass);
 }
 function teststaticAuth()
 {
     $this->assertTrue(true === File_Passwd::staticAuth('authbasic', 'passwd.authbasic.txt', 'mike', 123, 'des'));
     $this->assertTrue(false === File_Passwd::staticAuth('authbasic', 'passwd.authbasic.txt', 'mike', 'abc', 'des'));
     $this->assertFalse(File_Passwd::staticAuth('authbasic', 'passwd.authbasic.txt', 'nonexist', 'asd', 'des'));
 }
 function teststaticAuth()
 {
     $this->assertTrue(true === File_Passwd::staticAuth('authdigest', 'passwd.authdigest.txt', 'mike', 123, 'realm1'));
     $this->assertTrue(false === File_Passwd::staticAuth('authdigest', 'passwd.authdigest.txt', 'mike', 'abc', 'realm1'));
     $this->assertFalse(File_Passwd::staticAuth('authdigest', 'passwd.authdigest.txt', 'nonexist', 'asd', 'norealm'));
 }
 function teststaticAuth()
 {
     $this->assertTrue(true === File_Passwd::staticAuth('Custom', 'passwd.custom.txt', 'mike', 'mikespass', array(array('File_Passwd', 'crypt_plain'), '|')));
     $this->assertTrue(false === File_Passwd::staticAuth('Custom', 'passwd.custom.txt', 'mike', 'abc', array(array('File_Passwd', 'crypt_plain'), '|')));
     $this->assertTrue(PEAR::isError(File_Passwd::staticAuth('Custom', 'passwd.custom.txt', 'mike', 'mikespass')));
 }
 function teststaticAuth()
 {
     $this->assertTrue(true === File_Passwd::staticAuth('cvs', 'passwd.cvs.txt', 'mike', 123));
     $this->assertTrue(false === File_Passwd::staticAuth('cvs', 'passwd.cvs.txt', 'mike', 'abc'));
     $this->assertFalse(File_Passwd::staticAuth('cvs', 'passwd.cvs.txt', 'nonexist', 'asd'));
 }