aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/fr_CA.php8
-rw-r--r--lib/l10n/lt_LT.php1
-rw-r--r--lib/private/appframework/app.php6
-rw-r--r--lib/private/appframework/routing/routeactionhandler.php2
-rwxr-xr-xlib/private/request.php6
-rw-r--r--lib/private/user.php4
-rw-r--r--lib/public/appframework/app.php23
7 files changed, 45 insertions, 5 deletions
diff --git a/lib/l10n/fr_CA.php b/lib/l10n/fr_CA.php
new file mode 100644
index 00000000000..406ff5f5a26
--- /dev/null
+++ b/lib/l10n/fr_CA.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
diff --git a/lib/l10n/lt_LT.php b/lib/l10n/lt_LT.php
index 9c4eccd9d62..17bbb856e43 100644
--- a/lib/l10n/lt_LT.php
+++ b/lib/l10n/lt_LT.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "Failai turi būti parsiunčiami vienas po kito.",
"Back to Files" => "Atgal į Failus",
"Selected files too large to generate zip file." => "Pasirinkti failai per dideli archyvavimui į ZIP.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Prašome atsisiųsti failus mažesnėmis dalimis atskirai, arba mandagiai prašykite savo administratoriaus.",
"No source specified when installing app" => "Nenurodytas šaltinis diegiant programą",
"No href specified when installing app from http" => "Nenurodytas href diegiant programą iš http",
"No path specified when installing app from local file" => "Nenurodytas kelias diegiant programą iš vietinio failo",
diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php
index 6d3effbf1fa..b835188661a 100644
--- a/lib/private/appframework/app.php
+++ b/lib/private/appframework/app.php
@@ -43,8 +43,12 @@ class App {
* stored in the DI container
* @param string $methodName the method that you want to call
* @param DIContainer $container an instance of a pimple container.
+ * @param array $urlParams list of URL parameters (optional)
*/
- public static function main($controllerName, $methodName, IAppContainer $container) {
+ public static function main($controllerName, $methodName, DIContainer $container, array $urlParams = null) {
+ if (!is_null($urlParams)) {
+ $container['urlParams'] = $urlParams;
+ }
$controller = $container[$controllerName];
// initialize the dispatcher and run all the middleware before the controller
diff --git a/lib/private/appframework/routing/routeactionhandler.php b/lib/private/appframework/routing/routeactionhandler.php
index 7fb56f14eab..2b9dc38dc43 100644
--- a/lib/private/appframework/routing/routeactionhandler.php
+++ b/lib/private/appframework/routing/routeactionhandler.php
@@ -37,6 +37,6 @@ class RouteActionHandler {
}
public function __invoke($params) {
- App::main($this->controllerName, $this->actionName, $params, $this->container);
+ App::main($this->controllerName, $this->actionName, $this->container, $params);
}
}
diff --git a/lib/private/request.php b/lib/private/request.php
index 37d918d2032..b2afda35922 100755
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -165,7 +165,11 @@ class OC_Request {
if (strpos($path_info, $name) === 0) {
$path_info = substr($path_info, strlen($name));
}
- return rtrim($path_info, '/');
+ if($path_info === '/'){
+ return '';
+ } else {
+ return $path_info;
+ }
}
/**
diff --git a/lib/private/user.php b/lib/private/user.php
index 210e5ed3f02..e0d6b9f3f51 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -314,7 +314,7 @@ class OC_User {
* Checks if the user is logged in
*/
public static function isLoggedIn() {
- if (\OC::$session->get('user_id')) {
+ if (\OC::$session->get('user_id') && self::$incognitoMode === false) {
OC_App::loadApps(array('authentication'));
self::setupBackends();
return self::userExists(\OC::$session->get('user_id'));
@@ -353,7 +353,7 @@ class OC_User {
* @return bool
*/
public static function isAdminUser($uid) {
- if (OC_Group::inGroup($uid, 'admin')) {
+ if (OC_Group::inGroup($uid, 'admin') && self::$incognitoMode === false) {
return true;
}
return false;
diff --git a/lib/public/appframework/app.php b/lib/public/appframework/app.php
index 0ff6648c5d4..90150245c41 100644
--- a/lib/public/appframework/app.php
+++ b/lib/public/appframework/app.php
@@ -26,6 +26,7 @@
*/
namespace OCP\AppFramework;
+use OC\AppFramework\routing\RouteConfig;
/**
@@ -53,6 +54,28 @@ class App {
}
/**
+ * This function is to be called to create single routes and restful routes based on the given $routes array.
+ *
+ * Example code in routes.php of tasks app (it will register two restful resources):
+ * $routes = array(
+ * 'resources' => array(
+ * 'lists' => array('url' => '/tasklists'),
+ * 'tasks' => array('url' => '/tasklists/{listId}/tasks')
+ * )
+ * );
+ *
+ * $a = new TasksApp();
+ * $a->registerRoutes($this, $routes);
+ *
+ * @param \OC_Router $router
+ * @param array $routes
+ */
+ public function registerRoutes($router, $routes) {
+ $routeConfig = new RouteConfig($this->container, $router, $routes);
+ $routeConfig->register();
+ }
+
+ /**
* This function is called by the routing component to fire up the frameworks dispatch mechanism.
*
* Example code in routes.php of the task app: