2016-07-22 11:46:29 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-28 10:13:00 +03:00
|
|
|
* @copyright Copyright (c) 2016, Roger Szabo (roger.szabo@web.de)
|
2016-07-22 11:46:29 +03:00
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
|
|
|
* @author Julius Härtl <jus@bitgrid.net>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
|
|
|
* @author root <root@localhost.localdomain>
|
|
|
|
* @author Vinicius Cubas Brand <vinicius@eita.org.br>
|
2017-11-02 15:40:38 +03:00
|
|
|
*
|
2016-07-28 10:13:00 +03:00
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
2016-07-22 11:46:29 +03:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2016-07-28 10:13:00 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2016-07-22 11:46:29 +03:00
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
2016-07-28 10:13:00 +03:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2016-07-22 11:46:29 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCA\User_LDAP\Tests;
|
|
|
|
|
2019-02-24 10:54:43 +03:00
|
|
|
use OC\User\Manager;
|
2019-06-19 14:39:15 +03:00
|
|
|
use OCA\User_LDAP\Access;
|
|
|
|
use OCA\User_LDAP\Connection;
|
2017-11-02 15:40:38 +03:00
|
|
|
use OCA\User_LDAP\IGroupLDAP;
|
2019-11-22 22:52:10 +03:00
|
|
|
use OCA\User_LDAP\IUserLDAP;
|
2019-11-20 16:22:00 +03:00
|
|
|
use OCP\EventDispatcher\IEventDispatcher;
|
2017-11-02 15:40:38 +03:00
|
|
|
use OCP\IConfig;
|
2016-07-22 11:46:29 +03:00
|
|
|
use OCP\IServerContainer;
|
2019-02-24 10:54:43 +03:00
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
2016-07-22 11:46:29 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class LDAPProviderTest
|
|
|
|
*
|
|
|
|
* @group DB
|
|
|
|
*
|
|
|
|
* @package OCA\User_LDAP\Tests
|
|
|
|
*/
|
|
|
|
class LDAPProviderTest extends \Test\TestCase {
|
|
|
|
|
2019-11-21 18:40:38 +03:00
|
|
|
protected function setUp(): void {
|
2016-07-22 11:46:29 +03:00
|
|
|
parent::setUp();
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
private function getServerMock(IUserLDAP $userBackend, IGroupLDAP $groupBackend) {
|
2016-07-22 11:46:29 +03:00
|
|
|
$server = $this->getMockBuilder('OC\Server')
|
2017-11-02 15:40:38 +03:00
|
|
|
->setMethods(['getUserManager', 'getBackends', 'getGroupManager'])
|
2016-07-22 11:46:29 +03:00
|
|
|
->setConstructorArgs(['', new \OC\Config(\OC::$configDir)])
|
|
|
|
->getMock();
|
|
|
|
$server->expects($this->at(1))
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('getBackends')
|
|
|
|
->willReturn([$userBackend]);
|
2017-11-02 15:40:38 +03:00
|
|
|
$server->expects($this->any())
|
|
|
|
->method('getUserManager')
|
|
|
|
->willReturn($this->getUserManagerMock($userBackend));
|
|
|
|
$server->expects($this->any())
|
|
|
|
->method('getGroupManager')
|
|
|
|
->willReturn($this->getGroupManagerMock($groupBackend));
|
2016-07-22 11:46:29 +03:00
|
|
|
$server->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
2019-02-24 10:54:43 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
return $server;
|
|
|
|
}
|
2017-11-02 15:40:38 +03:00
|
|
|
|
|
|
|
private function getUserManagerMock(IUserLDAP $userBackend) {
|
2019-02-24 10:54:43 +03:00
|
|
|
$userManager = $this->getMockBuilder(Manager::class)
|
2017-11-02 15:40:38 +03:00
|
|
|
->setMethods(['getBackends'])
|
2019-11-20 16:22:00 +03:00
|
|
|
->setConstructorArgs([
|
|
|
|
$this->createMock(IConfig::class),
|
|
|
|
$this->createMock(EventDispatcherInterface::class),
|
|
|
|
$this->createMock(IEventDispatcher::class)
|
|
|
|
])
|
2017-11-02 15:40:38 +03:00
|
|
|
->getMock();
|
|
|
|
$userManager->expects($this->any())
|
|
|
|
->method('getBackends')
|
|
|
|
->willReturn([$userBackend]);
|
|
|
|
return $userManager;
|
|
|
|
}
|
2019-02-24 10:54:43 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
private function getGroupManagerMock(IGroupLDAP $groupBackend) {
|
|
|
|
$groupManager = $this->getMockBuilder('OC\Group\Manager')
|
|
|
|
->setMethods(['getBackends'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$groupManager->expects($this->any())
|
|
|
|
->method('getBackends')
|
|
|
|
->willReturn([$groupBackend]);
|
|
|
|
return $groupManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function getDefaultGroupBackendMock() {
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
2019-11-20 16:22:00 +03:00
|
|
|
->disableOriginalConstructor()
|
2017-11-02 15:40:38 +03:00
|
|
|
->getMock();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
return $groupBackend;
|
|
|
|
}
|
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
private function getLDAPProvider(IServerContainer $serverContainer) {
|
|
|
|
$factory = new \OCA\User_LDAP\LDAPProviderFactory($serverContainer);
|
|
|
|
return $factory->getLDAPProvider();
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetUserDNUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getUserDN('nonexisting_user');
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetUserDN() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'username2dn'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->at(0))
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->at(2))
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('username2dn')
|
|
|
|
->willReturn('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org');
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
2019-11-20 16:22:00 +03:00
|
|
|
$this->assertEquals('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org',
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider->getUserDN('existing_user'));
|
|
|
|
}
|
|
|
|
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
public function testGetGroupDNGroupIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('Group id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend->expects($this->any())->method('groupExists')->willReturn(false);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getGroupDN('nonexisting_group');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetGroupDN() {
|
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'username2dn'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists', 'getLDAPAccess', 'groupname2dn'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend->expects($this->at(0))
|
|
|
|
->method('groupExists')
|
|
|
|
->willReturn(true);
|
|
|
|
$groupBackend->expects($this->at(2))
|
|
|
|
->method('groupname2dn')
|
|
|
|
->willReturn('cn=existing_group,ou=Are Sufficient To,ou=Test,dc=example,dc=org');
|
|
|
|
$groupBackend->expects($this->any())
|
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertEquals('cn=existing_group,ou=Are Sufficient To,ou=Test,dc=example,dc=org',
|
|
|
|
$ldapProvider->getGroupDN('existing_group'));
|
2019-11-20 16:22:00 +03:00
|
|
|
}
|
2017-11-02 15:40:38 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetUserName() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['dn2UserName'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('dn2UserName')
|
|
|
|
->willReturn('existing_user');
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
2019-11-20 16:22:00 +03:00
|
|
|
$this->assertEquals('existing_user',
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider->getUserName('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testDNasBaseParameter() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods([])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-10-10 11:18:18 +03:00
|
|
|
$helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertEquals(
|
2019-11-20 16:22:00 +03:00
|
|
|
$helper->DNasBaseParameter('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'),
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider->DNasBaseParameter('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSanitizeDN() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods([])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-10-10 11:18:18 +03:00
|
|
|
$helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertEquals(
|
2019-11-20 16:22:00 +03:00
|
|
|
$helper->sanitizeDN('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'),
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider->sanitizeDN('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetLDAPConnectionUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getLDAPConnection('nonexisting_user');
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetLDAPConnection() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists', 'getNewLDAPConnection'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('getNewLDAPConnection')
|
|
|
|
->willReturn(true);
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertTrue($ldapProvider->getLDAPConnection('existing_user'));
|
|
|
|
}
|
2017-11-02 15:40:38 +03:00
|
|
|
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
public function testGetGroupLDAPConnectionGroupIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('Group id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend->expects($this->any())->method('groupExists')->willReturn(false);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getGroupLDAPConnection('nonexisting_group');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetGroupLDAPConnection() {
|
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists','getNewLDAPConnection'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend->expects($this->any())
|
|
|
|
->method('groupExists')
|
|
|
|
->willReturn(true);
|
|
|
|
|
|
|
|
$groupBackend->expects($this->any())
|
|
|
|
->method('getNewLDAPConnection')
|
|
|
|
->willReturn(true);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertTrue($ldapProvider->getGroupLDAPConnection('existing_group'));
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetLDAPBaseUsersUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getLDAPBaseUsers('nonexisting_user');
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetLDAPBaseUsers() {
|
2019-06-19 14:39:15 +03:00
|
|
|
$bases = [
|
|
|
|
'ou=users,ou=foobar,dc=example,dc=org',
|
|
|
|
'ou=users,ou=barfoo,dc=example,dc=org',
|
|
|
|
];
|
|
|
|
$dn = 'uid=malik,' . $bases[1];
|
|
|
|
|
|
|
|
$connection = $this->createMock(Connection::class);
|
|
|
|
$connection->expects($this->any())
|
|
|
|
->method('__get')
|
|
|
|
->willReturnCallback(function ($key) use ($bases) {
|
|
|
|
switch($key) {
|
|
|
|
case 'ldapBaseUsers':
|
|
|
|
return $bases;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
|
|
|
|
$access = $this->createMock(Access::class);
|
|
|
|
$access->expects($this->any())
|
|
|
|
->method('getConnection')
|
|
|
|
->willReturn($connection);
|
|
|
|
$access->expects($this->exactly(2))
|
|
|
|
->method('isDNPartOfBase')
|
|
|
|
->willReturnOnConsecutiveCalls(false, true);
|
|
|
|
$access->expects($this->atLeastOnce())
|
|
|
|
->method('username2dn')
|
|
|
|
->willReturn($dn);
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2019-06-19 14:39:15 +03:00
|
|
|
$userBackend->expects($this->atLeastOnce())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2019-06-19 14:39:15 +03:00
|
|
|
->method('getLDAPAccess')
|
|
|
|
->willReturn($access);
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
2019-06-19 14:39:15 +03:00
|
|
|
$this->assertEquals($bases[1], $ldapProvider->getLDAPBaseUsers('existing_user'));
|
2016-07-22 11:46:29 +03:00
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetLDAPBaseGroupsUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getLDAPBaseGroups('nonexisting_user');
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testGetLDAPBaseGroups() {
|
2019-06-19 14:39:15 +03:00
|
|
|
$bases = [
|
|
|
|
'ou=groupd,ou=foobar,dc=example,dc=org',
|
|
|
|
'ou=groups,ou=barfoo,dc=example,dc=org',
|
|
|
|
];
|
|
|
|
|
|
|
|
$connection = $this->createMock(Connection::class);
|
|
|
|
$connection->expects($this->any())
|
|
|
|
->method('__get')
|
|
|
|
->willReturnCallback(function ($key) use ($bases) {
|
|
|
|
switch($key) {
|
|
|
|
case 'ldapBaseGroups':
|
|
|
|
return $bases;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
|
|
|
|
$access = $this->createMock(Access::class);
|
|
|
|
$access->expects($this->any())
|
|
|
|
->method('getConnection')
|
|
|
|
->willReturn($connection);
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2019-06-19 14:39:15 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2019-06-19 14:39:15 +03:00
|
|
|
->method('getLDAPAccess')
|
|
|
|
->willReturn($access);
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
2019-06-19 14:39:15 +03:00
|
|
|
$this->assertEquals($bases[0], $ldapProvider->getLDAPBaseGroups('existing_user'));
|
2016-07-22 11:46:29 +03:00
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testClearCacheUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->clearCache('nonexisting_user');
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testClearCache() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'clearCache'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->at(0))
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->at(3))
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('clearCache')
|
|
|
|
->willReturn(true);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->clearCache('existing_user');
|
2018-01-25 13:23:12 +03:00
|
|
|
$this->addToAssertionCount(1);
|
2016-07-22 11:46:29 +03:00
|
|
|
}
|
2017-11-03 01:19:03 +03:00
|
|
|
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-03 01:19:03 +03:00
|
|
|
public function testClearGroupCacheGroupIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('Group id not found in LDAP');
|
|
|
|
|
2017-11-03 01:19:03 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$groupBackend->expects($this->any())->method('groupExists')->willReturn(false);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->clearGroupCache('nonexisting_group');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testClearGroupCache() {
|
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists', 'getLDAPAccess', 'getConnection', 'clearCache'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$groupBackend->expects($this->at(0))
|
|
|
|
->method('groupExists')
|
|
|
|
->willReturn(true);
|
|
|
|
$groupBackend->expects($this->at(3))
|
|
|
|
->method('clearCache')
|
|
|
|
->willReturn(true);
|
|
|
|
$groupBackend->expects($this->any())
|
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->clearGroupCache('existing_group');
|
2018-01-25 13:23:12 +03:00
|
|
|
$this->addToAssertionCount(1);
|
2017-11-03 01:19:03 +03:00
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testDnExists() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods(['dn2UserName'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
2020-04-09 10:22:29 +03:00
|
|
|
->method('dn2UserName')
|
|
|
|
->willReturn('existing_user');
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertTrue($ldapProvider->dnExists('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'));
|
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testFlagRecord() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods([])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->flagRecord('existing_user');
|
2018-01-25 13:23:12 +03:00
|
|
|
$this->addToAssertionCount(1);
|
2016-07-22 11:46:29 +03:00
|
|
|
}
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
public function testUnflagRecord() {
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
2016-07-22 11:46:29 +03:00
|
|
|
->setMethods([])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->unflagRecord('existing_user');
|
2018-01-25 13:23:12 +03:00
|
|
|
$this->addToAssertionCount(1);
|
2016-07-22 11:46:29 +03:00
|
|
|
}
|
2017-11-02 15:40:38 +03:00
|
|
|
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
public function testGetLDAPDisplayNameFieldUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getLDAPDisplayNameField('nonexisting_user');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetLDAPDisplayNameField() {
|
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$userBackend->expects($this->at(0))
|
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
|
|
|
$userBackend->expects($this->at(3))
|
|
|
|
->method('getConfiguration')
|
2020-03-26 11:30:18 +03:00
|
|
|
->willReturn(['ldap_display_name'=>'displayName']);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertEquals('displayName', $ldapProvider->getLDAPDisplayNameField('existing_user'));
|
|
|
|
}
|
|
|
|
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
public function testGetLDAPEmailFieldUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('User id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->setMethods(['userExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$userBackend->expects($this->any())->method('userExists')->willReturn(false);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getLDAPEmailField('nonexisting_user');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetLDAPEmailField() {
|
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$userBackend->expects($this->at(0))
|
|
|
|
->method('userExists')
|
|
|
|
->willReturn(true);
|
|
|
|
$userBackend->expects($this->at(3))
|
|
|
|
->method('getConfiguration')
|
2020-03-26 11:30:18 +03:00
|
|
|
->willReturn(['ldap_email_attr'=>'mail']);
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend->expects($this->any())
|
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertEquals('mail', $ldapProvider->getLDAPEmailField('existing_user'));
|
|
|
|
}
|
|
|
|
|
2019-11-20 16:22:00 +03:00
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
public function testGetLDAPGroupMemberAssocUserIDNotFound() {
|
2019-11-27 17:27:18 +03:00
|
|
|
$this->expectException(\Exception::class);
|
|
|
|
$this->expectExceptionMessage('Group id not found in LDAP');
|
|
|
|
|
2017-11-02 15:40:38 +03:00
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend->expects($this->any())->method('groupExists')->willReturn(false);
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$ldapProvider->getLDAPGroupMemberAssoc('nonexisting_group');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testgetLDAPGroupMemberAssoc() {
|
|
|
|
$userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP')
|
|
|
|
->setMethods(['groupExists', 'getLDAPAccess', 'getConnection', 'getConfiguration'])
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
$groupBackend->expects($this->at(0))
|
|
|
|
->method('groupExists')
|
|
|
|
->willReturn(true);
|
|
|
|
$groupBackend->expects($this->any())
|
|
|
|
->method('getConfiguration')
|
2020-03-26 11:30:18 +03:00
|
|
|
->willReturn(['ldap_group_member_assoc_attribute'=>'assoc_type']);
|
2017-11-02 15:40:38 +03:00
|
|
|
$groupBackend->expects($this->any())
|
|
|
|
->method($this->anything())
|
|
|
|
->willReturnSelf();
|
|
|
|
|
|
|
|
$server = $this->getServerMock($userBackend, $groupBackend);
|
|
|
|
|
|
|
|
$ldapProvider = $this->getLDAPProvider($server);
|
|
|
|
$this->assertEquals('assoc_type', $ldapProvider->getLDAPGroupMemberAssoc('existing_group'));
|
2019-11-20 16:22:00 +03:00
|
|
|
}
|
2017-11-02 15:40:38 +03:00
|
|
|
|
2016-07-22 11:46:29 +03:00
|
|
|
}
|