summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-01-21 19:36:20 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-01-21 19:36:20 +0100
commit9bab05fd45434a62c9c017d73d74c1fe1928ead0 (patch)
tree8ef2b1662295df1b4f9bc1fe4faa3bfea8109f65 /lib
parentc57c9eae769b70a1b273c564b76d57d95ebcf2ab (diff)
parent3b7fea25a30aa7dc590d90c5c91147ae9d94ba13 (diff)
downloadnextcloud-server-9bab05fd45434a62c9c017d73d74c1fe1928ead0.tar.gz
nextcloud-server-9bab05fd45434a62c9c017d73d74c1fe1928ead0.zip
Merge branch 'master' into fixing-gallery-password-protected-access-master
Diffstat (limited to 'lib')
-rw-r--r--lib/private/json.php14
-rw-r--r--lib/private/template/cssresourcelocator.php2
-rwxr-xr-xlib/private/util.php4
-rw-r--r--lib/public/json.php10
4 files changed, 28 insertions, 2 deletions
diff --git a/lib/private/json.php b/lib/private/json.php
index 6a9e5a2df5e..5c5d7e3a3da 100644
--- a/lib/private/json.php
+++ b/lib/private/json.php
@@ -65,6 +65,20 @@ class OC_JSON{
}
/**
+ * Check is a given user exists - send json error msg if not
+ * @param string $user
+ */
+ public static function checkUserExists($user) {
+ if (!OCP\User::userExists($user)) {
+ $l = OC_L10N::get('lib');
+ OCP\JSON::error(array('data' => array('message' => $l->t('Unknown user'))));
+ exit;
+ }
+ }
+
+
+
+ /**
* Check if the user is a subadmin, send json error msg if not
*/
public static function checkSubAdminUser() {
diff --git a/lib/private/template/cssresourcelocator.php b/lib/private/template/cssresourcelocator.php
index e26daa25827..8e7831ca549 100644
--- a/lib/private/template/cssresourcelocator.php
+++ b/lib/private/template/cssresourcelocator.php
@@ -22,7 +22,7 @@ class CSSResourceLocator extends ResourceLocator {
$app = substr($style, 0, strpos($style, '/'));
$style = substr($style, strpos($style, '/')+1);
$app_path = \OC_App::getAppPath($app);
- $app_url = \OC_App::getAppWebPath($app);
+ $app_url = $this->webroot . '/index.php/apps/' . $app;
if ($this->appendIfExist($app_path, $style.$this->form_factor.'.css', $app_url)
|| $this->appendIfExist($app_path, $style.'.css', $app_url)
) {
diff --git a/lib/private/util.php b/lib/private/util.php
index 72afa6f9478..8aa7a074d0d 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -51,6 +51,10 @@ class OC_Util {
self::$rootMounted = true;
}
+ if ($user != '' && !OCP\User::userExists($user)) {
+ return false;
+ }
+
//if we aren't logged in, there is no use to set up the filesystem
if( $user != "" ) {
\OC\Files\Filesystem::addStorageWrapper(function($mountPoint, $storage){
diff --git a/lib/public/json.php b/lib/public/json.php
index 831e3ef1cf6..cd5d233ef90 100644
--- a/lib/public/json.php
+++ b/lib/public/json.php
@@ -167,7 +167,7 @@ class JSON {
* @return string json formatted string if not admin user.
*/
public static function checkAdminUser() {
- return(\OC_JSON::checkAdminUser());
+ \OC_JSON::checkAdminUser();
}
/**
@@ -177,4 +177,12 @@ class JSON {
public static function encode($data) {
return(\OC_JSON::encode($data));
}
+
+ /**
+ * Check is a given user exists - send json error msg if not
+ * @param string $user
+ */
+ public static function checkUserExists($user) {
+ \OC_JSON::checkUserExists($user);
+ }
}