2015-03-02 17:25:50 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2015-06-25 12:43:55 +03:00
|
|
|
* @author Joas Schilling <nickvergessen@owncloud.com>
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Robin Appelman <icewind@owncloud.com>
|
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
2015-06-25 12:43:55 +03:00
|
|
|
* @author Vincent Petry <pvince81@owncloud.com>
|
2015-03-02 17:25:50 +03:00
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @copyright Copyright (c) 2015, ownCloud, Inc.
|
|
|
|
* @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,
|
|
|
|
* 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
|
|
|
|
*/
|
2015-11-27 16:01:03 +03:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|