summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-07-02 13:54:31 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-02 13:54:31 +0200
commit3fc5b34247cc30809ca525b96e73f1448e5b2e9b (patch)
treee92a0b479329a3f386452396b595a38cac61e4b4 /apps
parent38ed00398f4df27967ae771c54a6a8f6bed07dbd (diff)
parent29dd7eda2de629024548ddef419f1d6991ae07a6 (diff)
downloadnextcloud-server-3fc5b34247cc30809ca525b96e73f1448e5b2e9b.tar.gz
nextcloud-server-3fc5b34247cc30809ca525b96e73f1448e5b2e9b.zip
Merge branch 'master' into encryption_check_php_version
Conflicts: apps/files_encryption/files/error.php
Diffstat (limited to 'apps')
-rw-r--r--apps/files/ajax/upload.php70
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files_encryption/files/error.php2
3 files changed, 37 insertions, 37 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 12db682c1e2..8433716dec1 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -8,40 +8,40 @@ OCP\JSON::setContentTypeHeader('text/plain');
// If no token is sent along, rely on login only
$l = OC_L10N::get('files');
-if (!$_POST['dirToken']) {
- // The standard case, files are uploaded through logged in users :)
- OCP\JSON::checkLoggedIn();
- $dir = isset($_POST['dir']) ? $_POST['dir'] : "";
- if (!$dir || empty($dir) || $dir === false) {
- OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
- die();
- }
+if (empty($_POST['dirToken'])) {
+ // The standard case, files are uploaded through logged in users :)
+ OCP\JSON::checkLoggedIn();
+ $dir = isset($_POST['dir']) ? $_POST['dir'] : "";
+ if (!$dir || empty($dir) || $dir === false) {
+ OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
+ die();
+ }
} else {
- $linkItem = OCP\Share::getShareByToken($_POST['dirToken']);
-
- if ($linkItem === false) {
- OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Invalid Token')))));
- die();
- }
-
- if (!($linkItem['permissions'] & OCP\PERMISSION_CREATE)) {
- OCP\JSON::checkLoggedIn();
- } else {
-
- // The token defines the target directory (security reasons)
- $dir = sprintf(
- "/%s/%s",
- $linkItem['file_target'],
- isset($_POST['subdir']) ? $_POST['subdir'] : ''
- );
-
- if (!$dir || empty($dir) || $dir === false) {
- OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
- die();
- }
- // Setup FS with owner
- OC_Util::setupFS($linkItem['uid_owner']);
- }
+ $linkItem = OCP\Share::getShareByToken($_POST['dirToken']);
+
+ if ($linkItem === false) {
+ OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Invalid Token')))));
+ die();
+ }
+
+ if (!($linkItem['permissions'] & OCP\PERMISSION_CREATE)) {
+ OCP\JSON::checkLoggedIn();
+ } else {
+
+ // The token defines the target directory (security reasons)
+ $dir = sprintf(
+ "/%s/%s",
+ $linkItem['file_target'],
+ isset($_POST['subdir']) ? $_POST['subdir'] : ''
+ );
+
+ if (!$dir || empty($dir) || $dir === false) {
+ OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
+ die();
+ }
+ // Setup FS with owner
+ OC_Util::setupFS($linkItem['uid_owner']);
+ }
}
@@ -61,7 +61,7 @@ foreach ($_FILES['files']['error'] as $error) {
$errors = array(
UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'),
UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
- . ini_get('upload_max_filesize'),
+ . ini_get('upload_max_filesize'),
UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'),
UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'),
UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'),
@@ -107,7 +107,7 @@ if (strpos($dir, '..') === false) {
'size' => $meta['size'],
'id' => $meta['fileid'],
'name' => basename($target),
- 'originalname'=>$files['name'][$i],
+ 'originalname' => $files['name'][$i],
'uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize
);
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c15fc21abf4..cf3ce2e5089 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -467,7 +467,7 @@ $(document).ready(function(){
}
var date=new Date();
var param = {};
- if ($('#publicUploadRequestToken')) {
+ if ($('#publicUploadRequestToken').length) {
param.download_url = document.location.href + '&download&path=/' + $('#dir').val() + '/' + uniqueName;
}
// create new file context
diff --git a/apps/files_encryption/files/error.php b/apps/files_encryption/files/error.php
index 85128fa4aea..f93c67d920a 100644
--- a/apps/files_encryption/files/error.php
+++ b/apps/files_encryption/files/error.php
@@ -4,7 +4,7 @@ if (!isset($_)) { //also provide standalone error page
$l = OC_L10N::get('files_encryption');
- $errorMsg = $l->t('Your private key is not valid! Maybe your password was changed from outside. You can update your private key password in your personal settings to regain access to your files.');
+ $errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.');
if(isset($_GET['p']) && $_GET['p'] === '1') {
header('HTTP/1.0 404 ' . $errorMsg);