parent
0f2ad9862e
commit
2a4c51389c
@ -0,0 +1,23 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2014 Christopher Schäpers <christopher@schaepers.it> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
namespace OC\Core\Share; |
||||
|
||||
class Controller { |
||||
public static function showShare($args) { |
||||
\OC_Util::checkAppEnabled('files_sharing'); |
||||
|
||||
$token = $args['token']; |
||||
|
||||
\OC_App::loadApp('files_sharing'); |
||||
\OC_User::setIncognitoMode(true); |
||||
|
||||
require_once \OC_App::getAppPath('files_sharing') .'/public.php'; |
||||
} |
||||
} |
||||
?> |
@ -1,41 +0,0 @@ |
||||
<?php |
||||
|
||||
try { |
||||
|
||||
require_once 'lib/base.php'; |
||||
OC::checkMaintenanceMode(); |
||||
OC::checkSingleUserMode(); |
||||
$file = OCP\CONFIG::getAppValue('core', 'public_files'); |
||||
if(is_null($file)) { |
||||
header('HTTP/1.0 404 Not Found'); |
||||
exit; |
||||
} |
||||
|
||||
// convert the token to hex, if it's base36 |
||||
if (strlen((string)$_GET['t']) != 16 && strlen((string)$_GET['t']) != 32) { |
||||
$_GET['t'] = base_convert($_GET['t'], 36, 16); |
||||
|
||||
// the token should have leading zeroes and needs to be padded |
||||
if (strlen((string)$_GET['t']) != 16) { |
||||
$padding = ''; |
||||
for ($i = 0; $i < (16 - strlen((string)$_GET['t'])); $i++) { |
||||
$padding .= '0'; |
||||
} |
||||
$_GET['t'] = $padding . $_GET['t']; |
||||
} |
||||
} |
||||
|
||||
print($_GET['t']); |
||||
|
||||
OC_Util::checkAppEnabled('files_sharing'); |
||||
OC_App::loadApp('files_sharing'); |
||||
OC_User::setIncognitoMode(true); |
||||
|
||||
require_once OC_App::getAppPath('files_sharing') .'/public.php'; |
||||
|
||||
} catch (Exception $ex) { |
||||
//show the user a detailed error page |
||||
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
||||
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
||||
OC_Template::printExceptionErrorPage($ex); |
||||
} |
Loading…
Reference in new issue