From b3a5bc014656b4595f4d9c68d9a442b0b07530b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Henrique=20Gomes=20Pal=C3=A1cio?= Date: Tue, 14 May 2013 11:05:41 -0300 Subject: [PATCH] Update index.php --- apps/files/index.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/files/index.php b/apps/files/index.php index 20fbf7f93be9..97d2649d9994 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -24,6 +24,9 @@ // Check if we are a user OCP\User::checkLoggedIn(); +// Start session +session_start(); + // Load the files we need OCP\Util::addStyle('files', 'files'); OCP\Util::addscript('files', 'jquery.iframe-transport'); @@ -32,8 +35,18 @@ OCP\Util::addscript('files', 'filelist'); OCP\App::setActiveNavigationEntry('files_index'); + // Load the files -$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; +$dir = ''; +if (isset($_GET['dir'])) { + $dir = stripslashes($_GET['dir']); + // Save the directory you're working in session + $_SESSION['dir'] = $dir; +} elseif (isset($_SESSION['dir'])) { + // Get the directory you're working from session + $dir = $_SESSION['dir']; +} + // Redirect if directory does not exist if (!\OC\Files\Filesystem::is_dir($dir . '/')) { header('Location: ' . OCP\Util::getScriptName() . ''); @@ -137,4 +150,4 @@ function fileCmp($a, $b) { $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']); $tmpl->printPage(); -} \ No newline at end of file +}