summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/admin_audit/lib/AppInfo/Application.php13
-rw-r--r--apps/comments/appinfo/app.php2
-rw-r--r--apps/dav/l10n/sk.js4
-rw-r--r--apps/dav/l10n/sk.json4
-rw-r--r--apps/dav/l10n/sq.js3
-rw-r--r--apps/dav/l10n/sq.json3
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php7
-rw-r--r--apps/dav/lib/CalDAV/Search/SearchPlugin.php3
-rw-r--r--apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php2
-rw-r--r--apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php6
-rw-r--r--apps/dav/lib/Connector/Sabre/DavAclPlugin.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php8
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/SharesPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/TagsPlugin.php5
-rw-r--r--apps/dav/lib/DAV/Sharing/Backend.php2
-rw-r--r--apps/dav/lib/DAV/Sharing/Plugin.php5
-rw-r--r--apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php2
-rw-r--r--apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php2
-rw-r--r--apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php2
-rw-r--r--apps/encryption/l10n/id.js60
-rw-r--r--apps/encryption/l10n/id.json60
-rw-r--r--apps/encryption/lib/KeyManager.php2
-rw-r--r--apps/federatedfilesharing/l10n/id.js4
-rw-r--r--apps/federatedfilesharing/l10n/id.json4
-rw-r--r--apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php2
-rw-r--r--apps/federation/lib/AppInfo/Application.php3
-rw-r--r--apps/federation/lib/TrustedServers.php3
-rw-r--r--apps/files/ajax/list.php10
-rw-r--r--apps/files/appinfo/app.php5
-rw-r--r--apps/files/l10n/sk.js3
-rw-r--r--apps/files/l10n/sk.json3
-rw-r--r--apps/files/l10n/sq.js1
-rw-r--r--apps/files/l10n/sq.json1
-rw-r--r--apps/files/lib/App.php2
-rw-r--r--apps/files/lib/AppInfo/Application.php3
-rw-r--r--apps/files/lib/Command/Scan.php2
-rw-r--r--apps/files/lib/Command/ScanAppData.php2
-rw-r--r--apps/files/lib/Helper.php2
-rw-r--r--apps/files/lib/Settings/Admin.php2
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Parser.php2
-rw-r--r--apps/files_external/appinfo/app.php4
-rw-r--r--apps/files_external/l10n/id.js6
-rw-r--r--apps/files_external/l10n/id.json6
-rw-r--r--apps/files_external/lib/AppInfo/Application.php74
-rw-r--r--apps/files_external/lib/Controller/AjaxController.php4
-rw-r--r--apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php2
-rw-r--r--apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php2
-rw-r--r--apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php2
-rw-r--r--apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php6
-rw-r--r--apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php2
-rw-r--r--apps/files_external/lib/Lib/Auth/Password/Password.php2
-rw-r--r--apps/files_external/lib/Lib/Auth/PublicKey/RSA.php4
-rw-r--r--apps/files_external/lib/Lib/Backend/AmazonS3.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/DAV.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/FTP.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/Local.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/OwnCloud.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/SFTP.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/SFTP_Key.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/SMB.php4
-rw-r--r--apps/files_external/lib/Lib/Backend/SMB_OC.php2
-rw-r--r--apps/files_external/lib/Lib/Backend/Swift.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/OwnCloud.php5
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php9
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php10
-rw-r--r--apps/files_external/lib/Lib/Storage/Swift.php2
-rw-r--r--apps/files_external/lib/Service/BackendService.php2
-rw-r--r--apps/files_external/lib/config.php20
-rw-r--r--apps/files_sharing/appinfo/app.php7
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php6
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php4
-rw-r--r--apps/files_sharing/lib/External/Manager.php3
-rw-r--r--apps/files_sharing/lib/Helper.php2
-rw-r--r--apps/files_sharing/lib/Hooks.php2
-rw-r--r--apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php4
-rw-r--r--apps/files_sharing/lib/ShareBackend/File.php2
-rw-r--r--apps/files_sharing/lib/SharedMount.php2
-rw-r--r--apps/files_sharing/lib/Updater.php2
-rw-r--r--apps/files_trashbin/lib/AppInfo/Application.php6
-rw-r--r--apps/files_trashbin/lib/Expiration.php8
-rw-r--r--apps/files_trashbin/lib/Trashbin.php6
-rw-r--r--apps/files_versions/lib/AppInfo/Application.php6
-rw-r--r--apps/files_versions/lib/Expiration.php8
-rw-r--r--apps/files_versions/lib/Hooks.php16
-rw-r--r--apps/files_versions/lib/Storage.php2
-rw-r--r--apps/sharebymail/lib/AppInfo/Application.php3
-rw-r--r--apps/systemtags/appinfo/app.php5
-rw-r--r--apps/theming/appinfo/info.xml6
-rw-r--r--apps/theming/css/theming.scss18
-rw-r--r--apps/theming/lib/Migration/ThemingImages.php77
-rw-r--r--apps/theming/lib/ThemingDefaults.php4
-rw-r--r--apps/theming/tests/Migration/ThemingImages.php139
-rw-r--r--apps/theming/tests/ThemingDefaultsTest.php10
-rw-r--r--apps/user_ldap/ajax/getNewServerConfigPrefix.php2
-rw-r--r--apps/user_ldap/l10n/id.js10
-rw-r--r--apps/user_ldap/l10n/id.json10
-rw-r--r--apps/user_ldap/lib/Access.php39
-rw-r--r--apps/user_ldap/lib/AppInfo/Application.php3
-rw-r--r--apps/user_ldap/lib/Command/Search.php4
-rw-r--r--apps/user_ldap/lib/Connection.php8
-rw-r--r--apps/user_ldap/lib/Controller/ConfigAPIController.php2
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php8
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php2
-rw-r--r--apps/user_ldap/lib/Helper.php4
-rw-r--r--apps/user_ldap/lib/Jobs/CleanUp.php10
-rw-r--r--apps/user_ldap/lib/Migration/UUIDFixInsert.php2
-rw-r--r--apps/user_ldap/lib/User/Manager.php2
-rw-r--r--apps/user_ldap/lib/User/OfflineUser.php6
-rw-r--r--apps/user_ldap/lib/User/User.php24
-rw-r--r--apps/user_ldap/lib/User_LDAP.php13
-rw-r--r--apps/user_ldap/lib/Wizard.php14
-rw-r--r--apps/user_ldap/templates/renewpassword.php2
-rw-r--r--apps/user_ldap/templates/settings.php8
-rw-r--r--apps/workflowengine/lib/AppInfo/Application.php10
117 files changed, 410 insertions, 565 deletions
diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php
index 470352f895e..03423121eb4 100644
--- a/apps/admin_audit/lib/AppInfo/Application.php
+++ b/apps/admin_audit/lib/AppInfo/Application.php
@@ -48,6 +48,7 @@ use OCP\IPreview;
use OCP\IUserSession;
use OCP\Util;
use Symfony\Component\EventDispatcher\GenericEvent;
+use OCP\Share;
class Application extends App {
@@ -107,12 +108,12 @@ class Application extends App {
protected function sharingHooks(ILogger $logger) {
$shareActions = new Sharing($logger);
- Util::connectHook('OCP\Share', 'post_shared', $shareActions, 'shared');
- Util::connectHook('OCP\Share', 'post_unshare', $shareActions, 'unshare');
- Util::connectHook('OCP\Share', 'post_update_permissions', $shareActions, 'updatePermissions');
- Util::connectHook('OCP\Share', 'post_update_password', $shareActions, 'updatePassword');
- Util::connectHook('OCP\Share', 'post_set_expiration_date', $shareActions, 'updateExpirationDate');
- Util::connectHook('OCP\Share', 'share_link_access', $shareActions, 'shareAccessed');
+ Util::connectHook(Share::class, 'post_shared', $shareActions, 'shared');
+ Util::connectHook(Share::class, 'post_unshare', $shareActions, 'unshare');
+ Util::connectHook(Share::class, 'post_update_permissions', $shareActions, 'updatePermissions');
+ Util::connectHook(Share::class, 'post_update_password', $shareActions, 'updatePassword');
+ Util::connectHook(Share::class, 'post_set_expiration_date', $shareActions, 'updateExpirationDate');
+ Util::connectHook(Share::class, 'share_link_access', $shareActions, 'shareAccessed');
}
protected function authHooks(ILogger $logger) {
diff --git a/apps/comments/appinfo/app.php b/apps/comments/appinfo/app.php
index 15c545ae1e4..109063cd22e 100644
--- a/apps/comments/appinfo/app.php
+++ b/apps/comments/appinfo/app.php
@@ -36,7 +36,7 @@ $eventDispatcher->addListener(
$eventDispatcher->addListener(\OCP\Comments\CommentsEntityEvent::EVENT_ENTITY, function(\OCP\Comments\CommentsEntityEvent $event) {
$event->addEntityCollection('files', function($name) {
- $nodes = \OC::$server->getUserFolder()->getById(intval($name));
+ $nodes = \OC::$server->getUserFolder()->getById((int)$name);
return !empty($nodes);
});
});
diff --git a/apps/dav/l10n/sk.js b/apps/dav/l10n/sk.js
index 167a3f5e053..59bd102066a 100644
--- a/apps/dav/l10n/sk.js
+++ b/apps/dav/l10n/sk.js
@@ -57,6 +57,8 @@ OC.L10N.register(
"Request ID: %s" : "ID požiadavky: %s",
"CalDAV server" : "Server CalDAV",
"Send invitations to attendees" : "Odoslanie pozvánok účastníkom",
- "Please make sure to properly set up the email settings above." : "Uistite sa, že máte správne nastavené vyššie uvedené nastavenia e-mailu."
+ "Please make sure to properly set up the email settings above." : "Uistite sa, že máte správne nastavené vyššie uvedené nastavenia e-mailu.",
+ "Automatically generate a birthday calendar" : "Automaticky generovať narodeninový kalendár",
+ "Birthday calendars will be generated by a background job." : "Narodeninové kalendáre budú generované úlohou na pozadí."
},
"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;");
diff --git a/apps/dav/l10n/sk.json b/apps/dav/l10n/sk.json
index ffb75e0e49f..6e13d51b12c 100644
--- a/apps/dav/l10n/sk.json
+++ b/apps/dav/l10n/sk.json
@@ -55,6 +55,8 @@
"Request ID: %s" : "ID požiadavky: %s",
"CalDAV server" : "Server CalDAV",
"Send invitations to attendees" : "Odoslanie pozvánok účastníkom",
- "Please make sure to properly set up the email settings above." : "Uistite sa, že máte správne nastavené vyššie uvedené nastavenia e-mailu."
+ "Please make sure to properly set up the email settings above." : "Uistite sa, že máte správne nastavené vyššie uvedené nastavenia e-mailu.",
+ "Automatically generate a birthday calendar" : "Automaticky generovať narodeninový kalendár",
+ "Birthday calendars will be generated by a background job." : "Narodeninové kalendáre budú generované úlohou na pozadí."
},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"
} \ No newline at end of file
diff --git a/apps/dav/l10n/sq.js b/apps/dav/l10n/sq.js
index ecb7f350e09..c44c06f1a6c 100644
--- a/apps/dav/l10n/sq.js
+++ b/apps/dav/l10n/sq.js
@@ -41,6 +41,9 @@ OC.L10N.register(
"A calendar <strong>event</strong> was modified" : "Një <strong>event</strong> në kalendar u modifikua",
"A calendar <strong>todo</strong> was modified" : "Një kalendar <strong>todo<strong> u modifikua",
"Contact birthdays" : "Ditëlindjet e kontakteve",
+ "Hello %s," : "Përshëndetje %s,",
+ "%s invited you to »%s«" : "%s ju ftoi juve tek %s",
+ "Link:" : "Link:",
"Contacts" : "Kontaktet",
"Technical details" : "Detaje teknike",
"Remote Address: %s" : "Adresa remote: %s",
diff --git a/apps/dav/l10n/sq.json b/apps/dav/l10n/sq.json
index 981ace9d18a..a5d22616a01 100644
--- a/apps/dav/l10n/sq.json
+++ b/apps/dav/l10n/sq.json
@@ -39,6 +39,9 @@
"A calendar <strong>event</strong> was modified" : "Një <strong>event</strong> në kalendar u modifikua",
"A calendar <strong>todo</strong> was modified" : "Një kalendar <strong>todo<strong> u modifikua",
"Contact birthdays" : "Ditëlindjet e kontakteve",
+ "Hello %s," : "Përshëndetje %s,",
+ "%s invited you to »%s«" : "%s ju ftoi juve tek %s",
+ "Link:" : "Link:",
"Contacts" : "Kontaktet",
"Technical details" : "Detaje teknike",
"Remote Address: %s" : "Adresa remote: %s",
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index 62d218f0a2a..0f6e819bcc5 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -148,10 +148,11 @@ class BirthdayService {
/**
* @param string $cardData
* @param string $dateField
+ * @param string $postfix
* @param string $summarySymbol
* @return null|VCalendar
*/
- public function buildDateFromContact($cardData, $dateField, $summarySymbol) {
+ public function buildDateFromContact($cardData, $dateField, $postfix, $summarySymbol) {
if (empty($cardData)) {
return null;
}
@@ -221,7 +222,7 @@ class BirthdayService {
$date
);
$vEvent->DTEND['VALUE'] = 'DATE';
- $vEvent->{'UID'} = $doc->UID;
+ $vEvent->{'UID'} = $doc->UID . $postfix;
$vEvent->{'RRULE'} = 'FREQ=YEARLY';
$vEvent->{'SUMMARY'} = $summary;
$vEvent->{'TRANSP'} = 'TRANSPARENT';
@@ -297,7 +298,7 @@ class BirthdayService {
*/
private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) {
$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
- $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['symbol']);
+ $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix'], $type['symbol']);
$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
if (is_null($calendarData)) {
if (!is_null($existing)) {
diff --git a/apps/dav/lib/CalDAV/Search/SearchPlugin.php b/apps/dav/lib/CalDAV/Search/SearchPlugin.php
index 37000aa2eb8..e984267ff37 100644
--- a/apps/dav/lib/CalDAV/Search/SearchPlugin.php
+++ b/apps/dav/lib/CalDAV/Search/SearchPlugin.php
@@ -23,6 +23,7 @@
*/
namespace OCA\DAV\CalDAV\Search;
+use OCA\DAV\CalDAV\Search\Xml\Request\CalendarSearchReport;
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use OCA\DAV\CalDAV\CalendarHome;
@@ -78,7 +79,7 @@ class SearchPlugin extends ServerPlugin {
$server->on('report', [$this, 'report']);
$server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] =
- 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport';
+ CalendarSearchReport::class;
}
/**
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php
index 5fc38315438..bac661b6722 100644
--- a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php
+++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php
@@ -40,6 +40,6 @@ class LimitFilter implements XmlDeserializable {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value');
}
- return intval($value);
+ return (int)$value;
}
} \ No newline at end of file
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php
index 7aac59809a2..8ced850bbc0 100644
--- a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php
+++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php
@@ -40,6 +40,6 @@ class OffsetFilter implements XmlDeserializable {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value');
}
- return intval($value);
+ return (int)$value;
}
} \ No newline at end of file
diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
index ac625c3a9a4..58469d27205 100644
--- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
@@ -97,7 +97,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
}
$propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) {
- return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()));
+ return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId());
});
$propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) {
@@ -153,9 +153,9 @@ class CommentPropertiesPlugin extends ServerPlugin {
return null;
}
- $lastRead = $this->commentsManager->getReadMark('files', strval($node->getId()), $user);
+ $lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user);
- return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()), $lastRead);
+ return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead);
}
}
diff --git a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
index e77edd48651..fe747ee723b 100644
--- a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
@@ -27,6 +27,7 @@ use Sabre\CalDAV\Principal\User;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\INode;
use \Sabre\DAV\PropFind;
+use OCA\DAV\CardDAV\AddressBook;
/**
* Class DavAclPlugin is a wrapper around \Sabre\DAVACL\Plugin that returns 404
@@ -49,7 +50,7 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin {
$node = $this->server->tree->getNodeForPath($uri);
switch(get_class($node)) {
- case 'OCA\DAV\CardDAV\AddressBook':
+ case AddressBook::class:
$type = 'Addressbook';
break;
default:
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index b5333f48374..f36ebe5636c 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -339,10 +339,6 @@ class FilesPlugin extends ServerPlugin {
}
});
- $propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) {
- return $node->getFileInfo()->isEncrypted() ? '1' : '0';
- });
-
$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
return json_encode($this->previewManager->isAvailable($node->getFileInfo()));
});
@@ -391,6 +387,10 @@ class FilesPlugin extends ServerPlugin {
$propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) {
return $node->getSize();
});
+
+ $propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) {
+ return $node->getFileInfo()->isEncrypted() ? '1' : '0';
+ });
}
}
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index b8a8209129c..fd237b604a9 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -369,7 +369,7 @@ abstract class Node implements \Sabre\DAV\INode {
throw new \InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).');
}
- return intval($mtimeFromRequest);
+ return (int)$mtimeFromRequest;
}
}
diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
index 811a1fbfcbe..825b9821a2a 100644
--- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php
@@ -102,7 +102,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
*/
public function initialize(\Sabre\DAV\Server $server) {
$server->xml->namespacesMap[self::NS_OWNCLOUD] = 'oc';
- $server->xml->elementMap[self::SHARETYPES_PROPERTYNAME] = 'OCA\\DAV\\Connector\\Sabre\\ShareTypeList';
+ $server->xml->elementMap[self::SHARETYPES_PROPERTYNAME] = ShareTypeList::class;
$server->protectedProperties[] = self::SHARETYPES_PROPERTYNAME;
$this->server = $server;
diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
index 07e0f849a57..c9c9ec8661f 100644
--- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php
@@ -112,7 +112,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
public function initialize(\Sabre\DAV\Server $server) {
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
- $server->xml->elementMap[self::TAGS_PROPERTYNAME] = 'OCA\\DAV\\Connector\\Sabre\\TagList';
+ $server->xml->elementMap[self::TAGS_PROPERTYNAME] = TagList::class;
$this->server = $server;
$this->server->on('propFind', array($this, 'handleGetProperties'));
@@ -240,10 +240,9 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
}
}
- $tags = null;
$isFav = null;
- $propFind->handle(self::TAGS_PROPERTYNAME, function() use ($tags, &$isFav, $node) {
+ $propFind->handle(self::TAGS_PROPERTYNAME, function() use (&$isFav, $node) {
list($tags, $isFav) = $this->getTagsAndFav($node->getId());
return new TagList($tags);
});
diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php
index 141c54899ad..87c094c6d62 100644
--- a/apps/dav/lib/DAV/Sharing/Backend.php
+++ b/apps/dav/lib/DAV/Sharing/Backend.php
@@ -193,7 +193,7 @@ class Backend {
'href' => "principal:${row['principaluri']}",
'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '',
'status' => 1,
- 'readOnly' => ((int) $row['access'] === self::ACCESS_READ),
+ 'readOnly' => (int) $row['access'] === self::ACCESS_READ,
'{http://owncloud.org/ns}principal' => $row['principaluri'],
'{http://owncloud.org/ns}group-share' => is_null($p)
];
diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php
index 2ac65f94478..4d44c116427 100644
--- a/apps/dav/lib/DAV/Sharing/Plugin.php
+++ b/apps/dav/lib/DAV/Sharing/Plugin.php
@@ -25,6 +25,7 @@ namespace OCA\DAV\DAV\Sharing;
use OCA\DAV\Connector\Sabre\Auth;
use OCA\DAV\DAV\Sharing\Xml\Invite;
+use OCA\DAV\DAV\Sharing\Xml\ShareRequest;
use OCP\IRequest;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\INode;
@@ -100,8 +101,8 @@ class Plugin extends ServerPlugin {
*/
function initialize(Server $server) {
$this->server = $server;
- $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest';
- $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite';
+ $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = ShareRequest::class;
+ $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class;
$this->server->on('method:POST', [$this, 'httpPost']);
$this->server->on('propFind', [$this, 'propFind']);
diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php
index 9e1dee38fbd..b23bf8f14db 100644
--- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php
+++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php
@@ -147,7 +147,7 @@ class SystemTagsObjectMappingCollection implements ICollection {
function childExists($tagId) {
try {
- $result = ($this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true));
+ $result = $this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true);
if ($result) {
$tags = $this->tagManager->getTagsByIds([$tagId]);
diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
index c76ab832b14..eb4b3a7c9e6 100644
--- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
+++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php
@@ -60,7 +60,7 @@ class SystemTagsRelationsCollection extends SimpleCollection {
$userSession,
$groupManager,
function($name) {
- $nodes = \OC::$server->getUserFolder()->getById(intval($name));
+ $nodes = \OC::$server->getUserFolder()->getById((int)$name);
return !empty($nodes);
}
),
diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
index 867168033a4..739b81ddf01 100644
--- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
+++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
@@ -64,7 +64,7 @@ class BirthdayServiceTest extends TestCase {
* @param string | null $data
*/
public function testBuildBirthdayFromContact($expectedSummary, $data) {
- $cal = $this->service->buildDateFromContact($data, 'BDAY', '*');
+ $cal = $this->service->buildDateFromContact($data, 'BDAY', '', '*');
if ($expectedSummary === null) {
$this->assertNull($cal);
} else {
diff --git a/apps/encryption/l10n/id.js b/apps/encryption/l10n/id.js
index 2c6ec486a3c..a4106a01c21 100644
--- a/apps/encryption/l10n/id.js
+++ b/apps/encryption/l10n/id.js
@@ -1,62 +1,62 @@
OC.L10N.register(
"encryption",
{
- "Missing recovery key password" : "Sandi kunci pemuliahan tidak ada",
- "Please repeat the recovery key password" : "Silakan ulangi sandi kunci pemulihan",
- "Repeated recovery key password does not match the provided recovery key password" : "Sandi kunci pemulihan yang diulangi tidak cocok dengan sandi kunci pemulihan yang diberikan",
+ "Missing recovery key password" : "Kata sandi kunci pemuliahan tidak ada",
+ "Please repeat the recovery key password" : "Silakan ulangi kata sandi kunci pemulihan",
+ "Repeated recovery key password does not match the provided recovery key password" : "Kata sandi kunci pemulihan yang diulangi tidak cocok dengan kata sandi kunci pemulihan yang diberikan",
"Recovery key successfully enabled" : "Kunci pemulihan berhasil diaktifkan",
- "Could not enable recovery key. Please check your recovery key password!" : "Tidak dapat mengaktifkan kunci pemulihan. Silakan periksa sandi kunci pemulihan Anda!",
+ "Could not enable recovery key. Please check your recovery key password!" : "Tidak dapat mengaktifkan kunci pemulihan. Silakan periksa kata sandi kunci pemulihan Anda!",
"Recovery key successfully disabled" : "Kunci pemulihan berhasil dinonaktifkan",
- "Could not disable recovery key. Please check your recovery key password!" : "Tidak dapat menonaktifkan kunci pemulihan. Silakan periksa sandi kunci pemulihan Anda!",
+ "Could not disable recovery key. Please check your recovery key password!" : "Tidak dapat menonaktifkan kunci pemulihan. Silakan periksa kata sandi kunci pemulihan Anda!",
"Missing parameters" : "Parameter salah",
- "Please provide the old recovery password" : "Mohon berikan sandi pemulihan lama",
- "Please provide a new recovery password" : "Mohon berikan sandi pemulihan baru",
+ "Please provide the old recovery password" : "Mohon berikan kata sandi pemulihan lama",
+ "Please provide a new recovery password" : "Mohon berikan kata sandi pemulihan baru",
"Please repeat the new recovery password" : "Silakan ulangi sandi pemulihan baru",
- "Password successfully changed." : "Sandi berhasil diubah",
- "Could not change the password. Maybe the old password was not correct." : "Tidak dapat mengubah sandi. Kemungkinan sandi lama yang dimasukkan salah.",
+ "Password successfully changed." : "Kata sandi berhasil diubah",
+ "Could not change the password. Maybe the old password was not correct." : "Tidak dapat mengubah kata sandi. Kemungkinan kata sandi lama yang dimasukkan salah.",
"Recovery Key disabled" : "Kunci Pemulihan dinonaktifkan",
"Recovery Key enabled" : "Kunci Pemulihan diaktifkan",
"Could not enable the recovery key, please try again or contact your administrator" : "Tidak dapat mengaktifkan kunci pemulihan, silakan coba lagi atau hubungi administrator Anda",
- "Could not update the private key password." : "Tidak dapat memperbarui sandi kunci private.",
- "The old password was not correct, please try again." : "Sandi lama salah, mohon coba lagi.",
- "The current log-in password was not correct, please try again." : "Sandi masuk saat ini salah, mohon coba lagi.",
+ "Could not update the private key password." : "Tidak dapat memperbarui kata sandi kunci private.",
+ "The old password was not correct, please try again." : "Kata sandi lama salah, mohon coba lagi.",
+ "The current log-in password was not correct, please try again." : "Kata sandi masuk saat ini salah, mohon coba lagi.",
"Private key password successfully updated." : "Sandi kunci privat berhasil diperbarui.",
"You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Anda perlu mengganti kunci enkripsi Anda dari enkripsi lama (ownCloud <= 8.0) ke yang baru. Mohon jalankan 'occ encryption:migrate' atau hubungi administrator Anda",
- "Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files." : "Kunci privat tidak sah untuk aplikasi enkripsi. Silakan perbarui sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienkripsi.",
+ "Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files." : "Kunci privat tidak sah untuk aplikasi enkripsi. Silakan perbarui kata sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienkripsi.",
"Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again." : "Apl Enkripsi telah aktif, tapi kunci anda tidak diinisialisasikan. Harap keluar-log dan masuk-log kembali.",
"Encryption app is enabled and ready" : "Apl enkripsi aktif dan siap",
"Bad Signature" : "Tanda salah",
"Missing Signature" : "Tanda hilang",
- "one-time password for server-side-encryption" : "Sandi sekali pakai untuk server-side-encryption",
+ "one-time password for server-side-encryption" : "Kata sandi sekali pakai untuk server-side-encryption",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.",
"Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat membaca berkas ini, kemungkinan merupakan berkas berbagi. Silakan minta pemilik berkas untuk membagikan ulang kepada Anda.",
- "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Hai,\n\nadmin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan sandi '%s'.\n\nSilakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui sandi enkripsi Anda dengan memasukkan sandi ini kedalam kolom 'sandi masuk yang lama' dan sandi-masuk saat ini.\n\n",
+ "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Hai,\n\nadmin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan kata sandi '%s'.\n\nSilakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui kata sandi enkripsi Anda dengan memasukkan kata sandi ini kedalam kolom 'kata sandi masuk yang lama' dan kata sandi-masuk saat ini.\n\n",
"The share will expire on %s." : "Pembagian akan berakhir pada %s.",
"Cheers!" : "Horee!",
- "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Hai,<br><br>admin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan sandi <strong>%s</strong>.<br><br>Silakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui sandi enkripsi Anda dengan memasukkan sandi ini kedalam kolom 'sandi masuk yang lama' dan sandi masuk yang baru.<br><br>",
+ "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Hai,<br><br>admin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan kata sandi <strong>%s</strong>.<br><br>Silakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui kata sandi enkripsi Anda dengan memasukkan kata sandi ini kedalam kolom 'kata sandi masuk yang lama' dan kata sandi masuk yang baru.<br><br>",
"Default encryption module" : "Modul bawaan enkripsi",
"Encryption app is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikasi enkripsi telah diaktifkan tetapi kunci tidak terinisialisasi, silakan log-out dan log-in lagi",
"Encrypt the home storage" : "Enkripsi penyimpanan rumah",
"Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Mengaktifkan opsi ini akan mengenkripsi semua berkas yang disimpan pada penyimpanan utama, jika tidak diaktifkan maka hanya berkas pada penyimpanan eksternal saja yang akan dienkripsi.",
"Enable recovery key" : "Aktifkan kunci pemulihan",
"Disable recovery key" : "Nonaktifkan kunci pemulihan",
- "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kunci pemulihan adalah kunci enkripsi tambahan yang digunakan untuk mengenkripsi berkas. Kunci pemulihan memungkinkan untuk memulihkan berkas-berkas pengguna ketika pengguna tersebut melupakan sandi mereka.",
- "Recovery key password" : "Sandi kunci pemulihan",
- "Repeat recovery key password" : "Ulangi sandi kunci pemulihan",
- "Change recovery key password:" : "Ubah sandi kunci pemulihan:",
- "Old recovery key password" : "Sandi kunci pemulihan lama",
- "New recovery key password" : "Sandi kunci pemulihan baru",
+ "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kunci pemulihan adalah kunci enkripsi tambahan yang digunakan untuk mengenkripsi berkas. Kunci pemulihan memungkinkan untuk memulihkan berkas-berkas pengguna ketika pengguna tersebut melupakan kata sandi mereka.",
+ "Recovery key password" : "Kata sandi kunci pemulihan",
+ "Repeat recovery key password" : "Ulangi kata sandi kunci pemulihan",
+ "Change recovery key password:" : "Ubah kata sandi kunci pemulihan:",
+ "Old recovery key password" : "Kata sandi kunci pemulihan lama",
+ "New recovery key password" : "Kata sandi kunci pemulihan baru",
"Repeat new recovery key password" : "Ulangi sandi kunci pemulihan baru",
"Change Password" : "Ubah Sandi",
"Basic encryption module" : "Modul enkripsi dasar",
- "Your private key password no longer matches your log-in password." : "Sandi kunci private Anda tidak lagi cocok dengan sandi masuk Anda.",
- "Set your old private key password to your current log-in password:" : "Setel sandi kunci private Anda untuk sandi masuk Anda saat ini:",
- " If you don't remember your old password you can ask your administrator to recover your files." : "Jika Anda tidak ingat sandi lama, Anda dapat meminta administrator Anda untuk memulihkan berkas.",
- "Old log-in password" : "Sandi masuk yang lama",
- "Current log-in password" : "Sandi masuk saat ini",
- "Update Private Key Password" : "Perbarui Sandi Kunci Private",
- "Enable password recovery:" : "Aktifkan sandi pemulihan:",
- "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "Mengaktifkan opsi ini memungkinkan Anda untuk mendapatkan kembali akses ke berkas terenkripsi Anda dalam kasus kehilangan sandi",
+ "Your private key password no longer matches your log-in password." : "Kata sandi kunci private Anda tidak lagi cocok dengan kata sandi masuk Anda.",
+ "Set your old private key password to your current log-in password:" : "Setel kata sandi kunci private Anda untuk kata sandi masuk Anda saat ini:",
+ " If you don't remember your old password you can ask your administrator to recover your files." : "Jika Anda tidak ingat kata sandi lama, Anda dapat meminta administrator Anda untuk memulihkan berkas.",
+ "Old log-in password" : "Kata sandi masuk yang lama",
+ "Current log-in password" : "Kata sandi masuk saat ini",
+ "Update Private Key Password" : "Perbarui Kata Sandi Kunci Private",
+ "Enable password recovery:" : "Aktifkan kata sandi pemulihan:",
+ "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "Mengaktifkan opsi ini memungkinkan Anda untuk mendapatkan kembali akses ke berkas terenkripsi Anda dalam kasus kehilangan kata sandi",
"Enabled" : "Diaktifkan",
"Disabled" : "Dinonaktifkan",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikasi Enskripsi telah diaktifkan tetapi kunci tidak diinisialisasi, silakan log-out dan log-in lagi"
diff --git a/apps/encryption/l10n/id.json b/apps/encryption/l10n/id.json
index aa2dabe3347..81ea529c2d9 100644
--- a/apps/encryption/l10n/id.json
+++ b/apps/encryption/l10n/id.json
@@ -1,60 +1,60 @@
{ "translations": {
- "Missing recovery key password" : "Sandi kunci pemuliahan tidak ada",
- "Please repeat the recovery key password" : "Silakan ulangi sandi kunci pemulihan",
- "Repeated recovery key password does not match the provided recovery key password" : "Sandi kunci pemulihan yang diulangi tidak cocok dengan sandi kunci pemulihan yang diberikan",
+ "Missing recovery key password" : "Kata sandi kunci pemuliahan tidak ada",
+ "Please repeat the recovery key password" : "Silakan ulangi kata sandi kunci pemulihan",
+ "Repeated recovery key password does not match the provided recovery key password" : "Kata sandi kunci pemulihan yang diulangi tidak cocok dengan kata sandi kunci pemulihan yang diberikan",
"Recovery key successfully enabled" : "Kunci pemulihan berhasil diaktifkan",
- "Could not enable recovery key. Please check your recovery key password!" : "Tidak dapat mengaktifkan kunci pemulihan. Silakan periksa sandi kunci pemulihan Anda!",
+ "Could not enable recovery key. Please check your recovery key password!" : "Tidak dapat mengaktifkan kunci pemulihan. Silakan periksa kata sandi kunci pemulihan Anda!",
"Recovery key successfully disabled" : "Kunci pemulihan berhasil dinonaktifkan",
- "Could not disable recovery key. Please check your recovery key password!" : "Tidak dapat menonaktifkan kunci pemulihan. Silakan periksa sandi kunci pemulihan Anda!",
+ "Could not disable recovery key. Please check your recovery key password!" : "Tidak dapat menonaktifkan kunci pemulihan. Silakan periksa kata sandi kunci pemulihan Anda!",
"Missing parameters" : "Parameter salah",
- "Please provide the old recovery password" : "Mohon berikan sandi pemulihan lama",
- "Please provide a new recovery password" : "Mohon berikan sandi pemulihan baru",
+ "Please provide the old recovery password" : "Mohon berikan kata sandi pemulihan lama",
+ "Please provide a new recovery password" : "Mohon berikan kata sandi pemulihan baru",
"Please repeat the new recovery password" : "Silakan ulangi sandi pemulihan baru",
- "Password successfully changed." : "Sandi berhasil diubah",
- "Could not change the password. Maybe the old password was not correct." : "Tidak dapat mengubah sandi. Kemungkinan sandi lama yang dimasukkan salah.",
+ "Password successfully changed." : "Kata sandi berhasil diubah",
+ "Could not change the password. Maybe the old password was not correct." : "Tidak dapat mengubah kata sandi. Kemungkinan kata sandi lama yang dimasukkan salah.",
"Recovery Key disabled" : "Kunci Pemulihan dinonaktifkan",
"Recovery Key enabled" : "Kunci Pemulihan diaktifkan",
"Could not enable the recovery key, please try again or contact your administrator" : "Tidak dapat mengaktifkan kunci pemulihan, silakan coba lagi atau hubungi administrator Anda",
- "Could not update the private key password." : "Tidak dapat memperbarui sandi kunci private.",
- "The old password was not correct, please try again." : "Sandi lama salah, mohon coba lagi.",
- "The current log-in password was not correct, please try again." : "Sandi masuk saat ini salah, mohon coba lagi.",
+ "Could not update the private key password." : "Tidak dapat memperbarui kata sandi kunci private.",
+ "The old password was not correct, please try again." : "Kata sandi lama salah, mohon coba lagi.",
+ "The current log-in password was not correct, please try again." : "Kata sandi masuk saat ini salah, mohon coba lagi.",
"Private key password successfully updated." : "Sandi kunci privat berhasil diperbarui.",
"You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Anda perlu mengganti kunci enkripsi Anda dari enkripsi lama (ownCloud <= 8.0) ke yang baru. Mohon jalankan 'occ encryption:migrate' atau hubungi administrator Anda",
- "Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files." : "Kunci privat tidak sah untuk aplikasi enkripsi. Silakan perbarui sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienkripsi.",
+ "Invalid private key for encryption app. Please update your private key password in your personal settings to recover access to your encrypted files." : "Kunci privat tidak sah untuk aplikasi enkripsi. Silakan perbarui kata sandi kunci privat anda pada pengaturan pribadi untuk memulihkan akses ke berkas anda yang dienkripsi.",
"Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again." : "Apl Enkripsi telah aktif, tapi kunci anda tidak diinisialisasikan. Harap keluar-log dan masuk-log kembali.",
"Encryption app is enabled and ready" : "Apl enkripsi aktif dan siap",
"Bad Signature" : "Tanda salah",
"Missing Signature" : "Tanda hilang",
- "one-time password for server-side-encryption" : "Sandi sekali pakai untuk server-side-encryption",
+ "one-time password for server-side-encryption" : "Kata sandi sekali pakai untuk server-side-encryption",
"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.",
"Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Tidak dapat membaca berkas ini, kemungkinan merupakan berkas berbagi. Silakan minta pemilik berkas untuk membagikan ulang kepada Anda.",
- "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Hai,\n\nadmin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan sandi '%s'.\n\nSilakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui sandi enkripsi Anda dengan memasukkan sandi ini kedalam kolom 'sandi masuk yang lama' dan sandi-masuk saat ini.\n\n",
+ "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "Hai,\n\nadmin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan kata sandi '%s'.\n\nSilakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui kata sandi enkripsi Anda dengan memasukkan kata sandi ini kedalam kolom 'kata sandi masuk yang lama' dan kata sandi-masuk saat ini.\n\n",
"The share will expire on %s." : "Pembagian akan berakhir pada %s.",
"Cheers!" : "Horee!",
- "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Hai,<br><br>admin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan sandi <strong>%s</strong>.<br><br>Silakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui sandi enkripsi Anda dengan memasukkan sandi ini kedalam kolom 'sandi masuk yang lama' dan sandi masuk yang baru.<br><br>",
+ "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Hai,<br><br>admin mengaktifkan server-side-encryption. Berkas-berkas Anda dienkripsi menggunakan kata sandi <strong>%s</strong>.<br><br>Silakan masuk di antarmuka web, pergi ke bagian 'modul enkripsi dasar' pada pengaturan pribadi Anda dan perbarui kata sandi enkripsi Anda dengan memasukkan kata sandi ini kedalam kolom 'kata sandi masuk yang lama' dan kata sandi masuk yang baru.<br><br>",
"Default encryption module" : "Modul bawaan enkripsi",
"Encryption app is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikasi enkripsi telah diaktifkan tetapi kunci tidak terinisialisasi, silakan log-out dan log-in lagi",
"Encrypt the home storage" : "Enkripsi penyimpanan rumah",
"Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Mengaktifkan opsi ini akan mengenkripsi semua berkas yang disimpan pada penyimpanan utama, jika tidak diaktifkan maka hanya berkas pada penyimpanan eksternal saja yang akan dienkripsi.",
"Enable recovery key" : "Aktifkan kunci pemulihan",
"Disable recovery key" : "Nonaktifkan kunci pemulihan",
- "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kunci pemulihan adalah kunci enkripsi tambahan yang digunakan untuk mengenkripsi berkas. Kunci pemulihan memungkinkan untuk memulihkan berkas-berkas pengguna ketika pengguna tersebut melupakan sandi mereka.",
- "Recovery key password" : "Sandi kunci pemulihan",
- "Repeat recovery key password" : "Ulangi sandi kunci pemulihan",
- "Change recovery key password:" : "Ubah sandi kunci pemulihan:",
- "Old recovery key password" : "Sandi kunci pemulihan lama",
- "New recovery key password" : "Sandi kunci pemulihan baru",
+ "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kunci pemulihan adalah kunci enkripsi tambahan yang digunakan untuk mengenkripsi berkas. Kunci pemulihan memungkinkan untuk memulihkan berkas-berkas pengguna ketika pengguna tersebut melupakan kata sandi mereka.",
+ "Recovery key password" : "Kata sandi kunci pemulihan",
+ "Repeat recovery key password" : "Ulangi kata sandi kunci pemulihan",
+ "Change recovery key password:" : "Ubah kata sandi kunci pemulihan:",
+ "Old recovery key password" : "Kata sandi kunci pemulihan lama",
+ "New recovery key password" : "Kata sandi kunci pemulihan baru",
"Repeat new recovery key password" : "Ulangi sandi kunci pemulihan baru",
"Change Password" : "Ubah Sandi",
"Basic encryption module" : "Modul enkripsi dasar",
- "Your private key password no longer matches your log-in password." : "Sandi kunci private Anda tidak lagi cocok dengan sandi masuk Anda.",
- "Set your old private key password to your current log-in password:" : "Setel sandi kunci private Anda untuk sandi masuk Anda saat ini:",
- " If you don't remember your old password you can ask your administrator to recover your files." : "Jika Anda tidak ingat sandi lama, Anda dapat meminta administrator Anda untuk memulihkan berkas.",
- "Old log-in password" : "Sandi masuk yang lama",
- "Current log-in password" : "Sandi masuk saat ini",
- "Update Private Key Password" : "Perbarui Sandi Kunci Private",
- "Enable password recovery:" : "Aktifkan sandi pemulihan:",
- "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "Mengaktifkan opsi ini memungkinkan Anda untuk mendapatkan kembali akses ke berkas terenkripsi Anda dalam kasus kehilangan sandi",
+ "Your private key password no longer matches your log-in password." : "Kata sandi kunci private Anda tidak lagi cocok dengan kata sandi masuk Anda.",
+ "Set your old private key password to your current log-in password:" : "Setel kata sandi kunci private Anda untuk kata sandi masuk Anda saat ini:",
+ " If you don't remember your old password you can ask your administrator to recover your files." : "Jika Anda tidak ingat kata sandi lama, Anda dapat meminta administrator Anda untuk memulihkan berkas.",
+ "Old log-in password" : "Kata sandi masuk yang lama",
+ "Current log-in password" : "Kata sandi masuk saat ini",
+ "Update Private Key Password" : "Perbarui Kata Sandi Kunci Private",
+ "Enable password recovery:" : "Aktifkan kata sandi pemulihan:",
+ "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "Mengaktifkan opsi ini memungkinkan Anda untuk mendapatkan kembali akses ke berkas terenkripsi Anda dalam kasus kehilangan kata sandi",
"Enabled" : "Diaktifkan",
"Disabled" : "Dinonaktifkan",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Aplikasi Enskripsi telah diaktifkan tetapi kunci tidak diinisialisasi, silakan log-out dan log-in lagi"
diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php
index e52da123fe0..d1776cbe50c 100644
--- a/apps/encryption/lib/KeyManager.php
+++ b/apps/encryption/lib/KeyManager.php
@@ -211,7 +211,7 @@ class KeyManager {
*/
public function recoveryKeyExists() {
$key = $this->getRecoveryKey();
- return (!empty($key));
+ return !empty($key);
}
/**
diff --git a/apps/federatedfilesharing/l10n/id.js b/apps/federatedfilesharing/l10n/id.js
index 4760bb17b90..3cdd399f2e3 100644
--- a/apps/federatedfilesharing/l10n/id.js
+++ b/apps/federatedfilesharing/l10n/id.js
@@ -4,7 +4,7 @@ OC.L10N.register(
"Federated sharing" : "Pembagian terfederasi",
"Do you want to add the remote share {name} from {owner}@{remote}?" : "Apakah Anda ingin menambahkan pembagian remote {name} dari {owner}@{remote}?",
"Remote share" : "Berbagi remote",
- "Remote share password" : "Sandi berbagi remote",
+ "Remote share password" : "Kata sandi berbagi jarak jauh",
"Cancel" : "Batalkan",
"Add remote share" : "Tambah berbagi remote",
"Copy" : "Salin",
@@ -15,7 +15,7 @@ OC.L10N.register(
"Invalid Federated Cloud ID" : "Federated Cloud ID tidak sah",
"Server to server sharing is not enabled on this server" : "Berbagi server ke server tidak diaktifkan pada server ini",
"Couldn't establish a federated share." : "Tidak dapat mendirikan pembagian terfederasi",
- "Couldn't establish a federated share, maybe the password was wrong." : "Tidak dapat mendirikan pembagian terfederasi, mungkin sandi salah.",
+ "Couldn't establish a federated share, maybe the password was wrong." : "Tidak dapat mendirikan pembagian terfederasi, mungkin kata sandi salah.",
"The mountpoint name contains invalid characters." : "Nama mount point berisi karakter yang tidak sah.",
"Not allowed to create a federated share with the owner." : "Tidak diizinkan membuat pembagian terfederasi dengan pemilik.",
"Invalid or untrusted SSL certificate" : "Sertifikat SSL tidak sah atau tidak terpercaya",
diff --git a/apps/federatedfilesharing/l10n/id.json b/apps/federatedfilesharing/l10n/id.json
index 95da03dff5b..14083a28ed7 100644
--- a/apps/federatedfilesharing/l10n/id.json
+++ b/apps/federatedfilesharing/l10n/id.json
@@ -2,7 +2,7 @@
"Federated sharing" : "Pembagian terfederasi",
"Do you want to add the remote share {name} from {owner}@{remote}?" : "Apakah Anda ingin menambahkan pembagian remote {name} dari {owner}@{remote}?",
"Remote share" : "Berbagi remote",
- "Remote share password" : "Sandi berbagi remote",
+ "Remote share password" : "Kata sandi berbagi jarak jauh",
"Cancel" : "Batalkan",
"Add remote share" : "Tambah berbagi remote",
"Copy" : "Salin",
@@ -13,7 +13,7 @@
"Invalid Federated Cloud ID" : "Federated Cloud ID tidak sah",
"Server to server sharing is not enabled on this server" : "Berbagi server ke server tidak diaktifkan pada server ini",
"Couldn't establish a federated share." : "Tidak dapat mendirikan pembagian terfederasi",
- "Couldn't establish a federated share, maybe the password was wrong." : "Tidak dapat mendirikan pembagian terfederasi, mungkin sandi salah.",
+ "Couldn't establish a federated share, maybe the password was wrong." : "Tidak dapat mendirikan pembagian terfederasi, mungkin kata sandi salah.",
"The mountpoint name contains invalid characters." : "Nama mount point berisi karakter yang tidak sah.",
"Not allowed to create a federated share with the owner." : "Tidak diizinkan membuat pembagian terfederasi dengan pemilik.",
"Invalid or untrusted SSL certificate" : "Sertifikat SSL tidak sah atau tidak terpercaya",
diff --git a/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php b/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
index bd0990e37c2..de2edfe60f7 100644
--- a/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
+++ b/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
@@ -120,7 +120,7 @@ class RetryJob extends Job {
* @param array $argument
*/
protected function reAddJob(IJobList $jobList, array $argument) {
- $jobList->add('OCA\FederatedFileSharing\BackgroundJob\RetryJob',
+ $jobList->add(RetryJob::class,
[
'remote' => $argument['remote'],
'remoteId' => $argument['remoteId'],
diff --git a/apps/federation/lib/AppInfo/Application.php b/apps/federation/lib/AppInfo/Application.php
index ea8116e4353..3798a03cb54 100644
--- a/apps/federation/lib/AppInfo/Application.php
+++ b/apps/federation/lib/AppInfo/Application.php
@@ -32,6 +32,7 @@ use OCP\SabrePluginEvent;
use OCP\Util;
use Sabre\DAV\Auth\Plugin;
use Sabre\DAV\Server;
+use OCP\Share;
class Application extends App {
@@ -59,7 +60,7 @@ class Application extends App {
$hooksManager = $container->query(Hooks::class);
Util::connectHook(
- 'OCP\Share',
+ Share::class,
'federated_share_added',
$hooksManager,
'addServerHook'
diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php
index 2067533c3e7..eda77a79325 100644
--- a/apps/federation/lib/TrustedServers.php
+++ b/apps/federation/lib/TrustedServers.php
@@ -28,6 +28,7 @@
namespace OCA\Federation;
use OC\HintException;
+use OCA\Federation\BackgroundJob\RequestSharedSecret;
use OCP\AppFramework\Http;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
@@ -116,7 +117,7 @@ class TrustedServers {
$token = $this->secureRandom->generate(16);
$this->dbHandler->addToken($url, $token);
$this->jobList->add(
- 'OCA\Federation\BackgroundJob\RequestSharedSecret',
+ RequestSharedSecret::class,
[
'url' => $url,
'token' => $token,
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index d91db8744c4..617ad18ac14 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -23,6 +23,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
+use OCP\Files\StorageNotAvailableException;
+use OCP\Files\StorageInvalidException;
+
OCP\JSON::checkLoggedIn();
\OC::$server->getSession()->close();
$l = \OC::$server->getL10N('files');
@@ -80,7 +84,7 @@ try {
\OCP\Util::logException('files', $e);
OCP\JSON::error([
'data' => [
- 'exception' => '\OCP\Files\StorageNotAvailableException',
+ 'exception' => StorageNotAvailableException::class,
'message' => $l->t('Storage is temporarily not available')
]
]);
@@ -88,7 +92,7 @@ try {
\OCP\Util::logException('files', $e);
OCP\JSON::error(array(
'data' => array(
- 'exception' => '\OCP\Files\StorageInvalidException',
+ 'exception' => StorageInvalidException::class,
'message' => $l->t('Storage invalid')
)
));
@@ -96,7 +100,7 @@ try {
\OCP\Util::logException('files', $e);
OCP\JSON::error(array(
'data' => array(
- 'exception' => '\Exception',
+ 'exception' => \Exception::class,
'message' => $l->t('Unknown error')
)
));
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index b540c2e7682..fbe33fb54fe 100644
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -24,11 +24,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
+use OC\Search\Provider\File;
+
// required for translation purpose
// t('Files')
$l = \OC::$server->getL10N('files');
-\OC::$server->getSearch()->registerProvider('OC\Search\Provider\File', array('apps' => array('files')));
+\OC::$server->getSearch()->registerProvider(File::class, array('apps' => array('files')));
$templateManager = \OC_Helper::getFileTemplateManager();
$templateManager->registerTemplate('text/html', 'core/templates/filetemplates/template.html');
diff --git a/apps/files/l10n/sk.js b/apps/files/l10n/sk.js
index 5ebd9fc168b..be934c05333 100644
--- a/apps/files/l10n/sk.js
+++ b/apps/files/l10n/sk.js
@@ -19,6 +19,7 @@ OC.L10N.register(
"Uploading …" : "Nahrávanie...",
"…" : "...",
"{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} z {totalSize} ({bitrate})",
+ "Target folder does not exist any more" : "Cieľový priečinok už neexistuje",
"Actions" : "Akcie",
"Download" : "Sťahovanie",
"Rename" : "Premenovať",
@@ -60,6 +61,8 @@ OC.L10N.register(
"You don’t have permission to upload or create files here" : "Nemáte oprávnenie sem nahrávať alebo vytvoriť súbory",
"_Uploading %n file_::_Uploading %n files_" : ["Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"],
"New" : "Nový",
+ "{used} of {quota} used" : "použitých {used} z {quota}",
+ "{used} used" : "{used} použitých",
"\"{name}\" is an invalid file name." : "\"{name}\" je neplatné meno súboru.",
"File name cannot be empty." : "Meno súboru nemôže byť prázdne",
"\"{name}\" is not an allowed filetype" : "\"{name}\" nie je povolený typ súboru",
diff --git a/apps/files/l10n/sk.json b/apps/files/l10n/sk.json
index 19d7d7b72c4..70f567b055c 100644
--- a/apps/files/l10n/sk.json
+++ b/apps/files/l10n/sk.json
@@ -17,6 +17,7 @@
"Uploading …" : "Nahrávanie...",
"…" : "...",
"{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} z {totalSize} ({bitrate})",
+ "Target folder does not exist any more" : "Cieľový priečinok už neexistuje",
"Actions" : "Akcie",
"Download" : "Sťahovanie",
"Rename" : "Premenovať",
@@ -58,6 +59,8 @@
"You don’t have permission to upload or create files here" : "Nemáte oprávnenie sem nahrávať alebo vytvoriť súbory",
"_Uploading %n file_::_Uploading %n files_" : ["Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"],
"New" : "Nový",
+ "{used} of {quota} used" : "použitých {used} z {quota}",
+ "{used} used" : "{used} použitých",
"\"{name}\" is an invalid file name." : "\"{name}\" je neplatné meno súboru.",
"File name cannot be empty." : "Meno súboru nemôže byť prázdne",
"\"{name}\" is not an allowed filetype" : "\"{name}\" nie je povolený typ súboru",
diff --git a/apps/files/l10n/sq.js b/apps/files/l10n/sq.js
index 3a399954442..0d7dcf7089e 100644
--- a/apps/files/l10n/sq.js
+++ b/apps/files/l10n/sq.js
@@ -115,6 +115,7 @@ OC.L10N.register(
"Settings" : "Rregullime",
"Show hidden files" : "Shfaq kartela të fshehura",
"WebDAV" : "WebDAV",
+ "Cancel upload" : "Anulo ngarkimin",
"No files in here" : "S’ka kartela këtu",
"Upload some content or sync with your devices!" : "Ngarkoni ca lëndë ose bëni njëkohësim me pajisjet tuaja!",
"No entries found in this folder" : "Në këtë dosje s’u gjetën zëra",
diff --git a/apps/files/l10n/sq.json b/apps/files/l10n/sq.json
index 2baf0c01927..835e060ae59 100644
--- a/apps/files/l10n/sq.json
+++ b/apps/files/l10n/sq.json
@@ -113,6 +113,7 @@
"Settings" : "Rregullime",
"Show hidden files" : "Shfaq kartela të fshehura",
"WebDAV" : "WebDAV",
+ "Cancel upload" : "Anulo ngarkimin",
"No files in here" : "S’ka kartela këtu",
"Upload some content or sync with your devices!" : "Ngarkoni ca lëndë ose bëni njëkohësim me pajisjet tuaja!",
"No entries found in this folder" : "Në këtë dosje s’u gjetën zëra",
diff --git a/apps/files/lib/App.php b/apps/files/lib/App.php
index b756b123c43..0bf9ae20525 100644
--- a/apps/files/lib/App.php
+++ b/apps/files/lib/App.php
@@ -57,7 +57,7 @@ class App {
public static function extendJsConfig($settings) {
$appConfig = json_decode($settings['array']['oc_appconfig'], true);
- $maxChunkSize = (int)(\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', (10 * 1024 * 1024)));
+ $maxChunkSize = (int)\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024);
$appConfig['files'] = [
'max_chunk_size' => $maxChunkSize
];
diff --git a/apps/files/lib/AppInfo/Application.php b/apps/files/lib/AppInfo/Application.php
index e55d1c549a5..064f2baa987 100644
--- a/apps/files/lib/AppInfo/Application.php
+++ b/apps/files/lib/AppInfo/Application.php
@@ -31,6 +31,7 @@ use OCP\AppFramework\App;
use \OCA\Files\Service\TagService;
use \OCP\IContainer;
use OCA\Files\Controller\ViewController;
+use OCA\Files\Capabilities;
class Application extends App {
public function __construct(array $urlParams=array()) {
@@ -95,6 +96,6 @@ class Application extends App {
/*
* Register capabilities
*/
- $container->registerCapability('OCA\Files\Capabilities');
+ $container->registerCapability(Capabilities::class);
}
}
diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php
index 4026af2db79..c3b63f053f5 100644
--- a/apps/files/lib/Command/Scan.php
+++ b/apps/files/lib/Command/Scan.php
@@ -322,7 +322,7 @@ class Scan extends Base {
* @return string
*/
protected function formatExecTime() {
- list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime)));
+ list($secs, ) = explode('.', sprintf("%.1f", $this->execTime));
# if you want to have microseconds add this: . '.' . $tens;
return date('H:i:s', $secs);
diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php
index f347cb868b1..1eb22d5f68a 100644
--- a/apps/files/lib/Command/ScanAppData.php
+++ b/apps/files/lib/Command/ScanAppData.php
@@ -260,7 +260,7 @@ class ScanAppData extends Base {
* @return string
*/
protected function formatExecTime() {
- list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime)));
+ list($secs, ) = explode('.', sprintf("%.1f", $this->execTime));
# if you want to have microseconds add this: . '.' . $tens;
return date('H:i:s', $secs);
diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php
index 9d9717c9401..3ea1504bc8a 100644
--- a/apps/files/lib/Helper.php
+++ b/apps/files/lib/Helper.php
@@ -261,7 +261,7 @@ class Helper {
} else if ($sortAttribute === 'size') {
$sortFunc = 'compareSize';
}
- usort($files, array('\OCA\Files\Helper', $sortFunc));
+ usort($files, array(Helper::class, $sortFunc));
if ($sortDescending) {
$files = array_reverse($files);
}
diff --git a/apps/files/lib/Settings/Admin.php b/apps/files/lib/Settings/Admin.php
index 4965c1e6c17..2f4406c150b 100644
--- a/apps/files/lib/Settings/Admin.php
+++ b/apps/files/lib/Settings/Admin.php
@@ -56,7 +56,7 @@ class Admin implements ISettings {
$maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size));
$parameters = [
- 'uploadChangable' => (($htaccessWorking and $htaccessWritable) or $userIniWritable ),
+ 'uploadChangable' => ($htaccessWorking and $htaccessWritable) or $userIniWritable,
'uploadMaxFilesize' => $maxUploadFilesize,
// max possible makes only sense on a 32 bit system
'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4,
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Parser.php b/apps/files_external/3rdparty/icewind/smb/src/Parser.php
index 3142f9c29e0..c6515002657 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Parser.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Parser.php
@@ -133,7 +133,7 @@ class Parser {
return [
'mtime' => strtotime($data['write_time']),
'mode' => hexdec(substr($data['attributes'], strpos($data['attributes'], '('), -1)),
- 'size' => isset($data['stream']) ? intval(explode(' ', $data['stream'])[1]) : 0
+ 'size' => isset($data['stream']) ? (int)explode(' ', $data['stream'])[1] : 0
];
}
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 4a1b7c1b09c..3f7094f4dca 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -26,6 +26,8 @@
*
*/
+use OCA\Files_External\Config\ConfigAdapter;
+
OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php';
require_once __DIR__ . '/../3rdparty/autoload.php';
@@ -45,5 +47,5 @@ $appContainer = \OC_Mount_Config::$app->getContainer();
];
});
-$mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter');
+$mountProvider = $appContainer->query(ConfigAdapter::class);
\OC::$server->getMountProviderCollection()->registerProvider($mountProvider);
diff --git a/apps/files_external/l10n/id.js b/apps/files_external/l10n/id.js
index ff8cb00c9c6..769659738a6 100644
--- a/apps/files_external/l10n/id.js
+++ b/apps/files_external/l10n/id.js
@@ -26,7 +26,7 @@ OC.L10N.register(
"Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Beberapa mount point eksternal tidak terhubung. Klik barisan merah untuk informasi selanjutnya",
"Please enter the credentials for the {mount} mount" : "Masukkan kredensial untuk mount {mount}",
"Username" : "Nama Pengguna",
- "Password" : "Sandi",
+ "Password" : "Kata sandi",
"Credentials saved" : "Kredensial tersimpan",
"Credentials saving failed" : "Penyimpanan kredensial gagal",
"Credentials required" : "Kredensial dibutuhkan",
@@ -55,9 +55,9 @@ OC.L10N.register(
"Identity endpoint URL" : "Identitas URL akhir",
"Rackspace" : "Rackspace",
"API key" : "Kunci API",
- "Global credentials" : "Sandi Global",
+ "Global credentials" : "Kata sandi Global",
"Log-in credentials, save in database" : "Kredensial masuk, simpan di basis data",
- "Username and password" : "Nama pengguna dan sandi",
+ "Username and password" : "Nama pengguna dan kata sandi",
"Log-in credentials, save in session" : "Kredensial masuk, simpan dalam sesi",
"User entered, store in database" : "Dimasukkan pengguna, masukkan dalam basis data",
"RSA public key" : "Kunci publik RSA",
diff --git a/apps/files_external/l10n/id.json b/apps/files_external/l10n/id.json
index 1a163c191b0..66aec437761 100644
--- a/apps/files_external/l10n/id.json
+++ b/apps/files_external/l10n/id.json
@@ -24,7 +24,7 @@
"Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Beberapa mount point eksternal tidak terhubung. Klik barisan merah untuk informasi selanjutnya",
"Please enter the credentials for the {mount} mount" : "Masukkan kredensial untuk mount {mount}",
"Username" : "Nama Pengguna",
- "Password" : "Sandi",
+ "Password" : "Kata sandi",
"Credentials saved" : "Kredensial tersimpan",
"Credentials saving failed" : "Penyimpanan kredensial gagal",
"Credentials required" : "Kredensial dibutuhkan",
@@ -53,9 +53,9 @@
"Identity endpoint URL" : "Identitas URL akhir",
"Rackspace" : "Rackspace",
"API key" : "Kunci API",
- "Global credentials" : "Sandi Global",
+ "Global credentials" : "Kata sandi Global",
"Log-in credentials, save in database" : "Kredensial masuk, simpan di basis data",
- "Username and password" : "Nama pengguna dan sandi",
+ "Username and password" : "Nama pengguna dan kata sandi",
"Log-in credentials, save in session" : "Kredensial masuk, simpan dalam sesi",
"User entered, store in database" : "Dimasukkan pengguna, masukkan dalam basis data",
"RSA public key" : "Kunci publik RSA",
diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php
index 266665a58aa..e32828fbf4e 100644
--- a/apps/files_external/lib/AppInfo/Application.php
+++ b/apps/files_external/lib/AppInfo/Application.php
@@ -35,6 +35,30 @@ use \OCP\IContainer;
use \OCA\Files_External\Service\BackendService;
use \OCA\Files_External\Lib\Config\IBackendProvider;
use \OCA\Files_External\Lib\Config\IAuthMechanismProvider;
+use OCA\Files_External\Lib\Auth\AmazonS3\AccessKey;
+use OCA\Files_External\Lib\Auth\OpenStack\Rackspace;
+use OCA\Files_External\Lib\Auth\OpenStack\OpenStack;
+use OCA\Files_External\Lib\Auth\PublicKey\RSA;
+use OCA\Files_External\Lib\Auth\OAuth2\OAuth2;
+use OCA\Files_External\Lib\Auth\OAuth1\OAuth1;
+use OCA\Files_External\Lib\Auth\Password\GlobalAuth;
+use OCA\Files_External\Lib\Auth\Password\UserProvided;
+use OCA\Files_External\Lib\Auth\Password\LoginCredentials;
+use OCA\Files_External\Lib\Auth\Password\SessionCredentials;
+use OCA\Files_External\Lib\Auth\Password\Password;
+use OCA\Files_External\Lib\Auth\Builtin;
+use OCA\Files_External\Lib\Auth\NullMechanism;
+use OCA\Files_External\Lib\Backend\SMB_OC;
+use OCA\Files_External\Lib\Backend\SMB;
+use OCA\Files_External\Lib\Backend\SFTP_Key;
+use OCA\Files_External\Lib\Backend\Swift;
+use OCA\Files_External\Lib\Backend\AmazonS3;
+use OCA\Files_External\Lib\Backend\SFTP;
+use OCA\Files_External\Lib\Backend\OwnCloud;
+use OCA\Files_External\Lib\Backend\DAV;
+use OCA\Files_External\Lib\Backend\FTP;
+use OCA\Files_External\Lib\Backend\Local;
+use OCP\Files\Config\IUserMountCache;
/**
* @package OCA\Files_External\AppInfo
@@ -46,11 +70,11 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
$container = $this->getContainer();
- $container->registerService('OCP\Files\Config\IUserMountCache', function (IAppContainer $c) {
+ $container->registerService(IUserMountCache::class, function (IAppContainer $c) {
return $c->getServer()->query('UserMountCache');
});
- $backendService = $container->query('OCA\\Files_External\\Service\\BackendService');
+ $backendService = $container->query(BackendService::class);
$backendService->registerBackendProvider($this);
$backendService->registerAuthMechanismProvider($this);
@@ -71,16 +95,16 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
$container = $this->getContainer();
$backends = [
- $container->query('OCA\Files_External\Lib\Backend\Local'),
- $container->query('OCA\Files_External\Lib\Backend\FTP'),
- $container->query('OCA\Files_External\Lib\Backend\DAV'),
- $container->query('OCA\Files_External\Lib\Backend\OwnCloud'),
- $container->query('OCA\Files_External\Lib\Backend\SFTP'),
- $container->query('OCA\Files_External\Lib\Backend\AmazonS3'),
- $container->query('OCA\Files_External\Lib\Backend\Swift'),
- $container->query('OCA\Files_External\Lib\Backend\SFTP_Key'),
- $container->query('OCA\Files_External\Lib\Backend\SMB'),
- $container->query('OCA\Files_External\Lib\Backend\SMB_OC'),
+ $container->query(Local::class),
+ $container->query(FTP::class),
+ $container->query(DAV::class),
+ $container->query(OwnCloud::class),
+ $container->query(SFTP::class),
+ $container->query(AmazonS3::class),
+ $container->query(Swift::class),
+ $container->query(SFTP_Key::class),
+ $container->query(SMB::class),
+ $container->query(SMB_OC::class),
];
return $backends;
@@ -94,33 +118,33 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
return [
// AuthMechanism::SCHEME_NULL mechanism
- $container->query('OCA\Files_External\Lib\Auth\NullMechanism'),
+ $container->query(NullMechanism::class),
// AuthMechanism::SCHEME_BUILTIN mechanism
- $container->query('OCA\Files_External\Lib\Auth\Builtin'),
+ $container->query(Builtin::class),
// AuthMechanism::SCHEME_PASSWORD mechanisms
- $container->query('OCA\Files_External\Lib\Auth\Password\Password'),
- $container->query('OCA\Files_External\Lib\Auth\Password\SessionCredentials'),
- $container->query('OCA\Files_External\Lib\Auth\Password\LoginCredentials'),
- $container->query('OCA\Files_External\Lib\Auth\Password\UserProvided'),
- $container->query('OCA\Files_External\Lib\Auth\Password\GlobalAuth'),
+ $container->query(Password::class),
+ $container->query(SessionCredentials::class),
+ $container->query(LoginCredentials::class),
+ $container->query(UserProvided::class),
+ $container->query(GlobalAuth::class),
// AuthMechanism::SCHEME_OAUTH1 mechanisms
- $container->query('OCA\Files_External\Lib\Auth\OAuth1\OAuth1'),
+ $container->query(OAuth1::class),
// AuthMechanism::SCHEME_OAUTH2 mechanisms
- $container->query('OCA\Files_External\Lib\Auth\OAuth2\OAuth2'),
+ $container->query(OAuth2::class),
// AuthMechanism::SCHEME_PUBLICKEY mechanisms
- $container->query('OCA\Files_External\Lib\Auth\PublicKey\RSA'),
+ $container->query(RSA::class),
// AuthMechanism::SCHEME_OPENSTACK mechanisms
- $container->query('OCA\Files_External\Lib\Auth\OpenStack\OpenStack'),
- $container->query('OCA\Files_External\Lib\Auth\OpenStack\Rackspace'),
+ $container->query(OpenStack::class),
+ $container->query(Rackspace::class),
// Specialized mechanisms
- $container->query('OCA\Files_External\Lib\Auth\AmazonS3\AccessKey'),
+ $container->query(AccessKey::class),
];
}
diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php
index 9c2953851f5..66cbcae3e8f 100644
--- a/apps/files_external/lib/Controller/AjaxController.php
+++ b/apps/files_external/lib/Controller/AjaxController.php
@@ -110,9 +110,7 @@ class AjaxController extends Controller {
$currentUser = $this->userSession->getUser();
// Non-admins can only edit their own credentials
- $allowedToEdit = (
- $this->groupManager->isAdmin($currentUser->getUID()) || $currentUser->getUID() === $uid
- ) ? true : false;
+ $allowedToEdit = ($this->groupManager->isAdmin($currentUser->getUID()) || $currentUser->getUID() === $uid);
if ($allowedToEdit) {
$this->globalAuth->saveAuth($uid, $user, $password);
diff --git a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php
index dbf14b76da8..7da3458e54d 100644
--- a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php
+++ b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php
@@ -39,7 +39,7 @@ class AccessKey extends AuthMechanism {
->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
->setText($l->t('Access key'))
->addParameters([
- (new DefinitionParameter('key', $l->t('Access key'))),
+ new DefinitionParameter('key', $l->t('Access key')),
(new DefinitionParameter('secret', $l->t('Secret key')))
->setType(DefinitionParameter::VALUE_PASSWORD),
]);
diff --git a/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php b/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php
index 2602d5de41b..6a95710b3ef 100644
--- a/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php
+++ b/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php
@@ -39,7 +39,7 @@ class OAuth1 extends AuthMechanism {
->addParameters([
(new DefinitionParameter('configured', 'configured'))
->setType(DefinitionParameter::VALUE_HIDDEN),
- (new DefinitionParameter('app_key', $l->t('App key'))),
+ new DefinitionParameter('app_key', $l->t('App key')),
(new DefinitionParameter('app_secret', $l->t('App secret')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('token', 'token'))
diff --git a/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php b/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php
index 325efb0e1a0..a5317ae9fa6 100644
--- a/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php
+++ b/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php
@@ -39,7 +39,7 @@ class OAuth2 extends AuthMechanism {
->addParameters([
(new DefinitionParameter('configured', 'configured'))
->setType(DefinitionParameter::VALUE_HIDDEN),
- (new DefinitionParameter('client_id', $l->t('Client ID'))),
+ new DefinitionParameter('client_id', $l->t('Client ID')),
(new DefinitionParameter('client_secret', $l->t('Client secret')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('token', 'token'))
diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php
index 17c2c8bd146..ca1e0a08ae9 100644
--- a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php
+++ b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php
@@ -37,11 +37,11 @@ class OpenStack extends AuthMechanism {
->setScheme(self::SCHEME_OPENSTACK)
->setText($l->t('OpenStack'))
->addParameters([
- (new DefinitionParameter('user', $l->t('Username'))),
+ new DefinitionParameter('user', $l->t('Username')),
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
- (new DefinitionParameter('tenant', $l->t('Tenant name'))),
- (new DefinitionParameter('url', $l->t('Identity endpoint URL'))),
+ new DefinitionParameter('tenant', $l->t('Tenant name')),
+ new DefinitionParameter('url', $l->t('Identity endpoint URL')),
])
;
}
diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php b/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php
index caff8e26ae3..14398c1ad82 100644
--- a/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php
+++ b/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php
@@ -37,7 +37,7 @@ class Rackspace extends AuthMechanism {
->setScheme(self::SCHEME_OPENSTACK)
->setText($l->t('Rackspace'))
->addParameters([
- (new DefinitionParameter('user', $l->t('Username'))),
+ new DefinitionParameter('user', $l->t('Username')),
(new DefinitionParameter('key', $l->t('API key')))
->setType(DefinitionParameter::VALUE_PASSWORD),
])
diff --git a/apps/files_external/lib/Lib/Auth/Password/Password.php b/apps/files_external/lib/Lib/Auth/Password/Password.php
index cf8d6b9f458..95a10ebb1d9 100644
--- a/apps/files_external/lib/Lib/Auth/Password/Password.php
+++ b/apps/files_external/lib/Lib/Auth/Password/Password.php
@@ -37,7 +37,7 @@ class Password extends AuthMechanism {
->setScheme(self::SCHEME_PASSWORD)
->setText($l->t('Username and password'))
->addParameters([
- (new DefinitionParameter('user', $l->t('Username'))),
+ new DefinitionParameter('user', $l->t('Username')),
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
]);
diff --git a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
index 425a601d7e9..25c4a1767e9 100644
--- a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
+++ b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
@@ -47,8 +47,8 @@ class RSA extends AuthMechanism {
->setScheme(self::SCHEME_PUBLICKEY)
->setText($l->t('RSA public key'))
->addParameters([
- (new DefinitionParameter('user', $l->t('Username'))),
- (new DefinitionParameter('public_key', $l->t('Public key'))),
+ new DefinitionParameter('user', $l->t('Username')),
+ new DefinitionParameter('public_key', $l->t('Public key')),
(new DefinitionParameter('private_key', 'private_key'))
->setType(DefinitionParameter::VALUE_HIDDEN),
])
diff --git a/apps/files_external/lib/Lib/Backend/AmazonS3.php b/apps/files_external/lib/Lib/Backend/AmazonS3.php
index 5625805601c..d21794a6847 100644
--- a/apps/files_external/lib/Lib/Backend/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Backend/AmazonS3.php
@@ -42,7 +42,7 @@ class AmazonS3 extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\AmazonS3')
->setText($l->t('Amazon S3'))
->addParameters([
- (new DefinitionParameter('bucket', $l->t('Bucket'))),
+ new DefinitionParameter('bucket', $l->t('Bucket')),
(new DefinitionParameter('hostname', $l->t('Hostname')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('port', $l->t('Port')))
diff --git a/apps/files_external/lib/Lib/Backend/DAV.php b/apps/files_external/lib/Lib/Backend/DAV.php
index a8053f81d36..95d804ba943 100644
--- a/apps/files_external/lib/Lib/Backend/DAV.php
+++ b/apps/files_external/lib/Lib/Backend/DAV.php
@@ -42,7 +42,7 @@ class DAV extends Backend {
->setStorageClass('\OC\Files\Storage\DAV')
->setText($l->t('WebDAV'))
->addParameters([
- (new DefinitionParameter('host', $l->t('URL'))),
+ new DefinitionParameter('host', $l->t('URL')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure https://')))
diff --git a/apps/files_external/lib/Lib/Backend/FTP.php b/apps/files_external/lib/Lib/Backend/FTP.php
index edb8884f595..12aee8114f3 100644
--- a/apps/files_external/lib/Lib/Backend/FTP.php
+++ b/apps/files_external/lib/Lib/Backend/FTP.php
@@ -42,7 +42,7 @@ class FTP extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\FTP')
->setText($l->t('FTP'))
->addParameters([
- (new DefinitionParameter('host', $l->t('Host'))),
+ new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure ftps://')))
diff --git a/apps/files_external/lib/Lib/Backend/Local.php b/apps/files_external/lib/Lib/Backend/Local.php
index 298b0af1c7a..528528f2923 100644
--- a/apps/files_external/lib/Lib/Backend/Local.php
+++ b/apps/files_external/lib/Lib/Backend/Local.php
@@ -38,7 +38,7 @@ class Local extends Backend {
->setStorageClass('\OC\Files\Storage\Local')
->setText($l->t('Local'))
->addParameters([
- (new DefinitionParameter('datadir', $l->t('Location'))),
+ new DefinitionParameter('datadir', $l->t('Location')),
])
->setAllowedVisibility(BackendService::VISIBILITY_ADMIN)
->setPriority(BackendService::PRIORITY_DEFAULT + 50)
diff --git a/apps/files_external/lib/Lib/Backend/OwnCloud.php b/apps/files_external/lib/Lib/Backend/OwnCloud.php
index 0d3ffb30b40..7dcd1f27212 100644
--- a/apps/files_external/lib/Lib/Backend/OwnCloud.php
+++ b/apps/files_external/lib/Lib/Backend/OwnCloud.php
@@ -40,7 +40,7 @@ class OwnCloud extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
->setText($l->t('Nextcloud'))
->addParameters([
- (new DefinitionParameter('host', $l->t('URL'))),
+ new DefinitionParameter('host', $l->t('URL')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure https://')))
diff --git a/apps/files_external/lib/Lib/Backend/SFTP.php b/apps/files_external/lib/Lib/Backend/SFTP.php
index c9b31272999..561e0496083 100644
--- a/apps/files_external/lib/Lib/Backend/SFTP.php
+++ b/apps/files_external/lib/Lib/Backend/SFTP.php
@@ -36,7 +36,7 @@ class SFTP extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
->setText($l->t('SFTP'))
->addParameters([
- (new DefinitionParameter('host', $l->t('Host'))),
+ new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('root', $l->t('Root')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])
diff --git a/apps/files_external/lib/Lib/Backend/SFTP_Key.php b/apps/files_external/lib/Lib/Backend/SFTP_Key.php
index 80ac1ceecc4..62f108cd9dd 100644
--- a/apps/files_external/lib/Lib/Backend/SFTP_Key.php
+++ b/apps/files_external/lib/Lib/Backend/SFTP_Key.php
@@ -38,7 +38,7 @@ class SFTP_Key extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
->setText($l->t('SFTP with secret key login'))
->addParameters([
- (new DefinitionParameter('host', $l->t('Host'))),
+ new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])
diff --git a/apps/files_external/lib/Lib/Backend/SMB.php b/apps/files_external/lib/Lib/Backend/SMB.php
index c4aadbd13f6..38e386005ad 100644
--- a/apps/files_external/lib/Lib/Backend/SMB.php
+++ b/apps/files_external/lib/Lib/Backend/SMB.php
@@ -44,8 +44,8 @@ class SMB extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
->setText($l->t('SMB / CIFS'))
->addParameters([
- (new DefinitionParameter('host', $l->t('Host'))),
- (new DefinitionParameter('share', $l->t('Share'))),
+ new DefinitionParameter('host', $l->t('Host')),
+ new DefinitionParameter('share', $l->t('Share')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('domain', $l->t('Domain')))
diff --git a/apps/files_external/lib/Lib/Backend/SMB_OC.php b/apps/files_external/lib/Lib/Backend/SMB_OC.php
index 76126fd649f..54d941ff1db 100644
--- a/apps/files_external/lib/Lib/Backend/SMB_OC.php
+++ b/apps/files_external/lib/Lib/Backend/SMB_OC.php
@@ -46,7 +46,7 @@ class SMB_OC extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
->setText($l->t('SMB / CIFS using OC login'))
->addParameters([
- (new DefinitionParameter('host', $l->t('Host'))),
+ new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('username_as_share', $l->t('Username as share')))
->setType(DefinitionParameter::VALUE_BOOLEAN),
(new DefinitionParameter('share', $l->t('Share')))
diff --git a/apps/files_external/lib/Lib/Backend/Swift.php b/apps/files_external/lib/Lib/Backend/Swift.php
index 52ed66b95ae..b0a69ae51e0 100644
--- a/apps/files_external/lib/Lib/Backend/Swift.php
+++ b/apps/files_external/lib/Lib/Backend/Swift.php
@@ -46,7 +46,7 @@ class Swift extends Backend {
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('region', $l->t('Region')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
- (new DefinitionParameter('bucket', $l->t('Bucket'))),
+ new DefinitionParameter('bucket', $l->t('Bucket')),
(new DefinitionParameter('timeout', $l->t('Request timeout (seconds)')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php
index 427a076ffe1..17afb1fcf95 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -150,7 +150,7 @@ class FTP extends StreamWrapper{
*/
public static function checkDependencies() {
if (function_exists('ftp_login')) {
- return(true);
+ return true;
} else {
return array('ftp');
}
diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php
index d846fa811a0..d56e6b66145 100644
--- a/apps/files_external/lib/Lib/Storage/OwnCloud.php
+++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php
@@ -61,10 +61,7 @@ class OwnCloud extends \OC\Files\Storage\DAV{
}
if (isset($params['root'])){
- $root = $params['root'];
- if (substr($root, 0, 1) !== '/'){
- $root = '/' . $root;
- }
+ $root = '/' . ltrim($params['root'], '/');
}
else{
$root = '/';
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 22162fa61cf..6bd77dd2496 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -103,13 +103,8 @@ class SFTP extends \OC\Files\Storage\Common {
$this->root
= isset($params['root']) ? $this->cleanPath($params['root']) : '/';
- if ($this->root[0] !== '/') {
- $this->root = '/' . $this->root;
- }
-
- if (substr($this->root, -1, 1) !== '/') {
- $this->root .= '/';
- }
+ $this->root = '/' . ltrim($this->root, '/');
+ $this->root = rtrim($this->root, '/') . '/';
}
/**
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index d8bbe8c4718..58a6f65990f 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -84,13 +84,9 @@ class SMB extends Common implements INotifyStorage {
}
$this->share = $this->server->getShare(trim($params['share'], '/'));
- $this->root = isset($params['root']) ? $params['root'] : '/';
- if (!$this->root || $this->root[0] !== '/') {
- $this->root = '/' . $this->root;
- }
- if (substr($this->root, -1, 1) !== '/') {
- $this->root .= '/';
- }
+ $this->root = $params['root'] ?? '/';
+ $this->root = '/' . ltrim($this->root, '/');
+ $this->root = rtrim($this->root, '/') . '/';
} else {
throw new \Exception('Invalid configuration');
}
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php
index aeedd3dcd63..aaa7e95bbdf 100644
--- a/apps/files_external/lib/Lib/Storage/Swift.php
+++ b/apps/files_external/lib/Lib/Storage/Swift.php
@@ -170,7 +170,7 @@ class Swift extends \OC\Files\Storage\Common {
$bucketUrl = Url::factory($params['bucket']);
if ($bucketUrl->isAbsolute()) {
- $this->bucket = end(($bucketUrl->getPathSegments()));
+ $this->bucket = end($bucketUrl->getPathSegments());
$params['endpoint_url'] = $bucketUrl->addPath('..')->normalizePath();
} else {
$this->bucket = $params['bucket'];
diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php
index 49af01f5bf9..bd6c525f319 100644
--- a/apps/files_external/lib/Service/BackendService.php
+++ b/apps/files_external/lib/Service/BackendService.php
@@ -194,7 +194,7 @@ class BackendService {
*/
public function getAvailableBackends() {
return array_filter($this->getBackends(), function($backend) {
- return !($backend->checkDependencies());
+ return !$backend->checkDependencies();
});
}
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index ae04daf4f31..5238eaa42b2 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -41,6 +41,12 @@ use \OCA\Files_External\Lib\Backend\LegacyBackend;
use \OCA\Files_External\Lib\StorageConfig;
use \OCA\Files_External\Lib\Backend\Backend;
use \OCP\Files\StorageNotAvailableException;
+use OCA\Files_External\Service\BackendService;
+use OCA\Files_External\Lib\Auth\Builtin;
+use OCA\Files_External\Service\UserGlobalStoragesService;
+use OCP\IUserManager;
+use OCA\Files_External\Service\GlobalStoragesService;
+use OCA\Files_External\Service\UserStoragesService;
/**
* Class to configure mount.json globally and for users
@@ -66,8 +72,8 @@ class OC_Mount_Config {
* @deprecated 8.2.0 use \OCA\Files_External\Service\BackendService::registerBackend()
*/
public static function registerBackend($class, $definition) {
- $backendService = self::$app->getContainer()->query('OCA\Files_External\Service\BackendService');
- $auth = self::$app->getContainer()->query('OCA\Files_External\Lib\Auth\Builtin');
+ $backendService = self::$app->getContainer()->query(BackendService::class);
+ $auth = self::$app->getContainer()->query(Builtin::class);
$backendService->registerBackend(new LegacyBackend($class, $definition, $auth));
@@ -86,9 +92,9 @@ class OC_Mount_Config {
public static function getAbsoluteMountPoints($uid) {
$mountPoints = array();
- $userGlobalStoragesService = self::$app->getContainer()->query('OCA\Files_External\Service\UserGlobalStoragesService');
- $userStoragesService = self::$app->getContainer()->query('OCA\Files_External\Service\UserStoragesService');
- $user = self::$app->getContainer()->query('OCP\IUserManager')->get($uid);
+ $userGlobalStoragesService = self::$app->getContainer()->query(UserGlobalStoragesService::class);
+ $userStoragesService = self::$app->getContainer()->query(UserStoragesService::class);
+ $user = self::$app->getContainer()->query(IUserManager::class)->get($uid);
$userGlobalStoragesService->setUser($user);
$userStoragesService->setUser($user);
@@ -127,7 +133,7 @@ class OC_Mount_Config {
*/
public static function getSystemMountPoints() {
$mountPoints = [];
- $service = self::$app->getContainer()->query('OCA\Files_External\Service\GlobalStoragesService');
+ $service = self::$app->getContainer()->query(GlobalStoragesService::class);
foreach ($service->getStorages() as $storage) {
$mountPoints[] = self::prepareMountPointEntry($storage, false);
@@ -145,7 +151,7 @@ class OC_Mount_Config {
*/
public static function getPersonalMountPoints() {
$mountPoints = [];
- $service = self::$app->getContainer()->query('OCA\Files_External\Service\UserStoragesService');
+ $service = self::$app->getContainer()->query(UserStoragesService::class);
foreach ($service->getStorages() as $storage) {
$mountPoints[] = self::prepareMountPointEntry($storage, true);
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 4782ac1b94f..f5aa1fc09a1 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -27,10 +27,13 @@
*
*/
+use OCA\Files_Sharing\ShareBackend\File;
+use OCA\Files_Sharing\ShareBackend\Folder;
+
\OCA\Files_Sharing\Helper::registerHooks();
-\OC\Share\Share::registerBackend('file', 'OCA\Files_Sharing\ShareBackend\File');
-\OC\Share\Share::registerBackend('folder', 'OCA\Files_Sharing\ShareBackend\Folder', 'file');
+\OC\Share\Share::registerBackend('file', File::class);
+\OC\Share\Share::registerBackend('folder', Folder::class, 'file');
$application = new \OCA\Files_Sharing\AppInfo\Application();
$application->registerMountProviders();
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index fe2669640ca..e0c40730b31 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -41,6 +41,8 @@ use OCP\Defaults;
use OCP\Federation\ICloudIdManager;
use \OCP\IContainer;
use OCP\IServerContainer;
+use OCA\Files_Sharing\Capabilities;
+use OCA\Files_Sharing\External\Manager;
class Application extends App {
public function __construct(array $urlParams = array()) {
@@ -104,7 +106,7 @@ class Application extends App {
$uid
);
});
- $container->registerAlias('OCA\Files_Sharing\External\Manager', 'ExternalManager');
+ $container->registerAlias(Manager::class, 'ExternalManager');
/**
* Middleware
@@ -163,7 +165,7 @@ class Application extends App {
/*
* Register capabilities
*/
- $container->registerCapability('OCA\Files_Sharing\Capabilities');
+ $container->registerCapability(Capabilities::class);
}
public function registerMountProviders() {
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index c51bc1a75dd..eff6cf65142 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -244,7 +244,7 @@ class ShareController extends Controller {
$exception = $e;
}
}
- \OC_Hook::emit('OCP\Share', 'share_link_access', [
+ \OC_Hook::emit(Share::class, 'share_link_access', [
'itemType' => $itemType,
'itemSource' => $itemSource,
'uidOwner' => $uidOwner,
@@ -348,7 +348,7 @@ class ShareController extends Controller {
$freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
}
- $hideFileList = $share->getPermissions() & \OCP\Constants::PERMISSION_READ ? false : true;
+ $hideFileList = !($share->getPermissions() & \OCP\Constants::PERMISSION_READ);
$maxUploadFilesize = $freeSpace;
$folder = new Template('files', 'list', '');
diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php
index 6935685685c..c9303ac224c 100644
--- a/apps/files_sharing/lib/External/Manager.php
+++ b/apps/files_sharing/lib/External/Manager.php
@@ -39,6 +39,7 @@ use OCP\Http\Client\IClientService;
use OCP\IDBConnection;
use OCP\Notification\IManager;
use OCP\OCS\IDiscoveryService;
+use OCP\Share;
class Manager {
const STORAGE = '\OCA\Files_Sharing\External\Storage';
@@ -217,7 +218,7 @@ class Manager {
$updated = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
if ($updated === true) {
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept');
- \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]);
+ \OC_Hook::emit(Share::class, 'federated_share_added', ['server' => $share['remote']]);
$result = true;
}
}
diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php
index c8f46fa8132..684c20c4544 100644
--- a/apps/files_sharing/lib/Helper.php
+++ b/apps/files_sharing/lib/Helper.php
@@ -225,7 +225,7 @@ class Helper {
*/
public static function generateUniqueTarget($path, $excludeList, $view) {
$pathinfo = pathinfo($path);
- $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : '';
+ $ext = isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : '';
$name = $pathinfo['filename'];
$dir = $pathinfo['dirname'];
$i = 2;
diff --git a/apps/files_sharing/lib/Hooks.php b/apps/files_sharing/lib/Hooks.php
index 97b1079f1eb..51511ca6b64 100644
--- a/apps/files_sharing/lib/Hooks.php
+++ b/apps/files_sharing/lib/Hooks.php
@@ -53,7 +53,7 @@ class Hooks {
$mountManager = \OC\Files\Filesystem::getMountManager();
$mountedShares = $mountManager->findIn($path);
foreach ($mountedShares as $mount) {
- if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) {
$mountPoint = $mount->getMountPoint();
$view->unlink($mountPoint);
}
diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
index c96b559daf5..4b630d0a8da 100644
--- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
+++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
@@ -121,11 +121,11 @@ class SharingCheckMiddleware extends Middleware {
* @throws \Exception
*/
public function afterException($controller, $methodName, \Exception $exception) {
- if(is_a($exception, '\OCP\Files\NotFoundException')) {
+ if(is_a($exception, NotFoundException::class)) {
return new NotFoundResponse();
}
- if (is_a($exception, '\OCA\Files_Sharing\Exceptions\S2SException')) {
+ if (is_a($exception, S2SException::class)) {
return new JSONResponse($exception->getMessage(), 405);
}
diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php
index 83474546581..e09591b37c0 100644
--- a/apps/files_sharing/lib/ShareBackend/File.php
+++ b/apps/files_sharing/lib/ShareBackend/File.php
@@ -117,7 +117,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
}
}
- $excludeList = (is_array($exclude)) ? $exclude : array();
+ $excludeList = is_array($exclude) ? $exclude : array();
return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
}
diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php
index 4f0dc89e997..d90673421cd 100644
--- a/apps/files_sharing/lib/SharedMount.php
+++ b/apps/files_sharing/lib/SharedMount.php
@@ -131,7 +131,7 @@ class SharedMount extends MountPoint implements MoveableMount {
*/
private function generateUniqueTarget($path, $view, array $mountpoints) {
$pathinfo = pathinfo($path);
- $ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : '';
+ $ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : '';
$name = $pathinfo['filename'];
$dir = $pathinfo['dirname'];
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php
index de45b45ab37..784fe8b72b1 100644
--- a/apps/files_sharing/lib/Updater.php
+++ b/apps/files_sharing/lib/Updater.php
@@ -96,7 +96,7 @@ class Updater {
$mountManager = \OC\Files\Filesystem::getMountManager();
$mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath);
foreach ($mountedShares as $mount) {
- if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ if ($mount->getStorage()->instanceOfStorage(ISharedStorage::class)) {
$mountPoint = $mount->getMountPoint();
$target = str_replace($absOldPath, $absNewPath, $mountPoint);
$mount->moveMount($target);
diff --git a/apps/files_trashbin/lib/AppInfo/Application.php b/apps/files_trashbin/lib/AppInfo/Application.php
index ee1c9481286..e9d4e6ecc1d 100644
--- a/apps/files_trashbin/lib/AppInfo/Application.php
+++ b/apps/files_trashbin/lib/AppInfo/Application.php
@@ -25,6 +25,8 @@ namespace OCA\Files_Trashbin\AppInfo;
use OCP\AppFramework\App;
use OCA\Files_Trashbin\Expiration;
+use OCP\AppFramework\Utility\ITimeFactory;
+use OCA\Files_Trashbin\Capabilities;
class Application extends App {
public function __construct (array $urlParams = []) {
@@ -34,7 +36,7 @@ class Application extends App {
/*
* Register capabilities
*/
- $container->registerCapability('OCA\Files_Trashbin\Capabilities');
+ $container->registerCapability(Capabilities::class);
/*
* Register expiration
@@ -42,7 +44,7 @@ class Application extends App {
$container->registerService('Expiration', function($c) {
return new Expiration(
$c->query('ServerContainer')->getConfig(),
- $c->query('OCP\AppFramework\Utility\ITimeFactory')
+ $c->query(ITimeFactory::class)
);
});
}
diff --git a/apps/files_trashbin/lib/Expiration.php b/apps/files_trashbin/lib/Expiration.php
index 03f126fc415..c7ad4e29f18 100644
--- a/apps/files_trashbin/lib/Expiration.php
+++ b/apps/files_trashbin/lib/Expiration.php
@@ -142,13 +142,13 @@ class Expiration {
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
// Keep for X days but delete anytime if space needed
- $this->minAge = intval($minValue);
+ $this->minAge = (int)$minValue;
$this->maxAge = self::NO_OBLIGATION;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
// Delete anytime if space needed, Delete all older than max automatically
$this->minAge = self::NO_OBLIGATION;
- $this->maxAge = intval($maxValue);
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
// Delete all older than max OR older than min if space needed
@@ -158,8 +158,8 @@ class Expiration {
$maxValue = $minValue;
}
- $this->minAge = intval($minValue);
- $this->maxAge = intval($maxValue);
+ $this->minAge = (int)$minValue;
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = false;
}
}
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index d61881ce3b1..a9eb5224728 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -635,8 +635,6 @@ class Trashbin {
if ($timestamp) {
$filename = $filename . '.d' . $timestamp;
- } else {
- $filename = $filename;
}
$target = Filesystem::normalizePath('files_trashbin/files/' . $filename);
@@ -875,10 +873,10 @@ class Trashbin {
foreach ($matches as $ma) {
if ($timestamp) {
$parts = explode('.v', substr($ma['path'], 0, $offset));
- $versions[] = (end($parts));
+ $versions[] = end($parts);
} else {
$parts = explode('.v', $ma);
- $versions[] = (end($parts));
+ $versions[] = end($parts);
}
}
}
diff --git a/apps/files_versions/lib/AppInfo/Application.php b/apps/files_versions/lib/AppInfo/Application.php
index f75fea1e117..e09299c8bc8 100644
--- a/apps/files_versions/lib/AppInfo/Application.php
+++ b/apps/files_versions/lib/AppInfo/Application.php
@@ -25,6 +25,8 @@ namespace OCA\Files_Versions\AppInfo;
use OCP\AppFramework\App;
use OCA\Files_Versions\Expiration;
+use OCP\AppFramework\Utility\ITimeFactory;
+use OCA\Files_Versions\Capabilities;
class Application extends App {
public function __construct(array $urlParams = array()) {
@@ -35,7 +37,7 @@ class Application extends App {
/*
* Register capabilities
*/
- $container->registerCapability('OCA\Files_Versions\Capabilities');
+ $container->registerCapability(Capabilities::class);
/*
* Register expiration
@@ -43,7 +45,7 @@ class Application extends App {
$container->registerService('Expiration', function($c) {
return new Expiration(
$c->query('ServerContainer')->getConfig(),
- $c->query('OCP\AppFramework\Utility\ITimeFactory')
+ $c->query(ITimeFactory::class)
);
});
}
diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php
index 1dad8801230..83195d10a30 100644
--- a/apps/files_versions/lib/Expiration.php
+++ b/apps/files_versions/lib/Expiration.php
@@ -175,13 +175,13 @@ class Expiration {
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
// Keep for X days but delete anytime if space needed
- $this->minAge = intval($minValue);
+ $this->minAge = (int)$minValue;
$this->maxAge = self::NO_OBLIGATION;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
// Delete anytime if space needed, Delete all older than max automatically
$this->minAge = self::NO_OBLIGATION;
- $this->maxAge = intval($maxValue);
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
// Delete all older than max OR older than min if space needed
@@ -191,8 +191,8 @@ class Expiration {
$maxValue = $minValue;
}
- $this->minAge = intval($minValue);
- $this->maxAge = intval($maxValue);
+ $this->minAge = (int)$minValue;
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = false;
}
}
diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php
index 52dbf54b485..3c4049e2139 100644
--- a/apps/files_versions/lib/Hooks.php
+++ b/apps/files_versions/lib/Hooks.php
@@ -39,17 +39,17 @@ class Hooks {
public static function connectHooks() {
// Listen to write signals
- \OCP\Util::connectHook('OC_Filesystem', 'write', 'OCA\Files_Versions\Hooks', 'write_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'write', Hooks::class, 'write_hook');
// Listen to delete and rename signals
- \OCP\Util::connectHook('OC_Filesystem', 'post_delete', 'OCA\Files_Versions\Hooks', 'remove_hook');
- \OCP\Util::connectHook('OC_Filesystem', 'delete', 'OCA\Files_Versions\Hooks', 'pre_remove_hook');
- \OCP\Util::connectHook('OC_Filesystem', 'post_rename', 'OCA\Files_Versions\Hooks', 'rename_hook');
- \OCP\Util::connectHook('OC_Filesystem', 'post_copy', 'OCA\Files_Versions\Hooks', 'copy_hook');
- \OCP\Util::connectHook('OC_Filesystem', 'rename', 'OCA\Files_Versions\Hooks', 'pre_renameOrCopy_hook');
- \OCP\Util::connectHook('OC_Filesystem', 'copy', 'OCA\Files_Versions\Hooks', 'pre_renameOrCopy_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_delete', Hooks::class, 'remove_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'delete', Hooks::class, 'pre_remove_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_rename', Hooks::class, 'rename_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_copy', Hooks::class, 'copy_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'rename', Hooks::class, 'pre_renameOrCopy_hook');
+ \OCP\Util::connectHook('OC_Filesystem', 'copy', Hooks::class, 'pre_renameOrCopy_hook');
$eventDispatcher = \OC::$server->getEventDispatcher();
- $eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', ['OCA\Files_Versions\Hooks', 'onLoadFilesAppScripts']);
+ $eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', [Hooks::class, 'onLoadFilesAppScripts']);
}
/**
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index d798312fda3..f8a6636839a 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -503,7 +503,7 @@ class Storage {
$toDelete = [];
foreach (array_reverse($versions['all']) as $key => $version) {
- if (intval($version['version'])<$threshold) {
+ if ((int)$version['version'] <$threshold) {
$toDelete[$key] = $version;
} else {
//Versions are sorted by time - nothing mo to iterate.
diff --git a/apps/sharebymail/lib/AppInfo/Application.php b/apps/sharebymail/lib/AppInfo/Application.php
index 12419a8c3d9..3eabc9ec89f 100644
--- a/apps/sharebymail/lib/AppInfo/Application.php
+++ b/apps/sharebymail/lib/AppInfo/Application.php
@@ -26,6 +26,7 @@ namespace OCA\ShareByMail\AppInfo;
use OCA\ShareByMail\Settings;
use OCP\AppFramework\App;
use OCP\Util;
+use OCA\ShareByMail\Capabilities;
class Application extends App {
@@ -37,7 +38,7 @@ class Application extends App {
/** register capabilities */
$container = $this->getContainer();
- $container->registerCapability('OCA\ShareByMail\Capabilities');
+ $container->registerCapability(Capabilities::class);
/** register hooks */
Util::connectHook('\OCP\Config', 'js', $settings, 'announceShareProvider');
diff --git a/apps/systemtags/appinfo/app.php b/apps/systemtags/appinfo/app.php
index e1c86939458..58c291895e1 100644
--- a/apps/systemtags/appinfo/app.php
+++ b/apps/systemtags/appinfo/app.php
@@ -26,6 +26,7 @@
use OCP\SystemTag\ManagerEvent;
use OCP\SystemTag\MapperEvent;
+use OCA\SystemTags\Activity\Listener;
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
@@ -43,7 +44,7 @@ $eventDispatcher->addListener(
$managerListener = function(ManagerEvent $event) {
$application = new \OCP\AppFramework\App('systemtags');
/** @var \OCA\SystemTags\Activity\Listener $listener */
- $listener = $application->getContainer()->query('OCA\SystemTags\Activity\Listener');
+ $listener = $application->getContainer()->query(Listener::class);
$listener->event($event);
};
@@ -54,7 +55,7 @@ $eventDispatcher->addListener(ManagerEvent::EVENT_UPDATE, $managerListener);
$mapperListener = function(MapperEvent $event) {
$application = new \OCP\AppFramework\App('systemtags');
/** @var \OCA\SystemTags\Activity\Listener $listener */
- $listener = $application->getContainer()->query('OCA\SystemTags\Activity\Listener');
+ $listener = $application->getContainer()->query(Listener::class);
$listener->mapperEvent($event);
};
diff --git a/apps/theming/appinfo/info.xml b/apps/theming/appinfo/info.xml
index 11a8d2f73f7..d2eacea77b3 100644
--- a/apps/theming/appinfo/info.xml
+++ b/apps/theming/appinfo/info.xml
@@ -23,10 +23,4 @@
<admin>OCA\Theming\Settings\Admin</admin>
<admin-section>OCA\Theming\Settings\Section</admin-section>
</settings>
-
- <repair-steps>
- <post-migration>
- <step>OCA\Theming\Migration\ThemingImages</step>
- </post-migration>
- </repair-steps>
</info>
diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss
index 63d466542e1..3cb8ee2584d 100644
--- a/apps/theming/css/theming.scss
+++ b/apps/theming/css/theming.scss
@@ -91,18 +91,20 @@
}
/* override styles for login screen in guest.css */
-#header .logo {
- background-image: url(#{$image-logo});
- @if $theming-logo-mime != '' {
+@if variable_exists('theming-logo-mime') {
+ #header .logo {
+ background-image: url(#{$image-logo});
background-size: contain;
}
}
-#body-login,
-#firstrunwizard .firstrunwizard-header,
-#theming-preview {
- background-image: url(#{$image-login-background});
- background-color: $color-primary;
+@if variable_exists('theming-background-mime') {
+ #body-login,
+ #firstrunwizard .firstrunwizard-header,
+ #theming-preview {
+ background-image: url(#{$image-login-background});
+ background-color: $color-primary;
+ }
}
input.primary,
diff --git a/apps/theming/lib/Migration/ThemingImages.php b/apps/theming/lib/Migration/ThemingImages.php
deleted file mode 100644
index 4f929746cb1..00000000000
--- a/apps/theming/lib/Migration/ThemingImages.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2017 Julius Härtl <jus@bitgrid.net>
- *
- * @author Julius Haertl <jus@bitgrid.net>
- *
- * @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.
- *
- * This program 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 program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-namespace OCA\Theming\Migration;
-
-use OCA\Theming\ThemingDefaults;
-use OCP\Files\IAppData;
-use OCP\Files\IRootFolder;
-use OCP\Migration\IRepairStep;
-use OCP\Migration\IOutput;
-use OC\Files\Node\File;
-use OCP\Files\NotFoundException;
-
-class ThemingImages implements IRepairStep {
-
- private $appData;
- private $rootFolder;
-
- public function __construct(IAppData $appData, IRootFolder $rootFolder) {
- $this->appData = $appData;
- $this->rootFolder = $rootFolder;
- }
-
- /*
- * @inheritdoc
- */
- public function getName() {
- return 'Move theming files to AppData storage';
- }
-
- /**
- * @inheritdoc
- */
- public function run(IOutput $output) {
- $folder = $this->appData->newFolder("images");
- /** @var File $file */
- $file = null;
- try {
- $file = $this->rootFolder->get('themedinstancelogo');
- $logo = $folder->newFile('logo');
- $logo->putContent($file->getContent());
- $file->delete();
- } catch (NotFoundException $e) {
- $output->info('No theming logo image to migrate');
- }
-
- try {
- $file = $this->rootFolder->get('themedbackgroundlogo');
- $background = $folder->newFile('background');
- $background->putContent($file->getContent());
- $file->delete();
- } catch (NotFoundException $e) {
- $output->info('No theming background image to migrate');
- }
- }
-}
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 9dcc981817e..94abb4e288a 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -242,8 +242,8 @@ class ThemingDefaults extends \OC_Defaults {
'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'"
];
- $variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'";
- $variables['image-login-background'] = "'".$this->urlGenerator->getAbsoluteURL($this->getBackground())."'";
+ $variables['image-logo'] = "'".$this->getLogo()."'";
+ $variables['image-login-background'] = "'".$this->getBackground()."'";
$variables['image-login-plain'] = 'false';
if ($this->config->getAppValue('theming', 'color', null) !== null) {
diff --git a/apps/theming/tests/Migration/ThemingImages.php b/apps/theming/tests/Migration/ThemingImages.php
deleted file mode 100644
index a8d066c26f7..00000000000
--- a/apps/theming/tests/Migration/ThemingImages.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2017 Julius Härtl <jus@bitgrid.net>
- *
- * @author Julius Haertl <jus@bitgrid.net>
- *
- * @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.
- *
- * This program 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 program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-namespace OCA\Theming\Tests\Migration;
-
-use OCP\Files\File;
-use OCP\Files\NotFoundException;
-use OCP\Files\SimpleFS\ISimpleFile;
-use OCP\Files\SimpleFS\ISimpleFolder;
-use OCP\Migration\IOutput;
-use Test\TestCase;
-use OCA\Theming\Migration\ThemingImages;
-use OCP\Files\IAppData;
-use OCP\Files\IRootFolder;
-
-class ThemingImagesTest extends TestCase {
- /** @var ThemingImages */
- private $repairStep;
- /** @var IAppData */
- private $appData;
- /** @var IRootFolder */
- private $rootFolder;
- /** @var ISimpleFolder */
- private $imageFolder;
- /** @var IOutput */
- private $output;
-
- public function setUp() {
- parent::setUp();
- $this->appData = $this->createMock(IAppData::class);
- $this->rootFolder = $this->createMock(IRootFolder::class);
- $this->repairStep = new ThemingImages($this->appData, $this->rootFolder);
- $this->imageFolder = $this->createMock(ISimpleFolder::class);
- $this->output = $this->createMock(IOutput::class);
- }
-
- public function testGetName() {
- $this->assertEquals(
- 'Move theming files to AppData storage',
- $this->repairStep->getName()
- );
- }
-
- public function testRunNoImages() {
- $this->appData->expects($this->once())
- ->method('newFolder')
- ->willReturn($this->imageFolder);
- $this->rootFolder->expects($this->any())
- ->method('get')
- ->willThrowException(new NotFoundException());
- $this->imageFolder->expects($this->never())
- ->method('newFile');
- $this->output->expects($this->exactly(2))
- ->method('info');
- $this->repairStep->run($this->output);
- }
-
- public function testRunLogo() {
- $oldFile = $this->createMock(File::class);
- $newFile = $this->createMock(ISimpleFile::class);
-
- $this->appData->expects($this->once())
- ->method('newFolder')
- ->willReturn($this->imageFolder);
- $this->rootFolder->expects($this->at(1))
- ->method('get')
- ->with('themedbackgroundlogo')
- ->willThrowException(new NotFoundException());
- $this->rootFolder->expects($this->at(0))
- ->method('get')
- ->with('themedinstancelogo')
- ->willReturn($oldFile);
- $this->imageFolder->expects($this->once())
- ->method('newFile')
- ->with('logo')
- ->willReturn($newFile);
- $oldFile->expects($this->once())
- ->method('getContent')
- ->willReturn('data');
- $newFile->expects($this->once())
- ->method('putContent')
- ->with('data');
- $oldFile->expects($this->once())
- ->method('delete');
-
- $this->repairStep->run($this->output);
- }
-
- public function testRunBackground() {
- $oldFile = $this->createMock(File::class);
- $newFile = $this->createMock(ISimpleFile::class);
-
- $this->appData->expects($this->once())
- ->method('newFolder')
- ->willReturn($this->imageFolder);
- $this->rootFolder->expects($this->at(1))
- ->method('get')
- ->with('themedbackgroundlogo')
- ->willReturn($oldFile);
- $this->rootFolder->expects($this->at(0))
- ->method('get')
- ->with('themedinstancelogo')
- ->willThrowException(new NotFoundException());
- $this->imageFolder->expects($this->once())
- ->method('newFile')
- ->with('background')
- ->willReturn($newFile);
- $oldFile->expects($this->once())
- ->method('getContent')
- ->willReturn('data');
- $newFile->expects($this->once())
- ->method('putContent')
- ->with('data');
- $oldFile->expects($this->once())
- ->method('delete');
-
- $this->repairStep->run($this->output);
- }
-}
diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php
index d0dc6587f74..1a4679a2993 100644
--- a/apps/theming/tests/ThemingDefaultsTest.php
+++ b/apps/theming/tests/ThemingDefaultsTest.php
@@ -517,18 +517,12 @@ class ThemingDefaultsTest extends TestCase {
['theming.Theming.getLoginBackground', [], 'custom-background'],
]);
- $this->urlGenerator->expects($this->exactly(2))
- ->method('getAbsoluteURL')
- ->willReturnCallback(function ($path) {
- return 'absolute-' . $path;
- });
-
$expected = [
'theming-cachebuster' => '\'0\'',
'theming-logo-mime' => '\'jpeg\'',
'theming-background-mime' => '\'jpeg\'',
- 'image-logo' => "'absolute-custom-logo?v=0'",
- 'image-login-background' => "'absolute-custom-background?v=0'",
+ 'image-logo' => "'custom-logo?v=0'",
+ 'image-login-background' => "'custom-background?v=0'",
'color-primary' => $this->defaults->getColorPrimary(),
'color-primary-text' => '#ffffff',
'image-login-plain' => 'false',
diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php
index d65e9add563..c0c81be14d7 100644
--- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php
+++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php
@@ -32,7 +32,7 @@ $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig());
$serverConnections = $helper->getServerConfigurationPrefixes();
sort($serverConnections);
$lk = array_pop($serverConnections);
-$ln = intval(str_replace('s', '', $lk));
+$ln = (int)str_replace('s', '', $lk);
$nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
$resultData = array('configPrefix' => $nk);
diff --git a/apps/user_ldap/l10n/id.js b/apps/user_ldap/l10n/id.js
index a1b266263d6..000beca9611 100644
--- a/apps/user_ldap/l10n/id.js
+++ b/apps/user_ldap/l10n/id.js
@@ -39,7 +39,7 @@ OC.L10N.register(
"A connection error to LDAP / AD occurred, please check host, port and credentials." : "Terjadi kesalahan sambungan ke LDAP / AD, mohon periksa host, port dan kredensial.",
"Please provide a login name to test against" : "Mohon berikan nama login untuk mengujinya kembali",
"The group box was disabled, because the LDAP / AD server does not support memberOf." : "Kotak grup telah dinonaktifkan, karena server LDAP / AD tidak mendukung keanggotaan.",
- "Password change rejected. Hint: " : "Perubahan sandi ditolak. Petunjuk:",
+ "Password change rejected. Hint: " : "Perubahan kata sandi ditolak. Petunjuk:",
"LDAP / AD integration" : "Integrasi LDAP / AD",
"_%s group found_::_%s groups found_" : ["%s grup ditemukan"],
"_%s user found_::_%s users found_" : ["%s pengguna ditemukan"],
@@ -71,7 +71,7 @@ OC.L10N.register(
"Detect Port" : "Deteksi Port",
"User DN" : "Pengguna DN",
"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." : "DN dari klien pengguna yang dengannya tautan akan diterapkan, mis. uid=agen,dc=contoh,dc=com. Untuk akses anonim, biarkan DN dan kata sandi kosong.",
- "Password" : "Sandi",
+ "Password" : "Kata sandi",
"For anonymous access, leave DN and Password empty." : "Untuk akses anonim, biarkan DN dan Kata sandi kosong.",
"One Base DN per line" : "Satu Base DN per baris",
"You can specify Base DN for users and groups in the Advanced tab" : "Anda dapat menetapkan Base DN untuk pengguna dan grup dalam tab Lanjutan",
@@ -125,9 +125,9 @@ OC.L10N.register(
"When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" : "Ketika dihidupkan, grup yang berisi grup akan didukung. (Hanya bekerja jika atribut anggota grup berisi DN.)",
"Paging chunksize" : "Paging chunksize",
"Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" : "Chunksize digunakan untuk pencarian paged LDAP yang mengembalikan hasil secara massal seperti enumerasi pengguna dan grup. (Atur dengan nilai 0 untuk menonaktifkan pencarian paged LDAP dalam situasi tersebut.)",
- "Enable LDAP password changes per user" : "Aktifkan perubahan sandi LDAP per pengguna",
- "Allow LDAP users to change their password and allow Super Administrators and Group Administrators to change the password of their LDAP users. Only works when access control policies are configured accordingly on the LDAP server. As passwords are sent in plaintext to the LDAP server, transport encryption must be used and password hashing should be configured on the LDAP server." : "Perbolehkan pengguna LDAP mengubah sandi mereka dan perbolehkan Administrator Super dan Administrator Grup untuk mengubah sandi pengguna LDAP mereka. Hanya bekerja ketika kebijaksanaan akses kontrol terconfigurasi berdasarkan server LDAP. Sebagaimana sandi dikirim dalam plain teks ke server LDAP, pengiriman enkripsi harus digunakan dan hashing sandi harus terkonfigurasi di server LDAP.",
- "(New password is sent as plain text to LDAP)" : "(Sandi baru dikirim sebagai plain teks ke LDAP)",
+ "Enable LDAP password changes per user" : "Aktifkan perubahan kata sandi LDAP per pengguna",
+ "Allow LDAP users to change their password and allow Super Administrators and Group Administrators to change the password of their LDAP users. Only works when access control policies are configured accordingly on the LDAP server. As passwords are sent in plaintext to the LDAP server, transport encryption must be used and password hashing should be configured on the LDAP server." : "Perbolehkan pengguna LDAP mengubah kata sandi mereka dan perbolehkan Administrator Super dan Administrator Grup untuk mengubah kata sandi pengguna LDAP mereka. Hanya bekerja ketika kebijaksanaan akses kontrol terconfigurasi berdasarkan server LDAP. Sebagaimana kata sandi dikirim dalam plain teks ke server LDAP, pengiriman enkripsi harus digunakan dan hashing kata sandi harus terkonfigurasi di server LDAP.",
+ "(New password is sent as plain text to LDAP)" : "(Kata sandi baru dikirim sebagai plain teks ke LDAP)",
"Special Attributes" : "Atribut Khusus",
"Quota Field" : "Kolom Kuota",
"Quota Default" : "Kuota Baku",
diff --git a/apps/user_ldap/l10n/id.json b/apps/user_ldap/l10n/id.json
index 92c0f0c6e9d..0582def6063 100644
--- a/apps/user_ldap/l10n/id.json
+++ b/apps/user_ldap/l10n/id.json
@@ -37,7 +37,7 @@
"A connection error to LDAP / AD occurred, please check host, port and credentials." : "Terjadi kesalahan sambungan ke LDAP / AD, mohon periksa host, port dan kredensial.",
"Please provide a login name to test against" : "Mohon berikan nama login untuk mengujinya kembali",
"The group box was disabled, because the LDAP / AD server does not support memberOf." : "Kotak grup telah dinonaktifkan, karena server LDAP / AD tidak mendukung keanggotaan.",
- "Password change rejected. Hint: " : "Perubahan sandi ditolak. Petunjuk:",
+ "Password change rejected. Hint: " : "Perubahan kata sandi ditolak. Petunjuk:",
"LDAP / AD integration" : "Integrasi LDAP / AD",
"_%s group found_::_%s groups found_" : ["%s grup ditemukan"],
"_%s user found_::_%s users found_" : ["%s pengguna ditemukan"],
@@ -69,7 +69,7 @@
"Detect Port" : "Deteksi Port",
"User DN" : "Pengguna DN",
"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." : "DN dari klien pengguna yang dengannya tautan akan diterapkan, mis. uid=agen,dc=contoh,dc=com. Untuk akses anonim, biarkan DN dan kata sandi kosong.",
- "Password" : "Sandi",
+ "Password" : "Kata sandi",
"For anonymous access, leave DN and Password empty." : "Untuk akses anonim, biarkan DN dan Kata sandi kosong.",
"One Base DN per line" : "Satu Base DN per baris",
"You can specify Base DN for users and groups in the Advanced tab" : "Anda dapat menetapkan Base DN untuk pengguna dan grup dalam tab Lanjutan",
@@ -123,9 +123,9 @@
"When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)" : "Ketika dihidupkan, grup yang berisi grup akan didukung. (Hanya bekerja jika atribut anggota grup berisi DN.)",
"Paging chunksize" : "Paging chunksize",
"Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" : "Chunksize digunakan untuk pencarian paged LDAP yang mengembalikan hasil secara massal seperti enumerasi pengguna dan grup. (Atur dengan nilai 0 untuk menonaktifkan pencarian paged LDAP dalam situasi tersebut.)",
- "Enable LDAP password changes per user" : "Aktifkan perubahan sandi LDAP per pengguna",
- "Allow LDAP users to change their password and allow Super Administrators and Group Administrators to change the password of their LDAP users. Only works when access control policies are configured accordingly on the LDAP server. As passwords are sent in plaintext to the LDAP server, transport encryption must be used and password hashing should be configured on the LDAP server." : "Perbolehkan pengguna LDAP mengubah sandi mereka dan perbolehkan Administrator Super dan Administrator Grup untuk mengubah sandi pengguna LDAP mereka. Hanya bekerja ketika kebijaksanaan akses kontrol terconfigurasi berdasarkan server LDAP. Sebagaimana sandi dikirim dalam plain teks ke server LDAP, pengiriman enkripsi harus digunakan dan hashing sandi harus terkonfigurasi di server LDAP.",
- "(New password is sent as plain text to LDAP)" : "(Sandi baru dikirim sebagai plain teks ke LDAP)",
+ "Enable LDAP password changes per user" : "Aktifkan perubahan kata sandi LDAP per pengguna",
+ "Allow LDAP users to change their password and allow Super Administrators and Group Administrators to change the password of their LDAP users. Only works when access control policies are configured accordingly on the LDAP server. As passwords are sent in plaintext to the LDAP server, transport encryption must be used and password hashing should be configured on the LDAP server." : "Perbolehkan pengguna LDAP mengubah kata sandi mereka dan perbolehkan Administrator Super dan Administrator Grup untuk mengubah kata sandi pengguna LDAP mereka. Hanya bekerja ketika kebijaksanaan akses kontrol terconfigurasi berdasarkan server LDAP. Sebagaimana kata sandi dikirim dalam plain teks ke server LDAP, pengiriman enkripsi harus digunakan dan hashing kata sandi harus terkonfigurasi di server LDAP.",
+ "(New password is sent as plain text to LDAP)" : "(Kata sandi baru dikirim sebagai plain teks ke LDAP)",
"Special Attributes" : "Atribut Khusus",
"Quota Field" : "Kolom Kuota",
"Quota Default" : "Kuota Baku",
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 43feeb4c1f0..3d182077764 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -168,12 +168,14 @@ class Access extends LDAPUtility implements IUserTools {
/**
* reads a given attribute for an LDAP record identified by a DN
+ *
* @param string $dn the record in question
* @param string $attr the attribute that shall be retrieved
* if empty, just check the record's existence
* @param string $filter
* @return array|false an array of values on success or an empty
* array if $attr is empty, false otherwise
+ * @throws ServerNotAvailableException
*/
public function readAttribute($dn, $attr, $filter = 'objectClass=*') {
if(!$this->checkConnection()) {
@@ -193,7 +195,7 @@ class Access extends LDAPUtility implements IUserTools {
$this->abandonPagedSearch();
// openLDAP requires that we init a new Paged Search. Not needed by AD,
// but does not hurt either.
- $pagingSize = intval($this->connection->ldapPagingSize);
+ $pagingSize = (int)$this->connection->ldapPagingSize;
// 0 won't result in replies, small numbers may leave out groups
// (cf. #12306), 500 is default for paging and should work everywhere.
$maxResults = $pagingSize > 20 ? $pagingSize : 500;
@@ -255,6 +257,7 @@ class Access extends LDAPUtility implements IUserTools {
* @return array|bool false if there was any error, true if an exists check
* was performed and the requested DN found, array with the
* returned data on a successful usual operation
+ * @throws ServerNotAvailableException
*/
public function executeRead($cr, $dn, $attribute, $filter, $maxResults) {
$this->initPagedSearch($filter, array($dn), array($attribute), $maxResults, 0);
@@ -349,7 +352,7 @@ class Access extends LDAPUtility implements IUserTools {
* @throws \Exception
*/
public function setPassword($userDN, $password) {
- if(intval($this->connection->turnOnPasswordChange) !== 1) {
+ if((int)$this->connection->turnOnPasswordChange !== 1) {
throw new \Exception('LDAP password changes are disabled.');
}
$cr = $this->connection->getConnectionResource();
@@ -570,7 +573,7 @@ class Access extends LDAPUtility implements IUserTools {
}
if($isUser) {
- $usernameAttribute = strval($this->connection->ldapExpertUsernameAttr);
+ $usernameAttribute = (string)$this->connection->ldapExpertUsernameAttr;
if ($usernameAttribute !== '') {
$username = $this->readAttribute($fdn, $usernameAttribute);
$username = $username[0];
@@ -743,14 +746,14 @@ class Access extends LDAPUtility implements IUserTools {
*/
private function _createAltInternalOwnCloudNameForGroups($name) {
$usedNames = $this->groupMapper->getNamesBySearch($name, "", '_%');
- if(!($usedNames) || count($usedNames) === 0) {
+ if(!$usedNames || count($usedNames) === 0) {
$lastNo = 1; //will become name_2
} else {
natsort($usedNames);
$lastName = array_pop($usedNames);
- $lastNo = intval(substr($lastName, strrpos($lastName, '_') + 1));
+ $lastNo = (int)substr($lastName, strrpos($lastName, '_') + 1);
}
- $altName = $name.'_'.strval($lastNo+1);
+ $altName = $name.'_'. (string)($lastNo+1);
unset($usedNames);
$attempts = 1;
@@ -839,7 +842,7 @@ class Access extends LDAPUtility implements IUserTools {
});
}
$this->batchApplyUserAttributes($recordsToUpdate);
- return $this->fetchList($ldapRecords, (count($attr) > 1));
+ return $this->fetchList($ldapRecords, count($attr) > 1);
}
/**
@@ -883,7 +886,7 @@ class Access extends LDAPUtility implements IUserTools {
* @return array
*/
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
- return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1));
+ return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), count($attr) > 1);
}
/**
@@ -1048,7 +1051,7 @@ class Access extends LDAPUtility implements IUserTools {
}
//check whether paged search should be attempted
- $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, intval($limit), $offset);
+ $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, (int)$limit, $offset);
$linkResources = array_pad(array(), count($base), $cr);
$sr = $this->invokeLDAPMethod('search', $linkResources, $base, $filter, $attr);
@@ -1096,7 +1099,7 @@ class Access extends LDAPUtility implements IUserTools {
$this->pagedSearchedSuccessful = true;
}
} else {
- if(!is_null($limit) && intval($this->connection->ldapPagingSize) !== 0) {
+ if(!is_null($limit) && (int)$this->connection->ldapPagingSize !== 0) {
\OC::$server->getLogger()->debug(
'Paged search was not available',
[ 'app' => 'user_ldap' ]
@@ -1128,7 +1131,7 @@ class Access extends LDAPUtility implements IUserTools {
private function count($filter, $base, $attr = null, $limit = null, $offset = null, $skipHandling = false) {
\OCP\Util::writeLog('user_ldap', 'Count filter: '.print_r($filter, true), \OCP\Util::DEBUG);
- $limitPerPage = intval($this->connection->ldapPagingSize);
+ $limitPerPage = (int)$this->connection->ldapPagingSize;
if(!is_null($limit) && $limit < $limitPerPage && $limit > 0) {
$limitPerPage = $limit;
}
@@ -1171,7 +1174,7 @@ class Access extends LDAPUtility implements IUserTools {
$counter = 0;
foreach($searchResults as $res) {
- $count = intval($this->invokeLDAPMethod('countEntries', $this->connection->getConnectionResource(), $res));
+ $count = (int)$this->invokeLDAPMethod('countEntries', $this->connection->getConnectionResource(), $res);
$counter += $count;
}
@@ -1191,7 +1194,7 @@ class Access extends LDAPUtility implements IUserTools {
* @throws ServerNotAvailableException
*/
public function search($filter, $base, $attr = null, $limit = null, $offset = null, $skipHandling = false) {
- $limitPerPage = intval($this->connection->ldapPagingSize);
+ $limitPerPage = (int)$this->connection->ldapPagingSize;
if(!is_null($limit) && $limit < $limitPerPage && $limit > 0) {
$limitPerPage = $limit;
}
@@ -1284,7 +1287,7 @@ class Access extends LDAPUtility implements IUserTools {
&& !is_null($limit)
)
) {
- $findings = array_slice($findings, intval($offset), $limit);
+ $findings = array_slice($findings, (int)$offset, $limit);
}
return $findings;
}
@@ -1826,7 +1829,7 @@ class Access extends LDAPUtility implements IUserTools {
}
$offset -= $limit;
//we work with cache here
- $cacheKey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' . intval($limit) . '-' . intval($offset);
+ $cacheKey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' . (int)$limit . '-' . (int)$offset;
$cookie = '';
if(isset($this->cookies[$cacheKey])) {
$cookie = $this->cookies[$cacheKey];
@@ -1873,7 +1876,7 @@ class Access extends LDAPUtility implements IUserTools {
private function setPagedResultCookie($base, $filter, $limit, $offset, $cookie) {
// allow '0' for 389ds
if(!empty($cookie) || $cookie === '0') {
- $cacheKey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' .intval($limit) . '-' . intval($offset);
+ $cacheKey = 'lc' . crc32($base) . '-' . crc32($filter) . '-' . (int)$limit . '-' . (int)$offset;
$this->cookies[$cacheKey] = $cookie;
$this->lastCookie = $cookie;
}
@@ -1901,7 +1904,7 @@ class Access extends LDAPUtility implements IUserTools {
private function initPagedSearch($filter, $bases, $attr, $limit, $offset) {
$pagedSearchOK = false;
if($this->connection->hasPagedResultSupport && ($limit !== 0)) {
- $offset = intval($offset); //can be null
+ $offset = (int)$offset; //can be null
\OCP\Util::writeLog('user_ldap',
'initializing paged search for Filter '.$filter.' base '.print_r($bases, true)
.' attr '.print_r($attr, true). ' limit ' .$limit.' offset '.$offset,
@@ -1953,7 +1956,7 @@ class Access extends LDAPUtility implements IUserTools {
$this->abandonPagedSearch();
// in case someone set it to 0 … use 500, otherwise no results will
// be returned.
- $pageSize = intval($this->connection->ldapPagingSize) > 0 ? intval($this->connection->ldapPagingSize) : 500;
+ $pageSize = (int)$this->connection->ldapPagingSize > 0 ? (int)$this->connection->ldapPagingSize : 500;
$pagedSearchOK = $this->invokeLDAPMethod('controlPagedResult',
$this->connection->getConnectionResource(),
$pageSize, false, '');
diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php
index 2188605b5e8..6d5c416f04f 100644
--- a/apps/user_ldap/lib/AppInfo/Application.php
+++ b/apps/user_ldap/lib/AppInfo/Application.php
@@ -26,6 +26,7 @@ namespace OCA\User_LDAP\AppInfo;
use OCA\User_LDAP\Controller\RenewPasswordController;
use OCP\AppFramework\App;
use OCP\AppFramework\IAppContainer;
+use OCP\IL10N;
class Application extends App {
public function __construct () {
@@ -44,7 +45,7 @@ class Application extends App {
$server->getRequest(),
$c->query('UserManager'),
$server->getConfig(),
- $c->query('OCP\IL10N'),
+ $c->query(IL10N::class),
$c->query('Session'),
$server->getURLGenerator()
);
diff --git a/apps/user_ldap/lib/Command/Search.php b/apps/user_ldap/lib/Command/Search.php
index ae61bfcd41c..c81b8d54696 100644
--- a/apps/user_ldap/lib/Command/Search.php
+++ b/apps/user_ldap/lib/Command/Search.php
@@ -109,8 +109,8 @@ class Search extends Command {
$configPrefixes = $helper->getServerConfigurationPrefixes(true);
$ldapWrapper = new LDAP();
- $offset = intval($input->getOption('offset'));
- $limit = intval($input->getOption('limit'));
+ $offset = (int)$input->getOption('offset');
+ $limit = (int)$input->getOption('limit');
$this->validateOffsetAndLimit($offset, $limit);
if($input->getOption('group')) {
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index c73a35e6bf1..1ea3cc67303 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -106,14 +106,14 @@ class Connection extends LDAPUtility {
$this->doNotValidate = !in_array($this->configPrefix,
$helper->getServerConfigurationPrefixes());
$this->hasPagedResultSupport =
- intval($this->configuration->ldapPagingSize) !== 0
+ (int)$this->configuration->ldapPagingSize !== 0
|| $this->ldap->hasPagedResultSupport();
}
public function __destruct() {
if(!$this->dontDestruct && $this->ldap->isResource($this->ldapConnectionRes)) {
@$this->ldap->unbind($this->ldapConnectionRes);
- };
+ }
}
/**
@@ -368,7 +368,7 @@ class Connection extends LDAPUtility {
}
}
- $backupPort = intval($this->configuration->ldapBackupPort);
+ $backupPort = (int)$this->configuration->ldapBackupPort;
if ($backupPort <= 0) {
$this->configuration->backupPort = $this->configuration->ldapPort;
}
@@ -399,7 +399,7 @@ class Connection extends LDAPUtility {
private function doCriticalValidation() {
$configurationOK = true;
$errorStr = 'Configuration Error (prefix '.
- strval($this->configPrefix).'): ';
+ (string)$this->configPrefix .'): ';
//options that shall not be empty
$options = array('ldapHost', 'ldapPort', 'ldapUserDisplayName',
diff --git a/apps/user_ldap/lib/Controller/ConfigAPIController.php b/apps/user_ldap/lib/Controller/ConfigAPIController.php
index 54800ef24eb..e000bd4e709 100644
--- a/apps/user_ldap/lib/Controller/ConfigAPIController.php
+++ b/apps/user_ldap/lib/Controller/ConfigAPIController.php
@@ -285,7 +285,7 @@ class ConfigAPIController extends OCSController {
$config = new Configuration($configID);
$data = $config->getConfiguration();
- if(!boolval(intval($showPassword))) {
+ if(!(int)$showPassword) {
$data['ldapAgentPassword'] = '***';
}
foreach ($data as $key => $value) {
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 3faa96bc2b8..e1e6a78c44b 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -266,7 +266,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
$groups = $this->access->groupsMatchFilter($groups);
$allGroups = $groups;
$nestedGroups = $this->access->connection->ldapNestedGroups;
- if (intval($nestedGroups) === 1) {
+ if ((int)$nestedGroups === 1) {
foreach ($groups as $group) {
$subGroups = $this->_getGroupDNsFromMemberOf($group, $seen);
$allGroups = array_merge($allGroups, $subGroups);
@@ -667,8 +667,8 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
// if possible, read out membership via memberOf. It's far faster than
// performing a search, which still is a fallback later.
// memberof doesn't support memberuid, so skip it here.
- if(intval($this->access->connection->hasMemberOfFilterSupport) === 1
- && intval($this->access->connection->useMemberOfToDetectMembership) === 1
+ if((int)$this->access->connection->hasMemberOfFilterSupport === 1
+ && (int)$this->access->connection->useMemberOfToDetectMembership === 1
&& strtolower($this->access->connection->ldapGroupMemberAssocAttr) !== 'memberuid'
) {
$groupDNs = $this->_getGroupDNsFromMemberOf($userDN);
@@ -1008,7 +1008,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
return array();
}
$search = $this->access->escapeFilterPart($search, true);
- $pagingSize = intval($this->access->connection->ldapPagingSize);
+ $pagingSize = (int)$this->access->connection->ldapPagingSize;
if (!$this->access->connection->hasPagedResultSupport || $pagingSize <= 0) {
return $this->getGroupsChunk($search, $limit, $offset);
}
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index ad3fba4092f..9fccb64cd46 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -73,7 +73,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP {
* @return mixed, the result of the method or false
*/
protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) {
- $cacheKey = $this->getGroupCacheKey($gid);;
+ $cacheKey = $this->getGroupCacheKey($gid);
$prefix = $this->getFromCache($cacheKey);
//in case the uid has been found in the past, try this stored connection first
if(!is_null($prefix)) {
diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php
index 3d1ae31cfef..74c7aa7a68f 100644
--- a/apps/user_ldap/lib/Helper.php
+++ b/apps/user_ldap/lib/Helper.php
@@ -122,7 +122,7 @@ class Helper {
sort($serverConnections);
$lastKey = array_pop($serverConnections);
- $lastNumber = intval(str_replace('s', '', $lastKey));
+ $lastNumber = (int)str_replace('s', '', $lastKey);
return 's' . str_pad($lastNumber + 1, 2, '0', STR_PAD_LEFT);
}
@@ -221,7 +221,7 @@ class Helper {
public function setLDAPProvider() {
$current = \OC::$server->getConfig()->getSystemValue('ldapProviderFactory', null);
if(is_null($current)) {
- \OC::$server->getConfig()->setSystemValue('ldapProviderFactory', '\\OCA\\User_LDAP\\LDAPProviderFactory');
+ \OC::$server->getConfig()->setSystemValue('ldapProviderFactory', LDAPProviderFactory::class);
}
}
diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php
index 849c30ecd65..df7d888a902 100644
--- a/apps/user_ldap/lib/Jobs/CleanUp.php
+++ b/apps/user_ldap/lib/Jobs/CleanUp.php
@@ -69,8 +69,8 @@ class CleanUp extends TimedJob {
public function __construct() {
$minutes = \OC::$server->getConfig()->getSystemValue(
- 'ldapUserCleanupInterval', strval($this->defaultIntervalMin));
- $this->setInterval(intval($minutes) * 60);
+ 'ldapUserCleanupInterval', (string)$this->defaultIntervalMin);
+ $this->setInterval((int)$minutes * 60);
}
/**
@@ -156,7 +156,7 @@ class CleanUp extends TimedJob {
* @return bool
*/
public function isOffsetResetNecessary($resultCount) {
- return ($resultCount < $this->limit) ? true : false;
+ return $resultCount < $this->limit;
}
/**
@@ -183,7 +183,7 @@ class CleanUp extends TimedJob {
*/
private function isCleanUpEnabled() {
return (bool)$this->ocConfig->getSystemValue(
- 'ldapUserCleanupInterval', strval($this->defaultIntervalMin));
+ 'ldapUserCleanupInterval', (string)$this->defaultIntervalMin);
}
/**
@@ -215,7 +215,7 @@ class CleanUp extends TimedJob {
* @return int
*/
private function getOffset() {
- return intval($this->ocConfig->getAppValue('user_ldap', 'cleanUpJobOffset', 0));
+ return (int)$this->ocConfig->getAppValue('user_ldap', 'cleanUpJobOffset', 0);
}
/**
diff --git a/apps/user_ldap/lib/Migration/UUIDFixInsert.php b/apps/user_ldap/lib/Migration/UUIDFixInsert.php
index 4a1104f2c6f..a99e13f74ce 100644
--- a/apps/user_ldap/lib/Migration/UUIDFixInsert.php
+++ b/apps/user_ldap/lib/Migration/UUIDFixInsert.php
@@ -90,7 +90,7 @@ class UUIDFixInsert implements IRepairStep {
$offset += $batchSize;
} catch (\InvalidArgumentException $e) {
if(strpos($e->getMessage(), 'Background job arguments can\'t exceed 4000') !== false) {
- $batchSize = intval(floor(count($records) * 0.8));
+ $batchSize = (int)floor(count($records) * 0.8);
$retry = true;
}
}
diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php
index b04a321652c..55fc7499beb 100644
--- a/apps/user_ldap/lib/User/Manager.php
+++ b/apps/user_ldap/lib/User/Manager.php
@@ -207,7 +207,7 @@ class Manager {
public function isDeletedUser($id) {
$isDeleted = $this->ocConfig->getUserValue(
$id, 'user_ldap', 'isDeleted', 0);
- return intval($isDeleted) === 1;
+ return (int)$isDeleted === 1;
}
/**
diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php
index 942eee84cb7..9576b49d5a2 100644
--- a/apps/user_ldap/lib/User/OfflineUser.php
+++ b/apps/user_ldap/lib/User/OfflineUser.php
@@ -166,7 +166,7 @@ class OfflineUser {
* @return int
*/
public function getLastLogin() {
- return intval($this->lastLogin);
+ return (int)$this->lastLogin;
}
/**
@@ -211,7 +211,7 @@ class OfflineUser {
', 1);
$query->execute(array($this->ocName));
$sResult = $query->fetchColumn(0);
- if(intval($sResult) === 1) {
+ if((int)$sResult === 1) {
$this->hasActiveShares = true;
return;
}
@@ -223,7 +223,7 @@ class OfflineUser {
', 1);
$query->execute(array($this->ocName));
$sResult = $query->fetchColumn(0);
- if(intval($sResult) === 1) {
+ if((int)$sResult === 1) {
$this->hasActiveShares = true;
return;
}
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 8bde353a560..2f36e205fa6 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -194,11 +194,11 @@ class User {
$displayName = $displayName2 = '';
$attr = strtolower($this->connection->ldapUserDisplayName);
if(isset($ldapEntry[$attr])) {
- $displayName = strval($ldapEntry[$attr][0]);
+ $displayName = (string)$ldapEntry[$attr][0];
}
$attr = strtolower($this->connection->ldapUserDisplayName2);
if(isset($ldapEntry[$attr])) {
- $displayName2 = strval($ldapEntry[$attr][0]);
+ $displayName2 = (string)$ldapEntry[$attr][0];
}
if ($displayName !== '') {
$this->composeAndStoreDisplayName($displayName);
@@ -281,7 +281,7 @@ class User {
* @throws \Exception
*/
public function getHomePath($valueFromLDAP = null) {
- $path = strval($valueFromLDAP);
+ $path = (string)$valueFromLDAP;
$attr = null;
if (is_null($valueFromLDAP)
@@ -387,7 +387,7 @@ class User {
$lastChecked = $this->config->getUserValue($this->uid, 'user_ldap',
self::USER_PREFKEY_LASTREFRESH, 0);
- if((time() - intval($lastChecked)) < intval($this->config->getAppValue('user_ldap', 'updateAttributesInterval', 86400)) ) {
+ if((time() - (int)$lastChecked) < (int)$this->config->getAppValue('user_ldap', 'updateAttributesInterval', 86400)) {
return false;
}
return true;
@@ -412,7 +412,7 @@ class User {
* @returns string the effective display name
*/
public function composeAndStoreDisplayName($displayName, $displayName2 = '') {
- $displayName2 = strval($displayName2);
+ $displayName2 = (string)$displayName2;
if($displayName2 !== '') {
$displayName .= ' (' . $displayName2 . ')';
}
@@ -452,20 +452,20 @@ class User {
if($this->wasRefreshed('email')) {
return;
}
- $email = strval($valueFromLDAP);
+ $email = (string)$valueFromLDAP;
if(is_null($valueFromLDAP)) {
$emailAttribute = $this->connection->ldapEmailAttribute;
if ($emailAttribute !== '') {
$aEmail = $this->access->readAttribute($this->dn, $emailAttribute);
if(is_array($aEmail) && (count($aEmail) > 0)) {
- $email = strval($aEmail[0]);
+ $email = (string)$aEmail[0];
}
}
}
if ($email !== '') {
$user = $this->userManager->get($this->uid);
if (!is_null($user)) {
- $currentEmail = strval($user->getEMailAddress());
+ $currentEmail = (string)$user->getEMailAddress();
if ($currentEmail !== $email) {
$user->setEMailAddress($email);
}
@@ -610,7 +610,7 @@ class User {
*/
public function handlePasswordExpiry($params) {
$ppolicyDN = $this->connection->ldapDefaultPPolicyDN;
- if (empty($ppolicyDN) || (intval($this->connection->turnOnPasswordChange) !== 1)) {
+ if (empty($ppolicyDN) || ((int)$this->connection->turnOnPasswordChange !== 1)) {
return;//password expiry handling disabled
}
$uid = $params['uid'];
@@ -646,7 +646,7 @@ class User {
if($pwdGraceUseTime && $pwdGraceUseTimeCount > 0) { //was this a grace login?
if($pwdGraceAuthNLimit
&& (count($pwdGraceAuthNLimit) > 0)
- &&($pwdGraceUseTimeCount < intval($pwdGraceAuthNLimit[0]))) { //at least one more grace login available?
+ &&($pwdGraceUseTimeCount < (int)$pwdGraceAuthNLimit[0])) { //at least one more grace login available?
$this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true');
header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
'user_ldap.renewPassword.showRenewPasswordForm', array('user' => $uid)));
@@ -667,8 +667,8 @@ class User {
if($pwdChangedTime && (count($pwdChangedTime) > 0)) {
if($pwdMaxAge && (count($pwdMaxAge) > 0)
&& $pwdExpireWarning && (count($pwdExpireWarning) > 0)) {
- $pwdMaxAgeInt = intval($pwdMaxAge[0]);
- $pwdExpireWarningInt = intval($pwdExpireWarning[0]);
+ $pwdMaxAgeInt = (int)$pwdMaxAge[0];
+ $pwdExpireWarningInt = (int)$pwdExpireWarning[0];
if($pwdMaxAgeInt > 0 && $pwdExpireWarningInt > 0){
$pwdChangedTimeDt = \DateTime::createFromFormat('YmdHisZ', $pwdChangedTime[0]);
$pwdChangedTimeDt->add(new \DateInterval('PT'.$pwdMaxAgeInt.'S'));
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index 506ea36c529..5a2b993c334 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -38,6 +38,7 @@
namespace OCA\User_LDAP;
+use OC\ServerNotAvailableException;
use OC\User\Backend;
use OC\User\NoUserException;
use OCA\User_LDAP\Exceptions\NotOnLDAP;
@@ -231,7 +232,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
if($user->getUsername() !== false && $this->access->setPassword($user->getDN(), $password)) {
$ldapDefaultPPolicyDN = $this->access->connection->ldapDefaultPPolicyDN;
$turnOnPasswordChange = $this->access->connection->turnOnPasswordChange;
- if (!empty($ldapDefaultPPolicyDN) && (intval($turnOnPasswordChange) === 1)) {
+ if (!empty($ldapDefaultPPolicyDN) && ((int)$turnOnPasswordChange === 1)) {
//remove last password expiry warning if any
$notification = $this->notificationManager->createNotification();
$notification->setApp('user_ldap')
@@ -317,16 +318,18 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
try {
$uuid = $this->access->getUserMapper()->getUUIDByDN($dn);
- if(!$uuid) {
+ if (!$uuid) {
return false;
}
$newDn = $this->access->getUserDnByUuid($uuid);
//check if renamed user is still valid by reapplying the ldap filter
- if(!is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
+ if (!is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
return false;
}
$this->access->getUserMapper()->setDNbyUUID($newDn, $uuid);
return true;
+ } catch (ServerNotAvailableException $e) {
+ throw $e;
} catch (\Exception $e) {
return false;
}
@@ -384,7 +387,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
}
$marked = $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0);
- if(intval($marked) === 0) {
+ if((int)$marked === 0) {
\OC::$server->getLogger()->notice(
'User '.$uid . ' is not marked as deleted, not cleaning up.',
array('app' => 'user_ldap'));
@@ -546,7 +549,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
| Backend::GET_DISPLAYNAME
| Backend::PROVIDE_AVATAR
| Backend::COUNT_USERS
- | ((intval($this->access->connection->turnOnPasswordChange) === 1)?(Backend::SET_PASSWORD):0)
+ | (((int)$this->access->connection->turnOnPasswordChange === 1)? Backend::SET_PASSWORD :0)
| $this->userPluginManager->getImplementedActions())
& $actions);
}
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index bf7c6bbeb93..23c4976c2fa 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -227,7 +227,7 @@ class Wizard extends LDAPUtility {
if ($attr !== '' && $attr !== 'displayName') {
// most likely not the default value with upper case N,
// verify it still produces a result
- $count = intval($this->countUsersWithAttribute($attr, true));
+ $count = (int)$this->countUsersWithAttribute($attr, true);
if($count > 0) {
//no change, but we sent it back to make sure the user interface
//is still correct, even if the ajax call was cancelled meanwhile
@@ -239,13 +239,13 @@ class Wizard extends LDAPUtility {
// first attribute that has at least one result wins
$displayNameAttrs = array('displayname', 'cn');
foreach ($displayNameAttrs as $attr) {
- $count = intval($this->countUsersWithAttribute($attr, true));
+ $count = (int)$this->countUsersWithAttribute($attr, true);
if($count > 0) {
$this->applyFind('ldap_display_name', $attr);
return $this->result;
}
- };
+ }
throw new \Exception(self::$l->t('Could not detect user display name attribute. Please specify it yourself in advanced LDAP settings.'));
}
@@ -267,7 +267,7 @@ class Wizard extends LDAPUtility {
$attr = $this->configuration->ldapEmailAttribute;
if ($attr !== '') {
- $count = intval($this->countUsersWithAttribute($attr, true));
+ $count = (int)$this->countUsersWithAttribute($attr, true);
if($count > 0) {
return false;
}
@@ -690,7 +690,7 @@ class Wizard extends LDAPUtility {
if ($settingsFound === true) {
$config = array(
'ldapPort' => $p,
- 'ldapTLS' => intval($t)
+ 'ldapTLS' => (int)$t
);
$this->configuration->setConfiguration($config);
\OCP\Util::writeLog('user_ldap', 'Wiz: detected Port ' . $p, \OCP\Util::DEBUG);
@@ -1069,7 +1069,7 @@ class Wizard extends LDAPUtility {
if($login === true) {
$this->ldap->unbind($cr);
- \OCP\Util::writeLog('user_ldap', 'Wiz: Bind successful to Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('user_ldap', 'Wiz: Bind successful to Port '. $port . ' TLS ' . (int)$tls, \OCP\Util::DEBUG);
return true;
}
@@ -1326,7 +1326,7 @@ class Wizard extends LDAPUtility {
//636 ← LDAPS / SSL
//7xxx ← UCS. need to be checked first, because both ports may be open
$host = $this->configuration->ldapHost;
- $port = intval($this->configuration->ldapPort);
+ $port = (int)$this->configuration->ldapPort;
$portSettings = array();
//In case the port is already provided, we will check this first
diff --git a/apps/user_ldap/templates/renewpassword.php b/apps/user_ldap/templates/renewpassword.php
index 7b1df75e06b..9fc4271d6be 100644
--- a/apps/user_ldap/templates/renewpassword.php
+++ b/apps/user_ldap/templates/renewpassword.php
@@ -23,7 +23,7 @@ style('user_ldap', 'renewPassword');
<?php p($message); ?><br>
</div>
<?php endforeach; ?>
- <?php if (isset($_['internalexception']) && ($_['internalexception'])): ?>
+ <?php if (isset($_['internalexception']) && $_['internalexception']): ?>
<div class="warning">
<?php p($l->t('An internal error occurred.')); ?><br>
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php
index 42bbaaf78ca..1e1c85db247 100644
--- a/apps/user_ldap/templates/settings.php
+++ b/apps/user_ldap/templates/settings.php
@@ -71,10 +71,10 @@ style('user_ldap', 'settings');
print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>');
}
?>
- <?php require_once(__DIR__ . '/part.wizard-server.php'); ?>
- <?php require_once(__DIR__ . '/part.wizard-userfilter.php'); ?>
- <?php require_once(__DIR__ . '/part.wizard-loginfilter.php'); ?>
- <?php require_once(__DIR__ . '/part.wizard-groupfilter.php'); ?>
+ <?php require_once __DIR__ . '/part.wizard-server.php'; ?>
+ <?php require_once __DIR__ . '/part.wizard-userfilter.php'; ?>
+ <?php require_once __DIR__ . '/part.wizard-loginfilter.php'; ?>
+ <?php require_once __DIR__ . '/part.wizard-groupfilter.php'; ?>
<fieldset id="ldapSettings-1">
<div id="ldapAdvancedAccordion">
<h3><?php p($l->t('Connection Settings'));?></h3>
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php
index 28e32092419..8032112e863 100644
--- a/apps/workflowengine/lib/AppInfo/Application.php
+++ b/apps/workflowengine/lib/AppInfo/Application.php
@@ -21,13 +21,17 @@
namespace OCA\WorkflowEngine\AppInfo;
+use OCP\Template;
+use OCA\WorkflowEngine\Controller\RequestTime;
+use OCA\WorkflowEngine\Controller\FlowOperations;
+
class Application extends \OCP\AppFramework\App {
public function __construct() {
parent::__construct('workflowengine');
- $this->getContainer()->registerAlias('FlowOperationsController', 'OCA\WorkflowEngine\Controller\FlowOperations');
- $this->getContainer()->registerAlias('RequestTimeController', 'OCA\WorkflowEngine\Controller\RequestTime');
+ $this->getContainer()->registerAlias('FlowOperationsController', FlowOperations::class);
+ $this->getContainer()->registerAlias('RequestTimeController', RequestTime::class);
}
/**
@@ -40,7 +44,7 @@ class Application extends \OCP\AppFramework\App {
function() {
if (!function_exists('style')) {
// This is hacky, but we need to load the template class
- class_exists('OCP\Template', true);
+ class_exists(Template::class, true);
}
style('workflowengine', [