Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/files/lib/BackgroundJob/CleanupFileLocks.php1
-rw-r--r--apps/files/lib/Controller/ApiController.php6
-rw-r--r--apps/files/lib/Controller/ViewController.php3
-rw-r--r--apps/user_ldap/lib/Access.php28
4 files changed, 38 insertions, 0 deletions
diff --git a/apps/files/lib/BackgroundJob/CleanupFileLocks.php b/apps/files/lib/BackgroundJob/CleanupFileLocks.php
index f4898b24873..df4542386e9 100644
--- a/apps/files/lib/BackgroundJob/CleanupFileLocks.php
+++ b/apps/files/lib/BackgroundJob/CleanupFileLocks.php
@@ -48,6 +48,7 @@ class CleanupFileLocks extends TimedJob {
* Makes the background job do its work
*
* @param array $argument unused argument
+ * @throws \Exception
*/
public function run($argument) {
$lockingProvider = \OC::$server->getLockingProvider();
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index b0965d255bd..38c378d480d 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -242,6 +242,7 @@ class ApiController extends Controller {
* @param string $mode
* @param string $direction
* @return Response
+ * @throws \OCP\PreConditionNotMetException
*/
public function updateFileSorting($mode, $direction) {
$allowedMode = ['name', 'size', 'mtime'];
@@ -262,6 +263,8 @@ class ApiController extends Controller {
* @NoAdminRequired
*
* @param bool $show
+ * @return Response
+ * @throws \OCP\PreConditionNotMetException
*/
public function showHiddenFiles($show) {
$this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', (int)$show);
@@ -274,6 +277,8 @@ class ApiController extends Controller {
* @NoAdminRequired
*
* @param bool $show
+ * @return Response
+ * @throws \OCP\PreConditionNotMetException
*/
public function showGridView($show) {
$this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_grid', (int)$show);
@@ -299,6 +304,7 @@ class ApiController extends Controller {
* @param string $key the key of the folder
*
* @return Response
+ * @throws \OCP\PreConditionNotMetException
*/
public function toggleShowFolder(int $show, string $key) {
// ensure the edited key exists
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 9f9cd0b33c1..34e4427129d 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -135,6 +135,7 @@ class ViewController extends Controller {
*
* @param string $fileid
* @return TemplateResponse|RedirectResponse
+ * @throws NotFoundException
*/
public function showFile(string $fileid = null): Response {
// This is the entry point from the `/f/{fileid}` URL which is hardcoded in the server.
@@ -148,7 +149,9 @@ class ViewController extends Controller {
* @param string $dir
* @param string $view
* @param string $fileid
+ * @param bool $fileNotFound
* @return TemplateResponse|RedirectResponse
+ * @throws NotFoundException
*/
public function index($dir = '', $view = '', $fileid = null, $fileNotFound = false) {
if ($fileid !== null) {
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 1044938446e..41e04fdfcb3 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -454,9 +454,11 @@ class Access extends LDAPUtility {
/**
* returns the internal Nextcloud name for the given LDAP DN of the group, false on DN outside of search DN or failure
+ *
* @param string $fdn the dn of the group object
* @param string $ldapName optional, the display name of the object
* @return string|false with the name to use in Nextcloud, false on DN outside of search DN
+ * @throws \Exception
*/
public function dn2groupname($fdn, $ldapName = null) {
//To avoid bypassing the base DN settings under certain circumstances
@@ -511,9 +513,11 @@ class Access extends LDAPUtility {
/**
* returns the internal Nextcloud name for the given LDAP DN of the user, false on DN outside of search DN or failure
+ *
* @param string $dn the dn of the user object
* @param string $ldapName optional, the display name of the object
* @return string|false with with the name to use in Nextcloud
+ * @throws \Exception
*/
public function dn2username($fdn, $ldapName = null) {
//To avoid bypassing the base DN settings under certain circumstances
@@ -654,10 +658,12 @@ class Access extends LDAPUtility {
/**
* gives back the user names as they are used ownClod internally
+ *
* @param array $ldapUsers as returned by fetchList()
* @return array an array with the user names to use in Nextcloud
*
* gives back the user names as they are used ownClod internally
+ * @throws \Exception
*/
public function nextcloudUserNames($ldapUsers) {
return $this->ldap2NextcloudNames($ldapUsers, true);
@@ -665,10 +671,12 @@ class Access extends LDAPUtility {
/**
* gives back the group names as they are used ownClod internally
+ *
* @param array $ldapGroups as returned by fetchList()
* @return array an array with the group names to use in Nextcloud
*
* gives back the group names as they are used ownClod internally
+ * @throws \Exception
*/
public function nextcloudGroupNames($ldapGroups) {
return $this->ldap2NextcloudNames($ldapGroups, false);
@@ -751,9 +759,11 @@ class Access extends LDAPUtility {
/**
* caches the user display name
+ *
* @param string $ocName the internal Nextcloud username
* @param string $displayName the display name
* @param string $displayName2 the second display name
+ * @throws \Exception
*/
public function cacheUserDisplayName($ocName, $displayName, $displayName2 = '') {
$user = $this->userManager->get($ocName);
@@ -878,6 +888,7 @@ class Access extends LDAPUtility {
* @param int $offset
* @param bool $forceApplyAttributes
* @return array
+ * @throws \Exception
*/
public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null, $forceApplyAttributes = false) {
$ldapRecords = $this->searchUsers($filter, $attr, $limit, $offset);
@@ -966,6 +977,7 @@ class Access extends LDAPUtility {
/**
* executes an LDAP search, optimized for Users
+ *
* @param string $filter the LDAP filter for the search
* @param string|string[] $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
@@ -973,6 +985,7 @@ class Access extends LDAPUtility {
* @return array with the search result
*
* Executes an LDAP search
+ * @throws ServerNotAvailableException
*/
public function searchUsers($filter, $attr = null, $limit = null, $offset = null) {
$result = [];
@@ -988,6 +1001,7 @@ class Access extends LDAPUtility {
* @param int $limit
* @param int $offset
* @return false|int
+ * @throws ServerNotAvailableException
*/
public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) {
$result = false;
@@ -1000,6 +1014,7 @@ class Access extends LDAPUtility {
/**
* executes an LDAP search, optimized for Groups
+ *
* @param string $filter the LDAP filter for the search
* @param string|string[] $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
@@ -1007,6 +1022,7 @@ class Access extends LDAPUtility {
* @return array with the search result
*
* Executes an LDAP search
+ * @throws ServerNotAvailableException
*/
public function searchGroups($filter, $attr = null, $limit = null, $offset = null) {
$result = [];
@@ -1018,11 +1034,13 @@ class Access extends LDAPUtility {
/**
* returns the number of available groups
+ *
* @param string $filter the LDAP search filter
* @param string[] $attr optional
* @param int|null $limit
* @param int|null $offset
* @return int|bool
+ * @throws ServerNotAvailableException
*/
public function countGroups($filter, $attr = array('dn'), $limit = null, $offset = null) {
$result = false;
@@ -1039,6 +1057,7 @@ class Access extends LDAPUtility {
* @param int|null $limit
* @param int|null $offset
* @return int|bool
+ * @throws ServerNotAvailableException
*/
public function countObjects($limit = null, $offset = null) {
$result = false;
@@ -1142,6 +1161,7 @@ class Access extends LDAPUtility {
/**
* processes an LDAP paged search operation
+ *
* @param array $sr the array containing the LDAP search resources
* @param string $filter the LDAP filter for the search
* @param array $base an array containing the LDAP subtree(s) that shall be searched
@@ -1152,6 +1172,7 @@ class Access extends LDAPUtility {
* @param bool $skipHandling required for paged search when cookies to
* prior results need to be gained
* @return bool cookie validity, true if we have more pages, false otherwise.
+ * @throws ServerNotAvailableException
*/
private function processPagedSearchStatus($sr, $filter, $base, $iFoundItems, $limit, $offset, $pagedSearchOK, $skipHandling) {
$cookie = null;
@@ -1244,6 +1265,7 @@ class Access extends LDAPUtility {
/**
* @param array $searchResults
* @return int
+ * @throws ServerNotAvailableException
*/
private function countEntriesInSearchResults($searchResults) {
$counter = 0;
@@ -1649,6 +1671,7 @@ class Access extends LDAPUtility {
* @param bool $force the detection should be run, even if it is not set to auto
* @param array|null $ldapRecord
* @return bool true on success, false otherwise
+ * @throws ServerNotAvailableException
*/
private function detectUuidAttribute($dn, $isUser = true, $force = false, array $ldapRecord = null) {
if($isUser) {
@@ -1704,6 +1727,7 @@ class Access extends LDAPUtility {
* @param bool $isUser
* @param null $ldapRecord
* @return bool|string
+ * @throws ServerNotAvailableException
*/
public function getUUID($dn, $isUser = true, $ldapRecord = null) {
if($isUser) {
@@ -1809,8 +1833,10 @@ class Access extends LDAPUtility {
/**
* gets a SID of the domain of the given dn
+ *
* @param string $dn
* @return string|bool
+ * @throws ServerNotAvailableException
*/
public function getSID($dn) {
$domainDN = $this->getDomainDNFromDN($dn);
@@ -1979,12 +2005,14 @@ class Access extends LDAPUtility {
/**
* Prepares a paged search, if possible
+ *
* @param string $filter the LDAP filter for the search
* @param string[] $bases an array containing the LDAP subtree(s) that shall be searched
* @param string[] $attr optional, when a certain attribute shall be filtered outside
* @param int $limit
* @param int $offset
* @return bool|true
+ * @throws ServerNotAvailableException
*/
private function initPagedSearch($filter, $bases, $attr, $limit, $offset) {
$pagedSearchOK = false;