@@ -22,35 +22,35 @@ |
||
| 22 | 22 | namespace OC\App\CodeChecker; |
| 23 | 23 | |
| 24 | 24 | interface ICheck { |
| 25 | - /** |
|
| 26 | - * @param int $errorCode |
|
| 27 | - * @param string $errorObject |
|
| 28 | - * @return string |
|
| 29 | - */ |
|
| 30 | - public function getDescription($errorCode, $errorObject); |
|
| 25 | + /** |
|
| 26 | + * @param int $errorCode |
|
| 27 | + * @param string $errorObject |
|
| 28 | + * @return string |
|
| 29 | + */ |
|
| 30 | + public function getDescription($errorCode, $errorObject); |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @return array E.g.: `'ClassName' => 'oc version',` |
|
| 34 | - */ |
|
| 35 | - public function getClasses(); |
|
| 32 | + /** |
|
| 33 | + * @return array E.g.: `'ClassName' => 'oc version',` |
|
| 34 | + */ |
|
| 35 | + public function getClasses(); |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',` |
|
| 39 | - */ |
|
| 40 | - public function getConstants(); |
|
| 37 | + /** |
|
| 38 | + * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',` |
|
| 39 | + */ |
|
| 40 | + public function getConstants(); |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @return array E.g.: `'functionName' => 'oc version',` |
|
| 44 | - */ |
|
| 45 | - public function getFunctions(); |
|
| 42 | + /** |
|
| 43 | + * @return array E.g.: `'functionName' => 'oc version',` |
|
| 44 | + */ |
|
| 45 | + public function getFunctions(); |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @return array E.g.: `'ClassName::methodName' => 'oc version',` |
|
| 49 | - */ |
|
| 50 | - public function getMethods(); |
|
| 47 | + /** |
|
| 48 | + * @return array E.g.: `'ClassName::methodName' => 'oc version',` |
|
| 49 | + */ |
|
| 50 | + public function getMethods(); |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @return bool |
|
| 54 | - */ |
|
| 55 | - public function checkStrongComparisons(); |
|
| 52 | + /** |
|
| 53 | + * @return bool |
|
| 54 | + */ |
|
| 55 | + public function checkStrongComparisons(); |
|
| 56 | 56 | } |
@@ -28,41 +28,41 @@ |
||
| 28 | 28 | use OCP\Preview\IProvider; |
| 29 | 29 | |
| 30 | 30 | abstract class Provider implements IProvider { |
| 31 | - private $options; |
|
| 31 | + private $options; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Constructor |
|
| 35 | - * |
|
| 36 | - * @param array $options |
|
| 37 | - */ |
|
| 38 | - public function __construct(array $options = []) { |
|
| 39 | - $this->options = $options; |
|
| 40 | - } |
|
| 33 | + /** |
|
| 34 | + * Constructor |
|
| 35 | + * |
|
| 36 | + * @param array $options |
|
| 37 | + */ |
|
| 38 | + public function __construct(array $options = []) { |
|
| 39 | + $this->options = $options; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @return string Regex with the mimetypes that are supported by this provider |
|
| 44 | - */ |
|
| 45 | - abstract public function getMimeType(); |
|
| 42 | + /** |
|
| 43 | + * @return string Regex with the mimetypes that are supported by this provider |
|
| 44 | + */ |
|
| 45 | + abstract public function getMimeType(); |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Check if a preview can be generated for $path |
|
| 49 | - * |
|
| 50 | - * @param \OCP\Files\FileInfo $file |
|
| 51 | - * @return bool |
|
| 52 | - */ |
|
| 53 | - public function isAvailable(\OCP\Files\FileInfo $file) { |
|
| 54 | - return true; |
|
| 55 | - } |
|
| 47 | + /** |
|
| 48 | + * Check if a preview can be generated for $path |
|
| 49 | + * |
|
| 50 | + * @param \OCP\Files\FileInfo $file |
|
| 51 | + * @return bool |
|
| 52 | + */ |
|
| 53 | + public function isAvailable(\OCP\Files\FileInfo $file) { |
|
| 54 | + return true; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Generates thumbnail which fits in $maxX and $maxY and keeps the aspect ratio, for file at path $path |
|
| 59 | - * |
|
| 60 | - * @param string $path Path of file |
|
| 61 | - * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 62 | - * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 63 | - * @param bool $scalingup Disable/Enable upscaling of previews |
|
| 64 | - * @param \OC\Files\View $fileview fileview object of user folder |
|
| 65 | - * @return bool|\OCP\IImage false if no preview was generated |
|
| 66 | - */ |
|
| 67 | - abstract public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
| 57 | + /** |
|
| 58 | + * Generates thumbnail which fits in $maxX and $maxY and keeps the aspect ratio, for file at path $path |
|
| 59 | + * |
|
| 60 | + * @param string $path Path of file |
|
| 61 | + * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 62 | + * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 63 | + * @param bool $scalingup Disable/Enable upscaling of previews |
|
| 64 | + * @param \OC\Files\View $fileview fileview object of user folder |
|
| 65 | + * @return bool|\OCP\IImage false if no preview was generated |
|
| 66 | + */ |
|
| 67 | + abstract public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
| 68 | 68 | } |
@@ -22,15 +22,15 @@ |
||
| 22 | 22 | namespace OC\Share20; |
| 23 | 23 | |
| 24 | 24 | class Hooks { |
| 25 | - public static function post_deleteUser($arguments) { |
|
| 26 | - \OC::$server->getShareManager()->userDeleted($arguments['uid']); |
|
| 27 | - } |
|
| 25 | + public static function post_deleteUser($arguments) { |
|
| 26 | + \OC::$server->getShareManager()->userDeleted($arguments['uid']); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - public static function post_deleteGroup($arguments) { |
|
| 30 | - \OC::$server->getShareManager()->groupDeleted($arguments['gid']); |
|
| 31 | - } |
|
| 29 | + public static function post_deleteGroup($arguments) { |
|
| 30 | + \OC::$server->getShareManager()->groupDeleted($arguments['gid']); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - public static function post_removeFromGroup($arguments) { |
|
| 34 | - \OC::$server->getShareManager()->userDeletedFromGroup($arguments['uid'], $arguments['gid']); |
|
| 35 | - } |
|
| 33 | + public static function post_removeFromGroup($arguments) { |
|
| 34 | + \OC::$server->getShareManager()->userDeletedFromGroup($arguments['uid'], $arguments['gid']); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -27,12 +27,12 @@ |
||
| 27 | 27 | |
| 28 | 28 | class ModuleAlreadyExistsException extends GenericEncryptionException { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param string $id |
|
| 32 | - * @param string $name |
|
| 33 | - */ |
|
| 34 | - public function __construct($id, $name) { |
|
| 35 | - parent::__construct('Id "' . $id . '" already used by encryption module "' . $name . '"'); |
|
| 36 | - } |
|
| 30 | + /** |
|
| 31 | + * @param string $id |
|
| 32 | + * @param string $name |
|
| 33 | + */ |
|
| 34 | + public function __construct($id, $name) { |
|
| 35 | + parent::__construct('Id "' . $id . '" already used by encryption module "' . $name . '"'); |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | 38 | } |
@@ -27,10 +27,10 @@ |
||
| 27 | 27 | |
| 28 | 28 | class EncryptionHeaderKeyExistsException extends GenericEncryptionException { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @param string $key |
|
| 32 | - */ |
|
| 33 | - public function __construct($key) { |
|
| 34 | - parent::__construct('header key "'. $key . '" already reserved by ownCloud'); |
|
| 35 | - } |
|
| 30 | + /** |
|
| 31 | + * @param string $key |
|
| 32 | + */ |
|
| 33 | + public function __construct($key) { |
|
| 34 | + parent::__construct('header key "'. $key . '" already reserved by ownCloud'); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -27,50 +27,50 @@ |
||
| 27 | 27 | use OC\Files\View; |
| 28 | 28 | |
| 29 | 29 | class HookManager { |
| 30 | - /** |
|
| 31 | - * @var Update |
|
| 32 | - */ |
|
| 33 | - private static $updater; |
|
| 30 | + /** |
|
| 31 | + * @var Update |
|
| 32 | + */ |
|
| 33 | + private static $updater; |
|
| 34 | 34 | |
| 35 | - public static function postShared($params) { |
|
| 36 | - self::getUpdate()->postShared($params); |
|
| 37 | - } |
|
| 38 | - public static function postUnshared($params) { |
|
| 39 | - self::getUpdate()->postUnshared($params); |
|
| 40 | - } |
|
| 35 | + public static function postShared($params) { |
|
| 36 | + self::getUpdate()->postShared($params); |
|
| 37 | + } |
|
| 38 | + public static function postUnshared($params) { |
|
| 39 | + self::getUpdate()->postUnshared($params); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public static function postRename($params) { |
|
| 43 | - self::getUpdate()->postRename($params); |
|
| 44 | - } |
|
| 42 | + public static function postRename($params) { |
|
| 43 | + self::getUpdate()->postRename($params); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public static function postRestore($params) { |
|
| 47 | - self::getUpdate()->postRestore($params); |
|
| 48 | - } |
|
| 46 | + public static function postRestore($params) { |
|
| 47 | + self::getUpdate()->postRestore($params); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @return Update |
|
| 52 | - */ |
|
| 53 | - private static function getUpdate() { |
|
| 54 | - if (is_null(self::$updater)) { |
|
| 55 | - $user = \OC::$server->getUserSession()->getUser(); |
|
| 56 | - $uid = ''; |
|
| 57 | - if ($user) { |
|
| 58 | - $uid = $user->getUID(); |
|
| 59 | - } |
|
| 60 | - self::$updater = new Update( |
|
| 61 | - new View(), |
|
| 62 | - new Util( |
|
| 63 | - new View(), |
|
| 64 | - \OC::$server->getUserManager(), |
|
| 65 | - \OC::$server->getGroupManager(), |
|
| 66 | - \OC::$server->getConfig()), |
|
| 67 | - Filesystem::getMountManager(), |
|
| 68 | - \OC::$server->getEncryptionManager(), |
|
| 69 | - \OC::$server->getEncryptionFilesHelper(), |
|
| 70 | - $uid |
|
| 71 | - ); |
|
| 72 | - } |
|
| 50 | + /** |
|
| 51 | + * @return Update |
|
| 52 | + */ |
|
| 53 | + private static function getUpdate() { |
|
| 54 | + if (is_null(self::$updater)) { |
|
| 55 | + $user = \OC::$server->getUserSession()->getUser(); |
|
| 56 | + $uid = ''; |
|
| 57 | + if ($user) { |
|
| 58 | + $uid = $user->getUID(); |
|
| 59 | + } |
|
| 60 | + self::$updater = new Update( |
|
| 61 | + new View(), |
|
| 62 | + new Util( |
|
| 63 | + new View(), |
|
| 64 | + \OC::$server->getUserManager(), |
|
| 65 | + \OC::$server->getGroupManager(), |
|
| 66 | + \OC::$server->getConfig()), |
|
| 67 | + Filesystem::getMountManager(), |
|
| 68 | + \OC::$server->getEncryptionManager(), |
|
| 69 | + \OC::$server->getEncryptionFilesHelper(), |
|
| 70 | + $uid |
|
| 71 | + ); |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - return self::$updater; |
|
| 75 | - } |
|
| 74 | + return self::$updater; |
|
| 75 | + } |
|
| 76 | 76 | } |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | $server = \OC::$server; |
| 27 | 27 | |
| 28 | 28 | $controller = new \OC\OCS\Provider( |
| 29 | - 'ocs_provider', |
|
| 30 | - $server->getRequest(), |
|
| 31 | - $server->getAppManager() |
|
| 29 | + 'ocs_provider', |
|
| 30 | + $server->getRequest(), |
|
| 31 | + $server->getAppManager() |
|
| 32 | 32 | ); |
| 33 | 33 | echo $controller->buildProviderList()->render(); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | - /** @var array $_ */ |
|
| 3 | - /** @var \OCP\IL10N $l */ |
|
| 2 | + /** @var array $_ */ |
|
| 3 | + /** @var \OCP\IL10N $l */ |
|
| 4 | 4 | |
| 5 | 5 | style('core', ['styles', 'header']); |
| 6 | 6 | ?> |
@@ -34,28 +34,28 @@ |
||
| 34 | 34 | |
| 35 | 35 | class RemoveCertificate extends Base { |
| 36 | 36 | |
| 37 | - /** @var ICertificateManager */ |
|
| 38 | - protected $certificateManager; |
|
| 39 | - |
|
| 40 | - public function __construct(ICertificateManager $certificateManager) { |
|
| 41 | - $this->certificateManager = $certificateManager; |
|
| 42 | - parent::__construct(); |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - protected function configure() { |
|
| 46 | - $this |
|
| 47 | - ->setName('security:certificates:remove') |
|
| 48 | - ->setDescription('remove trusted certificate') |
|
| 49 | - ->addArgument( |
|
| 50 | - 'name', |
|
| 51 | - InputArgument::REQUIRED, |
|
| 52 | - 'the file name of the certificate to remove' |
|
| 53 | - ); |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 57 | - $name = $input->getArgument('name'); |
|
| 58 | - |
|
| 59 | - $this->certificateManager->removeCertificate($name); |
|
| 60 | - } |
|
| 37 | + /** @var ICertificateManager */ |
|
| 38 | + protected $certificateManager; |
|
| 39 | + |
|
| 40 | + public function __construct(ICertificateManager $certificateManager) { |
|
| 41 | + $this->certificateManager = $certificateManager; |
|
| 42 | + parent::__construct(); |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + protected function configure() { |
|
| 46 | + $this |
|
| 47 | + ->setName('security:certificates:remove') |
|
| 48 | + ->setDescription('remove trusted certificate') |
|
| 49 | + ->addArgument( |
|
| 50 | + 'name', |
|
| 51 | + InputArgument::REQUIRED, |
|
| 52 | + 'the file name of the certificate to remove' |
|
| 53 | + ); |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 57 | + $name = $input->getArgument('name'); |
|
| 58 | + |
|
| 59 | + $this->certificateManager->removeCertificate($name); |
|
| 60 | + } |
|
| 61 | 61 | } |