Fix multiline comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
bbba7bc45a
commit
85e369cddb
|
@ -299,10 +299,10 @@ class FilesPlugin extends ServerPlugin {
|
||||||
* so users were unable to navigate into folders where one subitem
|
* so users were unable to navigate into folders where one subitem
|
||||||
* is blocked by the files_accesscontrol app, see:
|
* is blocked by the files_accesscontrol app, see:
|
||||||
* https://github.com/nextcloud/files_accesscontrol/issues/65
|
* https://github.com/nextcloud/files_accesscontrol/issues/65
|
||||||
if (!$node->getFileInfo()->isReadable()) {
|
* if (!$node->getFileInfo()->isReadable()) {
|
||||||
// avoid detecting files through this means
|
* // avoid detecting files through this means
|
||||||
throw new NotFound();
|
* throw new NotFound();
|
||||||
}
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$propFind->handle(self::FILEID_PROPERTYNAME, function() use ($node) {
|
$propFind->handle(self::FILEID_PROPERTYNAME, function() use ($node) {
|
||||||
|
|
|
@ -221,8 +221,8 @@ class IMipPluginTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider dataIncludeResponseButtons
|
* @dataProvider dataIncludeResponseButtons
|
||||||
*/
|
*/
|
||||||
public function testIncludeResponseButtons(string $config_setting, string $recipient, bool $has_buttons ) {
|
public function testIncludeResponseButtons(string $config_setting, string $recipient, bool $has_buttons ) {
|
||||||
$message = $this->_testMessage([],$recipient);
|
$message = $this->_testMessage([],$recipient);
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ class Notify extends Base {
|
||||||
/**
|
/**
|
||||||
* @param int $mountId
|
* @param int $mountId
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function getStorageIds($mountId) {
|
private function getStorageIds($mountId) {
|
||||||
$qb = $this->connection->getQueryBuilder();
|
$qb = $this->connection->getQueryBuilder();
|
||||||
return $qb
|
return $qb
|
||||||
|
@ -223,7 +223,7 @@ class Notify extends Base {
|
||||||
* @param array $storageIds
|
* @param array $storageIds
|
||||||
* @param string $parent
|
* @param string $parent
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
private function updateParent($storageIds, $parent) {
|
private function updateParent($storageIds, $parent) {
|
||||||
$pathHash = md5(trim(\OC_Util::normalizeUnicode($parent), '/'));
|
$pathHash = md5(trim(\OC_Util::normalizeUnicode($parent), '/'));
|
||||||
$qb = $this->connection->getQueryBuilder();
|
$qb = $this->connection->getQueryBuilder();
|
||||||
|
@ -237,7 +237,7 @@ class Notify extends Base {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \OCP\IDBConnection
|
* @return \OCP\IDBConnection
|
||||||
*/
|
*/
|
||||||
private function reconnectToDatabase(IDBConnection $connection, OutputInterface $output) {
|
private function reconnectToDatabase(IDBConnection $connection, OutputInterface $output) {
|
||||||
try {
|
try {
|
||||||
$connection->close();
|
$connection->close();
|
||||||
|
|
|
@ -41,9 +41,9 @@ use Icewind\Streams\RetryWrapper;
|
||||||
use phpseclib\Net\SFTP\Stream;
|
use phpseclib\Net\SFTP\Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses phpseclib's Net\SFTP class and the Net\SFTP\Stream stream wrapper to
|
* Uses phpseclib's Net\SFTP class and the Net\SFTP\Stream stream wrapper to
|
||||||
* provide access to SFTP servers.
|
* provide access to SFTP servers.
|
||||||
*/
|
*/
|
||||||
class SFTP extends \OC\Files\Storage\Common {
|
class SFTP extends \OC\Files\Storage\Common {
|
||||||
private $host;
|
private $host;
|
||||||
private $user;
|
private $user;
|
||||||
|
|
|
@ -300,7 +300,7 @@ class ShareController extends AuthPublicShareController {
|
||||||
* @PublicPage
|
* @PublicPage
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return TemplateResponse
|
* @return TemplateResponse
|
||||||
* @throws NotFoundException
|
* @throws NotFoundException
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace OCA\Files_Sharing\Exceptions;
|
||||||
* Expected path with a different root
|
* Expected path with a different root
|
||||||
* Possible Error Codes:
|
* Possible Error Codes:
|
||||||
* 10 - Path not relative to data/ and point to the users file directory
|
* 10 - Path not relative to data/ and point to the users file directory
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
class BrokenPath extends \Exception {
|
class BrokenPath extends \Exception {
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,7 @@ class ApiTest extends TestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @medium
|
* @medium
|
||||||
*/
|
*/
|
||||||
function testSharePermissions() {
|
function testSharePermissions() {
|
||||||
// sharing file to a user should work if shareapi_exclude_groups is set
|
// sharing file to a user should work if shareapi_exclude_groups is set
|
||||||
// to no
|
// to no
|
||||||
|
|
|
@ -129,9 +129,9 @@ class Expiration {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read versions_retention_obligation, validate it
|
* Read versions_retention_obligation, validate it
|
||||||
* and set private members accordingly
|
* and set private members accordingly
|
||||||
*/
|
*/
|
||||||
private function parseRetentionObligation(){
|
private function parseRetentionObligation(){
|
||||||
$splitValues = explode(',', $this->retentionObligation);
|
$splitValues = explode(',', $this->retentionObligation);
|
||||||
if (!isset($splitValues[0])) {
|
if (!isset($splitValues[0])) {
|
||||||
|
|
|
@ -146,9 +146,9 @@ class CheckSetupController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the Nextcloud server can connect to a specific URL using both HTTPS and HTTP
|
* Checks if the Nextcloud server can connect to a specific URL using both HTTPS and HTTP
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function isSiteReachable($sitename) {
|
private function isSiteReachable($sitename) {
|
||||||
$httpSiteName = 'http://' . $sitename . '/';
|
$httpSiteName = 'http://' . $sitename . '/';
|
||||||
$httpsSiteName = 'https://' . $sitename . '/';
|
$httpsSiteName = 'https://' . $sitename . '/';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* @author Bjoern Schiessle <bjoern@schiessle.org>
|
* @author Bjoern Schiessle <bjoern@schiessle.org>
|
||||||
* @author Jan-Christoph Borchardt <hey@jancborchardt.net>
|
* @author Jan-Christoph Borchardt <hey@jancborchardt.net>
|
||||||
|
|
|
@ -90,8 +90,8 @@ class Access extends LDAPUtility {
|
||||||
protected $userMapper;
|
protected $userMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var AbstractMapping $userMapper
|
* @var AbstractMapping $userMapper
|
||||||
*/
|
*/
|
||||||
protected $groupMapper;
|
protected $groupMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1453,11 +1453,11 @@ class Access extends LDAPUtility {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* escapes (user provided) parts for LDAP filter
|
* escapes (user provided) parts for LDAP filter
|
||||||
* @param string $input, the provided value
|
* @param string $input, the provided value
|
||||||
* @param bool $allowAsterisk whether in * at the beginning should be preserved
|
* @param bool $allowAsterisk whether in * at the beginning should be preserved
|
||||||
* @return string the escaped string
|
* @return string the escaped string
|
||||||
*/
|
*/
|
||||||
public function escapeFilterPart($input, $allowAsterisk = false) {
|
public function escapeFilterPart($input, $allowAsterisk = false) {
|
||||||
$asterisk = '';
|
$asterisk = '';
|
||||||
if($allowAsterisk && strlen($input) > 0 && $input[0] === '*') {
|
if($allowAsterisk && strlen($input) > 0 && $input[0] === '*') {
|
||||||
|
|
|
@ -1129,13 +1129,13 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if backend implements actions
|
* Check if backend implements actions
|
||||||
* @param int $actions bitwise-or'ed actions
|
* @param int $actions bitwise-or'ed actions
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*
|
*
|
||||||
* Returns the supported actions as int to be
|
* Returns the supported actions as int to be
|
||||||
* compared with GroupInterface::CREATE_GROUP etc.
|
* compared with GroupInterface::CREATE_GROUP etc.
|
||||||
*/
|
*/
|
||||||
public function implementsActions($actions) {
|
public function implementsActions($actions) {
|
||||||
return (bool)((GroupInterface::COUNT_USERS |
|
return (bool)((GroupInterface::COUNT_USERS |
|
||||||
$this->groupPluginManager->getImplementedActions()) & $actions);
|
$this->groupPluginManager->getImplementedActions()) & $actions);
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
namespace OCA\User_LDAP\Mapping;
|
namespace OCA\User_LDAP\Mapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AbstractMapping
|
* Class AbstractMapping
|
||||||
* @package OCA\User_LDAP\Mapping
|
* @package OCA\User_LDAP\Mapping
|
||||||
*/
|
*/
|
||||||
abstract class AbstractMapping {
|
abstract class AbstractMapping {
|
||||||
/**
|
/**
|
||||||
* @var \OCP\IDBConnection $dbc
|
* @var \OCP\IDBConnection $dbc
|
||||||
|
|
|
@ -24,15 +24,15 @@
|
||||||
namespace OCA\User_LDAP\Mapping;
|
namespace OCA\User_LDAP\Mapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserMapping
|
* Class UserMapping
|
||||||
* @package OCA\User_LDAP\Mapping
|
* @package OCA\User_LDAP\Mapping
|
||||||
*/
|
*/
|
||||||
class GroupMapping extends AbstractMapping {
|
class GroupMapping extends AbstractMapping {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the DB table name which holds the mappings
|
* returns the DB table name which holds the mappings
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getTableName() {
|
protected function getTableName() {
|
||||||
return '*PREFIX*ldap_group_mapping';
|
return '*PREFIX*ldap_group_mapping';
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
namespace OCA\User_LDAP\Mapping;
|
namespace OCA\User_LDAP\Mapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserMapping
|
* Class UserMapping
|
||||||
* @package OCA\User_LDAP\Mapping
|
* @package OCA\User_LDAP\Mapping
|
||||||
*/
|
*/
|
||||||
class UserMapping extends AbstractMapping {
|
class UserMapping extends AbstractMapping {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -365,11 +365,11 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns whether a user was deleted in LDAP
|
* returns whether a user was deleted in LDAP
|
||||||
*
|
*
|
||||||
* @param string $uid The username of the user to delete
|
* @param string $uid The username of the user to delete
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function deleteUser($uid) {
|
public function deleteUser($uid) {
|
||||||
if ($this->userPluginManager->canDeleteUser()) {
|
if ($this->userPluginManager->canDeleteUser()) {
|
||||||
$status = $this->userPluginManager->deleteUser($uid);
|
$status = $this->userPluginManager->deleteUser($uid);
|
||||||
|
@ -522,13 +522,13 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if backend implements actions
|
* Check if backend implements actions
|
||||||
* @param int $actions bitwise-or'ed actions
|
* @param int $actions bitwise-or'ed actions
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*
|
*
|
||||||
* Returns the supported actions as int to be
|
* Returns the supported actions as int to be
|
||||||
* compared with \OC\User\Backend::CREATE_USER etc.
|
* compared with \OC\User\Backend::CREATE_USER etc.
|
||||||
*/
|
*/
|
||||||
public function implementsActions($actions) {
|
public function implementsActions($actions) {
|
||||||
return (bool)((Backend::CHECK_PASSWORD
|
return (bool)((Backend::CHECK_PASSWORD
|
||||||
| Backend::GET_HOME
|
| Backend::GET_HOME
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
* in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
* furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* The above copyright notice and this permission notice shall be included in
|
||||||
* all copies or substantial portions of the Software.
|
* all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OC\Core\Command\Background;
|
namespace OC\Core\Command\Background;
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
* in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
* furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* The above copyright notice and this permission notice shall be included in
|
||||||
* all copies or substantial portions of the Software.
|
* all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OC\Core\Command\Background;
|
namespace OC\Core\Command\Background;
|
||||||
|
|
||||||
|
@ -32,23 +32,23 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract base class for configuring the background job mode
|
* An abstract base class for configuring the background job mode
|
||||||
* from the command line interface.
|
* from the command line interface.
|
||||||
* Subclasses will override the getMode() function to specify the mode to configure.
|
* Subclasses will override the getMode() function to specify the mode to configure.
|
||||||
*/
|
*/
|
||||||
abstract class Base extends Command {
|
abstract class Base extends Command {
|
||||||
|
|
||||||
|
|
||||||
abstract protected function getMode();
|
abstract protected function getMode();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \OCP\IConfig
|
* @var \OCP\IConfig
|
||||||
*/
|
*/
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \OCP\IConfig $config
|
* @param \OCP\IConfig $config
|
||||||
*/
|
*/
|
||||||
public function __construct(IConfig $config) {
|
public function __construct(IConfig $config) {
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
@ -62,13 +62,13 @@ abstract class Base extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executing this command will set the background job mode for owncloud.
|
* Executing this command will set the background job mode for owncloud.
|
||||||
* The mode to set is specified by the concrete sub class by implementing the
|
* The mode to set is specified by the concrete sub class by implementing the
|
||||||
* getMode() function.
|
* getMode() function.
|
||||||
*
|
*
|
||||||
* @param InputInterface $input
|
* @param InputInterface $input
|
||||||
* @param OutputInterface $output
|
* @param OutputInterface $output
|
||||||
*/
|
*/
|
||||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||||
$mode = $this->getMode();
|
$mode = $this->getMode();
|
||||||
$this->config->setAppValue( 'core', 'backgroundjobs_mode', $mode );
|
$this->config->setAppValue( 'core', 'backgroundjobs_mode', $mode );
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
* in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
* furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* The above copyright notice and this permission notice shall be included in
|
||||||
* all copies or substantial portions of the Software.
|
* all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OC\Core\Command\Background;
|
namespace OC\Core\Command\Background;
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
* in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
* furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* The above copyright notice and this permission notice shall be included in
|
||||||
* all copies or substantial portions of the Software.
|
* all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OC\Core\Command\Background;
|
namespace OC\Core\Command\Background;
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ class AvatarController extends Controller {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*
|
*
|
||||||
* @return JSONResponse
|
* @return JSONResponse
|
||||||
*/
|
*/
|
||||||
public function deleteAvatar() {
|
public function deleteAvatar() {
|
||||||
|
|
|
@ -75,7 +75,7 @@ class WebAuthnController extends Controller {
|
||||||
Util::emitHook(
|
Util::emitHook(
|
||||||
'\OCA\Files_Sharing\API\Server2Server',
|
'\OCA\Files_Sharing\API\Server2Server',
|
||||||
'preLoginNameUsedAsUserName',
|
'preLoginNameUsedAsUserName',
|
||||||
array('uid' => &$uid)
|
['uid' => &$uid]
|
||||||
);
|
);
|
||||||
$this->logger->debug('Got UID: ' . $uid);
|
$this->logger->debug('Got UID: ' . $uid);
|
||||||
|
|
||||||
|
|
|
@ -524,10 +524,10 @@ class Event implements IEvent {
|
||||||
$this->getTimestamp() !== 0
|
$this->getTimestamp() !== 0
|
||||||
/**
|
/**
|
||||||
* Disabled for BC with old activities
|
* Disabled for BC with old activities
|
||||||
&&
|
* &&
|
||||||
$this->getObjectType() !== ''
|
* $this->getObjectType() !== ''
|
||||||
&&
|
* &&
|
||||||
$this->getObjectId() !== 0
|
* $this->getObjectId() !== 0
|
||||||
*/
|
*/
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,25 +187,25 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ArrayAccess methods
|
* ArrayAccess methods
|
||||||
*
|
*
|
||||||
* Gives access to the combined GET, POST and urlParams arrays
|
* Gives access to the combined GET, POST and urlParams arrays
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
*
|
*
|
||||||
* $var = $request['myvar'];
|
* $var = $request['myvar'];
|
||||||
*
|
*
|
||||||
* or
|
* or
|
||||||
*
|
*
|
||||||
* if(!isset($request['myvar']) {
|
* if(!isset($request['myvar']) {
|
||||||
* // Do something
|
* // Do something
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* $request['myvar'] = 'something'; // This throws an exception.
|
* $request['myvar'] = 'something'; // This throws an exception.
|
||||||
*
|
*
|
||||||
* @param string $offset The key to lookup
|
* @param string $offset The key to lookup
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function offsetExists($offset): bool {
|
public function offsetExists($offset): bool {
|
||||||
return isset($this->items['parameters'][$offset]);
|
return isset($this->items['parameters'][$offset]);
|
||||||
}
|
}
|
||||||
|
@ -248,20 +248,20 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access request variables by method and name.
|
* Access request variables by method and name.
|
||||||
* Examples:
|
* Examples:
|
||||||
*
|
*
|
||||||
* $request->post['myvar']; // Only look for POST variables
|
* $request->post['myvar']; // Only look for POST variables
|
||||||
* $request->myvar; or $request->{'myvar'}; or $request->{$myvar}
|
* $request->myvar; or $request->{'myvar'}; or $request->{$myvar}
|
||||||
* Looks in the combined GET, POST and urlParams array.
|
* Looks in the combined GET, POST and urlParams array.
|
||||||
*
|
*
|
||||||
* If you access e.g. ->post but the current HTTP request method
|
* If you access e.g. ->post but the current HTTP request method
|
||||||
* is GET a \LogicException will be thrown.
|
* is GET a \LogicException will be thrown.
|
||||||
*
|
*
|
||||||
* @param string $name The key to look for.
|
* @param string $name The key to look for.
|
||||||
* @throws \LogicException
|
* @throws \LogicException
|
||||||
* @return mixed|null
|
* @return mixed|null
|
||||||
*/
|
*/
|
||||||
public function __get($name) {
|
public function __get($name) {
|
||||||
switch($name) {
|
switch($name) {
|
||||||
case 'put':
|
case 'put':
|
||||||
|
|
|
@ -27,11 +27,9 @@ namespace OC\Authentication\Login;
|
||||||
|
|
||||||
use OC\Authentication\Events\LoginFailed;
|
use OC\Authentication\Events\LoginFailed;
|
||||||
use OC\Core\Controller\LoginController;
|
use OC\Core\Controller\LoginController;
|
||||||
use OCP\Authentication\Events\LoginFailedEvent;
|
|
||||||
use OCP\EventDispatcher\IEventDispatcher;
|
use OCP\EventDispatcher\IEventDispatcher;
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use OCP\Util;
|
|
||||||
|
|
||||||
class LoggedInCheckCommand extends ALoginCommand {
|
class LoggedInCheckCommand extends ALoginCommand {
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ namespace OC\Authentication\WebAuthn\Db;
|
||||||
use JsonSerializable;
|
use JsonSerializable;
|
||||||
use OCP\AppFramework\Db\Entity;
|
use OCP\AppFramework\Db\Entity;
|
||||||
use Webauthn\PublicKeyCredentialSource;
|
use Webauthn\PublicKeyCredentialSource;
|
||||||
use Webauthn\TrustPath\TrustPathLoader;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 19.0.0
|
* @since 19.0.0
|
||||||
|
|
|
@ -49,7 +49,6 @@ use Webauthn\PublicKeyCredentialLoader;
|
||||||
use Webauthn\PublicKeyCredentialParameters;
|
use Webauthn\PublicKeyCredentialParameters;
|
||||||
use Webauthn\PublicKeyCredentialRequestOptions;
|
use Webauthn\PublicKeyCredentialRequestOptions;
|
||||||
use Webauthn\PublicKeyCredentialRpEntity;
|
use Webauthn\PublicKeyCredentialRpEntity;
|
||||||
use Webauthn\PublicKeyCredentialSource;
|
|
||||||
use Webauthn\PublicKeyCredentialUserEntity;
|
use Webauthn\PublicKeyCredentialUserEntity;
|
||||||
use Webauthn\TokenBinding\TokenBindingNotSupportedHandler;
|
use Webauthn\TokenBinding\TokenBindingNotSupportedHandler;
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class CapabilitiesManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an array of al the capabilities that are registered at this manager
|
* Get an array of al the capabilities that are registered at this manager
|
||||||
*
|
*
|
||||||
* @param bool $public get public capabilities only
|
* @param bool $public get public capabilities only
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @return array
|
* @return array
|
||||||
|
|
|
@ -26,8 +26,8 @@ namespace OC\DB;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Various MySQL specific helper functions.
|
* Various MySQL specific helper functions.
|
||||||
*/
|
*/
|
||||||
class MySqlTools {
|
class MySqlTools {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,8 +28,8 @@ namespace OC\DB;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Various PostgreSQL specific helper functions.
|
* Various PostgreSQL specific helper functions.
|
||||||
*/
|
*/
|
||||||
class PgSqlTools {
|
class PgSqlTools {
|
||||||
|
|
||||||
/** @var \OCP\IConfig */
|
/** @var \OCP\IConfig */
|
||||||
|
@ -43,11 +43,11 @@ class PgSqlTools {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resynchronizes all sequences of a database after using INSERTs
|
* @brief Resynchronizes all sequences of a database after using INSERTs
|
||||||
* without leaving out the auto-incremented column.
|
* without leaving out the auto-incremented column.
|
||||||
* @param \OC\DB\Connection $conn
|
* @param \OC\DB\Connection $conn
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function resynchronizeDatabaseSequences(Connection $conn) {
|
public function resynchronizeDatabaseSequences(Connection $conn) {
|
||||||
$filterExpression = '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
|
$filterExpression = '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
|
||||||
$databaseName = $conn->getDatabase();
|
$databaseName = $conn->getDatabase();
|
||||||
|
|
|
@ -128,7 +128,7 @@ class Manager implements IManager {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an callback function which must return an encryption module instance
|
* Registers an callback function which must return an encryption module instance
|
||||||
*
|
*
|
||||||
* @param string $id
|
* @param string $id
|
||||||
|
|
|
@ -45,12 +45,12 @@ abstract class Backend implements \OCP\GroupInterface {
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all supported actions
|
* Get all supported actions
|
||||||
* @return int bitwise-or'ed actions
|
* @return int bitwise-or'ed actions
|
||||||
*
|
*
|
||||||
* Returns the supported actions as int to be
|
* Returns the supported actions as int to be
|
||||||
* compared with \OC\Group\Backend::CREATE_GROUP etc.
|
* compared with \OC\Group\Backend::CREATE_GROUP etc.
|
||||||
*/
|
*/
|
||||||
public function getSupportedActions() {
|
public function getSupportedActions() {
|
||||||
$actions = 0;
|
$actions = 0;
|
||||||
foreach($this->possibleActions AS $action => $methodName) {
|
foreach($this->possibleActions AS $action => $methodName) {
|
||||||
|
@ -63,13 +63,13 @@ abstract class Backend implements \OCP\GroupInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if backend implements actions
|
* Check if backend implements actions
|
||||||
* @param int $actions bitwise-or'ed actions
|
* @param int $actions bitwise-or'ed actions
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
* Returns the supported actions as int to be
|
* Returns the supported actions as int to be
|
||||||
* compared with \OC\Group\Backend::CREATE_GROUP etc.
|
* compared with \OC\Group\Backend::CREATE_GROUP etc.
|
||||||
*/
|
*/
|
||||||
public function implementsActions($actions) {
|
public function implementsActions($actions) {
|
||||||
return (bool)($this->getSupportedActions() & $actions);
|
return (bool)($this->getSupportedActions() & $actions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,23 +34,23 @@ namespace OC;
|
||||||
*/
|
*/
|
||||||
class LargeFileHelper {
|
class LargeFileHelper {
|
||||||
/**
|
/**
|
||||||
* pow(2, 53) as a base-10 string.
|
* pow(2, 53) as a base-10 string.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const POW_2_53 = '9007199254740992';
|
const POW_2_53 = '9007199254740992';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pow(2, 53) - 1 as a base-10 string.
|
* pow(2, 53) - 1 as a base-10 string.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const POW_2_53_MINUS_1 = '9007199254740991';
|
const POW_2_53_MINUS_1 = '9007199254740991';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether our assumptions hold on the PHP platform we are on.
|
* @brief Checks whether our assumptions hold on the PHP platform we are on.
|
||||||
*
|
*
|
||||||
* @throws \RunTimeException if our assumptions do not hold on the current
|
* @throws \RunTimeException if our assumptions do not hold on the current
|
||||||
* PHP platform.
|
* PHP platform.
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$pow_2_53 = (float)self::POW_2_53_MINUS_1 + 1.0;
|
$pow_2_53 = (float)self::POW_2_53_MINUS_1 + 1.0;
|
||||||
if ($this->formatUnsignedInteger($pow_2_53) !== self::POW_2_53) {
|
if ($this->formatUnsignedInteger($pow_2_53) !== self::POW_2_53) {
|
||||||
|
@ -61,16 +61,16 @@ class LargeFileHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Formats a signed integer or float as an unsigned integer base-10
|
* @brief Formats a signed integer or float as an unsigned integer base-10
|
||||||
* string. Passed strings will be checked for being base-10.
|
* string. Passed strings will be checked for being base-10.
|
||||||
*
|
*
|
||||||
* @param int|float|string $number Number containing unsigned integer data
|
* @param int|float|string $number Number containing unsigned integer data
|
||||||
*
|
*
|
||||||
* @throws \UnexpectedValueException if $number is not a float, not an int
|
* @throws \UnexpectedValueException if $number is not a float, not an int
|
||||||
* and not a base-10 string.
|
* and not a base-10 string.
|
||||||
*
|
*
|
||||||
* @return string Unsigned integer base-10 string
|
* @return string Unsigned integer base-10 string
|
||||||
*/
|
*/
|
||||||
public function formatUnsignedInteger($number) {
|
public function formatUnsignedInteger($number) {
|
||||||
if (is_float($number)) {
|
if (is_float($number)) {
|
||||||
// Undo the effect of the php.ini setting 'precision'.
|
// Undo the effect of the php.ini setting 'precision'.
|
||||||
|
@ -88,14 +88,14 @@ class LargeFileHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Tries to get the size of a file via various workarounds that
|
* @brief Tries to get the size of a file via various workarounds that
|
||||||
* even work for large files on 32-bit platforms.
|
* even work for large files on 32-bit platforms.
|
||||||
*
|
*
|
||||||
* @param string $filename Path to the file.
|
* @param string $filename Path to the file.
|
||||||
*
|
*
|
||||||
* @return null|int|float Number of bytes as number (float or int) or
|
* @return null|int|float Number of bytes as number (float or int) or
|
||||||
* null on failure.
|
* null on failure.
|
||||||
*/
|
*/
|
||||||
public function getFileSize($filename) {
|
public function getFileSize($filename) {
|
||||||
$fileSize = $this->getFileSizeViaCurl($filename);
|
$fileSize = $this->getFileSizeViaCurl($filename);
|
||||||
if (!is_null($fileSize)) {
|
if (!is_null($fileSize)) {
|
||||||
|
@ -109,13 +109,13 @@ class LargeFileHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Tries to get the size of a file via a CURL HEAD request.
|
* @brief Tries to get the size of a file via a CURL HEAD request.
|
||||||
*
|
*
|
||||||
* @param string $fileName Path to the file.
|
* @param string $fileName Path to the file.
|
||||||
*
|
*
|
||||||
* @return null|int|float Number of bytes as number (float or int) or
|
* @return null|int|float Number of bytes as number (float or int) or
|
||||||
* null on failure.
|
* null on failure.
|
||||||
*/
|
*/
|
||||||
public function getFileSizeViaCurl($fileName) {
|
public function getFileSizeViaCurl($fileName) {
|
||||||
if (\OC::$server->getIniWrapper()->getString('open_basedir') === '') {
|
if (\OC::$server->getIniWrapper()->getString('open_basedir') === '') {
|
||||||
$encodedFileName = rawurlencode($fileName);
|
$encodedFileName = rawurlencode($fileName);
|
||||||
|
@ -137,13 +137,13 @@ class LargeFileHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Tries to get the size of a file via an exec() call.
|
* @brief Tries to get the size of a file via an exec() call.
|
||||||
*
|
*
|
||||||
* @param string $filename Path to the file.
|
* @param string $filename Path to the file.
|
||||||
*
|
*
|
||||||
* @return null|int|float Number of bytes as number (float or int) or
|
* @return null|int|float Number of bytes as number (float or int) or
|
||||||
* null on failure.
|
* null on failure.
|
||||||
*/
|
*/
|
||||||
public function getFileSizeViaExec($filename) {
|
public function getFileSizeViaExec($filename) {
|
||||||
if (\OC_Helper::is_function_enabled('exec')) {
|
if (\OC_Helper::is_function_enabled('exec')) {
|
||||||
$os = strtolower(php_uname('s'));
|
$os = strtolower(php_uname('s'));
|
||||||
|
@ -160,15 +160,15 @@ class LargeFileHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the size of a file via a filesize() call and converts
|
* @brief Gets the size of a file via a filesize() call and converts
|
||||||
* negative signed int to positive float. As the result of filesize()
|
* negative signed int to positive float. As the result of filesize()
|
||||||
* will wrap around after a file size of 2^32 bytes = 4 GiB, this
|
* will wrap around after a file size of 2^32 bytes = 4 GiB, this
|
||||||
* should only be used as a last resort.
|
* should only be used as a last resort.
|
||||||
*
|
*
|
||||||
* @param string $filename Path to the file.
|
* @param string $filename Path to the file.
|
||||||
*
|
*
|
||||||
* @return int|float Number of bytes as number (float or int).
|
* @return int|float Number of bytes as number (float or int).
|
||||||
*/
|
*/
|
||||||
public function getFileSizeNative($filename) {
|
public function getFileSizeNative($filename) {
|
||||||
$result = filesize($filename);
|
$result = filesize($filename);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
|
|
|
@ -51,12 +51,12 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
|
||||||
protected $dispatcher;
|
protected $dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param IDBConnection $connection database connection
|
* @param IDBConnection $connection database connection
|
||||||
* @param ISystemTagManager $tagManager system tag manager
|
* @param ISystemTagManager $tagManager system tag manager
|
||||||
* @param EventDispatcherInterface $dispatcher
|
* @param EventDispatcherInterface $dispatcher
|
||||||
*/
|
*/
|
||||||
public function __construct(IDBConnection $connection, ISystemTagManager $tagManager, EventDispatcherInterface $dispatcher) {
|
public function __construct(IDBConnection $connection, ISystemTagManager $tagManager, EventDispatcherInterface $dispatcher) {
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->tagManager = $tagManager;
|
$this->tagManager = $tagManager;
|
||||||
|
|
|
@ -56,11 +56,11 @@ class TagManager implements \OCP\ITagManager {
|
||||||
private $mapper;
|
private $mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param TagMapper $mapper Instance of the TagMapper abstraction layer.
|
* @param TagMapper $mapper Instance of the TagMapper abstraction layer.
|
||||||
* @param \OCP\IUserSession $userSession the user session
|
* @param \OCP\IUserSession $userSession the user session
|
||||||
*/
|
*/
|
||||||
public function __construct(TagMapper $mapper, \OCP\IUserSession $userSession) {
|
public function __construct(TagMapper $mapper, \OCP\IUserSession $userSession) {
|
||||||
$this->mapper = $mapper;
|
$this->mapper = $mapper;
|
||||||
$this->userSession = $userSession;
|
$this->userSession = $userSession;
|
||||||
|
@ -68,16 +68,16 @@ class TagManager implements \OCP\ITagManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new \OCP\ITags instance and load tags from db.
|
* Create a new \OCP\ITags instance and load tags from db.
|
||||||
*
|
*
|
||||||
* @see \OCP\ITags
|
* @see \OCP\ITags
|
||||||
* @param string $type The type identifier e.g. 'contact' or 'event'.
|
* @param string $type The type identifier e.g. 'contact' or 'event'.
|
||||||
* @param array $defaultTags An array of default tags to be used if none are stored.
|
* @param array $defaultTags An array of default tags to be used if none are stored.
|
||||||
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
|
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
|
||||||
* @param string $userId user for which to retrieve the tags, defaults to the currently
|
* @param string $userId user for which to retrieve the tags, defaults to the currently
|
||||||
* logged in user
|
* logged in user
|
||||||
* @return \OCP\ITags
|
* @return \OCP\ITags
|
||||||
*/
|
*/
|
||||||
public function load($type, $defaultTags = [], $includeShared = false, $userId = null) {
|
public function load($type, $defaultTags = [], $includeShared = false, $userId = null) {
|
||||||
if (is_null($userId)) {
|
if (is_null($userId)) {
|
||||||
$user = $this->userSession->getUser();
|
$user = $this->userSession->getUser();
|
||||||
|
|
|
@ -43,12 +43,12 @@ class Tag extends Entity {
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param string $owner The tag's owner
|
* @param string $owner The tag's owner
|
||||||
* @param string $type The type of item this tag is used for
|
* @param string $type The type of item this tag is used for
|
||||||
* @param string $name The tag's name
|
* @param string $name The tag's name
|
||||||
*/
|
*/
|
||||||
public function __construct($owner = null, $type = null, $name = null) {
|
public function __construct($owner = null, $type = null, $name = null) {
|
||||||
$this->setOwner($owner);
|
$this->setOwner($owner);
|
||||||
$this->setType($type);
|
$this->setType($type);
|
||||||
|
|
|
@ -36,21 +36,21 @@ use OCP\IDBConnection;
|
||||||
class TagMapper extends Mapper {
|
class TagMapper extends Mapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param IDBConnection $db Instance of the Db abstraction layer.
|
* @param IDBConnection $db Instance of the Db abstraction layer.
|
||||||
*/
|
*/
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct(IDBConnection $db) {
|
||||||
parent::__construct($db, 'vcategory', Tag::class);
|
parent::__construct($db, 'vcategory', Tag::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load tags from the database.
|
* Load tags from the database.
|
||||||
*
|
*
|
||||||
* @param array|string $owners The user(s) whose tags we are going to load.
|
* @param array|string $owners The user(s) whose tags we are going to load.
|
||||||
* @param string $type The type of item for which we are loading tags.
|
* @param string $type The type of item for which we are loading tags.
|
||||||
* @return array An array of Tag objects.
|
* @return array An array of Tag objects.
|
||||||
*/
|
*/
|
||||||
public function loadTags($owners, $type) {
|
public function loadTags($owners, $type) {
|
||||||
if(!is_array($owners)) {
|
if(!is_array($owners)) {
|
||||||
$owners = [$owners];
|
$owners = [$owners];
|
||||||
|
@ -62,11 +62,11 @@ class TagMapper extends Mapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a given Tag object already exists in the database.
|
* Check if a given Tag object already exists in the database.
|
||||||
*
|
*
|
||||||
* @param Tag $tag The tag to look for in the database.
|
* @param Tag $tag The tag to look for in the database.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function tagExists($tag) {
|
public function tagExists($tag) {
|
||||||
$sql = 'SELECT `id`, `uid`, `type`, `category` FROM `' . $this->getTableName() . '` '
|
$sql = 'SELECT `id`, `uid`, `type`, `category` FROM `' . $this->getTableName() . '` '
|
||||||
. 'WHERE `uid` = ? AND `type` = ? AND `category` = ?';
|
. 'WHERE `uid` = ? AND `type` = ? AND `category` = ?';
|
||||||
|
|
|
@ -116,14 +116,14 @@ class Tags implements ITags {
|
||||||
const RELATION_TABLE = '*PREFIX*vcategory_to_object';
|
const RELATION_TABLE = '*PREFIX*vcategory_to_object';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param TagMapper $mapper Instance of the TagMapper abstraction layer.
|
* @param TagMapper $mapper Instance of the TagMapper abstraction layer.
|
||||||
* @param string $user The user whose data the object will operate on.
|
* @param string $user The user whose data the object will operate on.
|
||||||
* @param string $type The type of items for which tags will be loaded.
|
* @param string $type The type of items for which tags will be loaded.
|
||||||
* @param array $defaultTags Tags that should be created at construction.
|
* @param array $defaultTags Tags that should be created at construction.
|
||||||
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
|
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
|
||||||
*/
|
*/
|
||||||
public function __construct(TagMapper $mapper, $user, $type, $defaultTags = [], $includeShared = false) {
|
public function __construct(TagMapper $mapper, $user, $type, $defaultTags = [], $includeShared = false) {
|
||||||
$this->mapper = $mapper;
|
$this->mapper = $mapper;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
@ -142,21 +142,21 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if any tags are saved for this type and user.
|
* Check if any tags are saved for this type and user.
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isEmpty() {
|
public function isEmpty() {
|
||||||
return count($this->tags) === 0;
|
return count($this->tags) === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array mapping a given tag's properties to its values:
|
* Returns an array mapping a given tag's properties to its values:
|
||||||
* ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype']
|
* ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype']
|
||||||
*
|
*
|
||||||
* @param string $id The ID of the tag that is going to be mapped
|
* @param string $id The ID of the tag that is going to be mapped
|
||||||
* @return array|false
|
* @return array|false
|
||||||
*/
|
*/
|
||||||
public function getTag($id) {
|
public function getTag($id) {
|
||||||
$key = $this->getTagById($id);
|
$key = $this->getTagById($id);
|
||||||
if ($key !== false) {
|
if ($key !== false) {
|
||||||
|
@ -166,16 +166,16 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the tags for a specific user.
|
* Get the tags for a specific user.
|
||||||
*
|
*
|
||||||
* This returns an array with maps containing each tag's properties:
|
* This returns an array with maps containing each tag's properties:
|
||||||
* [
|
* [
|
||||||
* ['id' => 0, 'name' = 'First tag', 'owner' = 'User', 'type' => 'tagtype'],
|
* ['id' => 0, 'name' = 'First tag', 'owner' = 'User', 'type' => 'tagtype'],
|
||||||
* ['id' => 1, 'name' = 'Shared tag', 'owner' = 'Other user', 'type' => 'tagtype'],
|
* ['id' => 1, 'name' = 'Shared tag', 'owner' = 'Other user', 'type' => 'tagtype'],
|
||||||
* ]
|
* ]
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getTags() {
|
public function getTags() {
|
||||||
if(!count($this->tags)) {
|
if(!count($this->tags)) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -196,12 +196,12 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return only the tags owned by the given user, omitting any tags shared
|
* Return only the tags owned by the given user, omitting any tags shared
|
||||||
* by other users.
|
* by other users.
|
||||||
*
|
*
|
||||||
* @param string $user The user whose tags are to be checked.
|
* @param string $user The user whose tags are to be checked.
|
||||||
* @return array An array of Tag objects.
|
* @return array An array of Tag objects.
|
||||||
*/
|
*/
|
||||||
public function getTagsForUser($user) {
|
public function getTagsForUser($user) {
|
||||||
return array_filter($this->tags,
|
return array_filter($this->tags,
|
||||||
function($tag) use($user) {
|
function($tag) use($user) {
|
||||||
|
@ -256,14 +256,14 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the a list if items tagged with $tag.
|
* Get the a list if items tagged with $tag.
|
||||||
*
|
*
|
||||||
* Throws an exception if the tag could not be found.
|
* Throws an exception if the tag could not be found.
|
||||||
*
|
*
|
||||||
* @param string $tag Tag id or name.
|
* @param string $tag Tag id or name.
|
||||||
* @return array|false An array of object ids or false on error.
|
* @return array|false An array of object ids or false on error.
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function getIdsForTag($tag) {
|
public function getIdsForTag($tag) {
|
||||||
$result = null;
|
$result = null;
|
||||||
$tagId = false;
|
$tagId = false;
|
||||||
|
@ -330,34 +330,34 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a tag is saved for the given user,
|
* Checks whether a tag is saved for the given user,
|
||||||
* disregarding the ones shared with him or her.
|
* disregarding the ones shared with him or her.
|
||||||
*
|
*
|
||||||
* @param string $name The tag name to check for.
|
* @param string $name The tag name to check for.
|
||||||
* @param string $user The user whose tags are to be checked.
|
* @param string $user The user whose tags are to be checked.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function userHasTag($name, $user) {
|
public function userHasTag($name, $user) {
|
||||||
$key = $this->array_searchi($name, $this->getTagsForUser($user));
|
$key = $this->array_searchi($name, $this->getTagsForUser($user));
|
||||||
return ($key !== false) ? $this->tags[$key]->getId() : false;
|
return ($key !== false) ? $this->tags[$key]->getId() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a tag is saved for or shared with the current user.
|
* Checks whether a tag is saved for or shared with the current user.
|
||||||
*
|
*
|
||||||
* @param string $name The tag name to check for.
|
* @param string $name The tag name to check for.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasTag($name) {
|
public function hasTag($name) {
|
||||||
return $this->getTagId($name) !== false;
|
return $this->getTagId($name) !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new tag.
|
* Add a new tag.
|
||||||
*
|
*
|
||||||
* @param string $name A string with a name of the tag
|
* @param string $name A string with a name of the tag
|
||||||
* @return false|int the id of the added tag or false on error.
|
* @return false|int the id of the added tag or false on error.
|
||||||
*/
|
*/
|
||||||
public function add($name) {
|
public function add($name) {
|
||||||
$name = trim($name);
|
$name = trim($name);
|
||||||
|
|
||||||
|
@ -386,12 +386,12 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rename tag.
|
* Rename tag.
|
||||||
*
|
*
|
||||||
* @param string|integer $from The name or ID of the existing tag
|
* @param string|integer $from The name or ID of the existing tag
|
||||||
* @param string $to The new name of the tag.
|
* @param string $to The new name of the tag.
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function rename($from, $to) {
|
public function rename($from, $to) {
|
||||||
$from = trim($from);
|
$from = trim($from);
|
||||||
$to = trim($to);
|
$to = trim($to);
|
||||||
|
@ -432,14 +432,14 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a list of new tags.
|
* Add a list of new tags.
|
||||||
*
|
*
|
||||||
* @param string[] $names A string with a name or an array of strings containing
|
* @param string[] $names A string with a name or an array of strings containing
|
||||||
* the name(s) of the tag(s) to add.
|
* the name(s) of the tag(s) to add.
|
||||||
* @param bool $sync When true, save the tags
|
* @param bool $sync When true, save the tags
|
||||||
* @param int|null $id int Optional object id to add to this|these tag(s)
|
* @param int|null $id int Optional object id to add to this|these tag(s)
|
||||||
* @return bool Returns false on error.
|
* @return bool Returns false on error.
|
||||||
*/
|
*/
|
||||||
public function addMultiple($names, $sync=false, $id = null) {
|
public function addMultiple($names, $sync=false, $id = null) {
|
||||||
if(!is_array($names)) {
|
if(!is_array($names)) {
|
||||||
$names = [$names];
|
$names = [$names];
|
||||||
|
@ -522,12 +522,12 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete tags and tag/object relations for a user.
|
* Delete tags and tag/object relations for a user.
|
||||||
*
|
*
|
||||||
* For hooking up on post_deleteUser
|
* For hooking up on post_deleteUser
|
||||||
*
|
*
|
||||||
* @param array $arguments
|
* @param array $arguments
|
||||||
*/
|
*/
|
||||||
public static function post_deleteUser($arguments) {
|
public static function post_deleteUser($arguments) {
|
||||||
// Find all objectid/tagId pairs.
|
// Find all objectid/tagId pairs.
|
||||||
$result = null;
|
$result = null;
|
||||||
|
@ -586,11 +586,11 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete tag/object relations from the db
|
* Delete tag/object relations from the db
|
||||||
*
|
*
|
||||||
* @param array $ids The ids of the objects
|
* @param array $ids The ids of the objects
|
||||||
* @return boolean Returns false on error.
|
* @return boolean Returns false on error.
|
||||||
*/
|
*/
|
||||||
public function purgeObjects(array $ids) {
|
public function purgeObjects(array $ids) {
|
||||||
if(count($ids) === 0) {
|
if(count($ids) === 0) {
|
||||||
// job done ;)
|
// job done ;)
|
||||||
|
@ -620,10 +620,10 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get favorites for an object type
|
* Get favorites for an object type
|
||||||
*
|
*
|
||||||
* @return array|false An array of object ids.
|
* @return array|false An array of object ids.
|
||||||
*/
|
*/
|
||||||
public function getFavorites() {
|
public function getFavorites() {
|
||||||
if(!$this->userHasTag(ITags::TAG_FAVORITE, $this->user)) {
|
if(!$this->userHasTag(ITags::TAG_FAVORITE, $this->user)) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -642,11 +642,11 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an object to favorites
|
* Add an object to favorites
|
||||||
*
|
*
|
||||||
* @param int $objid The id of the object
|
* @param int $objid The id of the object
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function addToFavorites($objid) {
|
public function addToFavorites($objid) {
|
||||||
if(!$this->userHasTag(ITags::TAG_FAVORITE, $this->user)) {
|
if(!$this->userHasTag(ITags::TAG_FAVORITE, $this->user)) {
|
||||||
$this->add(ITags::TAG_FAVORITE);
|
$this->add(ITags::TAG_FAVORITE);
|
||||||
|
@ -655,22 +655,22 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an object from favorites
|
* Remove an object from favorites
|
||||||
*
|
*
|
||||||
* @param int $objid The id of the object
|
* @param int $objid The id of the object
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function removeFromFavorites($objid) {
|
public function removeFromFavorites($objid) {
|
||||||
return $this->unTag($objid, ITags::TAG_FAVORITE);
|
return $this->unTag($objid, ITags::TAG_FAVORITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a tag/object relation.
|
* Creates a tag/object relation.
|
||||||
*
|
*
|
||||||
* @param int $objid The id of the object
|
* @param int $objid The id of the object
|
||||||
* @param string $tag The id or name of the tag
|
* @param string $tag The id or name of the tag
|
||||||
* @return boolean Returns false on error.
|
* @return boolean Returns false on error.
|
||||||
*/
|
*/
|
||||||
public function tagAs($objid, $tag) {
|
public function tagAs($objid, $tag) {
|
||||||
if(is_string($tag) && !is_numeric($tag)) {
|
if(is_string($tag) && !is_numeric($tag)) {
|
||||||
$tag = trim($tag);
|
$tag = trim($tag);
|
||||||
|
@ -704,12 +704,12 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete single tag/object relation from the db
|
* Delete single tag/object relation from the db
|
||||||
*
|
*
|
||||||
* @param int $objid The id of the object
|
* @param int $objid The id of the object
|
||||||
* @param string $tag The id or name of the tag
|
* @param string $tag The id or name of the tag
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function unTag($objid, $tag) {
|
public function unTag($objid, $tag) {
|
||||||
if(is_string($tag) && !is_numeric($tag)) {
|
if(is_string($tag) && !is_numeric($tag)) {
|
||||||
$tag = trim($tag);
|
$tag = trim($tag);
|
||||||
|
@ -739,11 +739,11 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete tags from the database.
|
* Delete tags from the database.
|
||||||
*
|
*
|
||||||
* @param string[]|integer[] $names An array of tags (names or IDs) to delete
|
* @param string[]|integer[] $names An array of tags (names or IDs) to delete
|
||||||
* @return bool Returns false on error
|
* @return bool Returns false on error
|
||||||
*/
|
*/
|
||||||
public function delete($names) {
|
public function delete($names) {
|
||||||
if(!is_array($names)) {
|
if(!is_array($names)) {
|
||||||
$names = [$names];
|
$names = [$names];
|
||||||
|
@ -809,11 +809,11 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a tag's ID.
|
* Get a tag's ID.
|
||||||
*
|
*
|
||||||
* @param string $name The tag name to look for.
|
* @param string $name The tag name to look for.
|
||||||
* @return string|bool The tag's id or false if no matching tag is found.
|
* @return string|bool The tag's id or false if no matching tag is found.
|
||||||
*/
|
*/
|
||||||
private function getTagId($name) {
|
private function getTagId($name) {
|
||||||
$key = $this->array_searchi($name, $this->tags);
|
$key = $this->array_searchi($name, $this->tags);
|
||||||
if ($key !== false) {
|
if ($key !== false) {
|
||||||
|
@ -823,34 +823,34 @@ class Tags implements ITags {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a tag by its name.
|
* Get a tag by its name.
|
||||||
*
|
*
|
||||||
* @param string $name The tag name.
|
* @param string $name The tag name.
|
||||||
* @return integer|bool The tag object's offset within the $this->tags
|
* @return integer|bool The tag object's offset within the $this->tags
|
||||||
* array or false if it doesn't exist.
|
* array or false if it doesn't exist.
|
||||||
*/
|
*/
|
||||||
private function getTagByName($name) {
|
private function getTagByName($name) {
|
||||||
return $this->array_searchi($name, $this->tags, 'getName');
|
return $this->array_searchi($name, $this->tags, 'getName');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a tag by its ID.
|
* Get a tag by its ID.
|
||||||
*
|
*
|
||||||
* @param string $id The tag ID to look for.
|
* @param string $id The tag ID to look for.
|
||||||
* @return integer|bool The tag object's offset within the $this->tags
|
* @return integer|bool The tag object's offset within the $this->tags
|
||||||
* array or false if it doesn't exist.
|
* array or false if it doesn't exist.
|
||||||
*/
|
*/
|
||||||
private function getTagById($id) {
|
private function getTagById($id) {
|
||||||
return $this->array_searchi($id, $this->tags, 'getId');
|
return $this->array_searchi($id, $this->tags, 'getId');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array mapping a given tag's properties to its values:
|
* Returns an array mapping a given tag's properties to its values:
|
||||||
* ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype']
|
* ['id' => 0, 'name' = 'Tag', 'owner' = 'User', 'type' => 'tagtype']
|
||||||
*
|
*
|
||||||
* @param Tag $tag The tag that is going to be mapped
|
* @param Tag $tag The tag that is going to be mapped
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function tagMap(Tag $tag) {
|
private function tagMap(Tag $tag) {
|
||||||
return [
|
return [
|
||||||
'id' => $tag->getId(),
|
'id' => $tag->getId(),
|
||||||
|
|
|
@ -249,7 +249,7 @@ class TemplateLayout extends \OC_Template {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getVersionHashSuffix($path = false, $file = false) {
|
protected function getVersionHashSuffix($path = false, $file = false) {
|
||||||
|
|
|
@ -60,12 +60,12 @@ abstract class Backend implements UserInterface {
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all supported actions
|
* Get all supported actions
|
||||||
* @return int bitwise-or'ed actions
|
* @return int bitwise-or'ed actions
|
||||||
*
|
*
|
||||||
* Returns the supported actions as int to be
|
* Returns the supported actions as int to be
|
||||||
* compared with self::CREATE_USER etc.
|
* compared with self::CREATE_USER etc.
|
||||||
*/
|
*/
|
||||||
public function getSupportedActions() {
|
public function getSupportedActions() {
|
||||||
$actions = 0;
|
$actions = 0;
|
||||||
foreach($this->possibleActions AS $action => $methodName) {
|
foreach($this->possibleActions AS $action => $methodName) {
|
||||||
|
@ -78,13 +78,13 @@ abstract class Backend implements UserInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if backend implements actions
|
* Check if backend implements actions
|
||||||
* @param int $actions bitwise-or'ed actions
|
* @param int $actions bitwise-or'ed actions
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*
|
*
|
||||||
* Returns the supported actions as int to be
|
* Returns the supported actions as int to be
|
||||||
* compared with self::CREATE_USER etc.
|
* compared with self::CREATE_USER etc.
|
||||||
*/
|
*/
|
||||||
public function implementsActions($actions) {
|
public function implementsActions($actions) {
|
||||||
return (bool)($this->getSupportedActions() & $actions);
|
return (bool)($this->getSupportedActions() & $actions);
|
||||||
}
|
}
|
||||||
|
@ -113,19 +113,19 @@ abstract class Backend implements UserInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if a user exists
|
* check if a user exists
|
||||||
* @param string $uid the username
|
* @param string $uid the username
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function userExists($uid) {
|
public function userExists($uid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the user's home directory
|
* get the user's home directory
|
||||||
* @param string $uid the username
|
* @param string $uid the username
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function getHome($uid) {
|
public function getHome($uid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ use OC_User;
|
||||||
use OC_Util;
|
use OC_Util;
|
||||||
use OCA\DAV\Connector\Sabre\Auth;
|
use OCA\DAV\Connector\Sabre\Auth;
|
||||||
use OCP\AppFramework\Utility\ITimeFactory;
|
use OCP\AppFramework\Utility\ITimeFactory;
|
||||||
use OCP\Authentication\Events\LoginFailedEvent;
|
|
||||||
use OCP\EventDispatcher\IEventDispatcher;
|
use OCP\EventDispatcher\IEventDispatcher;
|
||||||
use OCP\Files\NotPermittedException;
|
use OCP\Files\NotPermittedException;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
|
@ -59,7 +58,6 @@ use OCP\ILogger;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\ISession;
|
use OCP\ISession;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
use OCP\IUserManager;
|
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCP\Lockdown\ILockdownManager;
|
use OCP\Lockdown\ILockdownManager;
|
||||||
use OCP\Security\ISecureRandom;
|
use OCP\Security\ISecureRandom;
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use OCP\IUser;
|
|
||||||
use Symfony\Component\Process\ExecutableFinder;
|
use Symfony\Component\Process\ExecutableFinder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,7 +45,7 @@ function p($string) {
|
||||||
* Prints a <link> tag for loading css
|
* Prints a <link> tag for loading css
|
||||||
* @param string $href the source URL, ignored when empty
|
* @param string $href the source URL, ignored when empty
|
||||||
* @param string $opts, additional optional options
|
* @param string $opts, additional optional options
|
||||||
*/
|
*/
|
||||||
function emit_css_tag($href, $opts = '') {
|
function emit_css_tag($href, $opts = '') {
|
||||||
$s='<link rel="stylesheet"';
|
$s='<link rel="stylesheet"';
|
||||||
if (!empty($href)) {
|
if (!empty($href)) {
|
||||||
|
@ -60,7 +60,7 @@ function emit_css_tag($href, $opts = '') {
|
||||||
/**
|
/**
|
||||||
* Prints all tags for CSS loading
|
* Prints all tags for CSS loading
|
||||||
* @param array $obj all the script information from template
|
* @param array $obj all the script information from template
|
||||||
*/
|
*/
|
||||||
function emit_css_loading_tags($obj) {
|
function emit_css_loading_tags($obj) {
|
||||||
foreach($obj['cssfiles'] as $css) {
|
foreach($obj['cssfiles'] as $css) {
|
||||||
emit_css_tag($css);
|
emit_css_tag($css);
|
||||||
|
@ -74,7 +74,7 @@ function emit_css_loading_tags($obj) {
|
||||||
* Prints a <script> tag with nonce and defer depending on config
|
* Prints a <script> tag with nonce and defer depending on config
|
||||||
* @param string $src the source URL, ignored when empty
|
* @param string $src the source URL, ignored when empty
|
||||||
* @param string $script_content the inline script content, ignored when empty
|
* @param string $script_content the inline script content, ignored when empty
|
||||||
*/
|
*/
|
||||||
function emit_script_tag($src, $script_content='') {
|
function emit_script_tag($src, $script_content='') {
|
||||||
$defer_str=' defer';
|
$defer_str=' defer';
|
||||||
$s='<script nonce="' . \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() . '"';
|
$s='<script nonce="' . \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() . '"';
|
||||||
|
@ -95,7 +95,7 @@ function emit_script_tag($src, $script_content='') {
|
||||||
/**
|
/**
|
||||||
* Print all <script> tags for loading JS
|
* Print all <script> tags for loading JS
|
||||||
* @param array $obj all the script information from template
|
* @param array $obj all the script information from template
|
||||||
*/
|
*/
|
||||||
function emit_script_loading_tags($obj) {
|
function emit_script_loading_tags($obj) {
|
||||||
foreach($obj['jsfiles'] as $jsfile) {
|
foreach($obj['jsfiles'] as $jsfile) {
|
||||||
emit_script_tag($jsfile, '');
|
emit_script_tag($jsfile, '');
|
||||||
|
|
|
@ -55,7 +55,7 @@ class App {
|
||||||
* @return void
|
* @return void
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
* @deprecated 14.0.0 Use settings section in appinfo.xml to register personal admin sections
|
* @deprecated 14.0.0 Use settings section in appinfo.xml to register personal admin sections
|
||||||
*/
|
*/
|
||||||
public static function registerPersonal( $app, $page ) {
|
public static function registerPersonal( $app, $page ) {
|
||||||
\OC_App::registerPersonal( $app, $page );
|
\OC_App::registerPersonal( $app, $page );
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ class App {
|
||||||
* @return array|null
|
* @return array|null
|
||||||
* @deprecated 14.0.0 ise \OC::$server->getAppManager()->getAppInfo($appId)
|
* @deprecated 14.0.0 ise \OC::$server->getAppManager()->getAppInfo($appId)
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
public static function getAppInfo( $app, $path=false ) {
|
public static function getAppInfo( $app, $path=false ) {
|
||||||
return \OC_App::getAppInfo( $app, $path);
|
return \OC_App::getAppInfo( $app, $path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ abstract class ApiController extends Controller {
|
||||||
* defaults to 'Authorization, Content-Type, Accept'
|
* defaults to 'Authorization, Content-Type, Accept'
|
||||||
* @param int $corsMaxAge number in seconds how long a preflighted OPTIONS
|
* @param int $corsMaxAge number in seconds how long a preflighted OPTIONS
|
||||||
* request should be cached, defaults to 1728000 seconds
|
* request should be cached, defaults to 1728000 seconds
|
||||||
* @since 7.0.0
|
* @since 7.0.0
|
||||||
*/
|
*/
|
||||||
public function __construct($appName,
|
public function __construct($appName,
|
||||||
IRequest $request,
|
IRequest $request,
|
||||||
|
@ -76,7 +76,7 @@ abstract class ApiController extends Controller {
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
* @PublicPage
|
* @PublicPage
|
||||||
* @since 7.0.0
|
* @since 7.0.0
|
||||||
*/
|
*/
|
||||||
public function preflightedCors() {
|
public function preflightedCors() {
|
||||||
if(isset($this->request->server['HTTP_ORIGIN'])) {
|
if(isset($this->request->server['HTTP_ORIGIN'])) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ abstract class Job implements IJob {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function to prepare the execution of the job.
|
* The function to prepare the execution of the job.
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* @param IJobList $jobList
|
* @param IJobList $jobList
|
||||||
* @param ILogger|null $logger
|
* @param ILogger|null $logger
|
||||||
|
|
|
@ -59,6 +59,6 @@ interface ITagManager {
|
||||||
* logged in user
|
* logged in user
|
||||||
* @return \OCP\ITags
|
* @return \OCP\ITags
|
||||||
* @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
|
* @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
|
||||||
*/
|
*/
|
||||||
public function load($type, $defaultTags = [], $includeShared = false, $userId = null);
|
public function load($type, $defaultTags = [], $includeShared = false, $userId = null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,11 +50,11 @@ namespace OCP;
|
||||||
*/
|
*/
|
||||||
interface IUserManager {
|
interface IUserManager {
|
||||||
/**
|
/**
|
||||||
* register a user backend
|
* register a user backend
|
||||||
*
|
*
|
||||||
* @param \OCP\UserInterface $backend
|
* @param \OCP\UserInterface $backend
|
||||||
* @since 8.0.0
|
* @since 8.0.0
|
||||||
*/
|
*/
|
||||||
public function registerBackend($backend);
|
public function registerBackend($backend);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
|
* @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
|
||||||
*
|
*
|
||||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||||
|
|
|
@ -27,7 +27,6 @@ declare(strict_types=1);
|
||||||
namespace OCP\User\Events;
|
namespace OCP\User\Events;
|
||||||
|
|
||||||
use OCP\EventDispatcher\Event;
|
use OCP\EventDispatcher\Event;
|
||||||
use OCP\IUser;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 18.0.0
|
* @since 18.0.0
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Activity;
|
namespace Test\Activity;
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ownCloud - App Framework
|
* ownCloud - App Framework
|
||||||
*
|
*
|
||||||
* @author Bernhard Posselt
|
* @author Bernhard Posselt
|
||||||
* @copyright 2012 Bernhard Posselt dev@bernhard-posselt.com
|
* @copyright 2012 Bernhard Posselt dev@bernhard-posselt.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\AppFramework\Db;
|
namespace Test\AppFramework\Db;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace lib\Authentication\Login;
|
namespace lib\Authentication\Login;
|
||||||
|
|
||||||
use Hoa\Iterator\Mock;
|
|
||||||
use OC\Authentication\Login\LoggedInCheckCommand;
|
use OC\Authentication\Login\LoggedInCheckCommand;
|
||||||
use OC\Core\Controller\LoginController;
|
use OC\Core\Controller\LoginController;
|
||||||
use OCP\EventDispatcher\IEventDispatcher;
|
use OCP\EventDispatcher\IEventDispatcher;
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
* Copyright (c) 2015 Christian Kampka <christian@kampka.net>
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
* in the Software without restriction, including without limitation the rights
|
* in the Software without restriction, including without limitation the rights
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
* furnished to do so, subject to the following conditions:
|
* furnished to do so, subject to the following conditions:
|
||||||
*
|
*
|
||||||
* The above copyright notice and this permission notice shall be included in
|
* The above copyright notice and this permission notice shall be included in
|
||||||
* all copies or substantial portions of the Software.
|
* all copies or substantial portions of the Software.
|
||||||
*
|
*
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Command;
|
namespace Test\Command;
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Robin Appelman
|
* @author Robin Appelman
|
||||||
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Group;
|
namespace Test\Group;
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
namespace Test;
|
namespace Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether LargeFileHelper is able to determine file size at all.
|
* Tests whether LargeFileHelper is able to determine file size at all.
|
||||||
* Large files are not considered yet.
|
* Large files are not considered yet.
|
||||||
*/
|
*/
|
||||||
class LargeFileHelperGetFileSizeTest extends TestCase {
|
class LargeFileHelperGetFileSizeTest extends TestCase {
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $filename;
|
protected $filename;
|
||||||
|
|
|
@ -25,8 +25,8 @@ class NaturalSortTest extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider defaultCollatorDataProvider
|
* @dataProvider defaultCollatorDataProvider
|
||||||
*/
|
*/
|
||||||
public function testDefaultCollatorCompare($array, $sorted)
|
public function testDefaultCollatorCompare($array, $sorted)
|
||||||
{
|
{
|
||||||
$comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
|
$comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
|
||||||
|
@ -190,10 +190,10 @@ class NaturalSortTest extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data provider for natural sorting with \OC\NaturalSort_DefaultCollator.
|
* Data provider for natural sorting with \OC\NaturalSort_DefaultCollator.
|
||||||
* Must provide the same result as in core/js/tests/specs/coreSpec.js
|
* Must provide the same result as in core/js/tests/specs/coreSpec.js
|
||||||
* @return array test cases
|
* @return array test cases
|
||||||
*/
|
*/
|
||||||
public function defaultCollatorDataProvider()
|
public function defaultCollatorDataProvider()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -24,10 +24,10 @@ namespace Test\PublicNamespace;
|
||||||
|
|
||||||
class UtilTest extends \Test\TestCase {
|
class UtilTest extends \Test\TestCase {
|
||||||
/**
|
/**
|
||||||
* @dataProvider channelProvider
|
* @dataProvider channelProvider
|
||||||
*
|
*
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
*/
|
*/
|
||||||
public function testOverrideChannel($channel) {
|
public function testOverrideChannel($channel) {
|
||||||
\OCP\Util::setChannel($channel);
|
\OCP\Util::setChannel($channel);
|
||||||
$actual = \OCP\Util::getChannel($channel);
|
$actual = \OCP\Util::getChannel($channel);
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Michael Gapczynski
|
* @author Michael Gapczynski
|
||||||
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
|
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Share;
|
namespace Test\Share;
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Bjoern Schiessle
|
* @author Bjoern Schiessle
|
||||||
* @copyright 2014 Bjoern Schiessle <schiessle@owncloud.com>
|
* @copyright 2014 Bjoern Schiessle <schiessle@owncloud.com>
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Share;
|
namespace Test\Share;
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Arthur Schiwon
|
* @author Arthur Schiwon
|
||||||
* @copyright 2014 Arthur Schiwon <blizzz@owncloud.com>
|
* @copyright 2014 Arthur Schiwon <blizzz@owncloud.com>
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Share;
|
namespace Test\Share;
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Michael Gapczynski
|
* @author Michael Gapczynski
|
||||||
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
|
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\Share;
|
namespace Test\Share;
|
||||||
use OC\Share\Share;
|
use OC\Share\Share;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* later.
|
* later.
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\SystemTag;
|
namespace Test\SystemTag;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* later.
|
* later.
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\SystemTag;
|
namespace Test\SystemTag;
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Thomas Tanghus
|
* @author Thomas Tanghus
|
||||||
* @copyright 2012-13 Thomas Tanghus (thomas@tanghus.net)
|
* @copyright 2012-13 Thomas Tanghus (thomas@tanghus.net)
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test;
|
namespace Test;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
@ -261,8 +261,8 @@ class TagsTest extends \Test\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @depends testTagAs
|
* @depends testTagAs
|
||||||
*/
|
*/
|
||||||
public function testUnTag() {
|
public function testUnTag() {
|
||||||
$objIds = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
$objIds = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Arthur Schiwon
|
* @author Arthur Schiwon
|
||||||
* @copyright 2013 Arthur Schiwon blizzz@owncloud.com
|
* @copyright 2013 Arthur Schiwon blizzz@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\User;
|
namespace Test\User;
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Robin Appelman
|
* @author Robin Appelman
|
||||||
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\User;
|
namespace Test\User;
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Robin Appelman
|
* @author Robin Appelman
|
||||||
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\User;
|
namespace Test\User;
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* ownCloud
|
||||||
*
|
*
|
||||||
* @author Robin Appelman
|
* @author Robin Appelman
|
||||||
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
* @copyright 2012 Robin Appelman icewind@owncloud.com
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 3 of the License, or any later version.
|
* version 3 of the License, or any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public
|
* You should have received a copy of the GNU Affero General Public
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Test\User;
|
namespace Test\User;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue