aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/l10n/de.js2
-rw-r--r--apps/files/l10n/de.json2
-rw-r--r--apps/files/l10n/de_DE.js2
-rw-r--r--apps/files/l10n/de_DE.json2
-rw-r--r--apps/files_sharing/css/public.scss6
-rw-r--r--apps/provisioning_api/lib/Controller/AUserData.php2
-rw-r--r--apps/provisioning_api/tests/Controller/UsersControllerTest.php4
-rw-r--r--apps/sharebymail/l10n/de.js2
-rw-r--r--apps/sharebymail/l10n/de.json2
-rw-r--r--apps/sharebymail/l10n/de_DE.js2
-rw-r--r--apps/sharebymail/l10n/de_DE.json2
-rw-r--r--apps/theming/l10n/nl.js1
-rw-r--r--apps/theming/l10n/nl.json1
-rw-r--r--apps/user_ldap/l10n/nl.js1
-rw-r--r--apps/user_ldap/l10n/nl.json1
-rw-r--r--build/integration/features/bootstrap/Provisioning.php6
-rw-r--r--config/config.sample.php19
-rw-r--r--core/js/placeholder.js10
-rw-r--r--lib/private/Lock/DBLockingProvider.php2
-rw-r--r--lib/private/Mail/Mailer.php3
-rw-r--r--lib/private/Mail/Message.php20
-rw-r--r--tests/lib/Mail/MailerTest.php5
-rw-r--r--tests/lib/Mail/MessageTest.php49
23 files changed, 106 insertions, 40 deletions
diff --git a/apps/files/l10n/de.js b/apps/files/l10n/de.js
index 31141b7f1e8..5ddb419e005 100644
--- a/apps/files/l10n/de.js
+++ b/apps/files/l10n/de.js
@@ -59,7 +59,7 @@ OC.L10N.register(
"_%n folder_::_%n folders_" : ["%n Ordner","%n Ordner"],
"_%n file_::_%n files_" : ["%n Datei","%n Dateien"],
"{dirs} and {files}" : "{dirs} und {files}",
- "_including %n hidden_::_including %n hidden_" : ["%n versteckten eingeschlossen","%n versteckten eingeschlossen"],
+ "_including %n hidden_::_including %n hidden_" : ["%n versteckte eingeschlossen","%n versteckte eingeschlossen"],
"You don’t have permission to upload or create files here" : "Du hast keine Berechtigung, hier Dateien hochzuladen oder zu erstellen",
"_Uploading %n file_::_Uploading %n files_" : ["%n Datei wird hochgeladen","%n Dateien werden hochgeladen"],
"New" : "Neu",
diff --git a/apps/files/l10n/de.json b/apps/files/l10n/de.json
index 27bb14838ad..b2104108251 100644
--- a/apps/files/l10n/de.json
+++ b/apps/files/l10n/de.json
@@ -57,7 +57,7 @@
"_%n folder_::_%n folders_" : ["%n Ordner","%n Ordner"],
"_%n file_::_%n files_" : ["%n Datei","%n Dateien"],
"{dirs} and {files}" : "{dirs} und {files}",
- "_including %n hidden_::_including %n hidden_" : ["%n versteckten eingeschlossen","%n versteckten eingeschlossen"],
+ "_including %n hidden_::_including %n hidden_" : ["%n versteckte eingeschlossen","%n versteckte eingeschlossen"],
"You don’t have permission to upload or create files here" : "Du hast keine Berechtigung, hier Dateien hochzuladen oder zu erstellen",
"_Uploading %n file_::_Uploading %n files_" : ["%n Datei wird hochgeladen","%n Dateien werden hochgeladen"],
"New" : "Neu",
diff --git a/apps/files/l10n/de_DE.js b/apps/files/l10n/de_DE.js
index 360ceb77e7b..e0daa185b77 100644
--- a/apps/files/l10n/de_DE.js
+++ b/apps/files/l10n/de_DE.js
@@ -59,7 +59,7 @@ OC.L10N.register(
"_%n folder_::_%n folders_" : ["%n Ordner","%n Ordner"],
"_%n file_::_%n files_" : ["%n Datei","%n Dateien"],
"{dirs} and {files}" : "{dirs} und {files}",
- "_including %n hidden_::_including %n hidden_" : ["%n versteckte eingeschlossen","%n versteckten eingeschlossen"],
+ "_including %n hidden_::_including %n hidden_" : ["%n versteckte eingeschlossen","%n versteckte eingeschlossen"],
"You don’t have permission to upload or create files here" : "Sie haben keine Berechtigung, hier Dateien hochzuladen oder zu erstellen",
"_Uploading %n file_::_Uploading %n files_" : ["%n Datei wird hoch geladen","%n Dateien werden hoch geladen"],
"New" : "Neu",
diff --git a/apps/files/l10n/de_DE.json b/apps/files/l10n/de_DE.json
index d3ec12010d3..041ddc0eff4 100644
--- a/apps/files/l10n/de_DE.json
+++ b/apps/files/l10n/de_DE.json
@@ -57,7 +57,7 @@
"_%n folder_::_%n folders_" : ["%n Ordner","%n Ordner"],
"_%n file_::_%n files_" : ["%n Datei","%n Dateien"],
"{dirs} and {files}" : "{dirs} und {files}",
- "_including %n hidden_::_including %n hidden_" : ["%n versteckte eingeschlossen","%n versteckten eingeschlossen"],
+ "_including %n hidden_::_including %n hidden_" : ["%n versteckte eingeschlossen","%n versteckte eingeschlossen"],
"You don’t have permission to upload or create files here" : "Sie haben keine Berechtigung, hier Dateien hochzuladen oder zu erstellen",
"_Uploading %n file_::_Uploading %n files_" : ["%n Datei wird hoch geladen","%n Dateien werden hoch geladen"],
"New" : "Neu",
diff --git a/apps/files_sharing/css/public.scss b/apps/files_sharing/css/public.scss
index 277814207b3..2a4225a7f12 100644
--- a/apps/files_sharing/css/public.scss
+++ b/apps/files_sharing/css/public.scss
@@ -35,12 +35,6 @@
height: auto;
min-height: 200px;
max-height: 800px;
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
}
#imgframe .ellipsis {
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php
index 82ca98ced8c..6c4967a6c3b 100644
--- a/apps/provisioning_api/lib/Controller/AUserData.php
+++ b/apps/provisioning_api/lib/Controller/AUserData.php
@@ -92,7 +92,7 @@ abstract class AUserData extends OCSController {
// Should be at least Admin Or SubAdmin!
if( $this->groupManager->isAdmin($currentLoggedInUser->getUID())
|| $this->groupManager->getSubAdmin()->isUserAccessible($currentLoggedInUser, $targetUserObject)) {
- $data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true');
+ $data['enabled'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true') === 'true';
} else {
// Check they are looking up themselves
if($currentLoggedInUser->getUID() !== $targetUserObject->getUID()) {
diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
index 6959f16f5cb..7625218e7e5 100644
--- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php
@@ -766,7 +766,7 @@ class UsersControllerTest extends TestCase {
$expected = [
'id' => 'UID',
- 'enabled' => 'true',
+ 'enabled' => true,
'storageLocation' => '/var/www/newtcloud/data/UID',
'lastLogin' => 1521191471000,
'backend' => 'Database',
@@ -881,7 +881,7 @@ class UsersControllerTest extends TestCase {
$expected = [
'id' => 'UID',
- 'enabled' => 'true',
+ 'enabled' => true,
'storageLocation' => '/var/www/newtcloud/data/UID',
'lastLogin' => 1521191471000,
'backend' => 'Database',
diff --git a/apps/sharebymail/l10n/de.js b/apps/sharebymail/l10n/de.js
index 63b0d0f55b6..7456b959727 100644
--- a/apps/sharebymail/l10n/de.js
+++ b/apps/sharebymail/l10n/de.js
@@ -29,7 +29,7 @@ OC.L10N.register(
"Password to access »%s« shared to you by %s" : "Das Passwort zum Zugriff auf %s wurde durch %s mit Dir geteilt.",
"Password to access »%s«" : "Passwort um auf »%s« zu zugreifen",
"It is protected with the following password: %s" : "Dies ist mit dem folgendem Passwort geschützt: %s",
- "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Du hast »%s« mit %s geteilt. Die Freigabe wurde an den Empfenger gesandt. Aufgrund der Sicherheits-Richtlinien die vom Administrator von %svorgegeben wurden, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund musst Du das Passwort selbst an den Empfänger senden.",
+ "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Du hast »%s« mit %s geteilt. Die Freigabe wurde an den Empfänger gesandt. Aufgrund der Sicherheits-Richtlinien die der Administrator von %s vorgegeben hat, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund musst Du das Passwort selbst an den Empfänger senden.",
"Password to access »%s« shared with %s" : "Passwort für den Zugriff auf %s, geteilt mit %s",
"This is the password: %s" : "Das Passwort lautet: %s",
"You can choose a different password at any time in the share dialog." : "Im Teilen-Dialog kannst Du jederzeit ein anderes Passwort wählen.",
diff --git a/apps/sharebymail/l10n/de.json b/apps/sharebymail/l10n/de.json
index acb51a3ff9a..ebdb263ad8a 100644
--- a/apps/sharebymail/l10n/de.json
+++ b/apps/sharebymail/l10n/de.json
@@ -27,7 +27,7 @@
"Password to access »%s« shared to you by %s" : "Das Passwort zum Zugriff auf %s wurde durch %s mit Dir geteilt.",
"Password to access »%s«" : "Passwort um auf »%s« zu zugreifen",
"It is protected with the following password: %s" : "Dies ist mit dem folgendem Passwort geschützt: %s",
- "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Du hast »%s« mit %s geteilt. Die Freigabe wurde an den Empfenger gesandt. Aufgrund der Sicherheits-Richtlinien die vom Administrator von %svorgegeben wurden, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund musst Du das Passwort selbst an den Empfänger senden.",
+ "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Du hast »%s« mit %s geteilt. Die Freigabe wurde an den Empfänger gesandt. Aufgrund der Sicherheits-Richtlinien die der Administrator von %s vorgegeben hat, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund musst Du das Passwort selbst an den Empfänger senden.",
"Password to access »%s« shared with %s" : "Passwort für den Zugriff auf %s, geteilt mit %s",
"This is the password: %s" : "Das Passwort lautet: %s",
"You can choose a different password at any time in the share dialog." : "Im Teilen-Dialog kannst Du jederzeit ein anderes Passwort wählen.",
diff --git a/apps/sharebymail/l10n/de_DE.js b/apps/sharebymail/l10n/de_DE.js
index ad208376738..b64cd6e801d 100644
--- a/apps/sharebymail/l10n/de_DE.js
+++ b/apps/sharebymail/l10n/de_DE.js
@@ -29,7 +29,7 @@ OC.L10N.register(
"Password to access »%s« shared to you by %s" : "Das Passwort zum Zugriff auf %s wurde durch %s mit Ihnen geteilt.",
"Password to access »%s«" : "Passwort um auf »%s« zu zugreifen",
"It is protected with the following password: %s" : "Dies ist mit dem folgendem Passwort geschützt: %s",
- "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Sie haben »%s« mit %s geteilt. Die Freigabe wurde an den Empfenger gesandt. Aufgrund der Sicherheits-Richtlinien die vom Administrator von %svorgegeben wurden, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund müssen Sie Passwort selbst an den Empfänger senden.",
+ "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Sie haben »%s« mit %s geteilt. Die Freigabe wurde an den Empfänger gesandt. Aufgrund der Sicherheits-Richtlinien die der Administrator von %svorgegeben hat, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund müssen Sie das Passwort selbst an den Empfänger senden.",
"Password to access »%s« shared with %s" : "Passwort für den Zugriff auf %s, geteilt mit %s",
"This is the password: %s" : "Das Passwort lautet: %s",
"You can choose a different password at any time in the share dialog." : "Im Teilen-Dialog können Sie jederzeit ein anderes Passwort wählen.",
diff --git a/apps/sharebymail/l10n/de_DE.json b/apps/sharebymail/l10n/de_DE.json
index 56eb2b91c03..ec4c52d3b13 100644
--- a/apps/sharebymail/l10n/de_DE.json
+++ b/apps/sharebymail/l10n/de_DE.json
@@ -27,7 +27,7 @@
"Password to access »%s« shared to you by %s" : "Das Passwort zum Zugriff auf %s wurde durch %s mit Ihnen geteilt.",
"Password to access »%s«" : "Passwort um auf »%s« zu zugreifen",
"It is protected with the following password: %s" : "Dies ist mit dem folgendem Passwort geschützt: %s",
- "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Sie haben »%s« mit %s geteilt. Die Freigabe wurde an den Empfenger gesandt. Aufgrund der Sicherheits-Richtlinien die vom Administrator von %svorgegeben wurden, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund müssen Sie Passwort selbst an den Empfänger senden.",
+ "You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient." : "Sie haben »%s« mit %s geteilt. Die Freigabe wurde an den Empfänger gesandt. Aufgrund der Sicherheits-Richtlinien die der Administrator von %svorgegeben hat, benötigt jede Freigabe einen Passwortschutz und es ist nicht zulässig, ein Passwort direkt an den Empfänger zu versenden. Aus diesem Grund müssen Sie das Passwort selbst an den Empfänger senden.",
"Password to access »%s« shared with %s" : "Passwort für den Zugriff auf %s, geteilt mit %s",
"This is the password: %s" : "Das Passwort lautet: %s",
"You can choose a different password at any time in the share dialog." : "Im Teilen-Dialog können Sie jederzeit ein anderes Passwort wählen.",
diff --git a/apps/theming/l10n/nl.js b/apps/theming/l10n/nl.js
index 0c21293c80f..9af639b765b 100644
--- a/apps/theming/l10n/nl.js
+++ b/apps/theming/l10n/nl.js
@@ -10,6 +10,7 @@ OC.L10N.register(
"The given web address is too long" : "Het opgegeven internetadres is te lang",
"The given slogan is too long" : "De opgegeven slagzin is te lang",
"The given color is invalid" : "De opgegeven kleur is ongeldig",
+ "The file was uploaded" : "Het bestand werd geüpload",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" : "Het geüploade bestand overschrijdt de upload_max_filesize richtlijn in php.ini:",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" : "Het bestand overschrijdt de MAX_FILE_SIZE richtlijn die is opgegeven in het HTML formulier",
"The file was only partially uploaded" : "Het bestand is slechts gedeeltelijk geüpload",
diff --git a/apps/theming/l10n/nl.json b/apps/theming/l10n/nl.json
index 5a75caf8446..8f19d7ab8a9 100644
--- a/apps/theming/l10n/nl.json
+++ b/apps/theming/l10n/nl.json
@@ -8,6 +8,7 @@
"The given web address is too long" : "Het opgegeven internetadres is te lang",
"The given slogan is too long" : "De opgegeven slagzin is te lang",
"The given color is invalid" : "De opgegeven kleur is ongeldig",
+ "The file was uploaded" : "Het bestand werd geüpload",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" : "Het geüploade bestand overschrijdt de upload_max_filesize richtlijn in php.ini:",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" : "Het bestand overschrijdt de MAX_FILE_SIZE richtlijn die is opgegeven in het HTML formulier",
"The file was only partially uploaded" : "Het bestand is slechts gedeeltelijk geüpload",
diff --git a/apps/user_ldap/l10n/nl.js b/apps/user_ldap/l10n/nl.js
index 3037f2aac6f..e3f3f19ef6b 100644
--- a/apps/user_ldap/l10n/nl.js
+++ b/apps/user_ldap/l10n/nl.js
@@ -184,6 +184,7 @@ OC.L10N.register(
"UUID Attribute for Users:" : "UUID attribuut voor gebruikers:",
"UUID Attribute for Groups:" : "UUID attribuut voor groepen:",
"Username-LDAP User Mapping" : "Gebruikersnaam-LDAP gebruikers vertaling",
+ "Usernames are used to store and assign metadata. In order to precisely identify and recognize users, each LDAP user will have an internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." : "Gebruikersnamen worden gebruikt om metadata op te slaan en toe te wijzen. Om gebruikers uniek te identificeren, krijgt elke LDAP-gebruiker ook een interne gebruikersnaam. Dit vereist een koppeling van de gebruikersnaam naar een ​​LDAP-gebruiker. De gecreëerde gebruikersnaam is gekoppeld aan de UUID van de LDAP-gebruiker. Aanvullend wordt ook de 'DN' gecached om het aantal LDAP-interacties te verminderen, maar dit wordt niet gebruikt voor identificatie. Als de DN verandert, zullen de veranderingen worden gevonden. De interne gebruikersnaam wordt overal gebruikt. Het wissen van de koppeling zal overal resten achterlaten. Het wissen van koppelingen is niet configuratiegevoelig, maar het raakt wel alle LDAP instellingen! Zorg ervoor dat deze koppelingen nooit in een productieomgeving gewist worden. Maak ze alleen leeg in een test- of ontwikkelomgeving.",
"Clear Username-LDAP User Mapping" : "Leegmaken Gebruikersnaam-LDAP gebruikers vertaling",
"Clear Groupname-LDAP Group Mapping" : "Leegmaken Groepsnaam-LDAP groep vertaling",
" entries available within the provided Base DN" : "accounts beschikbaar binnen de provider Basis DN",
diff --git a/apps/user_ldap/l10n/nl.json b/apps/user_ldap/l10n/nl.json
index a7bfe9ae0cb..db109d3c74d 100644
--- a/apps/user_ldap/l10n/nl.json
+++ b/apps/user_ldap/l10n/nl.json
@@ -182,6 +182,7 @@
"UUID Attribute for Users:" : "UUID attribuut voor gebruikers:",
"UUID Attribute for Groups:" : "UUID attribuut voor groepen:",
"Username-LDAP User Mapping" : "Gebruikersnaam-LDAP gebruikers vertaling",
+ "Usernames are used to store and assign metadata. In order to precisely identify and recognize users, each LDAP user will have an internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." : "Gebruikersnamen worden gebruikt om metadata op te slaan en toe te wijzen. Om gebruikers uniek te identificeren, krijgt elke LDAP-gebruiker ook een interne gebruikersnaam. Dit vereist een koppeling van de gebruikersnaam naar een ​​LDAP-gebruiker. De gecreëerde gebruikersnaam is gekoppeld aan de UUID van de LDAP-gebruiker. Aanvullend wordt ook de 'DN' gecached om het aantal LDAP-interacties te verminderen, maar dit wordt niet gebruikt voor identificatie. Als de DN verandert, zullen de veranderingen worden gevonden. De interne gebruikersnaam wordt overal gebruikt. Het wissen van de koppeling zal overal resten achterlaten. Het wissen van koppelingen is niet configuratiegevoelig, maar het raakt wel alle LDAP instellingen! Zorg ervoor dat deze koppelingen nooit in een productieomgeving gewist worden. Maak ze alleen leeg in een test- of ontwikkelomgeving.",
"Clear Username-LDAP User Mapping" : "Leegmaken Gebruikersnaam-LDAP gebruikers vertaling",
"Clear Groupname-LDAP Group Mapping" : "Leegmaken Groepsnaam-LDAP groep vertaling",
" entries available within the provided Base DN" : "accounts beschikbaar binnen de provider Basis DN",
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index 2543777faa5..0bc99cc561d 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -694,7 +694,8 @@ trait Provisioning {
];
$this->response = $client->get($fullUrl, $options);
- PHPUnit_Framework_Assert::assertEquals("false", simplexml_load_string($this->response->getBody())->data[0]->enabled);
+ // false in xml is empty
+ PHPUnit_Framework_Assert::assertTrue(empty(simplexml_load_string($this->response->getBody())->data[0]->enabled));
}
/**
@@ -713,7 +714,8 @@ trait Provisioning {
];
$this->response = $client->get($fullUrl, $options);
- PHPUnit_Framework_Assert::assertEquals("true", simplexml_load_string($this->response->getBody())->data[0]->enabled);
+ // boolean to string is integer
+ PHPUnit_Framework_Assert::assertEquals("1", simplexml_load_string($this->response->getBody())->data[0]->enabled);
}
/**
diff --git a/config/config.sample.php b/config/config.sample.php
index d1341feb0d2..b0ed2e7aa67 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -390,6 +390,18 @@ $CONFIG = array(
*/
'mail_smtppassword' => '',
+/**
+ * Replaces the default mail template layout. This can be utilized if the
+ * options to modify the mail texts with the theming app is not enough.
+ * The class must extend ``\OC\Mail\EMailTemplate``
+ */
+'mail_template_class' => '\OC\Mail\EMailTemplate',
+
+/**
+ * Email will be send by default with an HTML and a plain text body. This option
+ * allows to only send plain text emails.
+ */
+'mail_send_plaintext_only' => false,
/**
* Proxy Configurations
@@ -986,13 +998,6 @@ $CONFIG = array(
'systemtags.managerFactory' => '\OC\SystemTag\ManagerFactory',
/**
- * Replaces the default mail template layout. This can be utilized if the
- * options to modify the mail texts with the theming app is not enough.
- * The class must extend ``\OC\Mail\EMailTemplate``
- */
-'mail_template_class' => '\OC\Mail\EMailTemplate',
-
-/**
* Maintenance
*
* These options are for halting user activity when you are performing server
diff --git a/core/js/placeholder.js b/core/js/placeholder.js
index a73881344e3..a0dfe8491d4 100644
--- a/core/js/placeholder.js
+++ b/core/js/placeholder.js
@@ -112,7 +112,7 @@
// Convert a string to an integer evenly
function hashToInt(hash, maximum) {
- var final = 0;
+ var finalInt = 0;
var result = Array();
// Splitting evenly the string
@@ -121,13 +121,13 @@
result.push(parseInt(hash.charAt(i), 16) % 16);
}
// Adds up all results
- for (var i in result) {
- final += result[i];
+ for (var j in result) {
+ finalInt += result[j];
}
// chars in md5 goes up to f, hex:16
- return parseInt(final % maximum);
+ // make sure we're always using int in our operation
+ return parseInt(parseInt(finalInt) % maximum);
}
-
return finalPalette[hashToInt(hash, steps * 3 )];
};
diff --git a/lib/private/Lock/DBLockingProvider.php b/lib/private/Lock/DBLockingProvider.php
index 6538dcbc2ce..6adb7488217 100644
--- a/lib/private/Lock/DBLockingProvider.php
+++ b/lib/private/Lock/DBLockingProvider.php
@@ -210,6 +210,8 @@ class DBLockingProvider extends AbstractLockingProvider {
/**
* @param string $path
* @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE
+ *
+ * @suppress SqlInjectionChecker
*/
public function releaseLock(string $path, int $type) {
$this->markRelease($path, $type);
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index d55546769ee..001f7bd75c9 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -93,7 +93,8 @@ class Mailer implements IMailer {
* @return IMessage
*/
public function createMessage(): IMessage {
- return new Message(new \Swift_Message());
+ $plainTextOnly = $this->config->getSystemValue('mail_send_plaintext_only', false);
+ return new Message(new \Swift_Message(), $plainTextOnly);
}
/**
diff --git a/lib/private/Mail/Message.php b/lib/private/Mail/Message.php
index 7c7ecae8578..8a13e2c108c 100644
--- a/lib/private/Mail/Message.php
+++ b/lib/private/Mail/Message.php
@@ -39,12 +39,12 @@ use Swift_Message;
class Message implements IMessage {
/** @var Swift_Message */
private $swiftMessage;
+ /** @var bool */
+ private $plainTextOnly;
- /**
- * @param Swift_Message $swiftMessage
- */
- public function __construct(Swift_Message $swiftMessage) {
+ public function __construct(Swift_Message $swiftMessage, bool $plainTextOnly) {
$this->swiftMessage = $swiftMessage;
+ $this->plainTextOnly = $plainTextOnly;
}
/**
@@ -246,7 +246,9 @@ class Message implements IMessage {
* @return $this
*/
public function setHtmlBody($body) {
- $this->swiftMessage->addPart($body, 'text/html');
+ if (!$this->plainTextOnly) {
+ $this->swiftMessage->addPart($body, 'text/html');
+ }
return $this;
}
@@ -264,7 +266,9 @@ class Message implements IMessage {
* @return $this
*/
public function setBody($body, $contentType) {
- $this->swiftMessage->setBody($body, $contentType);
+ if (!$this->plainTextOnly || $contentType !== 'text/html') {
+ $this->swiftMessage->setBody($body, $contentType);
+ }
return $this;
}
@@ -275,7 +279,9 @@ class Message implements IMessage {
public function useTemplate(IEMailTemplate $emailTemplate): IMessage {
$this->setSubject($emailTemplate->renderSubject());
$this->setPlainBody($emailTemplate->renderText());
- $this->setHtmlBody($emailTemplate->renderHtml());
+ if (!$this->plainTextOnly) {
+ $this->setHtmlBody($emailTemplate->renderHtml());
+ }
return $this;
}
}
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php
index b0955a5d2fe..2dd4bca5190 100644
--- a/tests/lib/Mail/MailerTest.php
+++ b/tests/lib/Mail/MailerTest.php
@@ -95,6 +95,11 @@ class MailerTest extends TestCase {
}
public function testCreateMessage() {
+ $this->config
+ ->expects($this->any())
+ ->method('getSystemValue')
+ ->with('mail_send_plaintext_only', false)
+ ->will($this->returnValue(false));
$this->assertInstanceOf('\OC\Mail\Message', $this->mailer->createMessage());
}
diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php
index 78fd5f1bb8b..4b656938e48 100644
--- a/tests/lib/Mail/MessageTest.php
+++ b/tests/lib/Mail/MessageTest.php
@@ -9,6 +9,7 @@
namespace Test\Mail;
use OC\Mail\Message;
+use OCP\Mail\IEMailTemplate;
use Swift_Message;
use Test\TestCase;
@@ -36,7 +37,7 @@ class MessageTest extends TestCase {
$this->swiftMessage = $this->getMockBuilder('\Swift_Message')
->disableOriginalConstructor()->getMock();
- $this->message = new Message($this->swiftMessage);
+ $this->message = new Message($this->swiftMessage, false);
}
/**
@@ -180,4 +181,50 @@ class MessageTest extends TestCase {
$this->message->setHtmlBody('<blink>Fancy Body</blink>');
}
+ public function testPlainTextRenderOption() {
+ /** @var \PHPUnit_Framework_MockObject_MockObject|Swift_Message $swiftMessage */
+ $swiftMessage = $this->getMockBuilder('\Swift_Message')
+ ->disableOriginalConstructor()->getMock();
+ /** @var \PHPUnit_Framework_MockObject_MockObject|IEMailTemplate $template */
+ $template = $this->getMockBuilder('\OCP\Mail\IEMailTemplate')
+ ->disableOriginalConstructor()->getMock();
+
+ $message = new Message($swiftMessage, true);
+
+ $template
+ ->expects($this->never())
+ ->method('renderHTML');
+ $template
+ ->expects($this->once())
+ ->method('renderText');
+ $template
+ ->expects($this->once())
+ ->method('renderSubject');
+
+ $message->useTemplate($template);
+ }
+
+ public function testBothRenderingOptions() {
+ /** @var \PHPUnit_Framework_MockObject_MockObject|Swift_Message $swiftMessage */
+ $swiftMessage = $this->getMockBuilder('\Swift_Message')
+ ->disableOriginalConstructor()->getMock();
+ /** @var \PHPUnit_Framework_MockObject_MockObject|IEMailTemplate $template */
+ $template = $this->getMockBuilder('\OCP\Mail\IEMailTemplate')
+ ->disableOriginalConstructor()->getMock();
+
+ $message = new Message($swiftMessage, false);
+
+ $template
+ ->expects($this->once())
+ ->method('renderHTML');
+ $template
+ ->expects($this->once())
+ ->method('renderText');
+ $template
+ ->expects($this->once())
+ ->method('renderSubject');
+
+ $message->useTemplate($template);
+ }
+
}