From 825cdf8560e6b9f6dda9debdd271494fdfd3fcf7 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Tue, 29 Jan 2013 17:28:08 +0100 Subject: [PATCH 01/43] add support for apps to register alternative login methods below the standard login a list of icons/button will be displayed --- core/templates/login.php | 16 +++++++++++++++- lib/app.php | 9 +++++++++ lib/util.php | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/core/templates/login.php b/core/templates/login.php index c82d2cafa2..7616b93f9a 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -41,5 +41,19 @@ - + +
+
+ t('Alternative Logins:') ?> +
    + +
  • + +
+
+
+ + + Date: Wed, 30 Jan 2013 00:16:37 +0100 Subject: [PATCH 02/43] Remove the no longer existing function "isUserVerified" Thx @eMerzh --- settings/ajax/changepassword.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 8d45e62e4d..f6fa38fd9b 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -15,14 +15,8 @@ if(OC_User::isAdminUser(OC_User::getUser())) { if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) { $userstatus = 'subadmin'; } -if(OC_User::getUser() === $username) { - if (OC_User::checkPassword($username, $oldPassword)) { +if(OC_User::getUser() === $username && OC_User::checkPassword($username, $oldPassword)) { $userstatus = 'user'; - } else { - if (!OC_Util::isUserVerified()) { - $userstatus = null; - } - } } if(is_null($userstatus)) { From a7aff48658d66f9bd0df891be6bbbf9e11b2d20a Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 30 Jan 2013 00:17:41 +0100 Subject: [PATCH 03/43] Fix indentation --- settings/ajax/changepassword.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index f6fa38fd9b..c1ff0a6370 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -16,7 +16,7 @@ if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) { $userstatus = 'subadmin'; } if(OC_User::getUser() === $username && OC_User::checkPassword($username, $oldPassword)) { - $userstatus = 'user'; + $userstatus = 'user'; } if(is_null($userstatus)) { From 1557b6d99dd55bfd6b55eadf78cc954273bdcf54 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sun, 3 Feb 2013 14:44:33 +0100 Subject: [PATCH 04/43] Fix leftcontent positioning. Ref #1255 --- apps/files/css/files.css | 2 +- core/css/styles.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 661a2e827a..e18836a738 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -55,7 +55,7 @@ font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } -table { position:relative; top:37px; width:100%; } +table { position:relative; width:100%; } tbody tr { background-color:#fff; height:2.5em; } tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#f8f8f8; } tbody tr.selected { background-color:#eee; } diff --git a/core/css/styles.css b/core/css/styles.css index 19cfad7626..685a20ba08 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -119,7 +119,7 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #select_all{ margin-top:.4em !important;} /* CONTENT ------------------------------------------------------------------ */ -#controls { padding:0 0.5em; width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } +#controls { padding:0 0.5em; width:100%; top:0; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:relative; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } #controls .button { display:inline-block; } #content { position:relative; height:100%; width:100%; } @@ -128,9 +128,9 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b -moz-box-sizing:border-box; box-sizing:border-box; } #leftcontent, .leftcontent { - position:fixed; overflow:auto; top:0; width:20em; height:100%; + position:relative; overflow:auto; width:20em; height:100%; background:#f8f8f8; border-right:1px solid #ddd; - -moz-box-sizing:border-box; box-sizing:border-box; padding-top:6.4em; + -moz-box-sizing:border-box; box-sizing:border-box; } #leftcontent li, .leftcontent li { background:#f8f8f8; padding:.5em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 200ms; -moz-transition:background-color 200ms; -o-transition:background-color 200ms; transition:background-color 200ms; } #leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; } From bb9be6f6294934f13ced6a5bc26d226159fada1d Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 4 Feb 2013 00:24:34 +0100 Subject: [PATCH 05/43] Add box-sizing to controls. --- core/css/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/css/styles.css b/core/css/styles.css index 685a20ba08..80485fd063 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -119,7 +119,7 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #select_all{ margin-top:.4em !important;} /* CONTENT ------------------------------------------------------------------ */ -#controls { padding:0 0.5em; width:100%; top:0; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:relative; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } +#controls { padding:0 0.5em; width:100%; top:0; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:relative; -moz-box-sizing:border-box; box-sizing:border-box; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } #controls .button { display:inline-block; } #content { position:relative; height:100%; width:100%; } From 9060c3bd83f7fa3eeee2f5e303055c84e19f8f5b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 3 Feb 2013 17:12:57 +0100 Subject: [PATCH 06/43] Files: fix positioning of Trash button and upload progress bar --- apps/files/css/files.css | 4 ++-- apps/files/templates/index.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index e18836a738..0a12439c35 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -23,7 +23,7 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } -#trash { height:17px; margin:0 0 0 1em; z-index:1010; position:absolute; right:13.5em; } +#trash { height:17px; margin:0.3em 0.3em 0.3em 1em; z-index:1010; float: right; } #upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; @@ -44,7 +44,7 @@ z-index:20; position:relative; cursor:pointer; overflow:hidden; } -#uploadprogresswrapper { position:absolute; right:13.5em; top:0em; } +#uploadprogresswrapper { float: right; position: relative; } #uploadprogresswrapper #uploadprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; } /* FILE TABLE */ diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 2d4ed9ab2d..9c12067ae9 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -35,18 +35,18 @@ - + + - -
-
- +
+
+ -
From 07a7478fdece219b04370ca0e218f3eb18ca8831 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Thu, 24 Jan 2013 13:47:04 +0100 Subject: [PATCH 07/43] PHPUnit support for Windows added --- autotest.cmd | 117 ++++++++++++++ tests/win32-phpunit.php | 347 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 464 insertions(+) create mode 100644 autotest.cmd create mode 100644 tests/win32-phpunit.php diff --git a/autotest.cmd b/autotest.cmd new file mode 100644 index 0000000000..053860db54 --- /dev/null +++ b/autotest.cmd @@ -0,0 +1,117 @@ +:: +:: ownCloud +:: +:: @author Thomas Müller +:: @author Tobias Ramforth (translated into Windows batch file) +:: +:: @copyright 2012 Thomas Müller thomas.mueller@tmit.eu +:: +@echo off + +set DATADIR=data-autotest +set BASEDIR=%~dp0 + +:: create autoconfig for sqlite, mysql and postgresql +echo ^ .\tests\autoconfig-sqlite.php +echo $AUTOCONFIG ^= array ^( >> .\tests\autoconfig-sqlite.php +echo 'installed' ^=^> false^, >> .\tests\autoconfig-sqlite.php +echo 'dbtype' ^=^> 'sqlite'^, >> .\tests\autoconfig-sqlite.php +echo 'dbtableprefix' ^=^> 'oc_'^, >> .\tests\autoconfig-sqlite.php +echo 'adminlogin' ^=^> 'admin'^, >> .\tests\autoconfig-sqlite.php +echo 'adminpass' ^=^> 'admin'^, >> .\tests\autoconfig-sqlite.php +echo 'directory' ^=^> '%BASEDIR%%DATADIR%'^, >> .\tests\autoconfig-sqlite.php +echo ^)^; >> .\tests\autoconfig-sqlite.php + +echo ^ .\tests\autoconfig-mysql.php +echo $AUTOCONFIG ^= array ^( >> .\tests\autoconfig-mysql.php +echo 'installed' ^=^> false^, >> .\tests\autoconfig-mysql.php +echo 'dbtype' ^=^> 'mysql'^, >> .\tests\autoconfig-mysql.php +echo 'dbtableprefix' ^=^> 'oc_'^, >> .\tests\autoconfig-mysql.php +echo 'adminlogin' ^=^> 'admin'^, >> .\tests\autoconfig-mysql.php +echo 'adminpass' ^=^> 'admin'^, >> .\tests\autoconfig-mysql.php +echo 'directory' ^=^> '%BASEDIR%%DATADIR%'^, >> .\tests\autoconfig-mysql.php +echo 'dbuser' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-mysql.php +echo 'dbname' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-mysql.php +echo 'dbhost' ^=^> 'localhost'^, >> .\tests\autoconfig-mysql.php +echo 'dbpass' ^=^> 'owncloud'^, >> .\tests\autoconfig-mysql.php +echo ^)^; >> .\tests\autoconfig-mysql.php + +echo ^ .\tests\autoconfig-pgsql.php +echo $AUTOCONFIG ^= array ^( >> .\tests\autoconfig-pgsql.php +echo 'installed' ^=^> false^, >> .\tests\autoconfig-pgsql.php +echo 'dbtype' ^=^> 'pgsql'^, >> .\tests\autoconfig-pgsql.php +echo 'dbtableprefix' ^=^> 'oc_'^, >> .\tests\autoconfig-pgsql.php +echo 'adminlogin' ^=^> 'admin'^, >> .\tests\autoconfig-pgsql.php +echo 'adminpass' ^=^> 'admin'^, >> .\tests\autoconfig-pgsql.php +echo 'directory' ^=^> '%BASEDIR%%DATADIR%'^, >> .\tests\autoconfig-pgsql.php +echo 'dbuser' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-pgsql.php +echo 'dbname' ^=^> 'oc_autotest'^, >> .\tests\autoconfig-pgsql.php +echo 'dbhost' ^=^> 'localhost'^, >> .\tests\autoconfig-pgsql.php +echo 'dbpass' ^=^> 'owncloud'^, >> .\tests\autoconfig-pgsql.php +echo ^)^; >> .\tests\autoconfig-pgsql.php + +echo localhost:5432:*:oc_autotest:owncloud > %APPDATA%\postgresql\pgpass.conf + +:: +:: start test execution +:: +::call:execute_tests "sqlite" +call:execute_tests "mysql" +::call:execute_tests "mssql" +::call:execute_tests "ora" +::call:execute_tests "pgsql" + +goto:eof + +:execute_tests + echo "Setup environment for %~1 testing ..." + :: back to root folder + cd %BASEDIR% + + :: revert changes to tests\data + git checkout tests\data\* + + :: reset data directory + rmdir /s /q %DATADIR% + md %DATADIR% + + :: remove the old config file + :: del /q /f config\config.php + copy /y tests\preseed-config.php config\config.php + + :: drop database + if "%~1" == "mysql" mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest" + + if "%~1" == "pgsql" dropdb -h localhost -p 5432 -U oc_autotest -w oc_autotest + + :: copy autoconfig + copy /y %BASEDIR%\tests\autoconfig-%~1.php %BASEDIR%\config\autoconfig.php + + :: trigger installation + php -f index.php + + ::test execution + echo "Testing with %~1 ..." + cd tests + rmdir /s /q coverage-html-%~1 + md coverage-html-%~1 + php -f enable_all.php + ::phpunit --log-junit autotest-results-%~1.xml --coverage-clover autotest-clover-%~1.xml --coverage-html coverage-html-%~1 + ::phpunit --bootstrap bootstrap.php --configuration phpunit.xml + php win32-phpunit.php --bootstrap bootstrap.php --configuration phpunit.xml --log-junit autotest-results-%~1.xml --coverage-clover autotest-clover-%~1.xml --coverage-html coverage-html-%~1 + echo "Done with testing %~1 ..." + cd %BASEDIR% +goto:eof + +:: +:: NOTES on mysql: +:: - CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY 'owncloud'; +:: - grant access permissions: grant all on oc_autotest.* to 'oc_autotest'@'localhost'; +:: +:: NOTES on pgsql: +:: - su - postgres +:: - createuser -P (enter username and password and enable superuser) +:: - to enable dropdb I decided to add following line to pg_hba.conf (this is not the safest way but I don't care for the testing machine): +:: local all all trust +:: + diff --git a/tests/win32-phpunit.php b/tests/win32-phpunit.php new file mode 100644 index 0000000000..ac8f95efcb --- /dev/null +++ b/tests/win32-phpunit.php @@ -0,0 +1,347 @@ +printHeader(); + $this->printFooter($result); + } + + protected function writeProgress($progress) + { + //ignore + } + } + break; + } +} + +//loading of OC_PHPUnit_TextUI_Command +switch (OC_PHPUnit_Loader::$PHPUnitVersionId) { + case "36": + case "37": { + class OC_PHPUnit_TextUI_Command extends PHPUnit_TextUI_Command + { + + public static function main($exit = TRUE) + { + $command = new OC_PHPUnit_TextUI_Command(); + $command->run($_SERVER['argv'], $exit); + } + + protected function handleArguments(array $argv) + { + parent::handleArguments($argv); + $this->arguments['listeners'][] = new OC_PHPUnit_Framework_TestListener(); + $this->arguments['printer'] = new OC_PHPUnit_TextUI_ResultPrinter(); + } + + protected function createRunner() + { + $coverage_Filter = new PHP_CodeCoverage_Filter(); + $coverage_Filter->addFileToBlacklist(__FILE__); + $runner = new PHPUnit_TextUI_TestRunner($this->arguments['loader'], $coverage_Filter); + return $runner; + } + } + break; + } +} + +class OC_PHPUnit_Loader +{ + + const SUCCESS_EXIT = 0; + const FAILURE_EXIT = 1; + const EXCEPTION_EXIT = 2; + + public static $PHPUnitVersionId; + + /** + * @return void + */ + public static function checkIncludePath() + { + //check include path + $PHPUnitParentDirectory = self::getPHPUnitParentDirectory(); + if (is_null($PHPUnitParentDirectory)) { + echo "Cannot find PHPUnit in include path (" . ini_get('include_path') . ")"; + exit(OC_PHPUnit_Loader::FAILURE_EXIT); + } + } + + /** + * @return null | string + */ + private static function getPHPUnitParentDirectory() + { + $pathArray = explode(PATH_SEPARATOR, ini_get('include_path')); + foreach ($pathArray as $path) + { + if (file_exists($path . DIRECTORY_SEPARATOR . 'PHPUnit/')) { + return $path; + } + } + return null; + } + + /** + * @return void + */ + public static function detectPHPUnitVersionId() + { + require_once 'PHPUnit/Runner/Version.php'; + + $PHPUnitVersion = PHPUnit_Runner_Version::id(); + + if ($PHPUnitVersion === "@package_version@") { + + self::$PHPUnitVersionId = "37"; + } + else if (version_compare($PHPUnitVersion, '3.7.0') >= 0) { + + self::$PHPUnitVersionId = "37"; + } + else if (version_compare($PHPUnitVersion, '3.6.0') >= 0) { + + self::$PHPUnitVersionId = "36"; + } + else if (version_compare($PHPUnitVersion, '3.6.0') >= 0) { + + echo "unsupported PHPUnit version: $PHPUnitVersion"; + exit(OC_PHPUnit_Loader::FAILURE_EXIT); + } + } + + /** + * @return void + */ + public static function load37() + { + + require 'PHPUnit/Autoload.php'; + + } + + + /** + * @return void + */ + public static function load36() + { + define('PHPUnit_MAIN_METHOD', 'OC_PHPUnit_TextUI_Command::main'); + + require 'PHPUnit/Autoload.php'; + + } +} + +class OC_PHPUnit_Framework_TestListener implements PHPUnit_Framework_TestListener +{ + + private $isSummaryTestCountPrinted = false; + + public static function printEvent($eventName, $params = array()) + { + self::printText("\n[$eventName"); + foreach ($params as $key => $value) { + self::printText(" $key='$value'"); + } + self::printText("]\n"); + } + + public static function printText($text) + { + file_put_contents('php://stderr', $text); + } + + private static function getMessage(Exception $e) + { + $message = ""; + if (strlen(get_class($e)) != 0) { + $message = $message . get_class($e); + } + if (strlen($message) != 0 && strlen($e->getMessage()) != 0) { + $message = $message . " : "; + } + $message = $message . $e->getMessage(); + return self::escapeValue($message); + } + + private static function getDetails(Exception $e) + { + return self::escapeValue($e->getTraceAsString()); + } + + public static function getValueAsString($value) + { + if (is_null($value)) { + return "null"; + } + else if (is_bool($value)) { + return $value == true ? "true" : "false"; + } + else if (is_array($value) || is_string($value)) { + $valueAsString = print_r($value, true); + if (strlen($valueAsString) > 10000) { + return null; + } + return $valueAsString; + } + else if (is_scalar($value)){ + return print_r($value, true); + } + return null; + } + + private static function escapeValue($text) { + $text = str_replace("|", "||", $text); + $text = str_replace("'", "|'", $text); + $text = str_replace("\n", "|n", $text); + $text = str_replace("\r", "|r", $text); + $text = str_replace("]", "|]", $text); + return $text; + } + + public static function getFileName($className) + { + $reflectionClass = new ReflectionClass($className); + $fileName = $reflectionClass->getFileName(); + return $fileName; + } + + public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + { + self::printEvent("testFailed", array( + "name" => $test->getName(), + "message" => self::getMessage($e), + "details" => self::getDetails($e) + )); + } + + public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + { + $params = array( + "name" => $test->getName(), + "message" => self::getMessage($e), + "details" => self::getDetails($e) + ); + if ($e instanceof PHPUnit_Framework_ExpectationFailedException) { + $comparisonFailure = $e->getComparisonFailure(); + if ($comparisonFailure instanceof PHPUnit_Framework_ComparisonFailure) { + $actualResult = $comparisonFailure->getActual(); + $expectedResult = $comparisonFailure->getExpected(); + $actualString = self::getValueAsString($actualResult); + $expectedString = self::getValueAsString($expectedResult); + if (!is_null($actualString) && !is_null($expectedString)) { + $params['actual'] = self::escapeValue($actualString); + $params['expected'] = self::escapeValue($expectedString); + } + } + } + self::printEvent("testFailed", $params); + } + + public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + self::printEvent("testIgnored", array( + "name" => $test->getName(), + "message" => self::getMessage($e), + "details" => self::getDetails($e) + )); + } + + public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + { + self::printEvent("testIgnored", array( + "name" => $test->getName(), + "message" => self::getMessage($e), + "details" => self::getDetails($e) + )); + } + + public function startTest(PHPUnit_Framework_Test $test) + { + $testName = $test->getName(); + $params = array( + "name" => $testName + ); + if ($test instanceof PHPUnit_Framework_TestCase) { + $className = get_class($test); + $fileName = self::getFileName($className); + $params['locationHint'] = "php_qn://$fileName::\\$className::$testName"; + } + self::printEvent("testStarted", $params); + } + + public function endTest(PHPUnit_Framework_Test $test, $time) + { + self::printEvent("testFinished", array( + "name" => $test->getName(), + "duration" => (int)(round($time, 2) * 1000) + )); + } + + public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + { + if (!$this->isSummaryTestCountPrinted) { + $this->isSummaryTestCountPrinted = true; + //print tests count + self::printEvent("testCount", array( + "count" => count($suite) + )); + } + + $suiteName = $suite->getName(); + if (empty($suiteName)) { + return; + } + $params = array( + "name" => $suiteName, + ); + if (class_exists($suiteName, false)) { + $fileName = self::getFileName($suiteName); + $params['locationHint'] = "php_qn://$fileName::\\$suiteName"; + } + self::printEvent("testSuiteStarted", $params); + } + + public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + { + $suiteName = $suite->getName(); + if (empty($suiteName)) { + return; + } + self::printEvent("testSuiteFinished", + array( + "name" => $suite->getName() + )); + } + +} + +OC_PHPUnit_TextUI_Command::main(); From 46e10407f7aef7850e56da51fc81311c6b77acaa Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 4 Feb 2013 14:09:32 +0100 Subject: [PATCH 08/43] Remove padding hack to position users list. --- settings/css/settings.css | 1 - 1 file changed, 1 deletion(-) diff --git a/settings/css/settings.css b/settings/css/settings.css index 5a3ab2c6e9..f27f9e8628 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -31,7 +31,6 @@ tr:hover>td.password>span, tr:hover>td.displayName>span { margin:0; cursor:point tr:hover>td.remove>a, tr:hover>td.password>img,tr:hover>td.displayName>img, tr:hover>td.quota>img { visibility:visible; cursor:pointer; } tr:hover>td.remove>a { float:right; } li.selected { background-color:#ddd; } -#content>table:not(.nostyle) { margin-top:3em; } table:not(.nostyle) { width:100%; } #rightcontent { padding-left: 1em; } div.quota { float:right; display:block; position:absolute; right:25em; top:0; } From 6058c2f734ca2259aebab9cc83eb63c2718b2e4d Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Mon, 4 Feb 2013 15:04:26 +0100 Subject: [PATCH 09/43] we get best results regarding mime type detection if we use fileinfo - let's tell the admin about that --- lib/util.php | 8 ++++++++ settings/admin.php | 1 + settings/templates/admin.php | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 91970ab2b9..4de34b9dfd 100755 --- a/lib/util.php +++ b/lib/util.php @@ -516,6 +516,14 @@ class OC_Util { } } + /** + * Check if the PHP module fileinfo is loaded. + * @return bool + */ + public static function fileInfoLoaded() { + return function_exists('finfo_open'); + } + /** * Check if the ownCloud server can connect to the internet */ diff --git a/settings/admin.php b/settings/admin.php index 4d9685ab92..7cca716515 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -31,6 +31,7 @@ $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('internetconnectionworking', OC_Util::isinternetconnectionworking()); $tmpl->assign('islocaleworking', OC_Util::issetlocaleworking()); +$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes')); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 0097489743..9a9a691dcb 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -22,7 +22,20 @@ if (!$_['htaccessworking']) { +
+ t('Module \'fileinfo\' missing');?> + + + t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with mime-type detection.'); ?> + + +
+
From b06ac67e07512fbf1b12e586bc73d7569aec9e24 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 4 Feb 2013 18:30:49 +0100 Subject: [PATCH 10/43] Add 'hascontrols' class for content with fixed topbar. --- apps/files/css/files.css | 4 ++-- apps/files/templates/index.php | 18 +++++++++--------- core/css/styles.css | 10 +++++++++- settings/templates/apps.php | 2 +- settings/templates/users.php | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 0a12439c35..f37ac4c262 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -3,7 +3,7 @@ See the COPYING-README file. */ /* FILE MENU */ -.actions { padding:.3em; float:left; height:2em; } +.actions { padding:.3em; float:left; height:2em; width: 100%; } .actions input, .actions button, .actions .button { margin:0; float:left; } #new { @@ -23,7 +23,7 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; } -#trash { height:17px; margin:0.3em 0.3em 0.3em 1em; z-index:1010; float: right; } +#trash { height:17px; margin: 0 1em; z-index:1010; float: right; } #upload { height:27px; padding:0; margin-left:0.2em; overflow:hidden; diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 9c12067ae9..0b4aa21eac 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -35,18 +35,18 @@ - - + - -
-
- +
+
+ +
@@ -59,7 +59,7 @@
t('Nothing in here. Upload something!')?>
- +
diff --git a/core/css/styles.css b/core/css/styles.css index 80485fd063..02300ff4cd 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -119,10 +119,18 @@ input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-b #select_all{ margin-top:.4em !important;} /* CONTENT ------------------------------------------------------------------ */ -#controls { padding:0 0.5em; width:100%; top:0; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:relative; -moz-box-sizing:border-box; box-sizing:border-box; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } +#controls { + position:fixed; + height:2.8em; width:100%; + padding:0 70px 0 0.5em; margin:0; + -moz-box-sizing:border-box; box-sizing:border-box; + -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; + background:#f7f7f7; border-bottom:1px solid #eee; z-index:50; +} #controls .button { display:inline-block; } #content { position:relative; height:100%; width:100%; } +#content .hascontrols { position: relative; top: 3em; } #content-wrapper { position:absolute; height:100%; width:100%; padding-top:3.5em; padding-left:64px; -moz-box-sizing:border-box; box-sizing:border-box; diff --git a/settings/templates/apps.php b/settings/templates/apps.php index 3f0d2a9d1c..ed1232ac32 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -10,7 +10,7 @@ t('Add your App');?> t('More Apps');?> -