2013-01-18 16:11:29 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if(!OC_User::isLoggedIn()) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$timestamp = isset( $_REQUEST['timestamp'] ) ? $_REQUEST['timestamp'] : '';
|
|
|
|
$filename = isset( $_REQUEST['filename'] ) ? trim($_REQUEST['filename'], '/\\') : '';
|
|
|
|
|
2013-01-18 17:09:22 +04:00
|
|
|
if ( OCA_Trash\Trashbin::restore($filename, $timestamp) ) {
|
|
|
|
OCP\JSON::success(array("data" => array('filename'=>$filename, 'timestamp' => $timestamp)));
|
|
|
|
} else {
|
|
|
|
OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".$filename)));
|
|
|
|
}
|