aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/cs_CZ.php1
-rw-r--r--lib/l10n/fr_CA.php8
-rw-r--r--lib/l10n/ja_JP.php1
-rw-r--r--lib/l10n/lt_LT.php1
-rw-r--r--lib/l10n/sl.php5
-rw-r--r--lib/private/appframework/app.php6
-rw-r--r--lib/private/appframework/routing/routeactionhandler.php2
-rw-r--r--lib/private/avatar.php10
-rw-r--r--lib/private/connector/sabre/file.php2
-rw-r--r--lib/private/db/mdb2schemamanager.php2
-rw-r--r--lib/private/files/cache/updater.php12
-rw-r--r--lib/private/log/owncloud.php2
-rwxr-xr-xlib/private/preview.php41
-rw-r--r--lib/private/repair.php21
-rwxr-xr-xlib/private/request.php33
-rw-r--r--lib/private/updater.php6
-rw-r--r--lib/private/user.php20
-rw-r--r--lib/private/user/backend.php15
-rw-r--r--lib/private/user/user.php12
-rwxr-xr-xlib/private/util.php8
-rw-r--r--lib/public/appframework/app.php23
-rw-r--r--lib/public/contacts/imanager.php4
-rw-r--r--lib/public/iservercontainer.php11
-rw-r--r--lib/public/share.php18
24 files changed, 218 insertions, 46 deletions
diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php
index 0e44dd2a4bd..96d3660c473 100644
--- a/lib/l10n/cs_CZ.php
+++ b/lib/l10n/cs_CZ.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "Soubory musí být stahovány jednotlivě.",
"Back to Files" => "Zpět k souborům",
"Selected files too large to generate zip file." => "Vybrané soubory jsou příliš velké pro vytvoření ZIP souboru.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Prosím stáhněte soubory odděleně po menších množstvích nebo požádejte vašeho správce.",
"No source specified when installing app" => "Nebyl zadán zdroj při instalaci aplikace",
"No href specified when installing app from http" => "Nebyl zadán odkaz pro instalaci aplikace z HTTP",
"No path specified when installing app from local file" => "Nebyla zadána cesta pro instalaci aplikace z místního souboru",
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/ja_JP.php b/lib/l10n/ja_JP.php
index f7af9b592ad..d7baf176a14 100644
--- a/lib/l10n/ja_JP.php
+++ b/lib/l10n/ja_JP.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "ファイルは1つずつダウンロードする必要があります。",
"Back to Files" => "ファイルに戻る",
"Selected files too large to generate zip file." => "選択したファイルはZIPファイルの生成には大きすぎます。",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "少しずつに分けてファイルをダウンロードするか、管理者に問い合わせてください。",
"No source specified when installing app" => "アプリインストール時のソースが未指定",
"No href specified when installing app from http" => "アプリインストール時のhttpの URL が未指定",
"No path specified when installing app from local file" => "アプリインストール時のローカルファイルのパスが未指定",
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/l10n/sl.php b/lib/l10n/sl.php
index 49c9c6a3b29..b54d18ab3cf 100644
--- a/lib/l10n/sl.php
+++ b/lib/l10n/sl.php
@@ -19,7 +19,12 @@ $TRANSLATIONS = array(
"No href specified when installing app from http" => "Ni podanega podatka naslova HREF med nameščenjem programa preko protokola HTTP.",
"No path specified when installing app from local file" => "Ni podane poti med nameščenjem programa iz krajevne datoteke",
"Archives of type %s are not supported" => "Arhivi vrste %s niso podprti",
+"App does not provide an info.xml file" => "Program je brez datoteke info.xml",
+"App can't be installed because of not allowed code in the App" => "Programa ni mogoče namestiti zaradi nedovoljene programske kode.",
+"App can't be installed because it is not compatible with this version of ownCloud" => "Programa ni mogoče namestiti, ker ni skladen z trenutno nameščeno različico oblaka ownCloud.",
+"App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" => "Program ni mogoče namestiti zaradi neustrezne različice datoteke info.xml. Ta ni enaka različici programa.",
"App directory already exists" => "Programska mapa že obstaja",
+"Can't create app folder. Please fix permissions. %s" => "Programske mape ni mogoče ustvariti. Ni ustreznih dovoljenj. %s",
"Application is not enabled" => "Program ni omogočen",
"Authentication error" => "Napaka overjanja",
"Token expired. Please reload page." => "Žeton je potekel. Stran je treba ponovno naložiti.",
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/avatar.php b/lib/private/avatar.php
index 814a9b22bed..e97f55eecaf 100644
--- a/lib/private/avatar.php
+++ b/lib/private/avatar.php
@@ -44,15 +44,19 @@ class OC_Avatar implements \OCP\IAvatar {
/**
* @brief sets the users avatar
- * @param $data mixed imagedata or path to set a new avatar
+ * @param $data mixed OC_Image, imagedata or path to set a new avatar
* @throws Exception if the provided file is not a jpg or png image
* @throws Exception if the provided image is not valid
* @throws \OC\NotSquareException if the image is not square
* @return void
*/
public function set ($data) {
-
- $img = new OC_Image($data);
+ if($data instanceOf OC_Image) {
+ $img = $data;
+ $data = $img->data();
+ } else {
+ $img = new OC_Image($data);
+ }
$type = substr($img->mimeType(), -3);
if ($type === 'peg') {
$type = 'jpg';
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 26b5d200bde..295575f0af6 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -249,7 +249,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
// allow sync clients to send the mtime along in a header
$mtime = OC_Request::hasModificationTime();
if ($mtime !== false) {
- if($fs->touch($this->path, $mtime)) {
+ if($fs->touch($targetPath, $mtime)) {
header('X-OC-MTime: accepted');
}
}
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php
index 416e2f55426..6378c769055 100644
--- a/lib/private/db/mdb2schemamanager.php
+++ b/lib/private/db/mdb2schemamanager.php
@@ -19,6 +19,8 @@ class MDB2SchemaManager {
*/
public function __construct($conn) {
$this->conn = $conn;
+ $this->conn->close();
+ $this->conn->connect();
}
/**
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index d45c5e17fc8..73bc30e538f 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -59,9 +59,13 @@ class Updater {
*/
list($storage, $internalPath) = self::resolvePath($path);
if ($storage) {
+ $parent = dirname($internalPath);
+ if ($parent === '.') {
+ $parent = '';
+ }
$cache = $storage->getCache($internalPath);
$cache->remove($internalPath);
- $cache->correctFolderSize($internalPath);
+ $cache->correctFolderSize($parent);
self::correctFolder($path, time());
self::correctParentStorageMtime($storage, $internalPath);
}
@@ -86,6 +90,12 @@ class Updater {
if ($storageFrom === $storageTo) {
$cache = $storageFrom->getCache($internalFrom);
$cache->move($internalFrom, $internalTo);
+ if (pathinfo($internalFrom, PATHINFO_EXTENSION) !== pathinfo($internalTo, PATHINFO_EXTENSION)) {
+ // redetect mime type change
+ $mimeType = $storageTo->getMimeType($internalTo);
+ $fileId = $storageTo->getCache()->getId($internalTo);
+ $storageTo->getCache()->update($fileId, array('mimetype' => $mimeType));
+ }
$cache->correctFolderSize($internalFrom);
$cache->correctFolderSize($internalTo);
self::correctFolder($from, time());
diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php
index 15cace88f41..4c86d0e45e0 100644
--- a/lib/private/log/owncloud.php
+++ b/lib/private/log/owncloud.php
@@ -68,6 +68,8 @@ class OC_Log_Owncloud {
$timezone = new DateTimeZone('UTC');
}
$time = new DateTime(null, $timezone);
+ // remove username/passswords from URLs before writing the to the log file
+ $message = preg_replace('/\/\/(.*):(.*)@/', '//xxx:xxx@', $message);
$entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format));
$entry = json_encode($entry);
$handle = @fopen(self::$logFile, 'a');
diff --git a/lib/private/preview.php b/lib/private/preview.php
index 266f7795f12..ff93f438f73 100755
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -9,7 +9,7 @@
* Thumbnails:
* structure of filename:
* /data/user/thumbnails/pathhash/x-y.png
- *
+ *
*/
namespace OC;
@@ -40,6 +40,7 @@ class Preview {
private $maxX;
private $maxY;
private $scalingup;
+ private $mimetype;
//preview images object
/**
@@ -59,11 +60,18 @@ class Preview {
* @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
* @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
* @param bool $scalingUp Disable/Enable upscaling of previews
- * @return mixed (bool / string)
+ * @return mixed (bool / string)
* false if thumbnail does not exist
* path to thumbnail if thumbnail exists
*/
public function __construct($user='', $root='/', $file='', $maxX=1, $maxY=1, $scalingUp=true) {
+ //init fileviews
+ if($user === ''){
+ $user = \OC_User::getUser();
+ }
+ $this->fileView = new \OC\Files\View('/' . $user . '/' . $root);
+ $this->userView = new \OC\Files\View('/' . $user);
+
//set config
$this->configMaxX = \OC_Config::getValue('preview_max_x', null);
$this->configMaxY = \OC_Config::getValue('preview_max_y', null);
@@ -75,13 +83,6 @@ class Preview {
$this->setMaxY($maxY);
$this->setScalingUp($scalingUp);
- //init fileviews
- if($user === ''){
- $user = \OC_User::getUser();
- }
- $this->fileView = new \OC\Files\View('/' . $user . '/' . $root);
- $this->userView = new \OC\Files\View('/' . $user);
-
$this->preview = null;
//check if there are preview backends
@@ -166,10 +167,21 @@ class Preview {
*/
public function setFile($file) {
$this->file = $file;
+ if ($file !== '') {
+ $this->mimetype = $this->fileView->getMimeType($this->file);
+ }
return $this;
}
/**
+ * @brief set mimetype explicitely
+ * @param string $mimetype
+ */
+ public function setMimetype($mimetype) {
+ $this->mimetype = $mimetype;
+ }
+
+ /**
* @brief set the the max width of the preview
* @param int $maxX
* @return $this
@@ -265,7 +277,7 @@ class Preview {
$fileInfo = $this->fileView->getFileInfo($file);
$fileId = $fileInfo['fileid'];
-
+
$previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/';
$this->userView->deleteAll($previewPath);
$this->userView->rmdir($previewPath);
@@ -274,7 +286,7 @@ class Preview {
/**
* @brief check if thumbnail or bigger version of thumbnail of file is cached
- * @return mixed (bool / string)
+ * @return mixed (bool / string)
* false if thumbnail does not exist
* path to thumbnail if thumbnail exists
*/
@@ -386,11 +398,10 @@ class Preview {
}
if(is_null($this->preview)) {
- $mimetype = $this->fileView->getMimeType($file);
$preview = null;
foreach(self::$providers as $supportedMimetype => $provider) {
- if(!preg_match($supportedMimetype, $mimetype)) {
+ if(!preg_match($supportedMimetype, $this->mimetype)) {
continue;
}
@@ -516,7 +527,7 @@ class Preview {
$cropY = 0;
$image->crop($cropX, $cropY, $x, $y);
-
+
$this->preview = $image;
return;
}
@@ -598,7 +609,7 @@ class Preview {
public static function post_write($args) {
self::post_delete($args);
}
-
+
public static function post_delete($args) {
$path = $args['path'];
if(substr($path, 0, 1) === '/') {
diff --git a/lib/private/repair.php b/lib/private/repair.php
new file mode 100644
index 00000000000..e9de3baa7ce
--- /dev/null
+++ b/lib/private/repair.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC;
+
+use OC\Hooks\BasicEmitter;
+
+class Repair extends BasicEmitter {
+ /**
+ * run a series of repair steps for common problems
+ * progress can be reported by emitting \OC\Repair::step events
+ */
+ public function run() {
+ $this->emit('\OC\Repair', 'step', array('No repair steps configured at the moment'));
+ }
+}
diff --git a/lib/private/request.php b/lib/private/request.php
index 7a75bf25208..b2afda35922 100755
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -142,17 +142,34 @@ class OC_Request {
$requestUri = '/' . ltrim($requestUri, '/');
}
+ // Remove the query string from REQUEST_URI
+ if ($pos = strpos($requestUri, '?')) {
+ $requestUri = substr($requestUri, 0, $pos);
+ }
+
$scriptName = $_SERVER['SCRIPT_NAME'];
- // in case uri and script name don't match we better throw an exception
- if (strpos($requestUri, $scriptName) !== 0) {
- throw new Exception("REQUEST_URI($requestUri) does not start with the SCRIPT_NAME($scriptName)");
+ $path_info = $requestUri;
+
+ // strip off the script name's dir and file name
+ list($path, $name) = \Sabre_DAV_URLUtil::splitPath($scriptName);
+ if (!empty($path)) {
+ if( $path === $path_info || strpos($path_info, $path.'/') === 0) {
+ $path_info = substr($path_info, strlen($path));
+ } else {
+ throw new Exception("The requested uri($requestUri) cannot be processed by the script '$scriptName')");
+ }
}
- $path_info = substr($requestUri, strlen($scriptName));
- // Remove the query string from REQUEST_URI
- if ($pos = strpos($path_info, '?')) {
- $path_info = substr($path_info, 0, $pos);
+ if (strpos($path_info, '/'.$name) === 0) {
+ $path_info = substr($path_info, strlen($name) + 1);
+ }
+ if (strpos($path_info, $name) === 0) {
+ $path_info = substr($path_info, strlen($name));
+ }
+ if($path_info === '/'){
+ return '';
+ } else {
+ return $path_info;
}
- return $path_info;
}
/**
diff --git a/lib/private/updater.php b/lib/private/updater.php
index a1b07c5a242..764a0f14120 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -37,7 +37,7 @@ class Updater extends BasicEmitter {
/**
* Check if a new version is available
- * @param string $updateUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
+ * @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
* @return array | bool
*/
public function check($updaterUrl) {
@@ -116,6 +116,10 @@ class Updater extends BasicEmitter {
\OC_App::checkAppsRequirements();
// load all apps to also upgrade enabled apps
\OC_App::loadApps();
+
+ $repair = new Repair();
+ $repair->run();
+
\OC_Config::setValue('maintenance', false);
$this->emit('\OC\Updater', 'maintenanceEnd');
}
diff --git a/lib/private/user.php b/lib/private/user.php
index 5bd36006750..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;
@@ -425,6 +425,22 @@ class OC_User {
}
/**
+ * @brief Check whether user can change his avatar
+ * @param string $uid The username
+ * @return bool
+ *
+ * Check whether a specified user can change his avatar
+ */
+ public static function canUserChangeAvatar($uid) {
+ $user = self::getManager()->get($uid);
+ if ($user) {
+ return $user->canChangeAvatar();
+ } else {
+ return false;
+ }
+ }
+
+ /**
* @brief Check whether user can change his password
* @param string $uid The username
* @return bool
diff --git a/lib/private/user/backend.php b/lib/private/user/backend.php
index e9be08e429c..02c93d13bdf 100644
--- a/lib/private/user/backend.php
+++ b/lib/private/user/backend.php
@@ -31,13 +31,13 @@ define('OC_USER_BACKEND_NOT_IMPLEMENTED', -501);
/**
* actions that user backends can define
*/
-define('OC_USER_BACKEND_CREATE_USER', 0x000001);
-define('OC_USER_BACKEND_SET_PASSWORD', 0x000010);
-define('OC_USER_BACKEND_CHECK_PASSWORD', 0x000100);
-define('OC_USER_BACKEND_GET_HOME', 0x001000);
-define('OC_USER_BACKEND_GET_DISPLAYNAME', 0x010000);
-define('OC_USER_BACKEND_SET_DISPLAYNAME', 0x100000);
-
+define('OC_USER_BACKEND_CREATE_USER', 0x0000001);
+define('OC_USER_BACKEND_SET_PASSWORD', 0x0000010);
+define('OC_USER_BACKEND_CHECK_PASSWORD', 0x0000100);
+define('OC_USER_BACKEND_GET_HOME', 0x0001000);
+define('OC_USER_BACKEND_GET_DISPLAYNAME', 0x0010000);
+define('OC_USER_BACKEND_SET_DISPLAYNAME', 0x0100000);
+define('OC_USER_BACKEND_PROVIDE_AVATAR', 0x1000000);
/**
* Abstract base class for user management. Provides methods for querying backend
@@ -54,6 +54,7 @@ abstract class OC_User_Backend implements OC_User_Interface {
OC_USER_BACKEND_GET_HOME => 'getHome',
OC_USER_BACKEND_GET_DISPLAYNAME => 'getDisplayName',
OC_USER_BACKEND_SET_DISPLAYNAME => 'setDisplayName',
+ OC_USER_BACKEND_PROVIDE_AVATAR => 'canChangeAvatar',
);
/**
diff --git a/lib/private/user/user.php b/lib/private/user/user.php
index e5f842944f1..e773473ec41 100644
--- a/lib/private/user/user.php
+++ b/lib/private/user/user.php
@@ -140,6 +140,18 @@ class User {
}
/**
+ * check if the backend allows the user to change his avatar on Personal page
+ *
+ * @return bool
+ */
+ public function canChangeAvatar() {
+ if($this->backend->implementsActions(\OC_USER_BACKEND_PROVIDE_AVATAR)) {
+ return $this->backend->canChangeAvatar($this->uid);
+ }
+ return true;
+ }
+
+ /**
* check if the backend supports changing passwords
*
* @return bool
diff --git a/lib/private/util.php b/lib/private/util.php
index b5c5546da35..38de07abc92 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -437,11 +437,11 @@ class OC_Util {
);
$webServerRestart = true;
}
- if(floatval(phpversion()) < 5.3) {
+ if(version_compare(phpversion(), '5.3.8', '<')) {
$errors[] = array(
- 'error'=>'PHP 5.3 is required.',
- 'hint'=>'Please ask your server administrator to update PHP to version 5.3 or higher.'
- .' PHP 5.2 is no longer supported by ownCloud and the PHP community.'
+ 'error'=>'PHP 5.3.8 or higher is required.',
+ 'hint'=>'Please ask your server administrator to update PHP to the latest version.'
+ .' Your PHP version is no longer supported by ownCloud and the PHP community.'
);
$webServerRestart = true;
}
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:
diff --git a/lib/public/contacts/imanager.php b/lib/public/contacts/imanager.php
index 3bfbca7be50..973d48be5ec 100644
--- a/lib/public/contacts/imanager.php
+++ b/lib/public/contacts/imanager.php
@@ -119,11 +119,15 @@ namespace OCP\Contacts {
function isEnabled();
/**
+ * Registers an address book
+ *
* @param \OCP\IAddressBook $address_book
*/
function registerAddressBook(\OCP\IAddressBook $address_book);
/**
+ * Unregisters an address book
+ *
* @param \OCP\IAddressBook $address_book
*/
function unregisterAddressBook(\OCP\IAddressBook $address_book);
diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php
index 36296a59850..b958d2d03f4 100644
--- a/lib/public/iservercontainer.php
+++ b/lib/public/iservercontainer.php
@@ -100,11 +100,15 @@ interface IServerContainer {
function getUserSession();
/**
+ * Returns the navigation manager
+ *
* @return \OCP\INavigationManager
*/
function getNavigationManager();
/**
+ * Returns the config manager
+ *
* @return \OCP\IConfig
*/
function getConfig();
@@ -117,11 +121,15 @@ interface IServerContainer {
function getL10N($app);
/**
+ * Returns the URL generator
+ *
* @return \OCP\IURLGenerator
*/
function getURLGenerator();
/**
+ * Returns the Helper
+ *
* @return \OCP\IHelper
*/
function getHelper();
@@ -155,7 +163,8 @@ interface IServerContainer {
function getDatabaseConnection();
/**
- * @brief Returns an avatar manager, used for avatar functionality
+ * Returns an avatar manager, used for avatar functionality
+ *
* @return \OCP\IAvatarManager
*/
function getAvatarManager();
diff --git a/lib/public/share.php b/lib/public/share.php
index 86b6cfa46ad..6dbcd5b67bf 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -244,7 +244,9 @@ class Share {
* Get the items of item type shared with the current user
* @param string Item type
* @param int Format (optional) Format type must be defined by the backend
+ * @param mixed Parameters (optional)
* @param int Number of items to return (optional) Returns all by default
+ * @param bool include collections (optional)
* @return Return depends on format
*/
public static function getItemsSharedWith($itemType, $format = self::FORMAT_NONE,
@@ -258,6 +260,8 @@ class Share {
* @param string $itemType
* @param string $itemTarget
* @param int $format (optional) Format type must be defined by the backend
+ * @param mixed Parameters (optional)
+ * @param bool include collections (optional)
* @return Return depends on format
*/
public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE,
@@ -956,6 +960,7 @@ class Share {
* @param mixed Parameters to pass to formatItems()
* @param int Number of items to return, -1 to return all matches (optional)
* @param bool Include collection item types (optional)
+ * @param bool TODO (optional)
* @return mixed
*
* See public functions getItem(s)... for parameter usage
@@ -1356,8 +1361,11 @@ class Share {
* @param string Item source
* @param int SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
* @param string User or group the item is being shared with
+ * @param string User that is the owner of shared item
* @param int CRUDS permissions
* @param bool|array Parent folder target (optional)
+ * @param string token (optional)
+ * @param string name of the source item (optional)
* @return bool Returns true on success or false on failure
*/
private static function put($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
@@ -1595,6 +1603,7 @@ class Share {
* @param string Item source
* @param int SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
* @param string User or group the item is being shared with
+ * @param string User that is the owner of shared item
* @param string The suggested target originating from a reshare (optional)
* @param int The id of the parent group share (optional)
* @return string Item target
@@ -1782,6 +1791,7 @@ class Share {
*/
/**
+ * Function that is called after a user is deleted. Cleans up the shares of that user.
* @param array arguments
*/
public static function post_deleteUser($arguments) {
@@ -1798,6 +1808,8 @@ class Share {
}
/**
+ * Function that is called after a user is added to a group.
+ * TODO what does it do?
* @param array arguments
*/
public static function post_addToGroup($arguments) {
@@ -1831,6 +1843,7 @@ class Share {
}
/**
+ * Function that is called after a user is removed from a group. Shares are cleaned up.
* @param array arguments
*/
public static function post_removeFromGroup($arguments) {
@@ -1850,6 +1863,7 @@ class Share {
}
/**
+ * Function that is called after a group is removed. Cleans up the shares to that group.
* @param array arguments
*/
public static function post_deleteGroup($arguments) {
@@ -1896,7 +1910,7 @@ interface Share_Backend {
* Converts the shared item sources back into the item in the specified format
* @param array Shared items
* @param int Format
- * @return ?
+ * @return TODO
*
* The items array is a 3-dimensional array with the item_source as the
* first key and the share id as the second key to an array with the share
@@ -1925,6 +1939,8 @@ interface Share_Backend_File_Dependent extends Share_Backend {
/**
* Get the file path of the item
+ * @param string Item source
+ * @param string User that is the owner of shared item
*/
public function getFilePath($itemSource, $uidOwner);