summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/admin_dependencies_chk/appinfo/app.php5
-rw-r--r--apps/bookmarks/appinfo/app.php2
-rw-r--r--apps/calendar/ajax/import/import.php39
-rw-r--r--apps/calendar/appinfo/app.php4
-rw-r--r--apps/calendar/templates/part.choosecalendar.rowfields.php2
-rw-r--r--apps/calendar/templates/part.choosecalendar.rowfields.shared.php2
-rw-r--r--apps/contacts/appinfo/app.php5
-rw-r--r--apps/external/appinfo/app.php2
-rw-r--r--apps/files/ajax/timezone.php2
-rw-r--r--apps/files/appinfo/app.php1
-rw-r--r--apps/files/index.php4
-rw-r--r--apps/files/js/fileactions.js2
-rw-r--r--apps/files/js/filelist.js4
-rw-r--r--apps/files_archive/js/archive.js4
-rw-r--r--apps/files_encryption/lib/crypt.php27
-rw-r--r--apps/files_sharing/ajax/email.php4
-rw-r--r--apps/files_versions/appinfo/app.php8
-rw-r--r--apps/files_versions/versions.php20
-rw-r--r--apps/gallery/appinfo/app.php5
-rw-r--r--apps/media/appinfo/app.php2
-rw-r--r--apps/remoteStorage/appinfo/app.php4
-rw-r--r--apps/tasks/appinfo/app.php5
-rw-r--r--apps/tasks/index.php1
-rw-r--r--apps/user_ldap/lib_ldap.php19
-rw-r--r--apps/user_openid/phpmyid.php2
-rw-r--r--apps/user_openid/user_openid.php4
-rw-r--r--apps/user_webfinger/appinfo/app.php4
27 files changed, 70 insertions, 113 deletions
diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php
index 72d368a085e..62b26342d23 100644
--- a/apps/admin_dependencies_chk/appinfo/app.php
+++ b/apps/admin_dependencies_chk/appinfo/app.php
@@ -1,9 +1,4 @@
<?php
$l=OC_L10N::get('admin_dependencies_chk');
-OCP\App::register( array(
- 'order' => 14,
- 'id' => 'admin_dependencies_chk',
- 'name' => 'Owncloud Install Info' ));
-
OCP\App::registerAdmin('admin_dependencies_chk','settings');
diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php
index 8a8f443891c..f4bca9df700 100644
--- a/apps/bookmarks/appinfo/app.php
+++ b/apps/bookmarks/appinfo/app.php
@@ -10,8 +10,6 @@
OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php';
OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php';
-OCP\App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
-
$l = new OC_l10n('bookmarks');
OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks')));
diff --git a/apps/calendar/ajax/import/import.php b/apps/calendar/ajax/import/import.php
index 202af1eb46e..904c07c52e7 100644
--- a/apps/calendar/ajax/import/import.php
+++ b/apps/calendar/ajax/import/import.php
@@ -7,16 +7,23 @@
*/
//check for calendar rights or create new one
ob_start();
+
OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
+
$nl="\r\n";
$comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true);
+
$progressfile = 'import_tmp/' . md5(session_id()) . '.txt';
-if(is_writable('import_tmp/')){
- $progressfopen = fopen($progressfile, 'w');
- fwrite($progressfopen, '10');
- fclose($progressfopen);
+
+function writeProgress($pct) {
+ if(is_writable('import_tmp/')){
+ $progressfopen = fopen($progressfile, 'w');
+ fwrite($progressfopen, $pct);
+ fclose($progressfopen);
+ }
}
+writeProgress('10');
$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']);
if($_POST['method'] == 'new'){
$id = OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(), $_POST['calname']);
@@ -29,20 +36,12 @@ if($_POST['method'] == 'new'){
}
$id = $_POST['id'];
}
-if(is_writable('import_tmp/')){
- $progressfopen = fopen($progressfile, 'w');
- fwrite($progressfopen, '20');
- fclose($progressfopen);
-}
+writeProgress('20');
// normalize the newlines
$file = str_replace(array("\r","\n\n"), array("\n","\n"), $file);
$lines = explode("\n", $file);
unset($file);
-if(is_writable('import_tmp/')){
- $progressfopen = fopen($progressfile, 'w');
- fwrite($progressfopen, '30');
- fclose($progressfopen);
-}
+writeProgress('30');
// analyze the file, group components by uid, and keep refs to originating calendar object
// $cals is array calendar objects, keys are 1st line# $cal, ie array( $cal => $caldata )
// $caldata is array( 'first' => 1st component line#, 'last' => last comp line#, 'end' => end line# )
@@ -86,11 +85,7 @@ foreach($lines as $line) {
$i++;
}
// import the calendar
-if(is_writable('import_tmp/')){
- $progressfopen = fopen($progressfile, 'w');
- fwrite($progressfopen, '60');
- fclose($progressfopen);
-}
+writeProgress('60');
foreach($uids as $uid) {
$prefix=$suffix=$content=array();
@@ -117,11 +112,7 @@ foreach($uids as $uid) {
}
}
// finished import
-if(is_writable('import_tmp/')){
- $progressfopen = fopen($progressfile, 'w');
- fwrite($progressfopen, '100');
- fclose($progressfopen);
-}
+writeProgress('100');
sleep(3);
if(is_writable('import_tmp/')){
unlink($progressfile);
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php
index 73480522eaf..253844c1f08 100644
--- a/apps/calendar/appinfo/app.php
+++ b/apps/calendar/appinfo/app.php
@@ -12,10 +12,6 @@ OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'delete
OCP\Util::addscript('calendar','loader');
OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min");
OCP\Util::addStyle("3rdparty", "chosen/chosen");
-OCP\App::register( array(
- 'order' => 10,
- 'id' => 'calendar',
- 'name' => 'Calendar' ));
OCP\App::addNavigationEntry( array(
'id' => 'calendar_index',
'order' => 10,
diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php
index 965523f847a..bad268897bf 100644
--- a/apps/calendar/templates/part.choosecalendar.rowfields.php
+++ b/apps/calendar/templates/part.choosecalendar.rowfields.php
@@ -1,6 +1,6 @@
<?php
echo '<td width="20px"><input id="active_' . $_['calendar']['id'] . '" type="checkbox" onClick="Calendar.UI.Calendar.activation(this,' . $_['calendar']['id'] . ')"' . ($_['calendar']['active'] ? ' checked="checked"' : '') . '></td>';
-echo '<td id="' . OCP\USER::getUser() . '_' . $_['calendar']['id'] . '"><label for="active_' . $_['calendar']['id'] . '">' . $_['calendar']['displayname'] . '</label></td>';
+echo '<td id="' . OCP\USER::getUser() . '_' . $_['calendar']['id'] . '"><label for="active_' . $_['calendar']['id'] . '">' . htmlspecialchars($_['calendar']['displayname']) . '</label></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.Share.dropdown(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['id'] . '\');" title="' . $l->t("Share Calendar") . '" class="action"><img class="svg action" src="' . ((!$_['shared']) ? OCP\Util::imagePath('core', 'actions/share.svg') : OCP\Util::imagePath('core', 'actions/shared.svg')) . '"></a></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.showCalDAVUrl(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['uri'] . '\');" title="' . $l->t("CalDav Link") . '" class="action"><img class="svg action" src="'.OCP\Util::imagePath('core', 'actions/public.svg').'"></a></td>';
echo '<td width="20px"><a href="?app=calendar&getfile=export.php?calid=' . $_['calendar']['id'] . '" title="' . $l->t('Download') . '" class="action"><img class="svg action" src="'.OCP\Util::imagePath('core', 'actions/download.svg').'"></a></td>';
diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.shared.php b/apps/calendar/templates/part.choosecalendar.rowfields.shared.php
index a23266da0c3..6a212858a21 100644
--- a/apps/calendar/templates/part.choosecalendar.rowfields.shared.php
+++ b/apps/calendar/templates/part.choosecalendar.rowfields.shared.php
@@ -1,4 +1,4 @@
<?php
echo '<td width="20px"><input id="active_' . $_['share']['owner'] . '_' . $_['share']['calendar']['id'] . '" type="checkbox" onClick="Calendar.UI.Share.activation(this,\'' . $_['share']['owner'] . '\',' . $_['share']['calendar']['id'] . ')"' . ($_['share']['active'] ? ' checked="checked"' : '') . '></td>';
-echo '<td><label for="active_' . $_['share']['owner'] . '_' . $_['share']['calendar']['id'] . '">' . $_['share']['calendar']['displayname'] . '</label></td>';
+echo '<td><label for="active_' . $_['share']['owner'] . '_' . $_['share']['calendar']['id'] . '">' . htmlspecialchars($_['share']['calendar']['displayname']) . '</label></td>';
echo '<td style="font-style: italic;">' . $l->t('shared with you by') . ' ' . $_['share']['owner'] . '</td>'; \ No newline at end of file
diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php
index 20d97697bf4..7a04ec7ff5e 100644
--- a/apps/contacts/appinfo/app.php
+++ b/apps/contacts/appinfo/app.php
@@ -9,11 +9,6 @@ OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'delete
OCP\Util::connectHook('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents');
OCP\Util::connectHook('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources');
-OCP\App::register( array(
- 'order' => 10,
- 'id' => 'contacts',
- 'name' => 'Contacts' ));
-
OCP\App::addNavigationEntry( array(
'id' => 'contacts_index',
'order' => 10,
diff --git a/apps/external/appinfo/app.php b/apps/external/appinfo/app.php
index ee5437782cd..1a02f3a1be8 100644
--- a/apps/external/appinfo/app.php
+++ b/apps/external/appinfo/app.php
@@ -26,8 +26,6 @@ OCP\Util::addStyle( 'external', 'style');
OCP\App::registerAdmin('external', 'settings');
-OCP\App::register(array('order' => 70, 'id' => 'external', 'name' => 'External'));
-
$sites = OC_External::getSites();
for ($i = 0; $i < sizeof($sites); $i++) {
OCP\App::addNavigationEntry(
diff --git a/apps/files/ajax/timezone.php b/apps/files/ajax/timezone.php
index 8e1d2aa1ec1..cafb5074ece 100644
--- a/apps/files/ajax/timezone.php
+++ b/apps/files/ajax/timezone.php
@@ -1,6 +1,6 @@
<?php
// FIXME: this should start a secure session if forcessl is enabled
// see lib/base.php for an example
- session_start();
+ //session_start();
$_SESSION['timezone'] = $_GET['time'];
?>
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index 5c0d3c8db83..db3b213ab8d 100644
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -1,7 +1,6 @@
<?php
$l=OC_L10N::get('files');
-OCP\App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
OCP\App::registerAdmin('files','admin');
OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
diff --git a/apps/files/index.php b/apps/files/index.php
index a2fae12d945..60a3836cb59 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -74,11 +74,11 @@ foreach( explode( '/', $dir ) as $i ){
// make breadcrumb und filelist markup
$list = new OCP\Template( 'files', 'part.list', '' );
$list->assign( 'files', $files );
-$list->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'?dir=');
+$list->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'&dir=');
$list->assign( 'downloadURL', OCP\Util::linkTo('files', 'download.php').'?file=');
$breadcrumbNav = new OCP\Template( 'files', 'part.breadcrumb', '' );
$breadcrumbNav->assign( 'breadcrumb', $breadcrumb );
-$breadcrumbNav->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'?dir=');
+$breadcrumbNav->assign( 'baseURL', OCP\Util::linkTo('files', 'index.php').'&dir=');
$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 68268a7d3a9..19978b61a7d 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -161,7 +161,7 @@ FileActions.register('all','Rename',function(){return OC.imagePath('core','actio
});
FileActions.register('dir','Open','',function(filename){
- window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+ window.location=OC.linkTo('files', 'index.php') + '&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
});
FileActions.setDefault('dir','Open');
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 31fb5f892e4..e6a9a6883af 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -41,7 +41,7 @@ FileList={
html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name});
td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
td.append('<input type="checkbox" />');
- var link_elem = $('<a></a>').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
+ var link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"&dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
link_elem.append($('<span></span>').addClass('nametext').text(name));
link_elem.append($('<span></span>').attr({'class': 'uploadtext', 'currentUploads': 0}));
td.append(link_elem);
@@ -56,7 +56,7 @@ FileList={
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
td = $('<td></td>').attr({ "class": "filesize", "title": humanFileSize(size), "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'}).text(simpleSize);
html.append(td);
-
+
td = $('<td></td>').attr({ "class": "date" });
td.append($('<span></span>').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) ));
html.append(td);
diff --git a/apps/files_archive/js/archive.js b/apps/files_archive/js/archive.js
index 531eb61c01a..9fb9853e299 100644
--- a/apps/files_archive/js/archive.js
+++ b/apps/files_archive/js/archive.js
@@ -8,11 +8,11 @@
$(document).ready(function() {
if(typeof FileActions!=='undefined'){
FileActions.register('application/zip','Open','',function(filename){
- window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+ window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
});
FileActions.setDefault('application/zip','Open');
FileActions.register('application/x-gzip','Open','',function(filename){
- window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+ window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
});
FileActions.setDefault('application/x-gzip','Open');
}
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index ec27900cbc6..d2b8ad145ae 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -43,16 +43,23 @@ class OC_Crypt {
self::init($params['uid'],$params['password']);
}
- public static function init($login,$password) {
- $view=new OC_FilesystemView('/'.$login);
- OC_FileProxy::$enabled=false;
- if(!$view->file_exists('/encryption.key')){// does key exist?
- OC_Crypt::createkey($login,$password);
- }
- $key=$view->file_get_contents('/encryption.key');
- OC_FileProxy::$enabled=true;
- $_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
- }
+ public static function init($login,$password) {
+ $view1=new OC_FilesystemView('/');
+ if(!$view1->file_exists('/'.$login)){
+ $view1->mkdir('/'.$login);
+ }
+
+ $view=new OC_FilesystemView('/'.$login);
+
+ OC_FileProxy::$enabled=false;
+ if(!$view->file_exists('/encryption.key')){// does key exist?
+ OC_Crypt::createkey($login,$password);
+ }
+ $key=$view->file_get_contents('/encryption.key');
+ OC_FileProxy::$enabled=true;
+ $_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
+ }
+
/**
* get the blowfish encryption handeler for a key
diff --git a/apps/files_sharing/ajax/email.php b/apps/files_sharing/ajax/email.php
index 163683cd0e3..523c3d2078b 100644
--- a/apps/files_sharing/ajax/email.php
+++ b/apps/files_sharing/ajax/email.php
@@ -7,7 +7,7 @@ $type = (strpos($_POST['file'], '.') === false) ? 'folder' : 'file';
$subject = $user.' shared a '.$type.' with you';
$link = $_POST['link'];
$text = $user.' shared the '.$type.' '.$_POST['file'].' with you. It is available for download here: '.$link;
-$fromaddress = OCP\Config::getUserValue($user, 'settings', 'email', 'sharing-noreply@'.$_SERVER['HTTP_HOST']);
+$fromaddress = OCP\Config::getUserValue($user, 'settings', 'email', 'sharing-noreply@'.OCP\Util::getServerHost());
OC_Mail::send($_POST['toaddress'], $_POST['toaddress'], $subject, $text, $fromaddress, $user);
-?> \ No newline at end of file
+?>
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index 457c5125353..49f1573f7c2 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -2,14 +2,8 @@
require_once('apps/files_versions/versions.php');
-// Add an entry in the app list
-OCP\App::register( array(
- 'order' => 10,
- 'id' => 'files_versions',
- 'name' => 'Versioning' ));
-
OCP\App::registerAdmin('files_versions', 'settings');
OCP\Util::addscript('files_versions', 'versions');
// Listen to write signals
-OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, "OCA_Versions\Storage", "write_hook"); \ No newline at end of file
+OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, "OCA_Versions\Storage", "write_hook");
diff --git a/apps/files_versions/versions.php b/apps/files_versions/versions.php
index 8a88808f548..f39b5a7f4eb 100644
--- a/apps/files_versions/versions.php
+++ b/apps/files_versions/versions.php
@@ -81,7 +81,7 @@ class Storage {
Storage::init();
// check if filename is a directory
- if(is_dir($filesfoldername.$filename)){
+ if(is_dir($filesfoldername.'/'.$filename)){
return false;
}
@@ -96,14 +96,14 @@ class Storage {
}
// check filesize
- if(filesize($filesfoldername.$filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)){
+ if(filesize($filesfoldername.'/'.$filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)){
return false;
}
// check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
if ($uid == \OCP\User::getUser()) {
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
sort($matches);
$parts=explode('.v',end($matches));
if((end($parts)+Storage::DEFAULTMININTERVAL)>time()){
@@ -114,10 +114,10 @@ class Storage {
// create all parent folders
$info=pathinfo($filename);
- @mkdir($versionsfoldername.$info['dirname'],0700,true);
+ if(!file_exists($versionsfoldername.'/'.$info['dirname'])) mkdir($versionsfoldername.'/'.$info['dirname'],0700,true);
// store a new version of a file
- copy($filesfoldername.$filename,$versionsfoldername.$filename.'.v'.time());
+ copy($filesfoldername.'/'.$filename,$versionsfoldername.'/'.$filename.'.v'.time());
// expire old revisions
Storage::expire($filename);
@@ -143,7 +143,7 @@ class Storage {
$filesfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/files';
// rollback
- if ( @copy($versionsfoldername.$filename.'.v'.$revision,$filesfoldername.$filename) ) {
+ if ( @copy($versionsfoldername.'/'.$filename.'.v'.$revision,$filesfoldername.'/'.$filename) ) {
return true;
@@ -172,7 +172,7 @@ class Storage {
$versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
// check for old versions
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
if(count($matches)>1){
return true;
}else{
@@ -201,7 +201,7 @@ class Storage {
$versions=array();
// fetch for old versions
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
sort($matches);
foreach($matches as $ma) {
$parts=explode('.v',$ma);
@@ -238,14 +238,14 @@ class Storage {
$versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
// check for old versions
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
if(count($matches)>\OCP\Config::getSystemValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS)){
$numbertodelete=count($matches-\OCP\Config::getSystemValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS));
// delete old versions of a file
$deleteitems=array_slice($matches,0,$numbertodelete);
foreach($deleteitems as $de){
- unlink($versionsfoldername.$filename.'.v'.$de);
+ unlink($versionsfoldername.'/'.$filename.'.v'.$de);
}
}
}
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php
index 878da48698a..e1db33eb314 100644
--- a/apps/gallery/appinfo/app.php
+++ b/apps/gallery/appinfo/app.php
@@ -29,11 +29,6 @@ OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'apps/gallery/lib/hooks_handlers.p
$l = OC_L10N::get('gallery');
-OCP\App::register(array(
- 'order' => 20,
- 'id' => 'gallery',
- 'name' => 'Pictures'));
-
OCP\App::addNavigationEntry( array(
'id' => 'gallery_index',
'order' => 20,
diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php
index d6a09c48059..869bc344020 100644
--- a/apps/media/appinfo/app.php
+++ b/apps/media/appinfo/app.php
@@ -29,8 +29,6 @@ require_once('apps/media/lib_scanner.php');
OCP\Util::addscript('media','loader');
OCP\App::registerPersonal('media','settings');
-OCP\App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
-
OCP\App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
OC_Search::registerProvider('OC_MediaSearchProvider');
diff --git a/apps/remoteStorage/appinfo/app.php b/apps/remoteStorage/appinfo/app.php
index 14b8a3d11df..c278fd73056 100644
--- a/apps/remoteStorage/appinfo/app.php
+++ b/apps/remoteStorage/appinfo/app.php
@@ -1,6 +1,2 @@
<?php
-OCP\App::register( array(
- 'order' => 10,
- 'id' => 'remoteStorage',
- 'name' => 'remoteStorage compatibility' ));
OCP\App::registerPersonal('remoteStorage','settings');
diff --git a/apps/tasks/appinfo/app.php b/apps/tasks/appinfo/app.php
index f346e2aa4c0..e7c82d6f247 100644
--- a/apps/tasks/appinfo/app.php
+++ b/apps/tasks/appinfo/app.php
@@ -3,11 +3,6 @@ $l=new OC_L10N('tasks');
OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php';
OC::$CLASSPATH['OC_Task_App'] = 'apps/tasks/lib/app.php';
-OCP\App::register( array(
- 'order' => 11,
- 'id' => 'tasks',
- 'name' => 'Tasks' ));
-
OCP\App::addNavigationEntry( array(
'id' => 'tasks_index',
'order' => 11,
diff --git a/apps/tasks/index.php b/apps/tasks/index.php
index 5e17ca454ec..4ff304a5607 100644
--- a/apps/tasks/index.php
+++ b/apps/tasks/index.php
@@ -26,7 +26,6 @@ OCP\Util::addScript('','oc-vcategories');
OCP\App::setActiveNavigationEntry('tasks_index');
$categories = OC_Calendar_App::getCategoryOptions();
-$l10n = new OC_L10N('tasks');
$priority_options = OC_Task_App::getPriorityOptions();
$output = new OCP\Template('tasks', 'tasks', 'user');
$output->assign('priority_options', $priority_options);
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index 5cd7e0241bf..b900a67ec31 100644
--- a/apps/user_ldap/lib_ldap.php
+++ b/apps/user_ldap/lib_ldap.php
@@ -366,19 +366,24 @@ class OC_LDAP {
$table = self::getMapTable($isUser);
$dn = self::sanitizeDN($dn);
- $sqliteAdjustment = '';
+ $sqlAdjustment = '';
$dbtype = OCP\Config::getSystemValue('dbtype');
- if(($dbtype == 'sqlite') || ($dbtype == 'sqlite3')) {
- $sqliteAdjustment = 'OR';
+ if($dbtype == 'mysql') {
+ $sqlAdjustment = 'FROM dual';
}
$insert = OCP\DB::prepare('
- INSERT '.$sqliteAdjustment.' IGNORE INTO '.$table.'
- (ldap_dn, owncloud_name)
- VALUES (?,?)
+ INSERT INTO '.$table.' (ldap_dn, owncloud_name)
+ SELECT ?,?
+ '.$sqlAdjustment.'
+ WHERE NOT EXISTS (
+ SELECT 1
+ FROM '.$table.'
+ WHERE ldap_dn = ?
+ AND owncloud_name = ? )
');
- $res = $insert->execute(array($dn, $ocname));
+ $res = $insert->execute(array($dn, $ocname, $dn, $ocname));
return !OCP\DB::isError($res);
}
diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php
index 137daa485a9..5aaab642856 100644
--- a/apps/user_openid/phpmyid.php
+++ b/apps/user_openid/phpmyid.php
@@ -1624,7 +1624,7 @@ if (! array_key_exists('idp_url', $profile))
//Determine the requested URL - DO NOT OVERRIDE
$profile['req_url'] = sprintf("%s://%s%s",
$proto,
- $_SERVER['HTTP_HOST'],
+ OCP\Util::getServerHost(),
// $port,//host already includes the path
$_SERVER["REQUEST_URI"]);
diff --git a/apps/user_openid/user_openid.php b/apps/user_openid/user_openid.php
index 8deb42f68c8..3267db3fa0f 100644
--- a/apps/user_openid/user_openid.php
+++ b/apps/user_openid/user_openid.php
@@ -39,9 +39,9 @@ class OC_USER_OPENID extends OC_User_Backend {
// Get identity from user and redirect browser to OpenID Server
$openid = new SimpleOpenID;
$openid->SetIdentity($uid);
- $openid->SetTrustRoot('http://' . $_SERVER["HTTP_HOST"]);
+ $openid->SetTrustRoot('http://' . OCP\Util::getServerHost());
if ($openid->GetOpenIDServer()){
- $openid->SetApprovedURL('http://' . $_SERVER["HTTP_HOST"] . OC::$WEBROOT); // Send Response from OpenID server to this script
+ $openid->SetApprovedURL('http://' . OCP\Util::getServerHost() . OC::$WEBROOT); // Send Response from OpenID server to this script
$openid->Redirect(); // This will redirect user to OpenID Server
exit;
}else{
diff --git a/apps/user_webfinger/appinfo/app.php b/apps/user_webfinger/appinfo/app.php
index a45efd96a46..3336af66820 100644
--- a/apps/user_webfinger/appinfo/app.php
+++ b/apps/user_webfinger/appinfo/app.php
@@ -1,7 +1,3 @@
<?php
-OCP\App::register( array(
- 'order' => 11,
- 'id' => 'user_webfinger',
- 'name' => 'Webfinger' ));
OCP\CONFIG::setAppValue('core', 'public_host-meta', '/apps/user_webfinger/host-meta.php');
OCP\CONFIG::setAppValue('core', 'public_webfinger', '/apps/user_webfinger/webfinger.php');