Check session token

This commit is contained in:
Victor Dubiniuk 2014-09-08 22:05:31 +03:00
parent 8ae21d491a
commit 3934f6a663
2 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,9 @@ class SessionController extends Controller{
try { try {
$token = Helper::getArrayValueByKey($args, 'token'); $token = Helper::getArrayValueByKey($args, 'token');
$file = File::getByShareToken($token); $file = File::getByShareToken($token);
if ($file->isPasswordProtected() && !$file->checkPassword('')){
throw new \Exception('Not authorized');
}
$session = Db\Session::start($uid, $file); $session = Db\Session::start($uid, $file);
\OCP\JSON::success($session); \OCP\JSON::success($session);
} catch (\Exception $e){ } catch (\Exception $e){