summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--3rdparty/Sabre/DAV/Client.php9
-rw-r--r--apps/contacts/js/contacts.js2
-rw-r--r--apps/contacts/lib/addressbook.php2
-rw-r--r--apps/contacts/lib/app.php2
-rw-r--r--apps/files_external/lib/webdav.php5
-rw-r--r--apps/files_external/templates/settings.php2
-rw-r--r--apps/files_versions/appinfo/app.php4
-rw-r--r--apps/files_versions/lib/hooks.php37
-rw-r--r--apps/files_versions/lib/versions.php42
-rw-r--r--lib/user.php16
10 files changed, 69 insertions, 52 deletions
diff --git a/3rdparty/Sabre/DAV/Client.php b/3rdparty/Sabre/DAV/Client.php
index 23bd7c05394..d257c86da10 100644
--- a/3rdparty/Sabre/DAV/Client.php
+++ b/3rdparty/Sabre/DAV/Client.php
@@ -22,6 +22,7 @@ class Sabre_DAV_Client {
protected $userName;
protected $password;
protected $proxy;
+ protected $capath;
/**
* Constructor
@@ -49,6 +50,11 @@ class Sabre_DAV_Client {
'proxy'
);
+ $this->capath = '';
+ if (isset($settings['capath'])) {
+ $this->capath = $settings['capath'];
+ }
+
foreach($validSettings as $validSetting) {
if (isset($settings[$validSetting])) {
$this->$validSetting = $settings[$validSetting];
@@ -249,9 +255,12 @@ class Sabre_DAV_Client {
// Automatically follow redirects
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 5,
+ CURLOPT_SSL_VERIFYPEER => true,
//CURLOPT_SSL_VERIFYPEER => false,
);
+ if ($this->capath != '') $curlSettings[CURLOPT_CAPATH] = $this->capath;
+
switch ($method) {
case 'PUT':
$curlSettings[CURLOPT_PUT] = true;
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 25fc122bf30..39ef14e5062 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -327,7 +327,7 @@ Contacts={
// Make sure proper DOM is loaded.
if(!$('#card')[0] && newid) {
- $.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{},function(jsondata){
+ $.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{requesttoken:requesttoken},function(jsondata){
if(jsondata.status == 'success'){
$('#rightcontent').html(jsondata.data.page).ready(function() {
Contacts.UI.loadHandlers();
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index f33f4a204e7..40675efd8b4 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -41,7 +41,7 @@ class OC_Contacts_Addressbook{
/**
* @brief Returns the list of addressbooks for a specific user.
* @param string $uid
- * @param boolean $active Only return calendars with this $active state, default(=false) is don't care
+ * @param boolean $active Only return addressbooks with this $active state, default(=false) is don't care
* @return array or false.
*/
public static function all($uid, $active=false){
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php
index b3a7abd28bc..25461877e62 100644
--- a/apps/contacts/lib/app.php
+++ b/apps/contacts/lib/app.php
@@ -164,7 +164,7 @@ class OC_Contacts_App {
* @brief returns the default categories of ownCloud
* @return (array) $categories
*/
- protected static function getDefaultCategories(){
+ public static function getDefaultCategories(){
return array(
(string)self::$l10n->t('Birthday'),
(string)self::$l10n->t('Business'),
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index dda8afe9f2a..32dd26ae6c3 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -36,10 +36,15 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->root.='/';
}
+ $capath = '';
+ if($caview = \OCP\Files::getStorage('files_external')) {
+ $capath=\OCP\Config::getSystemValue('datadirectory').$caview->getAbsolutePath("");
+ }
$settings = array(
'baseUri' => $this->createBaseUri(),
'userName' => $this->user,
'password' => $this->password,
+ 'capath' => $capath,
);
$this->client = new Sabre_DAV_Client($settings);
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php
index dccc0913f23..8f8fe8d527f 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -81,7 +81,7 @@
</table>
<br />
- <?php if (!$_['isAdminPage']): ?>
+ <?php if (!$_['isAdminPage'] && false): // disabled until sabredav can handle uploaded ca certs ?>
<table id="sslCertificate" data-admin='<?php echo json_encode($_['isAdminPage']); ?>'>
<thead>
<tr>
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index dba612e4b79..9ac7f6d5cde 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -12,5 +12,5 @@ OCP\Util::addscript('files_versions', 'versions');
// Listen to write signals
OCP\Util::connectHook('OC_Filesystem', 'post_write', "OCA_Versions\Hooks", "write_hook");
// Listen to delete and rename signals
-OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA_Versions\Storage", "removeVersions");
-OCP\Util::connectHook('OC_Filesystem', 'rename', "OCA_Versions\Storage", "renameVersions"); \ No newline at end of file
+OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA_Versions\Hooks", "remove_hook");
+OCP\Util::connectHook('OC_Filesystem', 'rename', "OCA_Versions\Hooks", "rename_hook"); \ No newline at end of file
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
index 8a746705329..b43fdb9fd33 100644
--- a/apps/files_versions/lib/hooks.php
+++ b/apps/files_versions/lib/hooks.php
@@ -30,6 +30,43 @@ class Hooks {
}
}
+ /**
+ * @brief Erase versions of deleted file
+ * @param array
+ *
+ * This function is connected to the delete signal of OC_Filesystem
+ * cleanup the versions directory if the actual file gets deleted
+ */
+ public static function remove_hook($params) {
+ $rel_path = $params['path'];
+ $abs_path = \OCP\Config::getSystemValue('datadirectory').'/'.\OCP\User::getUser()."/versions".$rel_path.'.v';
+ if(Storage::isversioned($rel_path)) {
+ $versions = Storage::getVersions($rel_path);
+ foreach ($versions as $v){
+ unlink($abs_path . $v['version']);
+ }
+ }
+ }
+
+ /**
+ * @brief rename/move versions of renamed/moved files
+ * @param array with oldpath and newpath
+ *
+ * This function is connected to the rename signal of OC_Filesystem and adjust the name and location
+ * of the stored versions along the actual file
+ */
+ public static function rename_hook($params) {
+ $rel_oldpath = $params['oldpath'];
+ $abs_oldpath = \OCP\Config::getSystemValue('datadirectory').'/'.\OCP\User::getUser()."/versions".$rel_oldpath.'.v';
+ $abs_newpath = \OCP\Config::getSystemValue('datadirectory').'/'.\OCP\User::getUser()."/versions".$params['newpath'].'.v';
+ if(Storage::isversioned($rel_oldpath)) {
+ $versions = Storage::getVersions($rel_oldpath);
+ foreach ($versions as $v){
+ rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
+ }
+ }
+ }
+
}
?>
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index fb78e0a56c0..5611e538ad8 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -147,6 +147,9 @@ class Storage {
public static function rollback($filename,$revision) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ $users_view = \OCP\Files::getStorage("files_versions");
+ $users_view->chroot(\OCP\User::getUser().'/');
+
if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
$pos = strpos($source, '/files', 1);
$uid = substr($source, 1, $pos - 1);
@@ -159,7 +162,7 @@ class Storage {
$filesfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/files';
// rollback
- if ( @copy($versionsFolderName.'/'.$filename.'.v'.$revision,$filesfoldername.'/'.$filename) ) {
+ if( @$users_view->copy('versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
return true;
@@ -323,41 +326,4 @@ class Storage {
return $this->view->deleteAll( $dir, true );
}
-
- /**
- * @brief Erase versions of deleted file
- * @param array
- *
- * This function is connected to the delete signal of OC_Filesystem
- * cleanup the versions directory if the actual file gets deleted
- */
- public static function removeVersions($params) {
- $rel_path = $params['path'];
- $abs_path = \OCP\Config::getSystemValue('datadirectory').'/'.\OCP\User::getUser()."/versions".$rel_path.'.v';
- if(Storage::isversioned($rel_path)) {
- $versions = Storage::getVersions($rel_path);
- foreach ($versions as $v){
- unlink($abs_path . $v['version']);
- }
- }
- }
-
- /**
- * @brief rename/move versions of renamed/moved files
- * @param array with oldpath and newpath
- *
- * This function is connected to the rename signal of OC_Filesystem and adjust the name and location
- * of the stored versions along the actual file
- */
- public static function renameVersions($params) {
- $rel_oldpath = $params['oldpath'];
- $abs_oldpath = \OCP\Config::getSystemValue('datadirectory').'/'.\OCP\User::getUser()."/versions".$rel_oldpath.'.v';
- $abs_newpath = \OCP\Config::getSystemValue('datadirectory').'/'.\OCP\User::getUser()."/versions".$params['newpath'].'.v';
- if(Storage::isversioned($rel_oldpath)) {
- $versions = Storage::getVersions($rel_oldpath);
- foreach ($versions as $v){
- rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
- }
- }
- }
}
diff --git a/lib/user.php b/lib/user.php
index 23b88aa1d06..d02c1208a8d 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -240,17 +240,13 @@ class OC_User {
* Checks if the user is logged in
*/
public static function isLoggedIn(){
- static $is_login_checked = null;
- if (!is_null($is_login_checked)) {
- return $is_login_checked;
- }
if( isset($_SESSION['user_id']) AND $_SESSION['user_id']) {
OC_App::loadApps(array('authentication'));
if (self::userExists($_SESSION['user_id']) ){
- return $is_login_checked = true;
+ return true;
}
}
- return $is_login_checked = false;
+ return false;
}
/**
@@ -349,13 +345,17 @@ class OC_User {
* @return boolean
*/
public static function userExists($uid){
+ static $user_exists_checked = null;
+ if (!is_null($user_exists_checked)) {
+ return $user_exists_checked;
+ }
foreach(self::$_usedBackends as $backend){
$result=$backend->userExists($uid);
if($result===true){
- return true;
+ return $user_exists_checked = true;
}
}
- return false;
+ return $user_exists_checked = false;
}
/**