$auth->authenticate('user', array('password' => 'pass'), false)
);
}
+
+ /* /\** */
+ /* * Test group based login allow implemention. */
+ /* * */
+ /* * @return NULL */
+ /* *\/ */
+ /* public function testLoginAllow() */
+ /* { */
+ /* global $conf; */
+ /* $conf['kolab']['server']['allow_group'] = 'group2@example.org'; */
+ /* $conf['kolab']['server']['deny_group'] = null; */
+
+ /* $this->markTestSkipped(); */
+ /* $server = &$this->prepareEmptyKolabServer(); */
+ /* $result = $server->add($this->provideBasicUserOne()); */
+ /* $this->assertNoError($result); */
+ /* $result = $server->add($this->provideBasicUserTwo()); */
+ /* $this->assertNoError($result); */
+ /* $groups = $this->validGroups(); */
+ /* foreach ($groups as $group) { */
+ /* $result = $server->add($group[0]); */
+ /* $this->assertNoError($result); */
+ /* } */
+
+ /* $session = Horde_Kolab_Session::singleton( */
+ /* 'wrobel', */
+ /* array('password' => 'none'), */
+ /* true */
+ /* ); */
+
+ /* $this->assertNoError($session->auth); */
+ /* $this->assertEquals('wrobel@example.org', $session->user_mail); */
+
+ /* try { */
+ /* $session = Horde_Kolab_Session::singleton( */
+ /* 'test', */
+ /* array('password' => 'test'), */
+ /* true */
+ /* ); */
+ /* } catch (Horde_Kolab_Session_Exception $e) { */
+ /* $this->assertError( */
+ /* $e, 'You are no member of a group that may login on this server.' */
+ /* ); */
+ /* } */
+ /* // FIXME: Ensure that the session gets overwritten */
+ /* //$this->assertTrue(empty($session->user_mail)); */
+ /* } */
+
+ /* /\** */
+ /* * Test group based login deny implemention. */
+ /* * */
+ /* * @return NULL */
+ /* *\/ */
+ /* public function testLoginDeny() */
+ /* { */
+ /* global $conf; */
+ /* $conf['kolab']['server']['deny_group'] = 'group2@example.org'; */
+ /* unset($conf['kolab']['server']['allow_group']); */
+
+ /* $this->markTestSkipped(); */
+ /* $server = &$this->prepareEmptyKolabServer(); */
+ /* $result = $server->add($this->provideBasicUserOne()); */
+ /* $this->assertNoError($result); */
+ /* $result = $server->add($this->provideBasicUserTwo()); */
+ /* $this->assertNoError($result); */
+ /* $groups = $this->validGroups(); */
+ /* foreach ($groups as $group) { */
+ /* $result = $server->add($group[0]); */
+ /* $this->assertNoError($result); */
+ /* } */
+
+ /* $session = Horde_Kolab_Session::singleton( */
+ /* 'test', */
+ /* array('password' => 'test'), */
+ /* true */
+ /* ); */
+
+ /* $this->assertNoError($session->auth); */
+ /* $this->assertEquals('test@example.org', $session->user_mail); */
+
+ /* try { */
+ /* $session = Horde_Kolab_Session::singleton( */
+ /* 'wrobel', */
+ /* array('password' => 'none'), */
+ /* true */
+ /* ); */
+ /* } catch (Horde_Kolab_Session_Exception $e) { */
+ /* $this->assertError( */
+ /* $e, 'You are member of a group that may not login on this server.' */
+ /* ); */
+ /* } */
+ /* // FIXME: Ensure that the session gets overwritten */
+ /* //$this->assertTrue(empty($session->user_mail)); */
+ /* } */
}
class Horde_Auth_Kolab_Dummy extends Horde_Auth_Kolab
extends Horde_Kolab_Session_SessionTestCase
{
/**
- * Setup function.
- *
- * @return NULL.
- */
- protected function setUp()
- {
- $this->markTestIncomplete('Needs to be fixed');
- }
-
- /**
* Test class construction.
*
* @return NULL
$this->assertEquals('', $session->freebusy_server);
}
- /**
- * Test group based login allow implemention.
- *
- * @return NULL
- */
- public function testLoginAllow()
- {
- global $conf;
- $conf['kolab']['server']['allow_group'] = 'group2@example.org';
- $conf['kolab']['server']['deny_group'] = null;
-
- $this->markTestSkipped();
- $server = &$this->prepareEmptyKolabServer();
- $result = $server->add($this->provideBasicUserOne());
- $this->assertNoError($result);
- $result = $server->add($this->provideBasicUserTwo());
- $this->assertNoError($result);
- $groups = $this->validGroups();
- foreach ($groups as $group) {
- $result = $server->add($group[0]);
- $this->assertNoError($result);
- }
-
- $session = Horde_Kolab_Session::singleton(
- 'wrobel',
- array('password' => 'none'),
- true
- );
-
- $this->assertNoError($session->auth);
- $this->assertEquals('wrobel@example.org', $session->user_mail);
-
- try {
- $session = Horde_Kolab_Session::singleton(
- 'test',
- array('password' => 'test'),
- true
- );
- } catch (Horde_Kolab_Session_Exception $e) {
- $this->assertError(
- $e, 'You are no member of a group that may login on this server.'
- );
- }
- // FIXME: Ensure that the session gets overwritten
- //$this->assertTrue(empty($session->user_mail));
- }
-
- /**
- * Test group based login deny implemention.
- *
- * @return NULL
- */
- public function testLoginDeny()
- {
- global $conf;
- $conf['kolab']['server']['deny_group'] = 'group2@example.org';
- unset($conf['kolab']['server']['allow_group']);
-
- $this->markTestSkipped();
- $server = &$this->prepareEmptyKolabServer();
- $result = $server->add($this->provideBasicUserOne());
- $this->assertNoError($result);
- $result = $server->add($this->provideBasicUserTwo());
- $this->assertNoError($result);
- $groups = $this->validGroups();
- foreach ($groups as $group) {
- $result = $server->add($group[0]);
- $this->assertNoError($result);
- }
-
- $session = Horde_Kolab_Session::singleton(
- 'test',
- array('password' => 'test'),
- true
- );
-
- $this->assertNoError($session->auth);
- $this->assertEquals('test@example.org', $session->user_mail);
-
- try {
- $session = Horde_Kolab_Session::singleton(
- 'wrobel',
- array('password' => 'none'),
- true
- );
- } catch (Horde_Kolab_Session_Exception $e) {
- $this->assertError(
- $e, 'You are member of a group that may not login on this server.'
- );
- }
- // FIXME: Ensure that the session gets overwritten
- //$this->assertTrue(empty($session->user_mail));
- }
}