Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-08 00:56:34 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-05-08 00:56:34 +0400
commit10d291d6b3bf25794a8edaea6c867788b717eb15 (patch)
tree1b83402cd97b609d5afd719fb41e7650eb81e7fa
parent40b823bc8be138057c0e03c7f52cde8231386cdd (diff)
parent4dbc2093c680bebaa42f230937be88a58984c5bd (diff)
Merge branch 'master' of gitorious.org:owncloud/owncloud
-rw-r--r--.htaccess13
-rw-r--r--3rdparty/Sabre/DAV/Server.php2
-rwxr-xr-xapps/admin_dependencies_chk/settings.php12
-rwxr-xr-xapps/calendar/appinfo/app.php5
-rwxr-xr-xapps/calendar/appinfo/remote.php6
-rw-r--r--apps/calendar/js/calendar.js5
-rw-r--r--apps/calendar/share.php1
-rwxr-xr-xapps/calendar/templates/calendar.php2
-rwxr-xr-xapps/calendar/templates/settings.php2
-rwxr-xr-xapps/calendar/templates/share.dropdown.php4
-rwxr-xr-xapps/contacts/appinfo/app.php4
-rwxr-xr-xapps/contacts/appinfo/remote.php5
-rw-r--r--apps/contacts/js/contacts.js58
-rwxr-xr-xapps/contacts/templates/index.php2
-rwxr-xr-xapps/contacts/templates/settings.php4
-rwxr-xr-xapps/files/appinfo/app.php6
-rw-r--r--apps/files/appinfo/remote.php6
-rwxr-xr-xapps/files/index.php46
-rwxr-xr-xapps/files_sharing/ajax/getitem.php2
-rwxr-xr-xapps/files_sharing/ajax/share.php8
-rwxr-xr-xapps/files_sharing/appinfo/app.php2
-rwxr-xr-xapps/files_sharing/get.php5
-rw-r--r--apps/files_sharing/js/share.js8
-rwxr-xr-xapps/files_sharing/lib_share.php14
-rwxr-xr-xapps/gallery/appinfo/app.php1
-rw-r--r--apps/gallery/js/album_cover.js2
-rw-r--r--apps/gallery/js/sharing.js12
-rwxr-xr-xapps/media/appinfo/app.php1
-rwxr-xr-xapps/media/lib_ampache.php2
-rw-r--r--apps/media/remote.php7
-rwxr-xr-xapps/media/server/xml.server.php2
-rwxr-xr-xapps/media/templates/settings.php2
-rw-r--r--apps/remoteStorage/appinfo/webfinger.php2
-rwxr-xr-xapps/user_ldap/lib_ldap.php12
-rwxr-xr-xapps/user_webfinger/webfinger.php18
-rw-r--r--core/js/js.js10
-rw-r--r--index.php2
-rw-r--r--lib/base.php4
-rw-r--r--lib/filecache.php2
-rw-r--r--lib/helper.php25
-rw-r--r--lib/public/util.php14
-rw-r--r--lib/user.php6
-rw-r--r--public.php10
-rw-r--r--remote.php16
-rw-r--r--remote/.gitignore2
-rw-r--r--settings/ajax/createuser.php8
-rw-r--r--settings/js/users.js35
-rw-r--r--settings/templates/personal.php2
48 files changed, 221 insertions, 198 deletions
diff --git a/.htaccess b/.htaccess
index adc6667d5bf..fd1f6abb969 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,9 +1,9 @@
ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
-Redirect 301 /apps/calendar/caldav.php /remote/caldav.php
-Redirect 301 /apps/contacts/carddav.php /remote/carddav.php
-Redirect 301 /apps/files/webdav.php /remote/webdav.php
-Redirect 301 /files/webdav.php /remote/webdav.php
+Redirect 301 /apps/calendar/caldav.php /remote.php/caldav/
+Redirect 301 /apps/contacts/carddav.php /remote.php/carddav/
+Redirect 301 /apps/files/webdav.php /remote.php/webdav/
+Redirect 301 /files/webdav.php /remote.php/webdav/
<IfModule mod_php5.c>
php_value upload_max_filesize 512M
php_value post_max_size 512M
@@ -15,9 +15,10 @@ php_value memory_limit 512M
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
-RewriteRule ^.well-known/carddav /remote/carddav.php [R]
-RewriteRule ^.well-known/caldav /remote/caldav.php [R]
+RewriteRule ^.well-known/carddav /remote.php/carddav/ [R]
+RewriteRule ^.well-known/caldav /remote.php/caldav/ [R]
RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
+RewriteRule ^remote/(.*) remote.php [QSA,L]
</IfModule>
Options -Indexes
diff --git a/3rdparty/Sabre/DAV/Server.php b/3rdparty/Sabre/DAV/Server.php
index 4284c127b6e..50b190e8fab 100644
--- a/3rdparty/Sabre/DAV/Server.php
+++ b/3rdparty/Sabre/DAV/Server.php
@@ -215,7 +215,7 @@ class Sabre_DAV_Server {
$DOM->appendChild($error);
$error->appendChild($DOM->createElement('s:exception',get_class($e)));
- $error->appendChild($DOM->createElement('s:message',$e->getMessage()));
+ $error->appendChild($DOM->createElement('s:message',htmlentities($e->getMessage())));
if ($this->debugExceptions) {
$error->appendChild($DOM->createElement('s:file',$e->getFile()));
$error->appendChild($DOM->createElement('s:line',$e->getLine()));
diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php
index 2eb20414292..4e0803f791b 100755
--- a/apps/admin_dependencies_chk/settings.php
+++ b/apps/admin_dependencies_chk/settings.php
@@ -69,11 +69,23 @@ $modules[] =array(
'message'=> $l->t('The php-ctype module is needed validate data.'));
$modules[] =array(
+ 'status' => class_exists('DOMDocument') ? 'ok' : 'error',
+ 'part'=> 'php-xml',
+ 'modules'=> array('core'),
+ 'message'=> $l->t('The php-xml module is needed to share files with webdav.'));
+
+$modules[] =array(
'status' => ini_get('allow_url_fopen') == '1' ? 'ok' : 'error',
'part'=> 'allow_url_fopen',
'modules'=> array('core'),
'message'=> $l->t('The allow_url_fopen directive of your php.ini should be set to 1 to retrieve knowledge base from OCS servers'));
+$modules[] =array(
+ 'status' => class_exists('PDO') ? 'ok' : 'warning',
+ 'part'=> 'php-pdo',
+ 'modules'=> array('core'),
+ 'message'=> $l->t('The php-pdo module is needed to store owncloud data into a database.'));
+
foreach($modules as $key => $module) {
$enabled = false ;
foreach($module['modules'] as $app) {
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php
index 055066de0df..0c91bf8f135 100755
--- a/apps/calendar/appinfo/app.php
+++ b/apps/calendar/appinfo/app.php
@@ -23,6 +23,5 @@ OCP\App::addNavigationEntry( array(
'name' => $l->t('Calendar')));
OCP\App::registerPersonal('calendar', 'settings');
OC_Search::registerProvider('OC_Search_Provider_Calendar');
-if(!file_exists(OC::$SERVERROOT.'/remote/caldav.php')){
- file_put_contents(OC::$SERVERROOT.'/remote/caldav.php', file_get_contents(OC::$APPSROOT . '/apps/calendar/appinfo/remote.php'));
-} \ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'remote_caldav', '/apps/calendar/appinfo/remote.php');
+OCP\CONFIG::setAppValue('core', 'public_calendar', '/apps/calendar/share.php'); \ No newline at end of file
diff --git a/apps/calendar/appinfo/remote.php b/apps/calendar/appinfo/remote.php
index 32b454ee90c..7ff6a2fbbe2 100755
--- a/apps/calendar/appinfo/remote.php
+++ b/apps/calendar/appinfo/remote.php
@@ -5,10 +5,6 @@
* later.
* See the COPYING-README file.
*/
-// Do not load FS ...
-$RUNTIME_NOSETUPFS = true;
-require_once('../lib/base.php');
-
OCP\App::checkAppEnabled('calendar');
// Backends
@@ -24,7 +20,7 @@ $nodes = array(
// Fire up server
$server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri(OC::$WEBROOT.'/remote/caldav.php');
+$server->setBaseUri($baseuri);
// Add plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
$server->addPlugin(new Sabre_CalDAV_Plugin());
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index a16856938ce..b3beb8d44cb 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -517,7 +517,10 @@ Calendar={
},
share:function(id, idtype, sharewith, sharetype){
$.getJSON(OC.filePath('calendar', 'ajax/share', 'share.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(data){
-
+ if(sharetype == 'public'){
+ $('#public_token').val(parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=calendar&t='+data.message);
+ $('#public_token').css('display', 'block');
+ }
});
},
unshare:function(id, idtype, sharewith, sharetype){
diff --git a/apps/calendar/share.php b/apps/calendar/share.php
index 1cc8a2ef15e..68c7d0ffae2 100644
--- a/apps/calendar/share.php
+++ b/apps/calendar/share.php
@@ -1,5 +1,4 @@
<?php
-require_once('../../lib/base.php');
$token = strip_tags($_GET['t']);
$shared = OC_Calendar_Share::getElementByToken($token);
$nl = "\n\r";
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index 7e767e36732..832194f0fe1 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -19,7 +19,7 @@
var missing_field_totime = '<?php echo addslashes($l->t('To Time')) ?>';
var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>';
var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>';
- var totalurl = '<?php echo OCP\Util::linkToAbsolute('calendar', 'caldav.php'); ?>/calendars';
+ var totalurl = '<?php echo OCP\Util::linkToRemote('caldav'); ?>calendars';
var firstDay = '<?php echo (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
$(document).ready(function() {
<?php
diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php
index 0a325ccbc24..12117750ca5 100755
--- a/apps/calendar/templates/settings.php
+++ b/apps/calendar/templates/settings.php
@@ -47,6 +47,6 @@
</table>
<?php echo $l->t('Calendar CalDAV syncing address:');?>
- <code><?php echo OCP\Util::linkToAbsolute('remote', 'caldav.php'); ?></code><br />
+ <code><?php echo OCP\Util::linkToRemote('caldav'); ?></code><br />
</fieldset>
</form>
diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php
index e0dabebf257..356a8d4fab1 100755
--- a/apps/calendar/templates/share.dropdown.php
+++ b/apps/calendar/templates/share.dropdown.php
@@ -73,5 +73,5 @@ echo OCP\html_select_options($allgroups, array());
</ul>
<div id="public">
<input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br>
- <input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('apps/calendar', 'share.php?t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
-</div> \ No newline at end of file
+ <input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('', 'public.php').'?service=calendar&t=' . $public['share'] ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
+</div>
diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php
index c8c1d779dae..7e196733064 100755
--- a/apps/contacts/appinfo/app.php
+++ b/apps/contacts/appinfo/app.php
@@ -25,6 +25,4 @@ OCP\App::addNavigationEntry( array(
OCP\App::registerPersonal('contacts','settings');
OCP\Util::addscript('contacts', 'loader');
OC_Search::registerProvider('OC_Search_Provider_Contacts');
-if(!file_exists(OC::$SERVERROOT.'/remote/carddav.php')){
- file_put_contents(OC::$SERVERROOT.'/remote/carddav.php', file_get_contents(OC::$APPSROOT . '/apps/contacts/appinfo/remote.php'));
-} \ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'remote_carddav', '/apps/contacts/appinfo/remote.php'); \ No newline at end of file
diff --git a/apps/contacts/appinfo/remote.php b/apps/contacts/appinfo/remote.php
index 804c560e3d0..67006b77f97 100755
--- a/apps/contacts/appinfo/remote.php
+++ b/apps/contacts/appinfo/remote.php
@@ -19,9 +19,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
-// Do not load FS ...
-$RUNTIME_NOSETUPFS = true;
-require_once('../lib/base.php');
OCP\App::checkAppEnabled('contacts');
@@ -38,7 +35,7 @@ $nodes = array(
// Fire up server
$server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri(OC::$WEBROOT.'/remote/carddav.php');
+$server->setBaseUri($baseuri);
// Add plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
$server->addPlugin(new Sabre_CardDAV_Plugin());
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 68a01174d83..44b29792206 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -168,14 +168,14 @@ Contacts={
honsuf:'',
data:undefined,
update:function(id) {
- // Make sure proper DOM is loaded.
var newid;
if(id == undefined) {
newid = $('#contacts li:first-child').data('id');
} else {
newid = id;
}
- if(!$('n')) {
+ // Make sure proper DOM is loaded.
+ if(!$('#card')) {
$.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{},function(jsondata){
if(jsondata.status == 'success'){
$('#rightcontent').html(jsondata.data.page);
@@ -185,8 +185,6 @@ Contacts={
});
}
if($('#contacts li').length > 0) {
- //var newid = $('#contacts li:first-child').data('id');
- //$('#contacts li:first-child').addClass('active');
$('#leftcontent li[data-id="'+newid+'"]').addClass('active');
$.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':newid},function(jsondata){
if(jsondata.status == 'success'){
@@ -210,8 +208,6 @@ Contacts={
},
doExport:function() {
document.location.href = OC.linkTo('contacts', 'export.php') + '?contactid=' + this.id;
- //$.get(OC.linkTo('contacts', 'export.php'),{'contactid':this.id},function(jsondata){
- //});
},
doImport:function(){
Contacts.UI.notImplemented();
@@ -249,7 +245,7 @@ Contacts={
if(!added) {
$('#leftcontent ul').append(item);
}
- if(isnew) {
+ if(isnew) { // add some default properties
Contacts.UI.Card.addProperty('EMAIL');
Contacts.UI.Card.addProperty('TEL');
Contacts.UI.Card.addProperty('NICKNAME');
@@ -261,7 +257,6 @@ Contacts={
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
- //alert(jsondata.data.message);
}
});
$('#contact_identity').show();
@@ -291,11 +286,10 @@ Contacts={
newid = newlistitem.data('id');
}
$('#rightcontent').data('id',newid);
- //$('#rightcontent').empty();
this.id = this.fn = this.fullname = this.shortname = this.famname = this.givname = this.addname = this.honpre = this.honsuf = '';
this.data = undefined;
- // Load first in list.
- if($('#contacts li').length > 0) {
+
+ if($('#contacts li').length > 0) { // Load first in list.
Contacts.UI.Card.update(newid);
} else {
// load intro page
@@ -313,7 +307,6 @@ Contacts={
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
- //alert(jsondata.data.message);
}
});
}
@@ -321,7 +314,6 @@ Contacts={
return false;
},
loadContact:function(jsondata){
- //$('#contact_communication').hide();
this.data = jsondata;
this.id = this.data.id;
$('#rightcontent').data('id',this.id);
@@ -508,7 +500,6 @@ Contacts={
}
},
saveProperty:function(obj){
- // I couldn't get the selector to filter on 'contacts_property' so I filter by hand here :-/
if(!$(obj).hasClass('contacts_property')) {
return false;
}
@@ -569,7 +560,6 @@ Contacts={
}
},
addProperty:function(type){
- //console.log('addProperty:' + type);
switch (type) {
case 'PHOTO':
this.loadPhoto(true);
@@ -617,7 +607,6 @@ Contacts={
deleteProperty:function(obj, type){
Contacts.UI.loading(obj, true);
var checksum = Contacts.UI.checksumFor(obj);
- //console.log('deleteProperty, id: ' + this.id + ', checksum: ' + checksum);
if(checksum) {
$.getJSON(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){
@@ -822,16 +811,13 @@ Contacts={
if(isnew) {
container.remove();
}
- //Contacts.UI.showHideContactInfo();
}
},
close : function(event, ui) {
- //alert('close');
$(this).dialog('destroy').remove();
if(isnew) {
container.remove();
}
- //Contacts.UI.showHideContactInfo();
},
open : function(event, ui) {
$( "#adr_city" ).autocomplete({
@@ -848,9 +834,6 @@ Contacts={
},
success: function( data ) {
response( $.map( data.geonames, function( item ) {
- /*for(var key in item) {
- console.log(key + ': ' + item[key]);
- }*/
return {
label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
value: item.name,
@@ -865,9 +848,6 @@ Contacts={
if(ui.item && $('#adr_country').val().trim().length == 0) {
$('#adr_country').val(ui.item.country);
}
- /*log( ui.item ?
- "Selected: " + ui.item.label :
- "Nothing selected, input was " + this.value);*/
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
@@ -892,9 +872,6 @@ Contacts={
},
success: function( data ) {
response( $.map( data.geonames, function( item ) {
- //for(var key in item) {
- // console.log(key + ': ' + item[key]);
- //}
return {
label: item.name,
value: item.name
@@ -1245,12 +1222,9 @@ Contacts={
function(jsondata) {
if (jsondata.status == 'success'){
$(obj).closest('tr').remove();
- //$('#chooseaddressbook_dialog').dialog('destroy').remove();
Contacts.UI.Contacts.update();
- //Contacts.UI.Addressbooks.overview();
} else {
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
- //alert('Error: ' + data.message);
}
});
}
@@ -1480,7 +1454,6 @@ $(document).ready(function(){
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
- //alert(jsondata.data.message);
}
});
return false;
@@ -1507,9 +1480,6 @@ $(document).ready(function(){
}
});
- // NOTE: For some reason the selector doesn't work when I select by '.contacts_property' too...
- // I do the filtering in the event handler instead.
- //$('input[type="text"],input[type="checkbox"],input[type="email"],input[type="tel"],input[type="date"], select').live('change', function(){
$('.contacts_property').live('change', function(){
Contacts.UI.Card.saveProperty(this);
});
@@ -1523,7 +1493,7 @@ $(document).ready(function(){
});
// Name has changed. Update it and reorder.
- $('#fn').live('change',function(){
+ $('#fn').change(function(){
var name = $('#fn').val();
var item = $('#contacts [data-id="'+Contacts.UI.Card.id+'"]').clone();
$('#contacts [data-id="'+Contacts.UI.Card.id+'"]').remove();
@@ -1541,9 +1511,7 @@ $(document).ready(function(){
}
});
- /**
- * Profile picture upload handling
- */
+ // Profile picture upload handling
// New profile picture selected
$('#file_upload_start').change(function(){
Contacts.UI.Card.uploadPhoto(this.files);
@@ -1594,30 +1562,22 @@ $(document).ready(function(){
OC.dialogs.alert(xhr.status + ': ' + xhr.responseText, t('contacts', 'Error'));
}
} else {
- //alert(xhr.responseText);
OC.dialogs.alert(response.data.message, t('contacts', 'Error'));
}
- // stop loading indicator
- //$('#contacts_details_photo_progress').hide();
}
};
fileUpload.onprogress = function(e){
if (e.lengthComputable){
var _progress = Math.round((e.loaded * 100) / e.total);
- if (_progress != 100){
- //$('#contacts_details_photo_progress').text(_progress + '%');
- //$('#contacts_details_photo_progress').val(_progress);
- }
+ //if (_progress != 100){
+ //}
}
};
- // Start loading indicator.
- //$('#contacts_details_photo_progress').show()();
xhr.open('POST', OC.filePath('contacts', 'ajax', 'uploadphoto.php')+'?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true);
xhr.setRequestHeader('Cache-Control', 'no-cache');
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('X_FILE_NAME', encodeURIComponent(file.name));
- //xhr.setRequestHeader("X_FILENAME", file.name);
xhr.setRequestHeader('X-File-Size', file.size);
xhr.setRequestHeader('Content-Type', file.type);
xhr.send(file);
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index c28b47e7c28..7d212e71ba8 100755
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -1,5 +1,5 @@
<script type='text/javascript'>
- var totalurl = '<?php echo OCP\Util::linkToAbsolute('contacts', 'carddav.php'); ?>/addressbooks';
+ var totalurl = '<?php echo OCP\Util::linkToRemote('carddav'); ?>addressbooks';
var categories = <?php echo json_encode($_['categories']); ?>;
var lang = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'core', 'lang', 'en'); ?>';
</script>
diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php
index 9dffdfb0e4f..216003b6c69 100755
--- a/apps/contacts/templates/settings.php
+++ b/apps/contacts/templates/settings.php
@@ -4,9 +4,9 @@
<?php echo $l->t('CardDAV syncing addresses'); ?> (<a href="http://owncloud.org/synchronisation/" target="_blank"><?php echo $l->t('more info'); ?></a>)
<dl>
<dt><?php echo $l->t('Primary address (Kontact et al)'); ?></dt>
- <dd><code><?php echo OCP\Util::linkToAbsolute('remote', 'carddav.php'); ?>/</code></dd>
+ <dd><code><?php echo OCP\Util::linkToRemote('carddav'); ?></code></dd>
<dt><?php echo $l->t('iOS/OS X'); ?></dt>
- <dd><code><?php echo OCP\Util::linkToAbsolute('remote', 'carddav.php'); ?>/principals/<?php echo OCP\USER::getUser(); ?></code>/</dd>
+ <dd><code><?php echo OCP\Util::linkToRemote('carddav'); ?>principals/<?php echo OCP\USER::getUser(); ?></code>/</dd>
</dl>
Powered by <a href="http://geonames.org/" target="_blank">geonames.org webservice</a>
</fieldset>
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index 3f4e1705fb0..e7358242ddb 100755
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -1,6 +1,4 @@
<?php
-
-
$l=OC_L10N::get('files');
OCP\App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
@@ -9,6 +7,4 @@ 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") ));
OC_Search::registerProvider('OC_Search_Provider_File');
-if(!file_exists(OC::$SERVERROOT.'/remote/webdav.php')){
- file_put_contents(OC::$SERVERROOT.'/remote/webdav.php', file_get_contents(OC::$APPSROOT . '/apps/files/appinfo/remote.php'));
-} \ No newline at end of file
+OCP\CONFIG::setAppValue('core', 'remote_webdav', '/apps/files/appinfo/remote.php'); \ No newline at end of file
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php
index defb97ab152..465e0c0a935 100644
--- a/apps/files/appinfo/remote.php
+++ b/apps/files/appinfo/remote.php
@@ -22,12 +22,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
-
-// Do not load FS ...
-$RUNTIME_NOSETUPFS = true;
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication');
-require_once('../lib/base.php');
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
@@ -38,7 +34,7 @@ $publicDir = new OC_Connector_Sabre_Directory('');
// Fire up server
$server = new Sabre_DAV_Server($publicDir);
-$server->setBaseUri(OC::$WEBROOT.'/remote/webdav.php');
+$server->setBaseUri($baseuri);
// Load plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
diff --git a/apps/files/index.php b/apps/files/index.php
index 0c439e4ae1a..7ead3ce8f86 100755
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -25,26 +25,26 @@
OCP\User::checkLoggedIn();
// Load the files we need
-OCP\Util::addStyle( "files", "files" );
-OCP\Util::addscript( "files", "jquery.iframe-transport" );
-OCP\Util::addscript( "files", "jquery.fileupload" );
-OCP\Util::addscript( "files", "files" );
+OCP\Util::addStyle( 'files', 'files' );
+OCP\Util::addscript( 'files', 'jquery.iframe-transport' );
+OCP\Util::addscript( 'files', 'jquery.fileupload' );
+OCP\Util::addscript( 'files', 'files' );
OCP\Util::addscript( 'files', 'filelist' );
OCP\Util::addscript( 'files', 'fileactions' );
if(!isset($_SESSION['timezone'])){
OCP\Util::addscript( 'files', 'timezone' );
}
-OCP\App::setActiveNavigationEntry( "files_index" );
+OCP\App::setActiveNavigationEntry( 'files_index' );
// Load the files
$dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
// Redirect if directory does not exist
if(!OC_Filesystem::is_dir($dir.'/')) {
- header("Location: ".$_SERVER['PHP_SELF']."");
+ header('Location: '.$_SERVER['PHP_SELF'].'');
}
$files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
- $i["date"] = OCP\Util::formatDate($i["mtime"] );
+ $i['date'] = OCP\Util::formatDate($i['mtime'] );
if($i['type']=='file'){
$fileinfo=pathinfo($i['name']);
$i['basename']=$fileinfo['filename'];
@@ -63,22 +63,22 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
// Make breadcrumb
$breadcrumb = array();
-$pathtohere = "";
-foreach( explode( "/", $dir ) as $i ){
- if( $i != "" ){
- $pathtohere .= "/".str_replace('+','%20', urlencode($i));
- $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
+$pathtohere = '';
+foreach( explode( '/', $dir ) as $i ){
+ if( $i != '' ){
+ $pathtohere .= '/'.str_replace('+','%20', urlencode($i));
+ $breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $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( "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=");
+$list = new OCP\Template( 'files', 'part.list', '' );
+$list->assign( 'files', $files );
+$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=');
$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
@@ -88,12 +88,12 @@ $freeSpace=OC_Filesystem::free_space('/');
$freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
-$tmpl = new OCP\Template( "files", "index", "user" );
-$tmpl->assign( "fileList", $list->fetchPage() );
-$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
+$tmpl = new OCP\Template( 'files', 'index', 'user' );
+$tmpl->assign( 'fileList', $list->fetchPage() );
+$tmpl->assign( 'breadcrumb', $breadcrumbNav->fetchPage() );
$tmpl->assign( 'dir', $dir);
$tmpl->assign( 'readonly', !OC_Filesystem::is_writable($dir));
-$tmpl->assign( "files", $files );
+$tmpl->assign( 'files', $files );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign( 'uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign( 'allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php
index 6eed0408238..36ac372cad4 100755
--- a/apps/files_sharing/ajax/getitem.php
+++ b/apps/files_sharing/ajax/getitem.php
@@ -19,7 +19,7 @@ while ($path != $userDirectory) {
$item['privateLink'] = $token;
} else {
// If in parent folder, include a path parameter to get direct access to file
- $item['privateLink'] = $token.'&path='.substr($source, strlen($path));
+ $item['privateLink'] = $token.'&path='.str_replace('%2F', '/', str_replace('+', '%20', urlencode(substr($source, strlen($path)))));;
}
} else {
// Check if uid_shared_with is a group
diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php
index 79ebf9187b9..4478144e92f 100755
--- a/apps/files_sharing/ajax/share.php
+++ b/apps/files_sharing/ajax/share.php
@@ -22,12 +22,12 @@ foreach ($sources as $source) {
OCP\JSON::success();
}
} catch (Exception $exception) {
- OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(),OCP\Util::ERROR);
- OCP\JSON::error();
+ OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(), OCP\Util::ERROR);
+ OCP\JSON::error(array('data' => array('message' => $exception->getMessage())));
}
} else {
- OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source,OCP\Util::ERROR);
- OCP\JSON::error();
+ OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source, OCP\Util::ERROR);
+ OCP\JSON::error(array('data' => array('message' => 'File does not exist or is not readable')));
}
}
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index bd81a45cc55..b3b9776d297 100755
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -17,5 +17,5 @@ if ($dir != '/Shared' || OCP\Config::getAppValue('files_sharing', 'resharing', '
OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min");
OCP\Util::addStyle( 'files_sharing', 'sharing' );
OCP\Util::addStyle("3rdparty", "chosen/chosen");
-
+OCP\CONFIG::setAppValue('core', 'public_files', '/apps/files_sharing/get.php');
?>
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index 2b2c9dd07fd..59a4efba6a6 100755
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -5,9 +5,8 @@ OCP\JSON::checkAppEnabled('files_sharing');
require_once 'lib_share.php';
//get the path of the shared file
-$token = $_GET['token'];
-$source = OC_Share::getSource($token);
-if ($source !== false) {
+if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) {
+ $token = $_GET['token'];
// TODO Manipulating the string may not be the best choice. Is there an alternative?
$user = substr($source, 1, strpos($source, "/", 1) - 1);
OC_Util::setupFS($user);
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index e9b46873d3a..e23146798f2 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -35,7 +35,7 @@ OC.Share={
callback(result.data);
}
} else {
- OC.dialogs.alert('Error', 'Error while sharing');
+ OC.dialogs.alert(result.data.message, 'Error while sharing');
}
});
},
@@ -177,9 +177,9 @@ OC.Share={
},
showPrivateLink:function(item, token) {
$('#privateLinkCheckbox').attr('checked', true);
- var link = parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token;
+ var link = parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=files&token='+token;
if (token.indexOf('&path=') == -1) {
- link += '&file=' + item;
+ link += '&file=' + encodeURIComponent(item);
} else {
// Disable checkbox if inside a shared parent folder
$('#privateLinkCheckbox').attr('disabled', 'true');
@@ -210,9 +210,9 @@ OC.Share={
}
$(document).ready(function() {
- OC.Share.loadIcons();
if (typeof FileActions !== 'undefined') {
+ OC.Share.loadIcons();
FileActions.register('all', 'Share', function(filename) {
// Return the correct sharing icon
if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index d5cf3d0a1ba..c2340bdc181 100755
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -98,15 +98,8 @@ class OC_Share {
$uid = $uid."@".$gid;
}
$query->execute(array($uid_owner, $uid, $source, $target, $permissions));
- // Add file to filesystem cache
- $userDirectory = "/".OCP\USER::getUser()."/files";
- $data = OC_Filecache::get(substr($source, strlen($userDirectory)));
- $parentQuery = OCP\DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path=?');
- $parentResult = $parentQuery->execute(array($sharedFolder))->fetchRow();
- $parent = $parentResult['id'];
- $is_writeable = $permissions & OC_Share::WRITE;
- $cacheQuery = OCP\DB::prepare('INSERT INTO *PREFIX*fscache(parent, name, path, size, mtime, ctime, mimetype, mimepart, user, writable) VALUES(?,?,?,?,?,?,?,?,?,?)');
- $cacheQuery->execute(array($parent, basename($target), $target, $data['size'], $data['mtime'], $data['ctime'], $data['mimetype'], dirname($data['mimetype']), $uid, $is_writeable));
+ // Update mtime of shared folder to invoke a file cache rescan
+ OC_Filesystem::getStorage($sharedFolder)->touch($sharedFolder);
}
}
}
@@ -383,6 +376,9 @@ class OC_Share {
$source = self::cleanPath($source);
$query = OCP\DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ? AND uid_shared_with ".self::getUsersAndGroups($uid_shared_with));
$query->execute(array(strlen($source), $source, OCP\USER::getUser()));
+ // Update mtime of shared folder to invoke a file cache rescan
+ $sharedFolder = '/'.$uid_shared_with.'/files/Shared';
+ OC_Filesystem::getStorage($sharedFolder)->touch($sharedFolder);
}
/**
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php
index 2501ae7bbd5..333b1581ce1 100755
--- a/apps/gallery/appinfo/app.php
+++ b/apps/gallery/appinfo/app.php
@@ -56,4 +56,5 @@ class OC_GallerySearchProvider extends OC_Search_Provider{
OC_Search::registerProvider('OC_GallerySearchProvider');
require_once('apps/gallery/lib/hooks_handlers.php');
+OCP\CONFIG::setAppValue('core', 'public_gallery', '/apps/gallery/sharing.php');
?>
diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js
index d44e7f83d1f..61084c99b29 100644
--- a/apps/gallery/js/album_cover.js
+++ b/apps/gallery/js/album_cover.js
@@ -31,7 +31,7 @@ function albumClick(title) {
}
function constructSharingPath() {
- return document.location.protocol + '//' + document.location.host + OC.linkTo('gallery', 'sharing.php') + '?token=' + Albums.token;
+ return document.location.protocol + '//' + document.location.host + OC.linkTo('', 'public.php') + '?service=gallery&token=' + Albums.token;
}
function shareGallery() {
diff --git a/apps/gallery/js/sharing.js b/apps/gallery/js/sharing.js
index 340d1b9b274..679e39578aa 100644
--- a/apps/gallery/js/sharing.js
+++ b/apps/gallery/js/sharing.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
- $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN}, albumClickHandler);
+ $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN}, albumClickHandler);
});
var paths = [];
@@ -13,7 +13,7 @@ function returnTo(num) {
}
path = '';
for (var e in paths) path += '/' + paths[e];
- $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN, path: path}, function(r) {
+ $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) {
albumClickHandler(r);
});
}
@@ -21,7 +21,7 @@ function returnTo(num) {
function albumClickHandler(r) {
var element = $('div#gallery_list');
element.html('');
- var album_template = '<div class="gallery_box"><div><a rel="images"><img src="ajax/sharing.php?token='+TOKEN+'&operation=get_album_thumbnail&albumname=IMGPATH"></a></div><h1></h1></div>';
+ var album_template = '<div class="gallery_box"><div><a rel="images"><img src="' + OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_album_thumbnail&albumname=IMGPATH"></a></div><h1></h1></div>';
for (var i in r.albums) {
var a = r.albums[i];
@@ -36,7 +36,7 @@ function albumClickHandler(r) {
paths.push($(this).attr('title'));
path = '';
for (var e in paths) path += '/' + paths[e];
- $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN, path: path}, function(r) {
+ $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) {
var name = paths[paths.length-1];
counter++;
var d = '<span class="breadcrumbelement" onclick="javascript:returnTo('+counter+');return false;">'+name+'</span>';
@@ -49,9 +49,9 @@ function albumClickHandler(r) {
var pat = '';
for (var a in paths) pat += '/'+paths[a];
- var photo_template = '<div class="gallery_box"><div><a rel="images" href="*HREF*" target="_blank"><img src="ajax/sharing.php?token='+TOKEN+'&operation=get_thumbnail&img=IMGPATH"></a></div></div>';
+ var photo_template = '<div class="gallery_box"><div><a rel="images" href="*HREF*" target="_blank"><img src="' + OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_thumbnail&img=IMGPATH"></a></div></div>';
for (var a in r.photos) {
- var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', 'ajax/sharing.php?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a]));
+ var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a]));
element.append(local);
}
}
diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php
index 26cb2045549..0ab6543e070 100755
--- a/apps/media/appinfo/app.php
+++ b/apps/media/appinfo/app.php
@@ -32,3 +32,4 @@ 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');
+OCP\CONFIG::setAppValue('core', 'remote_ampache', '/apps/media/remote.php'); \ No newline at end of file
diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php
index d658605611c..f5c91661abe 100755
--- a/apps/media/lib_ampache.php
+++ b/apps/media/lib_ampache.php
@@ -207,7 +207,7 @@ class OC_MEDIA_AMPACHE{
echo("\t\t<title>$name</title>\n");
echo("\t\t<artist id='$artist'>$artistName</artist>\n");
echo("\t\t<album id='$album'>$albumName</album>\n");
- $url=OCP\Util::linkToAbsolute('media', 'server/xml.server.php')."?action=play&song=$id&auth={$_GET['auth']}";
+ $url=OCP\Util::linkToRemote('ampache')."server/xml.server.php/?action=play&song=$id&auth={$_GET['auth']}";
$url=self::fixXmlString($url);
echo("\t\t<url>$url</url>\n");
echo("\t\t<time>{$song['song_length']}</time>\n");
diff --git a/apps/media/remote.php b/apps/media/remote.php
new file mode 100644
index 00000000000..8a88c2b51ae
--- /dev/null
+++ b/apps/media/remote.php
@@ -0,0 +1,7 @@
+<?php
+if($path_info == '/ampache' || $path_info == '/ampache/'){
+ require_once(OC::$APPSROOT . '/apps/media/index.php');
+}else{
+ require_once(OC::$APPSROOT . '/apps/media/server/xml.server.php');
+}
+?> \ No newline at end of file
diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php
index 63f2a51dcb5..6cb6c91ca06 100755
--- a/apps/media/server/xml.server.php
+++ b/apps/media/server/xml.server.php
@@ -21,8 +21,6 @@
*
*/
-require_once('../../inc.php');
-
OCP\App::checkAppEnabled('media');
require_once(OC::$APPSROOT . '/apps/media/lib_collection.php');
require_once(OC::$APPSROOT . '/apps/media/lib_ampache.php');
diff --git a/apps/media/templates/settings.php b/apps/media/templates/settings.php
index 2fe0b945a63..a7dc0775c44 100755
--- a/apps/media/templates/settings.php
+++ b/apps/media/templates/settings.php
@@ -2,6 +2,6 @@
<fieldset class="personalblock">
<strong>Media</strong><br />
Ampache address:
- <code><?php echo OCP\Util::linkToAbsolute('media', ''); ?></code><br />
+ <code><?php echo OCP\Util::linkToRemote('ampache'); ?></code><br />
</fieldset>
</form>
diff --git a/apps/remoteStorage/appinfo/webfinger.php b/apps/remoteStorage/appinfo/webfinger.php
index 7c0ab846057..6403d3a6916 100644
--- a/apps/remoteStorage/appinfo/webfinger.php
+++ b/apps/remoteStorage/appinfo/webfinger.php
@@ -1,6 +1,8 @@
+<?php if(OC_User::userExists(WF_USER)) { ?>
<Link
rel="remoteStorage"
template="<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/"
api="WebDAV"
auth="<?php echo WF_BASEURL; ?>/apps/remoteStorage/auth.php/<?php echo WF_USER; ?>">
</Link>
+<?php } ?>
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index c71c0cb7e54..4c2c22cbbee 100755
--- a/apps/user_ldap/lib_ldap.php
+++ b/apps/user_ldap/lib_ldap.php
@@ -568,6 +568,15 @@ class OC_LDAP {
self::$ldapUserFilter = OCP\Config::getAppValue('user_ldap', 'ldap_userlist_filter','objectClass=person');
self::$ldapGroupDisplayName = OCP\Config::getAppValue('user_ldap', 'ldap_group_display_name', LDAP_GROUP_DISPLAY_NAME_ATTR);
+ if(empty(self::$ldapBaseUsers)) {
+ OCP\Util::writeLog('ldap', 'Base for Users is empty, using Base DN', OCP\Util::INFO);
+ self::$ldapBaseUsers = self::$ldapBase;
+ }
+ if(empty(self::$ldapBaseGroups)) {
+ OCP\Util::writeLog('ldap', 'Base for Groups is empty, using Base DN', OCP\Util::INFO);
+ self::$ldapBaseGroups = self::$ldapBase;
+ }
+
if(
!empty(self::$ldapHost)
&& !empty(self::$ldapPort)
@@ -576,8 +585,6 @@ class OC_LDAP {
|| ( empty(self::$ldapAgentName) && empty(self::$ldapAgentPassword))
)
&& !empty(self::$ldapBase)
- && !empty(self::$ldapBaseUsers)
- && !empty(self::$ldapBaseGroups)
&& !empty(self::$ldapUserDisplayName)
)
{
@@ -591,6 +598,7 @@ class OC_LDAP {
*/
static private function establishConnection() {
if(!self::$configured) {
+ OCP\Util::writeLog('ldap', 'Configuration is invalid, cannot connect', OCP\Util::INFO);
return false;
}
if(!self::$ldapConnectionRes) {
diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php
index da35cf29d0e..307a1630019 100755
--- a/apps/user_webfinger/webfinger.php
+++ b/apps/user_webfinger/webfinger.php
@@ -25,15 +25,17 @@ $SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
$WEBROOT=substr($SUBURI,0,-34);
*/
+require_once('../../lib/base.php');
-$request = urldecode($_GET['q']);
+$userName = '';
+$hostName = '';
+$request = strip_tags(urldecode($_GET['q']));
if($_GET['q']) {
$reqParts = explode('@', $request);
- $userName = $reqParts[0];
- $hostName = $reqParts[1];
-} else {
- $userName = '';
- $hostName = '';
+ if(count($reqParts)==2) {
+ $userName = $reqParts[0];
+ $hostName = $reqParts[1];
+ }
}
if(substr($userName, 0, 5) == 'acct:') {
$userName = substr($userName, 5);
@@ -49,12 +51,16 @@ if(isset($_SERVER['HTTPS'])) {
$baseAddress = 'http://';
}
$baseAddress .= $_SERVER['SERVER_NAME'].OC::$WEBROOT;
+if(empty($id)) {
+ header("HTTP/1.0 400 Bad Request");
+}
define('WF_USER', $userName);
define('WF_ID', $id);
define('WF_BASEURL', $baseAddress);
echo "<";
?>
?xml version="1.0" encoding="UTF-8"?>
+<?php if(empty($id)) echo '<!-- Invalid URI: ' . str_replace('>', '/>', $request) . " -->\n"; ?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
<hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME']; ?></hm:Host>
<Subject>acct:<?php echo $id ?></Subject>
diff --git a/core/js/js.js b/core/js/js.js
index 7585d4b09d1..4b0978cfb52 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -33,7 +33,7 @@ OC={
webroot:oc_webroot,
appswebroot:oc_appswebroot,
currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false,
- coreApps:['admin','log','search','settings','core','3rdparty'],
+ coreApps:['', 'admin','log','search','settings','core','3rdparty'],
/**
* get an absolute url to a file in an appen
* @param app the id of the app the file belongs to
@@ -70,11 +70,13 @@ OC={
link+=file;
}else{
link+='/';
- app+='/';
if(!isCore){
link+='apps/';
}
- link+=app;
+ if (app != '') {
+ app+='/';
+ link+=app;
+ }
if(type){
link+=type+'/';
}
@@ -160,7 +162,7 @@ OC.search.lastResults={};
OC.addStyle.loaded=[];
OC.addScript.loaded=[];
-if(typeof localStorage !='undefined'){
+if(typeof localStorage !='undefined' && localStorage != null){
//user and instance awere localstorage
OC.localStorage={
namespace:'oc_'+OC.currentUser+'_'+OC.webroot+'_',
diff --git a/index.php b/index.php
index 91f0cfb5e48..5d5307065bd 100644
--- a/index.php
+++ b/index.php
@@ -44,7 +44,7 @@ if($not_installed) {
// Handle WebDAV
if($_SERVER['REQUEST_METHOD']=='PROPFIND'){
- header('location: '.OC_Helper::linkToAbsolute('remote','webdav.php'));
+ header('location: '.OC_Helper::linkToRemote('webdav'));
exit();
}
diff --git a/lib/base.php b/lib/base.php
index 40df2b0c56c..14f2439ecbd 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -443,8 +443,8 @@ class OC{
$_GET['getfile'] = $file;
}
if(!is_null(self::$REQUESTEDFILE)){
- $subdir = OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE;
- $parent = OC::$APPSROOT . '/' . self::$REQUESTEDAPP;
+ $subdir = OC::$APPSROOT . '/apps/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE;
+ $parent = OC::$APPSROOT . '/apps/' . self::$REQUESTEDAPP;
if(!OC_Helper::issubdirectory($subdir, $parent)){
self::$REQUESTEDFILE = null;
header('HTTP/1.0 404 Not Found');
diff --git a/lib/filecache.php b/lib/filecache.php
index 091a7939e1a..8763865c8c3 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -655,7 +655,7 @@ class OC_FileCache{
}else{
$view=new OC_FilesystemView(($root=='/')?'':$root);
}
- $dh=$view->opendir($path);
+ $dh=$view->opendir($path.'/');
if($dh){//check for changed/new files
while (($filename = readdir($dh)) !== false) {
if($filename != '.' and $filename != '..'){
diff --git a/lib/helper.php b/lib/helper.php
index 2ddd5e7b778..f5e247ca9eb 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -41,15 +41,15 @@ class OC_Helper {
$app .= '/';
// Check if the app is in the app folder
if( file_exists( OC::$APPSROOT . '/apps/'. $app.$file )){
- if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){
+ //if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){
if(substr($app, -1, 1) == '/'){
$app = substr($app, 0, strlen($app) - 1);
}
$urlLinkTo = OC::$WEBROOT . '/?app=' . $app;
$urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):'';
- }else{
- $urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file;
- }
+ //}else{
+ // $urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file;
+ //}
}
else{
$urlLinkTo = OC::$WEBROOT . '/' . $app . $file;
@@ -106,6 +106,17 @@ class OC_Helper {
}
/**
+ * @brief Creates an absolute url for remote use
+ * @param $service id
+ * @returns the url
+ *
+ * Returns a absolute url to the given service.
+ */
+ public static function linkToRemote( $service ) {
+ return self::linkToAbsolute( '', 'remote.php') . '/' . $service . '/';
+ }
+
+ /**
* @brief Creates path to an image
* @param $app app
* @param $image image name
@@ -576,14 +587,12 @@ class OC_Helper {
return true;
}
}
- /*
- echo 'SUB: ' . $sub . "\n";
+ /*echo 'SUB: ' . $sub . "\n";
echo 'PAR: ' . $parent . "\n";
echo 'REALSUB: ' . $realpath_sub . "\n";
echo 'REALPAR: ' . $realpath_parent . "\n";
echo substr($realpath_sub, 0, strlen($realpath_parent));
- exit;
- */
+ exit;*/
return false;
}
}
diff --git a/lib/public/util.php b/lib/public/util.php
index 4068d73370d..f9f3759fe5b 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -130,6 +130,18 @@ class Util {
}
+ /**
+ * @brief Creates an absolute url for remote use
+ * @param $service id
+ * @returns the url
+ *
+ * Returns a absolute url to the given app and file.
+ */
+ public static function linkToRemote( $service ) {
+ return(\OC_Helper::linkToRemote( $service ));
+ }
+
+
/**
* @brief Creates an url
* @param $app app
@@ -150,7 +162,7 @@ class Util {
* reverse proxies
*/
public static function getServerHost() {
- return(\OC_Helper::severHost());
+ return(\OC_Helper::serverHost());
}
/**
diff --git a/lib/user.php b/lib/user.php
index 8b887559df3..816caff8dd8 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -117,15 +117,15 @@ class OC_User {
// Check the name for bad characters
// Allowed are: "a-z", "A-Z", "0-9" and "_.@-"
if( preg_match( '/[^a-zA-Z0-9 _\.@\-]/', $uid )){
- return false;
+ throw new Exception('Only the following characters are allowed in a username: "a-z", "A-Z", "0-9", and "_.@-"');
}
// No empty username
if(trim($uid) == ''){
- return false;
+ throw new Exception('A valid username must be provided');
}
// Check if user already exists
if( self::userExists($uid) ){
- return false;
+ throw new Exception('The username is already being used');
}
diff --git a/public.php b/public.php
new file mode 100644
index 00000000000..27a75adec93
--- /dev/null
+++ b/public.php
@@ -0,0 +1,10 @@
+<?php
+$RUNTIME_NOSETUPFS = true;
+//$RUNTIME_NOAPPS = TRUE;
+require_once('lib/base.php');
+$file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($_GET['service']));
+if(is_null($file)){
+ header('HTTP/1.0 404 Not Found');
+ exit;
+}
+require_once(OC::$APPSROOT . $file); \ No newline at end of file
diff --git a/remote.php b/remote.php
new file mode 100644
index 00000000000..2a7ab167d04
--- /dev/null
+++ b/remote.php
@@ -0,0 +1,16 @@
+<?php
+$RUNTIME_NOSETUPFS = true;
+//$RUNTIME_NOAPPS = TRUE;
+require_once('lib/base.php');
+$path_info = $_SERVER['PATH_INFO'];
+if (!$pos = strpos($path_info, '/', 1)) {
+ $pos = strlen($path_info);
+}
+$service=substr($path_info, 1, $pos-1);
+$file = OCP\CONFIG::getAppValue('core', 'remote_' . $service);
+if(is_null($file)){
+ header('HTTP/1.0 404 Not Found');
+ exit;
+}
+$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
+require_once(OC::$APPSROOT . $file); \ No newline at end of file
diff --git a/remote/.gitignore b/remote/.gitignore
deleted file mode 100644
index c96a04f008e..00000000000
--- a/remote/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore \ No newline at end of file
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php
index 1ed53efcf06..6714711bc87 100644
--- a/settings/ajax/createuser.php
+++ b/settings/ajax/createuser.php
@@ -23,7 +23,8 @@ if( in_array( $username, OC_User::getUsers())){
}
// Return Success story
-if( OC_User::createUser( $username, $password )){
+try {
+ OC_User::createUser($username, $password);
foreach( $groups as $i ){
if(!OC_Group::groupExists($i)){
OC_Group::createGroup($i);
@@ -31,9 +32,8 @@ if( OC_User::createUser( $username, $password )){
OC_Group::addToGroup( $username, $i );
}
OC_JSON::success(array("data" => array( "username" => $username, "groups" => implode( ", ", OC_Group::getUserGroups( $username )))));
-}
-else{
- OC_JSON::error(array("data" => array( "message" => "Unable to add user" )));
+} catch (Exception $exception) {
+ OC_JSON::error(array("data" => array( "message" => $exception->getMessage())));
}
?>
diff --git a/settings/js/users.js b/settings/js/users.js
index eed93d3b303..33872ceaf7b 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -158,29 +158,16 @@ $(document).ready(function(){
event.preventDefault();
var username=$('#newusername').val();
if($('#content table tbody tr').filterAttr('data-uid',username).length>0){
+ OC.dialogs.alert('The username is already being used', 'Error creating user');
return;
}
if($.trim(username) == '') {
- alert('Please provide a username!');
+ OC.dialogs.alert('A valid username must be provided', 'Error creating user');
return false;
}
var password=$('#newuserpassword').val();
var groups=$('#newusergroups').prev().children('div').data('settings').checked;
- var tr
- $.post(
- OC.filePath('settings','ajax','createuser.php'),
- {
- username:username,
- password:password,
- groups:groups,
- },
- function(result){
- if(result.status!='success'){
- tr.remove();
- }
- }
- );
- tr=$('#content table tbody tr').first().clone();
+ var tr=$('#content table tbody tr').first().clone();
tr.attr('data-uid',username);
tr.find('td.name').text(username);
var select=$('<select multiple="multiple" data-placehoder="Groups" title="Groups">');
@@ -201,10 +188,24 @@ $(document).ready(function(){
tr.find('td.remove').append($('<img alt="Delete" title="'+t('settings','Delete')+'" class="svg action" src="'+OC.imagePath('core','actions/delete')+'"/>'));
}
applyMultiplySelect(select);
- $('#content table tbody').last().after(tr);
+ $('#content table tbody').last().append(tr);
tr.find('select.quota option').attr('selected',null);
tr.find('select.quota option').first().attr('selected','selected');
tr.find('select.quota').data('previous','default');
+ $.post(
+ OC.filePath('settings','ajax','createuser.php'),
+ {
+ username:username,
+ password:password,
+ groups:groups,
+ },
+ function(result){
+ if(result.status!='success'){
+ tr.remove();
+ OC.dialogs.alert(result.data.message, 'Error creating user');
+ }
+ }
+ );
});
});
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 3f1d57c73d4..014996a5b20 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -47,7 +47,7 @@
<p class="personalblock">
<strong>WebDAV</strong>
- <code><?php echo OC_Helper::linkToAbsolute('remote', 'webdav.php'); ?></code><br />
+ <code><?php echo OC_Helper::linkToRemote('webdav'); ?></code><br />
<em><?php echo $l->t('use this address to connect to your ownCloud in your file manager');?></em>
</p>