@ -0,0 +1,71 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* ownCloud |
||||||
|
* |
||||||
|
* @author Arthur Schiwon |
||||||
|
* @copyright 2013 Arthur Schiwon blizzz@owncloud.com |
||||||
|
* |
||||||
|
* This library is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||||
|
* License as published by the Free Software Foundation; either |
||||||
|
* version 3 of the License, or any later version. |
||||||
|
* |
||||||
|
* This library is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU Affero General Public |
||||||
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace OCA\user_ldap\tests; |
||||||
|
|
||||||
|
use \OCA\user_ldap\lib\Access; |
||||||
|
use \OCA\user_ldap\lib\Connection; |
||||||
|
use \OCA\user_ldap\lib\ILDAPWrapper; |
||||||
|
|
||||||
|
class Test_Access extends \PHPUnit_Framework_TestCase { |
||||||
|
private function getConnecterAndLdapMock() { |
||||||
|
static $conMethods; |
||||||
|
static $accMethods; |
||||||
|
|
||||||
|
if(is_null($conMethods) || is_null($accMethods)) { |
||||||
|
$conMethods = get_class_methods('\OCA\user_ldap\lib\Connection'); |
||||||
|
$accMethods = get_class_methods('\OCA\user_ldap\lib\Access'); |
||||||
|
} |
||||||
|
$lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); |
||||||
|
$connector = $this->getMock('\OCA\user_ldap\lib\Connection', |
||||||
|
$conMethods, |
||||||
|
array($lw, null, null)); |
||||||
|
|
||||||
|
return array($lw, $connector); |
||||||
|
} |
||||||
|
|
||||||
|
public function testEscapeFilterPartValidChars() { |
||||||
|
list($lw, $con) = $this->getConnecterAndLdapMock(); |
||||||
|
$access = new Access($con, $lw); |
||||||
|
|
||||||
|
$input = 'okay'; |
||||||
|
$this->assertTrue($input === $access->escapeFilterPart($input)); |
||||||
|
} |
||||||
|
|
||||||
|
public function testEscapeFilterPartEscapeWildcard() { |
||||||
|
list($lw, $con) = $this->getConnecterAndLdapMock(); |
||||||
|
$access = new Access($con, $lw); |
||||||
|
|
||||||
|
$input = '*'; |
||||||
|
$expected = '\\\\*'; |
||||||
|
$this->assertTrue($expected === $access->escapeFilterPart($input)); |
||||||
|
} |
||||||
|
|
||||||
|
public function testEscapeFilterPartEscapeWildcard2() { |
||||||
|
list($lw, $con) = $this->getConnecterAndLdapMock(); |
||||||
|
$access = new Access($con, $lw); |
||||||
|
|
||||||
|
$input = 'foo*bar'; |
||||||
|
$expected = 'foo\\\\*bar'; |
||||||
|
$this->assertTrue($expected === $access->escapeFilterPart($input)); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
@media only screen and (max-width: 600px) { |
||||||
|
|
||||||
|
/* compress search box on mobile, expand when focused */ |
||||||
|
.searchbox input[type="search"] { |
||||||
|
width: 15%; |
||||||
|
-webkit-transition: width 100ms; |
||||||
|
-moz-transition: width 100ms; |
||||||
|
-o-transition: width 100ms; |
||||||
|
transition: width 100ms; |
||||||
|
} |
||||||
|
.searchbox input[type="search"]:focus, |
||||||
|
.searchbox input[type="search"]:active { |
||||||
|
width: 155px; |
||||||
|
} |
||||||
|
|
||||||
|
/* do not show display name on mobile when profile picture is present */ |
||||||
|
#header .avatardiv.avatardiv-shown + #expandDisplayName { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@ -1,20 +0,0 @@ |
|||||||
<?php |
|
||||||
/** |
|
||||||
* Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch> |
|
||||||
* This file is licensed under the Affero General Public License version 3 or |
|
||||||
* later. |
|
||||||
* See the COPYING-README file. |
|
||||||
*/ |
|
||||||
|
|
||||||
// Set the content type to Javascript |
|
||||||
header("Content-type: text/javascript"); |
|
||||||
|
|
||||||
// Disallow caching |
|
||||||
header("Cache-Control: no-cache, must-revalidate"); |
|
||||||
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); |
|
||||||
|
|
||||||
if (OC_User::isAdminUser(OC_User::getUser())) { |
|
||||||
echo("var isadmin = true;"); |
|
||||||
} else { |
|
||||||
echo("var isadmin = false;"); |
|
||||||
} |
|
@ -0,0 +1,34 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* Copyright (c) 2014 Bjoern Schiessle <schiessle@owncloud.com> |
||||||
|
* This file is licensed under the Affero General Public License version 3 or |
||||||
|
* later. |
||||||
|
* See the COPYING-README file. |
||||||
|
*/ |
||||||
|
|
||||||
|
class Test_Urlgenerator extends PHPUnit_Framework_TestCase { |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* @small |
||||||
|
* @brief test absolute URL construction |
||||||
|
* @dataProvider provideURLs |
||||||
|
*/ |
||||||
|
function testGetAbsoluteURL($url, $expectedResult) { |
||||||
|
|
||||||
|
$urlGenerator = new \OC\URLGenerator(null); |
||||||
|
$result = $urlGenerator->getAbsoluteURL($url); |
||||||
|
|
||||||
|
$this->assertEquals($expectedResult, $result); |
||||||
|
} |
||||||
|
|
||||||
|
public function provideURLs() { |
||||||
|
return array( |
||||||
|
array("index.php", "http://localhost/index.php"), |
||||||
|
array("/index.php", "http://localhost/index.php"), |
||||||
|
array("/apps/index.php", "http://localhost/apps/index.php"), |
||||||
|
array("apps/index.php", "http://localhost/apps/index.php"), |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
|
|