@@ -23,12 +23,12 @@ |
||
23 | 23 | namespace OCA\Files_Sharing\External; |
24 | 24 | |
25 | 25 | class Watcher extends \OC\Files\Cache\Watcher { |
26 | - /** |
|
27 | - * remove deleted files in $path from the cache |
|
28 | - * |
|
29 | - * @param string $path |
|
30 | - */ |
|
31 | - public function cleanFolder($path) { |
|
32 | - // not needed, the scanner takes care of this |
|
33 | - } |
|
26 | + /** |
|
27 | + * remove deleted files in $path from the cache |
|
28 | + * |
|
29 | + * @param string $path |
|
30 | + */ |
|
31 | + public function cleanFolder($path) { |
|
32 | + // not needed, the scanner takes care of this |
|
33 | + } |
|
34 | 34 | } |
@@ -29,43 +29,43 @@ |
||
29 | 29 | |
30 | 30 | class Mount extends MountPoint implements MoveableMount { |
31 | 31 | |
32 | - /** |
|
33 | - * @var \OCA\Files_Sharing\External\Manager |
|
34 | - */ |
|
35 | - protected $manager; |
|
32 | + /** |
|
33 | + * @var \OCA\Files_Sharing\External\Manager |
|
34 | + */ |
|
35 | + protected $manager; |
|
36 | 36 | |
37 | - /** |
|
38 | - * @param string|\OC\Files\Storage\Storage $storage |
|
39 | - * @param string $mountpoint |
|
40 | - * @param array $options |
|
41 | - * @param \OCA\Files_Sharing\External\Manager $manager |
|
42 | - * @param \OC\Files\Storage\StorageFactory $loader |
|
43 | - */ |
|
44 | - public function __construct($storage, $mountpoint, $options, $manager, $loader = null) { |
|
45 | - parent::__construct($storage, $mountpoint, $options, $loader); |
|
46 | - $this->manager = $manager; |
|
47 | - } |
|
37 | + /** |
|
38 | + * @param string|\OC\Files\Storage\Storage $storage |
|
39 | + * @param string $mountpoint |
|
40 | + * @param array $options |
|
41 | + * @param \OCA\Files_Sharing\External\Manager $manager |
|
42 | + * @param \OC\Files\Storage\StorageFactory $loader |
|
43 | + */ |
|
44 | + public function __construct($storage, $mountpoint, $options, $manager, $loader = null) { |
|
45 | + parent::__construct($storage, $mountpoint, $options, $loader); |
|
46 | + $this->manager = $manager; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Move the mount point to $target |
|
51 | - * |
|
52 | - * @param string $target the target mount point |
|
53 | - * @return bool |
|
54 | - */ |
|
55 | - public function moveMount($target) { |
|
56 | - $result = $this->manager->setMountPoint($this->mountPoint, $target); |
|
57 | - $this->setMountPoint($target); |
|
49 | + /** |
|
50 | + * Move the mount point to $target |
|
51 | + * |
|
52 | + * @param string $target the target mount point |
|
53 | + * @return bool |
|
54 | + */ |
|
55 | + public function moveMount($target) { |
|
56 | + $result = $this->manager->setMountPoint($this->mountPoint, $target); |
|
57 | + $this->setMountPoint($target); |
|
58 | 58 | |
59 | - return $result; |
|
60 | - } |
|
59 | + return $result; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * Remove the mount points |
|
64 | - * |
|
65 | - * @return mixed |
|
66 | - * @return bool |
|
67 | - */ |
|
68 | - public function removeMount() { |
|
69 | - return $this->manager->removeShare($this->mountPoint); |
|
70 | - } |
|
62 | + /** |
|
63 | + * Remove the mount points |
|
64 | + * |
|
65 | + * @return mixed |
|
66 | + * @return bool |
|
67 | + */ |
|
68 | + public function removeMount() { |
|
69 | + return $this->manager->removeShare($this->mountPoint); |
|
70 | + } |
|
71 | 71 | } |
@@ -27,81 +27,81 @@ |
||
27 | 27 | |
28 | 28 | class Updater { |
29 | 29 | |
30 | - /** |
|
31 | - * @param array $params |
|
32 | - */ |
|
33 | - static public function renameHook($params) { |
|
34 | - self::renameChildren($params['oldpath'], $params['newpath']); |
|
35 | - self::moveShareToShare($params['newpath']); |
|
36 | - } |
|
37 | - |
|
38 | - /** |
|
39 | - * Fix for https://github.com/owncloud/core/issues/20769 |
|
40 | - * |
|
41 | - * The owner is allowed to move their files (if they are shared) into a receiving folder |
|
42 | - * In this case we need to update the parent of the moved share. Since they are |
|
43 | - * effectively handing over ownership of the file the rest of the code needs to know |
|
44 | - * they need to build up the reshare tree. |
|
45 | - * |
|
46 | - * @param string $path |
|
47 | - */ |
|
48 | - static private function moveShareToShare($path) { |
|
49 | - $userFolder = \OC::$server->getUserFolder(); |
|
50 | - |
|
51 | - // If the user folder can't be constructed (e.g. link share) just return. |
|
52 | - if ($userFolder === null) { |
|
53 | - return; |
|
54 | - } |
|
55 | - |
|
56 | - $src = $userFolder->get($path); |
|
57 | - |
|
58 | - $shareManager = \OC::$server->getShareManager(); |
|
59 | - |
|
60 | - $shares = $shareManager->getSharesBy($userFolder->getOwner()->getUID(), \OCP\Share::SHARE_TYPE_USER, $src, false, -1); |
|
61 | - $shares = array_merge($shares, $shareManager->getSharesBy($userFolder->getOwner()->getUID(), \OCP\Share::SHARE_TYPE_GROUP, $src, false, -1)); |
|
62 | - |
|
63 | - // If the path we move is not a share we don't care |
|
64 | - if (empty($shares)) { |
|
65 | - return; |
|
66 | - } |
|
67 | - |
|
68 | - // Check if the destination is inside a share |
|
69 | - $mountManager = \OC::$server->getMountManager(); |
|
70 | - $dstMount = $mountManager->find($src->getPath()); |
|
71 | - if (!($dstMount instanceof \OCA\Files_Sharing\SharedMount)) { |
|
72 | - return; |
|
73 | - } |
|
74 | - |
|
75 | - $newOwner = $dstMount->getShare()->getShareOwner(); |
|
76 | - |
|
77 | - //Ownership is moved over |
|
78 | - foreach ($shares as $share) { |
|
79 | - /** @var \OCP\Share\IShare $share */ |
|
80 | - $share->setShareOwner($newOwner); |
|
81 | - $shareManager->updateShare($share); |
|
82 | - } |
|
83 | - } |
|
84 | - |
|
85 | - /** |
|
86 | - * rename mount point from the children if the parent was renamed |
|
87 | - * |
|
88 | - * @param string $oldPath old path relative to data/user/files |
|
89 | - * @param string $newPath new path relative to data/user/files |
|
90 | - */ |
|
91 | - static private function renameChildren($oldPath, $newPath) { |
|
92 | - |
|
93 | - $absNewPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath); |
|
94 | - $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath); |
|
95 | - |
|
96 | - $mountManager = \OC\Files\Filesystem::getMountManager(); |
|
97 | - $mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath); |
|
98 | - foreach ($mountedShares as $mount) { |
|
99 | - if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) { |
|
100 | - $mountPoint = $mount->getMountPoint(); |
|
101 | - $target = str_replace($absOldPath, $absNewPath, $mountPoint); |
|
102 | - $mount->moveMount($target); |
|
103 | - } |
|
104 | - } |
|
105 | - } |
|
30 | + /** |
|
31 | + * @param array $params |
|
32 | + */ |
|
33 | + static public function renameHook($params) { |
|
34 | + self::renameChildren($params['oldpath'], $params['newpath']); |
|
35 | + self::moveShareToShare($params['newpath']); |
|
36 | + } |
|
37 | + |
|
38 | + /** |
|
39 | + * Fix for https://github.com/owncloud/core/issues/20769 |
|
40 | + * |
|
41 | + * The owner is allowed to move their files (if they are shared) into a receiving folder |
|
42 | + * In this case we need to update the parent of the moved share. Since they are |
|
43 | + * effectively handing over ownership of the file the rest of the code needs to know |
|
44 | + * they need to build up the reshare tree. |
|
45 | + * |
|
46 | + * @param string $path |
|
47 | + */ |
|
48 | + static private function moveShareToShare($path) { |
|
49 | + $userFolder = \OC::$server->getUserFolder(); |
|
50 | + |
|
51 | + // If the user folder can't be constructed (e.g. link share) just return. |
|
52 | + if ($userFolder === null) { |
|
53 | + return; |
|
54 | + } |
|
55 | + |
|
56 | + $src = $userFolder->get($path); |
|
57 | + |
|
58 | + $shareManager = \OC::$server->getShareManager(); |
|
59 | + |
|
60 | + $shares = $shareManager->getSharesBy($userFolder->getOwner()->getUID(), \OCP\Share::SHARE_TYPE_USER, $src, false, -1); |
|
61 | + $shares = array_merge($shares, $shareManager->getSharesBy($userFolder->getOwner()->getUID(), \OCP\Share::SHARE_TYPE_GROUP, $src, false, -1)); |
|
62 | + |
|
63 | + // If the path we move is not a share we don't care |
|
64 | + if (empty($shares)) { |
|
65 | + return; |
|
66 | + } |
|
67 | + |
|
68 | + // Check if the destination is inside a share |
|
69 | + $mountManager = \OC::$server->getMountManager(); |
|
70 | + $dstMount = $mountManager->find($src->getPath()); |
|
71 | + if (!($dstMount instanceof \OCA\Files_Sharing\SharedMount)) { |
|
72 | + return; |
|
73 | + } |
|
74 | + |
|
75 | + $newOwner = $dstMount->getShare()->getShareOwner(); |
|
76 | + |
|
77 | + //Ownership is moved over |
|
78 | + foreach ($shares as $share) { |
|
79 | + /** @var \OCP\Share\IShare $share */ |
|
80 | + $share->setShareOwner($newOwner); |
|
81 | + $shareManager->updateShare($share); |
|
82 | + } |
|
83 | + } |
|
84 | + |
|
85 | + /** |
|
86 | + * rename mount point from the children if the parent was renamed |
|
87 | + * |
|
88 | + * @param string $oldPath old path relative to data/user/files |
|
89 | + * @param string $newPath new path relative to data/user/files |
|
90 | + */ |
|
91 | + static private function renameChildren($oldPath, $newPath) { |
|
92 | + |
|
93 | + $absNewPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath); |
|
94 | + $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath); |
|
95 | + |
|
96 | + $mountManager = \OC\Files\Filesystem::getMountManager(); |
|
97 | + $mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath); |
|
98 | + foreach ($mountedShares as $mount) { |
|
99 | + if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) { |
|
100 | + $mountPoint = $mount->getMountPoint(); |
|
101 | + $target = str_replace($absOldPath, $absNewPath, $mountPoint); |
|
102 | + $mount->moveMount($target); |
|
103 | + } |
|
104 | + } |
|
105 | + } |
|
106 | 106 | |
107 | 107 | } |
@@ -31,36 +31,36 @@ |
||
31 | 31 | */ |
32 | 32 | class DeleteOrphanedSharesJob extends TimedJob { |
33 | 33 | |
34 | - /** |
|
35 | - * Default interval in minutes |
|
36 | - * |
|
37 | - * @var int $defaultIntervalMin |
|
38 | - **/ |
|
39 | - protected $defaultIntervalMin = 15; |
|
34 | + /** |
|
35 | + * Default interval in minutes |
|
36 | + * |
|
37 | + * @var int $defaultIntervalMin |
|
38 | + **/ |
|
39 | + protected $defaultIntervalMin = 15; |
|
40 | 40 | |
41 | - /** |
|
42 | - * sets the correct interval for this timed job |
|
43 | - */ |
|
44 | - public function __construct(){ |
|
45 | - $this->interval = $this->defaultIntervalMin * 60; |
|
46 | - } |
|
41 | + /** |
|
42 | + * sets the correct interval for this timed job |
|
43 | + */ |
|
44 | + public function __construct(){ |
|
45 | + $this->interval = $this->defaultIntervalMin * 60; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Makes the background job do its work |
|
50 | - * |
|
51 | - * @param array $argument unused argument |
|
52 | - */ |
|
53 | - public function run($argument) { |
|
54 | - $connection = \OC::$server->getDatabaseConnection(); |
|
55 | - $logger = \OC::$server->getLogger(); |
|
48 | + /** |
|
49 | + * Makes the background job do its work |
|
50 | + * |
|
51 | + * @param array $argument unused argument |
|
52 | + */ |
|
53 | + public function run($argument) { |
|
54 | + $connection = \OC::$server->getDatabaseConnection(); |
|
55 | + $logger = \OC::$server->getLogger(); |
|
56 | 56 | |
57 | - $sql = |
|
58 | - 'DELETE FROM `*PREFIX*share` ' . |
|
59 | - 'WHERE `item_type` in (\'file\', \'folder\') ' . |
|
60 | - 'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)'; |
|
57 | + $sql = |
|
58 | + 'DELETE FROM `*PREFIX*share` ' . |
|
59 | + 'WHERE `item_type` in (\'file\', \'folder\') ' . |
|
60 | + 'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)'; |
|
61 | 61 | |
62 | - $deletedEntries = $connection->executeUpdate($sql); |
|
63 | - $logger->debug("$deletedEntries orphaned share(s) deleted", ['app' => 'DeleteOrphanedSharesJob']); |
|
64 | - } |
|
62 | + $deletedEntries = $connection->executeUpdate($sql); |
|
63 | + $logger->debug("$deletedEntries orphaned share(s) deleted", ['app' => 'DeleteOrphanedSharesJob']); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
@@ -28,9 +28,9 @@ |
||
28 | 28 | $route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare'; |
29 | 29 | |
30 | 30 | if($token !== '') { |
31 | - OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token))); |
|
31 | + OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token))); |
|
32 | 32 | } else { |
33 | - header('HTTP/1.0 404 Not Found'); |
|
34 | - $tmpl = new OCP\Template('', '404', 'guest'); |
|
35 | - print_unescaped($tmpl->fetchPage()); |
|
33 | + header('HTTP/1.0 404 Not Found'); |
|
34 | + $tmpl = new OCP\Template('', '404', 'guest'); |
|
35 | + print_unescaped($tmpl->fetchPage()); |
|
36 | 36 | } |
@@ -26,48 +26,48 @@ |
||
26 | 26 | use OC\Updater\VersionCheck; |
27 | 27 | |
28 | 28 | class UpdateChecker { |
29 | - /** @var VersionCheck */ |
|
30 | - private $updater; |
|
29 | + /** @var VersionCheck */ |
|
30 | + private $updater; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @param VersionCheck $updater |
|
34 | - */ |
|
35 | - public function __construct(VersionCheck $updater) { |
|
36 | - $this->updater = $updater; |
|
37 | - } |
|
32 | + /** |
|
33 | + * @param VersionCheck $updater |
|
34 | + */ |
|
35 | + public function __construct(VersionCheck $updater) { |
|
36 | + $this->updater = $updater; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @return array |
|
41 | - */ |
|
42 | - public function getUpdateState() { |
|
43 | - $data = $this->updater->check(); |
|
44 | - $result = []; |
|
39 | + /** |
|
40 | + * @return array |
|
41 | + */ |
|
42 | + public function getUpdateState() { |
|
43 | + $data = $this->updater->check(); |
|
44 | + $result = []; |
|
45 | 45 | |
46 | - if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
47 | - $result['updateAvailable'] = true; |
|
48 | - $result['updateVersion'] = $data['versionstring']; |
|
49 | - $result['updaterEnabled'] = $data['autoupdater'] === '1'; |
|
50 | - if(substr($data['web'], 0, 8) === 'https://') { |
|
51 | - $result['updateLink'] = $data['web']; |
|
52 | - } |
|
53 | - if(substr($data['url'], 0, 8) === 'https://') { |
|
54 | - $result['downloadLink'] = $data['url']; |
|
55 | - } |
|
46 | + if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
47 | + $result['updateAvailable'] = true; |
|
48 | + $result['updateVersion'] = $data['versionstring']; |
|
49 | + $result['updaterEnabled'] = $data['autoupdater'] === '1'; |
|
50 | + if(substr($data['web'], 0, 8) === 'https://') { |
|
51 | + $result['updateLink'] = $data['web']; |
|
52 | + } |
|
53 | + if(substr($data['url'], 0, 8) === 'https://') { |
|
54 | + $result['downloadLink'] = $data['url']; |
|
55 | + } |
|
56 | 56 | |
57 | - return $result; |
|
58 | - } |
|
57 | + return $result; |
|
58 | + } |
|
59 | 59 | |
60 | - return []; |
|
61 | - } |
|
60 | + return []; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @param array $data |
|
65 | - */ |
|
66 | - public function getJavaScript(array $data) { |
|
67 | - $data['array']['oc_updateState'] = json_encode([ |
|
68 | - 'updateAvailable' => true, |
|
69 | - 'updateVersion' => $this->getUpdateState()['updateVersion'], |
|
70 | - 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', |
|
71 | - ]); |
|
72 | - } |
|
63 | + /** |
|
64 | + * @param array $data |
|
65 | + */ |
|
66 | + public function getJavaScript(array $data) { |
|
67 | + $data['array']['oc_updateState'] = json_encode([ |
|
68 | + 'updateAvailable' => true, |
|
69 | + 'updateVersion' => $this->getUpdateState()['updateVersion'], |
|
70 | + 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', |
|
71 | + ]); |
|
72 | + } |
|
73 | 73 | } |
@@ -30,27 +30,27 @@ |
||
30 | 30 | use OCP\AppFramework\IAppContainer; |
31 | 31 | |
32 | 32 | class Application extends App { |
33 | - public function __construct (array $urlParams = array()) { |
|
34 | - parent::__construct('updatenotification', $urlParams); |
|
35 | - $container = $this->getContainer(); |
|
33 | + public function __construct (array $urlParams = array()) { |
|
34 | + parent::__construct('updatenotification', $urlParams); |
|
35 | + $container = $this->getContainer(); |
|
36 | 36 | |
37 | - $container->registerService('AdminController', function(IAppContainer $c) { |
|
38 | - $updater = new \OC\Updater\VersionCheck( |
|
39 | - \OC::$server->getHTTPClientService(), |
|
40 | - \OC::$server->getConfig() |
|
41 | - ); |
|
42 | - return new AdminController( |
|
43 | - $c->query('AppName'), |
|
44 | - $c->query('Request'), |
|
45 | - $c->getServer()->getJobList(), |
|
46 | - $c->getServer()->getSecureRandom(), |
|
47 | - $c->getServer()->getConfig(), |
|
48 | - new TimeFactory(), |
|
49 | - $c->getServer()->getL10N($c->query('AppName')), |
|
50 | - new UpdateChecker($updater), |
|
51 | - $c->getServer()->getDateTimeFormatter() |
|
52 | - ); |
|
53 | - }); |
|
54 | - } |
|
37 | + $container->registerService('AdminController', function(IAppContainer $c) { |
|
38 | + $updater = new \OC\Updater\VersionCheck( |
|
39 | + \OC::$server->getHTTPClientService(), |
|
40 | + \OC::$server->getConfig() |
|
41 | + ); |
|
42 | + return new AdminController( |
|
43 | + $c->query('AppName'), |
|
44 | + $c->query('Request'), |
|
45 | + $c->getServer()->getJobList(), |
|
46 | + $c->getServer()->getSecureRandom(), |
|
47 | + $c->getServer()->getConfig(), |
|
48 | + new TimeFactory(), |
|
49 | + $c->getServer()->getL10N($c->query('AppName')), |
|
50 | + new UpdateChecker($updater), |
|
51 | + $c->getServer()->getDateTimeFormatter() |
|
52 | + ); |
|
53 | + }); |
|
54 | + } |
|
55 | 55 | |
56 | 56 | } |
@@ -34,44 +34,44 @@ |
||
34 | 34 | * @package OCA\UpdateNotification |
35 | 35 | */ |
36 | 36 | class ResetTokenBackgroundJob extends TimedJob { |
37 | - /** @var IConfig */ |
|
38 | - private $config; |
|
39 | - /** @var ITimeFactory */ |
|
40 | - private $timeFactory; |
|
37 | + /** @var IConfig */ |
|
38 | + private $config; |
|
39 | + /** @var ITimeFactory */ |
|
40 | + private $timeFactory; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param IConfig|null $config |
|
44 | - * @param ITimeFactory|null $timeFactory |
|
45 | - */ |
|
46 | - public function __construct(IConfig $config = null, |
|
47 | - ITimeFactory $timeFactory = null) { |
|
48 | - // Run all 10 minutes |
|
49 | - $this->setInterval(60 * 10); |
|
42 | + /** |
|
43 | + * @param IConfig|null $config |
|
44 | + * @param ITimeFactory|null $timeFactory |
|
45 | + */ |
|
46 | + public function __construct(IConfig $config = null, |
|
47 | + ITimeFactory $timeFactory = null) { |
|
48 | + // Run all 10 minutes |
|
49 | + $this->setInterval(60 * 10); |
|
50 | 50 | |
51 | - if ($config instanceof IConfig && $timeFactory instanceof ITimeFactory) { |
|
52 | - $this->config = $config; |
|
53 | - $this->timeFactory = $timeFactory; |
|
54 | - } else { |
|
55 | - $this->fixDIForJobs(); |
|
56 | - } |
|
57 | - } |
|
51 | + if ($config instanceof IConfig && $timeFactory instanceof ITimeFactory) { |
|
52 | + $this->config = $config; |
|
53 | + $this->timeFactory = $timeFactory; |
|
54 | + } else { |
|
55 | + $this->fixDIForJobs(); |
|
56 | + } |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * DI for jobs |
|
61 | - */ |
|
62 | - private function fixDIForJobs() { |
|
63 | - $this->config = \OC::$server->getConfig(); |
|
64 | - $this->timeFactory = new TimeFactory(); |
|
65 | - } |
|
59 | + /** |
|
60 | + * DI for jobs |
|
61 | + */ |
|
62 | + private function fixDIForJobs() { |
|
63 | + $this->config = \OC::$server->getConfig(); |
|
64 | + $this->timeFactory = new TimeFactory(); |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * @param $argument |
|
69 | - */ |
|
70 | - protected function run($argument) { |
|
71 | - // Delete old tokens after 2 days |
|
72 | - if($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
73 | - $this->config->deleteSystemValue('updater.secret'); |
|
74 | - } |
|
75 | - } |
|
67 | + /** |
|
68 | + * @param $argument |
|
69 | + */ |
|
70 | + protected function run($argument) { |
|
71 | + // Delete old tokens after 2 days |
|
72 | + if($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
73 | + $this->config->deleteSystemValue('updater.secret'); |
|
74 | + } |
|
75 | + } |
|
76 | 76 | |
77 | 77 | } |
@@ -25,6 +25,6 @@ |
||
25 | 25 | |
26 | 26 | $application = new Application(); |
27 | 27 | $application->registerRoutes($this, ['routes' => [ |
28 | - ['name' => 'Admin#createCredentials', 'url' => '/credentials', 'verb' => 'GET'], |
|
29 | - ['name' => 'Admin#setChannel', 'url' => '/channel', 'verb' => 'POST'], |
|
28 | + ['name' => 'Admin#createCredentials', 'url' => '/credentials', 'verb' => 'GET'], |
|
29 | + ['name' => 'Admin#setChannel', 'url' => '/channel', 'verb' => 'POST'], |
|
30 | 30 | ]]); |