summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/comments/l10n/et_EE.js21
-rw-r--r--apps/comments/l10n/et_EE.json21
-rw-r--r--apps/files_versions/l10n/et_EE.js7
-rw-r--r--apps/files_versions/l10n/et_EE.json7
-rw-r--r--apps/theming/js/settings-admin.js18
-rw-r--r--apps/theming/lib/Controller/ThemingController.php13
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php120
-rw-r--r--apps/user_ldap/lib/ILDAPWrapper.php4
-rw-r--r--apps/user_ldap/lib/LDAP.php4
-rw-r--r--apps/user_ldap/lib/Wizard.php19
10 files changed, 163 insertions, 71 deletions
diff --git a/apps/comments/l10n/et_EE.js b/apps/comments/l10n/et_EE.js
index 0979ed0c04b..ddebbc786a4 100644
--- a/apps/comments/l10n/et_EE.js
+++ b/apps/comments/l10n/et_EE.js
@@ -1,22 +1,29 @@
OC.L10N.register(
"comments",
{
- "Type in a new comment..." : "Kirjuta uus komentaar...",
+ "Comments" : "Kommentaarid",
+ "Unknown user" : "Tundmatu kasutaja",
+ "New comment …" : "Uus kommentaar",
"Delete comment" : "Kustuta kommentaar",
"Post" : "Postita",
"Cancel" : "Loobu",
"Edit comment" : "Muuda kommentaari",
"[Deleted user]" : "[Kustutatud kasutaja]",
- "Comments" : "Kommentaarid",
- "No other comments available" : "Ühtegi teist kommentaari pole saadaval",
- "More comments..." : "Veel kommentaare...",
+ "No comments yet, start the conversation!" : "Kommentaare veel pole, alusta vestlust",
+ "More comments …" : "Veel kommentaare ...",
"Save" : "Salvesta",
"Allowed characters {count} of {max}" : "Lubatud märkide arv {count}/{max}",
- "{count} unread comments" : "{count} lugemata kommentaari",
+ "Error occurred while retrieving comment with id {id}" : "Kommentaari {id} laadimisel tekkis tõrge",
+ "Error occurred while updating comment with id {id}" : "Kommentaari {id} uuendamisel tekkis tõrge",
+ "Error occurred while posting comment" : "Viga kommentaari postitamisel",
"Comment" : "Kommentaar",
"You commented" : "Sa kommenteerisid",
"%1$s commented" : "%1$s kommenteeris",
- "You commented on %2$s" : "Sa kommenteerisid %2$s",
- "%1$s commented on %2$s" : "%1$s kommenteeris %2$s"
+ "{author} commented" : "{author} kommenteeris",
+ "You commented on %1$s" : "Sa kommmenteerisid %1$s",
+ "You commented on {file}" : "Sa kommenteerisid faili {file}",
+ "%1$s commented on %2$s" : "%1$s kommenteeris %2$s",
+ "{author} commented on {file}" : "{author} kommenteeris faili {file}",
+ "<strong>Comments</strong> for files" : "<strong>kommentaari</strong> ffailidele"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/comments/l10n/et_EE.json b/apps/comments/l10n/et_EE.json
index 93051ab6ddd..12c44872dfe 100644
--- a/apps/comments/l10n/et_EE.json
+++ b/apps/comments/l10n/et_EE.json
@@ -1,20 +1,27 @@
{ "translations": {
- "Type in a new comment..." : "Kirjuta uus komentaar...",
+ "Comments" : "Kommentaarid",
+ "Unknown user" : "Tundmatu kasutaja",
+ "New comment …" : "Uus kommentaar",
"Delete comment" : "Kustuta kommentaar",
"Post" : "Postita",
"Cancel" : "Loobu",
"Edit comment" : "Muuda kommentaari",
"[Deleted user]" : "[Kustutatud kasutaja]",
- "Comments" : "Kommentaarid",
- "No other comments available" : "Ühtegi teist kommentaari pole saadaval",
- "More comments..." : "Veel kommentaare...",
+ "No comments yet, start the conversation!" : "Kommentaare veel pole, alusta vestlust",
+ "More comments …" : "Veel kommentaare ...",
"Save" : "Salvesta",
"Allowed characters {count} of {max}" : "Lubatud märkide arv {count}/{max}",
- "{count} unread comments" : "{count} lugemata kommentaari",
+ "Error occurred while retrieving comment with id {id}" : "Kommentaari {id} laadimisel tekkis tõrge",
+ "Error occurred while updating comment with id {id}" : "Kommentaari {id} uuendamisel tekkis tõrge",
+ "Error occurred while posting comment" : "Viga kommentaari postitamisel",
"Comment" : "Kommentaar",
"You commented" : "Sa kommenteerisid",
"%1$s commented" : "%1$s kommenteeris",
- "You commented on %2$s" : "Sa kommenteerisid %2$s",
- "%1$s commented on %2$s" : "%1$s kommenteeris %2$s"
+ "{author} commented" : "{author} kommenteeris",
+ "You commented on %1$s" : "Sa kommmenteerisid %1$s",
+ "You commented on {file}" : "Sa kommenteerisid faili {file}",
+ "%1$s commented on %2$s" : "%1$s kommenteeris %2$s",
+ "{author} commented on {file}" : "{author} kommenteeris faili {file}",
+ "<strong>Comments</strong> for files" : "<strong>kommentaari</strong> ffailidele"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/files_versions/l10n/et_EE.js b/apps/files_versions/l10n/et_EE.js
index 5827b02c127..e5f4e59a41a 100644
--- a/apps/files_versions/l10n/et_EE.js
+++ b/apps/files_versions/l10n/et_EE.js
@@ -4,8 +4,11 @@ OC.L10N.register(
"Could not revert: %s" : "Ei suuda taastada faili: %s",
"Versions" : "Versioonid",
"Failed to revert {file} to revision {timestamp}." : "Ebaõnnestus faili {file} taastamine revisjonile {timestamp}",
+ "_%n byte_::_%n bytes_" : ["%n bait","%n baiti"],
"Restore" : "Taasta",
- "More versions..." : "Rohkem versioone...",
- "No other versions available" : "Muid versioone pole saadaval"
+ "No earlier versions available" : "Eelnevaid versioone pole saadaval",
+ "More versions …" : "Veel versioone ...",
+ "No versions available" : "Ühtegi versiooni pole saadaval",
+ "More versions..." : "Rohkem versioone..."
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/files_versions/l10n/et_EE.json b/apps/files_versions/l10n/et_EE.json
index 6cfd38102ab..eb5ac1b1636 100644
--- a/apps/files_versions/l10n/et_EE.json
+++ b/apps/files_versions/l10n/et_EE.json
@@ -2,8 +2,11 @@
"Could not revert: %s" : "Ei suuda taastada faili: %s",
"Versions" : "Versioonid",
"Failed to revert {file} to revision {timestamp}." : "Ebaõnnestus faili {file} taastamine revisjonile {timestamp}",
+ "_%n byte_::_%n bytes_" : ["%n bait","%n baiti"],
"Restore" : "Taasta",
- "More versions..." : "Rohkem versioone...",
- "No other versions available" : "Muid versioone pole saadaval"
+ "No earlier versions available" : "Eelnevaid versioone pole saadaval",
+ "More versions …" : "Veel versioone ...",
+ "No versions available" : "Ühtegi versiooni pole saadaval",
+ "More versions..." : "Rohkem versioone..."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js
index 8c2ab2bc08e..d9e66284d14 100644
--- a/apps/theming/js/settings-admin.js
+++ b/apps/theming/js/settings-admin.js
@@ -30,7 +30,7 @@ function setThemingValue(setting, value) {
OC.generateUrl('/apps/theming/ajax/updateStylesheet'), {'setting' : setting, 'value' : value}
).done(function(response) {
hideUndoButton(setting, value);
- preview(setting, value);
+ preview(setting, value, response.data.serverCssUrl);
}).fail(function(response) {
OC.msg.finishedSaving('#theming_settings_msg', response);
$('#theming_settings_loading').hide();
@@ -38,12 +38,12 @@ function setThemingValue(setting, value) {
}
-function preview(setting, value) {
+function preview(setting, value, serverCssUrl) {
OC.msg.startAction('#theming_settings_msg', t('theming', 'Loading preview…'));
- var stylesheetsLoaded = 2;
+ var stylesheetsLoaded = 1;
var reloadStylesheets = function(cssFile) {
var queryString = '?reload=' + new Date().getTime();
- var url = OC.generateUrl(cssFile) + queryString;
+ var url = cssFile + queryString;
var old = $('link[href*="' + cssFile.replace("/","\/") + '"]');
var stylesheet = $("<link/>", {
rel: "stylesheet",
@@ -62,8 +62,12 @@ function preview(setting, value) {
stylesheet.appendTo("head");
};
- reloadStylesheets('/css/core/server.css');
- reloadStylesheets('/apps/theming/styles');
+ if (serverCssUrl !== undefined) {
+ stylesheetsLoaded++;
+
+ reloadStylesheets(serverCssUrl);
+ }
+ reloadStylesheets(OC.generateUrl('/apps/theming/styles'));
// Preview images
var timestamp = new Date().getTime();
@@ -218,7 +222,7 @@ $(document).ready(function () {
var input = document.getElementById('theming-'+setting);
input.value = response.data.value;
}
- preview(setting, response.data.value);
+ preview(setting, response.data.value, response.data.serverCssUrl);
});
});
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index 225673079a3..b409d309f4d 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -73,6 +73,8 @@ class ThemingController extends Controller {
private $appData;
/** @var SCSSCacher */
private $scssCacher;
+ /** @var IURLGenerator */
+ private $urlGenerator;
/**
* ThemingController constructor.
@@ -87,6 +89,7 @@ class ThemingController extends Controller {
* @param ITempManager $tempManager
* @param IAppData $appData
* @param SCSSCacher $scssCacher
+ * @param IURLGenerator $urlGenerator
*/
public function __construct(
$appName,
@@ -98,7 +101,8 @@ class ThemingController extends Controller {
IL10N $l,
ITempManager $tempManager,
IAppData $appData,
- SCSSCacher $scssCacher
+ SCSSCacher $scssCacher,
+ IURLGenerator $urlGenerator
) {
parent::__construct($appName, $request);
@@ -110,6 +114,7 @@ class ThemingController extends Controller {
$this->tempManager = $tempManager;
$this->appData = $appData;
$this->scssCacher = $scssCacher;
+ $this->urlGenerator = $urlGenerator;
}
/**
@@ -172,7 +177,8 @@ class ThemingController extends Controller {
[
'data' =>
[
- 'message' => $this->l10n->t('Saved')
+ 'message' => $this->l10n->t('Saved'),
+ 'serverCssUrl' => $this->urlGenerator->linkTo('', $this->scssCacher->getCachedSCSS('core', '/core/css/server.scss'))
],
'status' => 'success'
]
@@ -303,7 +309,8 @@ class ThemingController extends Controller {
'data' =>
[
'value' => $value,
- 'message' => $this->l10n->t('Saved')
+ 'message' => $this->l10n->t('Saved'),
+ 'serverCssUrl' => $this->urlGenerator->linkTo('', $this->scssCacher->getCachedSCSS('core', '/core/css/server.scss'))
],
'status' => 'success'
]
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index 5fa8dc51939..5e6e43ca3cb 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -70,6 +70,8 @@ class ThemingControllerTest extends TestCase {
private $appData;
/** @var SCSSCacher */
private $scssCacher;
+ /** @var IURLGenerator */
+ private $urlGenerator;
public function setUp() {
$this->request = $this->createMock(IRequest::class);
@@ -85,6 +87,7 @@ class ThemingControllerTest extends TestCase {
->willReturn(123);
$this->tempManager = \OC::$server->getTempManager();
$this->scssCacher = $this->createMock(SCSSCacher::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->themingController = new ThemingController(
'theming',
@@ -96,39 +99,33 @@ class ThemingControllerTest extends TestCase {
$this->l10n,
$this->tempManager,
$this->appData,
- $this->scssCacher
+ $this->scssCacher,
+ $this->urlGenerator
);
return parent::setUp();
}
- public function dataUpdateStylesheet() {
+ public function dataUpdateStylesheetSuccess() {
return [
- ['name', str_repeat('a', 250), 'success', 'Saved'],
- ['name', str_repeat('a', 251), 'error', 'The given name is too long'],
- ['url', str_repeat('a', 500), 'success', 'Saved'],
- ['url', str_repeat('a', 501), 'error', 'The given web address is too long'],
- ['slogan', str_repeat('a', 500), 'success', 'Saved'],
- ['slogan', str_repeat('a', 501), 'error', 'The given slogan is too long'],
- ['color', '#0082c9', 'success', 'Saved'],
- ['color', '#0082C9', 'success', 'Saved'],
- ['color', '0082C9', 'error', 'The given color is invalid'],
- ['color', '#0082Z9', 'error', 'The given color is invalid'],
- ['color', 'Nextcloud', 'error', 'The given color is invalid'],
+ ['name', str_repeat('a', 250), 'Saved'],
+ ['url', str_repeat('a', 500), 'Saved'],
+ ['slogan', str_repeat('a', 500), 'Saved'],
+ ['color', '#0082c9', 'Saved'],
+ ['color', '#0082C9', 'Saved'],
];
}
/**
- * @dataProvider dataUpdateStylesheet
+ * @dataProvider dataUpdateStylesheetSuccess
*
* @param string $setting
* @param string $value
- * @param string $status
* @param string $message
*/
- public function testUpdateStylesheet($setting, $value, $status, $message) {
+ public function testUpdateStylesheetSuccess($setting, $value, $message) {
$this->themingDefaults
- ->expects($status === 'success' ? $this->once() : $this->never())
+ ->expects($this->once())
->method('set')
->with($setting, $value);
$this->l10n
@@ -136,13 +133,68 @@ class ThemingControllerTest extends TestCase {
->method('t')
->with($message)
->willReturn($message);
+ $this->scssCacher
+ ->expects($this->once())
+ ->method('getCachedSCSS')
+ ->with('core', '/core/css/server.scss')
+ ->willReturn('/core/css/someHash-server.scss');
+ $this->urlGenerator
+ ->expects($this->once())
+ ->method('linkTo')
+ ->with('', '/core/css/someHash-server.scss')
+ ->willReturn('/nextcloudWebroot/core/css/someHash-server.scss');
- $expected = new DataResponse([
- 'data' => [
- 'message' => $message,
- ],
- 'status' => $status,
- ]);
+ $expected = new DataResponse(
+ [
+ 'data' =>
+ [
+ 'message' => $message,
+ 'serverCssUrl' => '/nextcloudWebroot/core/css/someHash-server.scss',
+ ],
+ 'status' => 'success',
+ ]
+ );
+ $this->assertEquals($expected, $this->themingController->updateStylesheet($setting, $value));
+ }
+
+ public function dataUpdateStylesheetError() {
+ return [
+ ['name', str_repeat('a', 251), 'The given name is too long'],
+ ['url', str_repeat('a', 501), 'The given web address is too long'],
+ ['slogan', str_repeat('a', 501), 'The given slogan is too long'],
+ ['color', '0082C9', 'The given color is invalid'],
+ ['color', '#0082Z9', 'The given color is invalid'],
+ ['color', 'Nextcloud', 'The given color is invalid'],
+ ];
+ }
+
+ /**
+ * @dataProvider dataUpdateStylesheetError
+ *
+ * @param string $setting
+ * @param string $value
+ * @param string $message
+ */
+ public function testUpdateStylesheetError($setting, $value, $message) {
+ $this->themingDefaults
+ ->expects($this->never())
+ ->method('set')
+ ->with($setting, $value);
+ $this->l10n
+ ->expects($this->once())
+ ->method('t')
+ ->with($message)
+ ->willReturn($message);
+
+ $expected = new DataResponse(
+ [
+ 'data' =>
+ [
+ 'message' => $message,
+ ],
+ 'status' => 'error',
+ ]
+ );
$this->assertEquals($expected, $this->themingController->updateStylesheet($setting, $value));
}
@@ -411,6 +463,16 @@ class ThemingControllerTest extends TestCase {
->method('undo')
->with('MySetting')
->willReturn('MyValue');
+ $this->scssCacher
+ ->expects($this->once())
+ ->method('getCachedSCSS')
+ ->with('core', '/core/css/server.scss')
+ ->willReturn('/core/css/someHash-server.scss');
+ $this->urlGenerator
+ ->expects($this->once())
+ ->method('linkTo')
+ ->with('', '/core/css/someHash-server.scss')
+ ->willReturn('/nextcloudWebroot/core/css/someHash-server.scss');
$expected = new DataResponse(
[
@@ -418,6 +480,7 @@ class ThemingControllerTest extends TestCase {
[
'value' => 'MyValue',
'message' => 'Saved',
+ 'serverCssUrl' => '/nextcloudWebroot/core/css/someHash-server.scss',
],
'status' => 'success'
]
@@ -444,6 +507,16 @@ class ThemingControllerTest extends TestCase {
->method('undo')
->with($value)
->willReturn($value);
+ $this->scssCacher
+ ->expects($this->once())
+ ->method('getCachedSCSS')
+ ->with('core', '/core/css/server.scss')
+ ->willReturn('/core/css/someHash-server.scss');
+ $this->urlGenerator
+ ->expects($this->once())
+ ->method('linkTo')
+ ->with('', '/core/css/someHash-server.scss')
+ ->willReturn('/nextcloudWebroot/core/css/someHash-server.scss');
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$this->appData
@@ -466,6 +539,7 @@ class ThemingControllerTest extends TestCase {
[
'value' => $value,
'message' => 'Saved',
+ 'serverCssUrl' => '/nextcloudWebroot/core/css/someHash-server.scss',
],
'status' => 'success'
]
diff --git a/apps/user_ldap/lib/ILDAPWrapper.php b/apps/user_ldap/lib/ILDAPWrapper.php
index 4034d0baea4..71dd60c3725 100644
--- a/apps/user_ldap/lib/ILDAPWrapper.php
+++ b/apps/user_ldap/lib/ILDAPWrapper.php
@@ -82,14 +82,14 @@ interface ILDAPWrapper {
/**
* Return the LDAP error number of the last LDAP command
* @param resource $link LDAP link resource
- * @return string error message as string
+ * @return int error code
*/
public function errno($link);
/**
* Return the LDAP error message of the last LDAP command
* @param resource $link LDAP link resource
- * @return int error code as integer
+ * @return string error message
*/
public function error($link);
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index ebee0784130..eafd8eacd06 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -100,7 +100,7 @@ class LDAP implements ILDAPWrapper {
/**
* @param LDAP $link
- * @return mixed|string
+ * @return integer
*/
public function errno($link) {
return $this->invokeLDAPMethod('errno', $link);
@@ -108,7 +108,7 @@ class LDAP implements ILDAPWrapper {
/**
* @param LDAP $link
- * @return int|mixed
+ * @return string
*/
public function error($link) {
return $this->invokeLDAPMethod('error', $link);
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index f6b78208fd2..9d4da9cbf3f 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -1019,21 +1019,14 @@ class Wizard extends LDAPUtility {
/**
* Connects and Binds to an LDAP Server
+ *
* @param int $port the port to connect with
* @param bool $tls whether startTLS is to be used
- * @param bool $ncc
* @return bool
* @throws \Exception
*/
- private function connectAndBind($port = 389, $tls = false, $ncc = false) {
- if($ncc) {
- //No certificate check
- //FIXME: undo afterwards
- putenv('LDAPTLS_REQCERT=never');
- }
-
+ private function connectAndBind($port, $tls) {
//connect, does not really trigger any server communication
- \OCP\Util::writeLog('user_ldap', 'Wiz: Checking Host Info ', \OCP\Util::DEBUG);
$host = $this->configuration->ldapHost;
$hostInfo = parse_url($host);
if(!$hostInfo) {
@@ -1045,7 +1038,6 @@ class Wizard extends LDAPUtility {
throw new \Exception(self::$l->t('Invalid Host'));
}
- \OCP\Util::writeLog('user_ldap', 'Wiz: Setting LDAP Options ', \OCP\Util::DEBUG);
//set LDAP options
$this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
$this->ldap->setOption($cr, LDAP_OPT_REFERRALS, 0);
@@ -1074,18 +1066,13 @@ class Wizard extends LDAPUtility {
if($login === true) {
$this->ldap->unbind($cr);
- if($ncc) {
- throw new \Exception('Certificate cannot be validated.');
- }
\OCP\Util::writeLog('user_ldap', 'Wiz: Bind successful to Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG);
return true;
}
- if($errNo === -1 || ($errNo === 2 && $ncc)) {
+ if($errNo === -1) {
//host, port or TLS wrong
return false;
- } else if ($errNo === 2) {
- return $this->connectAndBind($port, $tls, true);
}
throw new \Exception($error, $errNo);
}