Пример #1
0
 /**
  * 
  * @param string $server
  * @param string $certificate
  * @return \FreeIPA\APIAccess\Connection
  */
 public function connection($server = null, $certificate = null)
 {
     if (!$this->_connection) {
         $this->_connection = \FreeIPA\APIAccess\Connection::getInstance($server, $certificate);
     }
     return $this->_connection;
 }
Пример #2
0
 /**
  * Login test
  * 
  * @since GIT: 0.1.0
  * @version GIT: 0.1.0
  */
 public function testLoginSecondMethod()
 {
     $ipa = \FreeIPA\APIAccess\Connection::getInstance(null, null, true);
     $ipa->setIPAServer($this->data['host']);
     $ipa->setCertificateFile($this->data['cert']);
     $auth = $ipa->authenticate($this->data['user'], $this->data['pass']);
     $this->assertEquals(true, $auth);
     $auth_info = $ipa->getAuthenticationInfo();
     $this->assertArrayHasKey('authenticate', $auth_info);
     $this->assertArrayHasKey('reason', $auth_info);
     $this->assertArrayHasKey('message', $auth_info);
     $this->assertArrayHasKey('http_code', $auth_info);
     $this->assertEquals(true, $auth_info['authenticate']);
 }