2015-03-02 17:25:50 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-21 17:49:16 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2020-04-29 12:57:22 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2016-07-21 17:49:16 +03:00
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
2016-01-12 17:02:16 +03:00
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
2016-07-21 19:13:36 +03:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
2020-12-16 16:54:15 +03:00
|
|
|
* @author Vincent Petry <vincent@nextcloud.com>
|
2015-03-02 17:25:50 +03:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @license AGPL-3.0
|
2015-03-02 17:25:50 +03:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
2015-03-02 17:25:50 +03:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2015-03-02 17:25:50 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-03-26 13:44:34 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
2015-03-02 17:25:50 +03:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2015-03-02 17:25:50 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCA\Files_Trashbin\Command;
|
|
|
|
|
|
|
|
use OC\Command\FileAccess;
|
|
|
|
use OCA\Files_Trashbin\Trashbin;
|
|
|
|
use OCP\Command\ICommand;
|
|
|
|
|
|
|
|
class Expire implements ICommand {
|
|
|
|
use FileAccess;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $user;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $user
|
|
|
|
*/
|
2020-04-10 17:51:06 +03:00
|
|
|
public function __construct($user) {
|
2015-03-02 17:25:50 +03:00
|
|
|
$this->user = $user;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handle() {
|
2015-06-05 12:31:49 +03:00
|
|
|
$userManager = \OC::$server->getUserManager();
|
|
|
|
if (!$userManager->userExists($this->user)) {
|
|
|
|
// User has been deleted already
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-03-10 13:47:06 +03:00
|
|
|
\OC_Util::tearDownFS();
|
2015-03-02 17:25:50 +03:00
|
|
|
\OC_Util::setupFS($this->user);
|
2015-11-27 16:01:03 +03:00
|
|
|
Trashbin::expire($this->user);
|
2015-04-24 13:09:09 +03:00
|
|
|
\OC_Util::tearDownFS();
|
2015-03-02 17:25:50 +03:00
|
|
|
}
|
|
|
|
}
|