2012-11-04 17:42:18 +00:00
|
|
|
<?php
|
2014-10-15 09:58:44 +00:00
|
|
|
/**
|
2015-02-26 10:37:37 +00:00
|
|
|
* @author Lukas Reschke
|
|
|
|
* @copyright 2014 Lukas Reschke lukas@owncloud.com
|
2014-10-15 09:58:44 +00:00
|
|
|
*
|
2015-02-26 10:37:37 +00:00
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
2014-10-15 09:58:44 +00:00
|
|
|
*/
|
2015-02-26 10:37:37 +00:00
|
|
|
|
2014-10-15 09:58:44 +00:00
|
|
|
// This file is just used to redirect the legacy sharing URLs (< ownCloud 8) to the new ones
|
|
|
|
|
|
|
|
$urlGenerator = new \OC\URLGenerator(\OC::$server->getConfig());
|
|
|
|
$token = isset($_GET['t']) ? $_GET['t'] : '';
|
2014-11-18 13:47:48 +00:00
|
|
|
$route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare';
|
2014-10-15 09:58:44 +00:00
|
|
|
|
2015-02-25 16:26:54 +00:00
|
|
|
if($token !== '') {
|
|
|
|
OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
|
|
|
|
} else {
|
|
|
|
header('HTTP/1.0 404 Not Found');
|
|
|
|
$tmpl = new OCP\Template('', '404', 'guest');
|
|
|
|
print_unescaped($tmpl->fetchPage());
|
|
|
|
}
|