From 69ee0efc0b355c33ec566cffb36c4b0dc429c338 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 17 Apr 2012 19:31:29 +0200 Subject: [PATCH 01/48] remove the require_once lib base from all (or nearly all) files --- apps/bookmarks/addBm.php | 2 +- apps/bookmarks/ajax/addBookmark.php | 2 +- apps/bookmarks/ajax/delBookmark.php | 2 +- apps/bookmarks/ajax/editBookmark.php | 2 +- apps/bookmarks/ajax/recordClick.php | 2 +- apps/bookmarks/ajax/updateList.php | 2 +- apps/bookmarks/index.php | 2 +- apps/calendar/ajax/calendar/activation.php | 2 +- apps/calendar/ajax/calendar/delete.php | 2 +- apps/calendar/ajax/calendar/edit.form.php | 2 +- apps/calendar/ajax/calendar/edit.php | 2 +- apps/calendar/ajax/calendar/new.form.php | 2 +- apps/calendar/ajax/calendar/new.php | 2 +- apps/calendar/ajax/calendar/overview.php | 2 +- apps/calendar/ajax/calendar/update.php | 2 +- apps/calendar/ajax/categories/rescan.php | 2 +- apps/calendar/ajax/changeview.php | 2 +- apps/calendar/ajax/event/delete.php | 2 +- apps/calendar/ajax/event/edit.form.php | 2 +- apps/calendar/ajax/event/edit.php | 2 +- apps/calendar/ajax/event/move.php | 2 +- apps/calendar/ajax/event/new.form.php | 2 +- apps/calendar/ajax/event/new.php | 2 +- apps/calendar/ajax/event/resize.php | 2 +- apps/calendar/ajax/events.php | 2 +- apps/calendar/ajax/import/dialog.php | 2 +- apps/calendar/ajax/import/import.php | 2 +- apps/calendar/ajax/settings/getfirstday.php | 2 +- apps/calendar/ajax/settings/gettimezonedetection.php | 2 +- apps/calendar/ajax/settings/guesstimezone.php | 2 +- apps/calendar/ajax/settings/setfirstday.php | 2 +- apps/calendar/ajax/settings/settimeformat.php | 2 +- apps/calendar/ajax/settings/settimezone.php | 2 +- apps/calendar/ajax/settings/timeformat.php | 2 +- apps/calendar/ajax/settings/timezonedetection.php | 2 +- apps/calendar/ajax/share/changepermission.php | 2 +- apps/calendar/ajax/share/dropdown.php | 2 +- apps/calendar/ajax/share/share.php | 2 +- apps/calendar/ajax/share/unshare.php | 2 +- apps/calendar/caldav.php | 2 +- apps/calendar/export.php | 2 +- apps/calendar/import.php | 2 +- apps/calendar/index.php | 2 +- apps/calendar/resettimezone.php | 2 +- apps/contacts/ajax/activation.php | 2 +- apps/contacts/ajax/addbook.php | 2 +- apps/contacts/ajax/addcontact.php | 2 +- apps/contacts/ajax/addproperty.php | 2 +- apps/contacts/ajax/categories/categoriesfor.php | 2 +- apps/contacts/ajax/categories/delete.php | 2 +- apps/contacts/ajax/categories/list.php | 2 +- apps/contacts/ajax/categories/rescan.php | 2 +- apps/contacts/ajax/chooseaddressbook.php | 2 +- apps/contacts/ajax/contactdetails.php | 2 +- apps/contacts/ajax/contacts.php | 2 +- apps/contacts/ajax/createaddressbook.php | 2 +- apps/contacts/ajax/cropphoto.php | 2 +- apps/contacts/ajax/deletebook.php | 2 +- apps/contacts/ajax/deletecard.php | 2 +- apps/contacts/ajax/deleteproperty.php | 2 +- apps/contacts/ajax/editaddress.php | 2 +- apps/contacts/ajax/editaddressbook.php | 2 +- apps/contacts/ajax/editname.php | 2 +- apps/contacts/ajax/getdetails.php | 2 +- apps/contacts/ajax/importdialog.php | 2 +- apps/contacts/ajax/loadcard.php | 2 +- apps/contacts/ajax/loadintro.php | 2 +- apps/contacts/ajax/loadphoto.php | 2 +- apps/contacts/ajax/newcontact.php | 2 +- apps/contacts/ajax/savecrop.php | 2 +- apps/contacts/ajax/saveproperty.php | 2 +- apps/contacts/ajax/updateaddressbook.php | 2 +- apps/contacts/ajax/uploadphoto.php | 2 +- apps/contacts/carddav.php | 2 +- apps/contacts/dynphoto.php | 2 +- apps/contacts/export.php | 2 +- apps/contacts/import.php | 2 +- apps/contacts/index.php | 2 +- apps/contacts/photo.php | 2 +- apps/contacts/thumbnail.php | 2 +- apps/external/ajax/setsites.php | 2 +- apps/external/index.php | 2 +- apps/files_sharing/ajax/getitem.php | 2 +- apps/files_sharing/ajax/setpermissions.php | 2 +- apps/files_sharing/ajax/share.php | 2 +- apps/files_sharing/ajax/unshare.php | 2 +- apps/files_sharing/ajax/userautocomplete.php | 2 +- apps/files_sharing/list.php | 2 +- apps/files_texteditor/ajax/loadfile.php | 2 +- apps/files_texteditor/ajax/mtime.php | 2 +- apps/files_texteditor/ajax/savefile.php | 2 +- apps/files_versioning/ajax/gethead.php | 2 +- apps/files_versioning/ajax/sethead.php | 2 +- apps/gallery/ajax/createAlbum.php | 2 +- apps/gallery/ajax/galleryOp.php | 2 +- apps/gallery/ajax/sharing.php | 2 +- apps/gallery/ajax/thumbnail.php | 2 +- apps/gallery/index.php | 2 +- apps/gallery/lib/album.php | 2 +- apps/gallery/lib/images_utils.php | 2 +- apps/gallery/sharing.php | 2 +- apps/media/ajax/api.php | 2 +- apps/media/ajax/autoupdate.php | 2 +- apps/media/index.php | 2 +- apps/media/server/xml.server.php | 2 +- apps/media/tomahawk.php | 2 +- apps/remoteStorage/WebDAV.php | 2 +- apps/remoteStorage/ajax/revokeToken.php | 2 +- apps/remoteStorage/auth.php | 2 +- apps/user_migrate/ajax/export.php | 2 +- apps/user_webfinger/webfinger.php | 2 +- core/ajax/appconfig.php | 2 +- core/ajax/grouplist.php | 2 +- core/ajax/translations.php | 2 +- core/ajax/userlist.php | 2 +- core/ajax/validateuser.php | 2 +- core/ajax/vcategories/add.php | 2 +- core/ajax/vcategories/delete.php | 2 +- core/ajax/vcategories/edit.php | 2 +- core/lostpassword/index.php | 2 +- core/lostpassword/resetpassword.php | 2 +- files/ajax/autocomplete.php | 2 +- files/ajax/delete.php | 2 +- files/ajax/download.php | 2 +- files/ajax/list.php | 2 +- files/ajax/mimeicon.php | 2 +- files/ajax/move.php | 2 +- files/ajax/newfile.php | 2 +- files/ajax/newfolder.php | 2 +- files/ajax/rawlist.php | 2 +- files/ajax/rename.php | 2 +- files/ajax/upload.php | 2 +- search/ajax/search.php | 2 +- settings/ajax/changepassword.php | 2 +- settings/ajax/creategroup.php | 2 +- settings/ajax/createuser.php | 2 +- settings/ajax/disableapp.php | 2 +- settings/ajax/enableapp.php | 2 +- settings/ajax/getlog.php | 2 +- settings/ajax/lostpassword.php | 2 +- settings/ajax/openid.php | 2 +- settings/ajax/removegroup.php | 2 +- settings/ajax/removeuser.php | 2 +- settings/ajax/setlanguage.php | 2 +- settings/ajax/setloglevel.php | 2 +- settings/ajax/setquota.php | 2 +- settings/ajax/togglegroups.php | 2 +- 147 files changed, 147 insertions(+), 147 deletions(-) diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php index 861b677222d..27e01bb3baf 100644 --- a/apps/bookmarks/addBm.php +++ b/apps/bookmarks/addBm.php @@ -21,7 +21,7 @@ * */ -require_once('../../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index 8cda7f0f060..4daed58af3b 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -24,7 +24,7 @@ //no apps or filesystem $RUNTIME_NOSETUPFS=true; -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/bookmarks/ajax/delBookmark.php b/apps/bookmarks/ajax/delBookmark.php index 4aef86e771b..655d9f825d9 100644 --- a/apps/bookmarks/ajax/delBookmark.php +++ b/apps/bookmarks/ajax/delBookmark.php @@ -24,7 +24,7 @@ //no apps or filesystem $RUNTIME_NOSETUPFS=true; -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php index 35f30ebcb7a..a834cd216e6 100644 --- a/apps/bookmarks/ajax/editBookmark.php +++ b/apps/bookmarks/ajax/editBookmark.php @@ -24,7 +24,7 @@ //no apps or filesystem $RUNTIME_NOSETUPFS=true; -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/bookmarks/ajax/recordClick.php b/apps/bookmarks/ajax/recordClick.php index e6fdfe043e1..a542f636d8c 100644 --- a/apps/bookmarks/ajax/recordClick.php +++ b/apps/bookmarks/ajax/recordClick.php @@ -24,7 +24,7 @@ //no apps or filesystem $RUNTIME_NOSETUPFS=true; -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index 487e0d290e3..6aa951bbb65 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -25,7 +25,7 @@ //no apps or filesystem $RUNTIME_NOSETUPFS=true; -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/bookmarks/index.php b/apps/bookmarks/index.php index 50fea3fddbd..4d604a4fd55 100644 --- a/apps/bookmarks/index.php +++ b/apps/bookmarks/index.php @@ -21,7 +21,7 @@ * */ -require_once('../../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/calendar/ajax/calendar/activation.php b/apps/calendar/ajax/calendar/activation.php index 7677d85aff3..c93a0495717 100644 --- a/apps/calendar/ajax/calendar/activation.php +++ b/apps/calendar/ajax/calendar/activation.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $calendarid = $_POST['calendarid']; diff --git a/apps/calendar/ajax/calendar/delete.php b/apps/calendar/ajax/calendar/delete.php index a2f5311731c..4bef912333c 100644 --- a/apps/calendar/ajax/calendar/delete.php +++ b/apps/calendar/ajax/calendar/delete.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/calendar/edit.form.php b/apps/calendar/ajax/calendar/edit.form.php index 8922b3eba4e..d3f9629f1ae 100644 --- a/apps/calendar/ajax/calendar/edit.form.php +++ b/apps/calendar/ajax/calendar/edit.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/calendar/edit.php b/apps/calendar/ajax/calendar/edit.php index 8922b3eba4e..d3f9629f1ae 100644 --- a/apps/calendar/ajax/calendar/edit.php +++ b/apps/calendar/ajax/calendar/edit.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/calendar/new.form.php b/apps/calendar/ajax/calendar/new.form.php index fa014351f77..3de56460c2d 100644 --- a/apps/calendar/ajax/calendar/new.form.php +++ b/apps/calendar/ajax/calendar/new.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); diff --git a/apps/calendar/ajax/calendar/new.php b/apps/calendar/ajax/calendar/new.php index 228e6247724..ada28a9fc07 100644 --- a/apps/calendar/ajax/calendar/new.php +++ b/apps/calendar/ajax/calendar/new.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/calendar/ajax/calendar/overview.php b/apps/calendar/ajax/calendar/overview.php index dd55f3e018f..f66d1eae8f8 100644 --- a/apps/calendar/ajax/calendar/overview.php +++ b/apps/calendar/ajax/calendar/overview.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + $l10n = OC_L10N::get('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/calendar/update.php b/apps/calendar/ajax/calendar/update.php index f400c8c14b4..9bb1307a845 100644 --- a/apps/calendar/ajax/calendar/update.php +++ b/apps/calendar/ajax/calendar/update.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/calendar/ajax/categories/rescan.php b/apps/calendar/ajax/categories/rescan.php index 0fd878ed8f9..9273986cad4 100644 --- a/apps/calendar/ajax/categories/rescan.php +++ b/apps/calendar/ajax/categories/rescan.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php index ae48b229b16..707c8c59ebf 100644 --- a/apps/calendar/ajax/changeview.php +++ b/apps/calendar/ajax/changeview.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once ("../../../lib/base.php"); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $view = $_GET['v']; diff --git a/apps/calendar/ajax/event/delete.php b/apps/calendar/ajax/event/delete.php index 5fc12900ef3..49b740656de 100644 --- a/apps/calendar/ajax/event/delete.php +++ b/apps/calendar/ajax/event/delete.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php index 98c22eb0206..1634e7ea416 100644 --- a/apps/calendar/ajax/event/edit.form.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + if(!OC_USER::isLoggedIn()) { die(''); diff --git a/apps/calendar/ajax/event/edit.php b/apps/calendar/ajax/event/edit.php index 64daffddef0..53912cb4c93 100644 --- a/apps/calendar/ajax/event/edit.php +++ b/apps/calendar/ajax/event/edit.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/event/move.php b/apps/calendar/ajax/event/move.php index 8150fdbaa32..bfebefb8fe0 100644 --- a/apps/calendar/ajax/event/move.php +++ b/apps/calendar/ajax/event/move.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $id = $_POST['id']; diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php index 838002a3a09..2e03c02af27 100644 --- a/apps/calendar/ajax/event/new.form.php +++ b/apps/calendar/ajax/event/new.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + if(!OC_USER::isLoggedIn()) { die(''); diff --git a/apps/calendar/ajax/event/new.php b/apps/calendar/ajax/event/new.php index 7070bbf05d7..5e8c305e97a 100644 --- a/apps/calendar/ajax/event/new.php +++ b/apps/calendar/ajax/event/new.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/event/resize.php b/apps/calendar/ajax/event/resize.php index aa2d420e77d..9a9d37ff3d4 100644 --- a/apps/calendar/ajax/event/resize.php +++ b/apps/calendar/ajax/event/resize.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $id = $_POST['id']; diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index d053df2e4c1..0cfee0dbdc1 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once ('../../../lib/base.php'); + require_once('when/When.php'); $l = OC_L10N::get('calendar'); $unnamed = $l->t('unnamed'); diff --git a/apps/calendar/ajax/import/dialog.php b/apps/calendar/ajax/import/dialog.php index 16ec54d14a2..0c1a8f94943 100644 --- a/apps/calendar/ajax/import/dialog.php +++ b/apps/calendar/ajax/import/dialog.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); $tmpl = new OC_Template('calendar', 'part.import'); diff --git a/apps/calendar/ajax/import/import.php b/apps/calendar/ajax/import/import.php index d0bdab4f0d5..95294948f75 100644 --- a/apps/calendar/ajax/import/import.php +++ b/apps/calendar/ajax/import/import.php @@ -7,7 +7,7 @@ */ //check for calendar rights or create new one ob_start(); -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); $nl = "\n\r"; diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php index cab5870509a..63218dcd028 100644 --- a/apps/calendar/ajax/settings/getfirstday.php +++ b/apps/calendar/ajax/settings/getfirstday.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $firstday = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstday', 'mo'); OC_JSON::encodedPrint(array('firstday' => $firstday)); diff --git a/apps/calendar/ajax/settings/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php index 11255fe8ef3..b9555900a0e 100644 --- a/apps/calendar/ajax/settings/gettimezonedetection.php +++ b/apps/calendar/ajax/settings/gettimezonedetection.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); OC_JSON::success(array('detection' => OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index c02b8d10b8d..c0b4ef65263 100755 --- a/apps/calendar/ajax/settings/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/settings/setfirstday.php b/apps/calendar/ajax/settings/setfirstday.php index 3b652212205..3b1b5481db4 100644 --- a/apps/calendar/ajax/settings/setfirstday.php +++ b/apps/calendar/ajax/settings/setfirstday.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); if(isset($_POST["firstday"])){ OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'firstday', $_POST["firstday"]); diff --git a/apps/calendar/ajax/settings/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php index 8f65447065c..374825a5d40 100644 --- a/apps/calendar/ajax/settings/settimeformat.php +++ b/apps/calendar/ajax/settings/settimeformat.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); if(isset($_POST["timeformat"])){ OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index 8dda28335f7..b0ca9dcd944 100644 --- a/apps/calendar/ajax/settings/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -7,7 +7,7 @@ */ // Init owncloud -require_once('../../../../lib/base.php'); + $l=OC_L10N::get('calendar'); diff --git a/apps/calendar/ajax/settings/timeformat.php b/apps/calendar/ajax/settings/timeformat.php index e0dbe8d3cd7..728b7155efe 100644 --- a/apps/calendar/ajax/settings/timeformat.php +++ b/apps/calendar/ajax/settings/timeformat.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $timeformat = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'timeformat', "24"); OC_JSON::encodedPrint(array("timeformat" => $timeformat)); diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php index f67bab901e7..d29c5568e49 100644 --- a/apps/calendar/ajax/settings/timezonedetection.php +++ b/apps/calendar/ajax/settings/timezonedetection.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); if($_POST['timezonedetection'] == 'on'){ diff --git a/apps/calendar/ajax/share/changepermission.php b/apps/calendar/ajax/share/changepermission.php index d91f87b613f..5538637eab4 100644 --- a/apps/calendar/ajax/share/changepermission.php +++ b/apps/calendar/ajax/share/changepermission.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + $id = strip_tags($_GET['id']); $idtype = strip_tags($_GET['idtype']); $permission = (int) strip_tags($_GET['permission']); diff --git a/apps/calendar/ajax/share/dropdown.php b/apps/calendar/ajax/share/dropdown.php index eb396d38fd9..85530c163ed 100644 --- a/apps/calendar/ajax/share/dropdown.php +++ b/apps/calendar/ajax/share/dropdown.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + $user = OC_USER::getUser(); $calid = $_GET['calid']; $calendar = OC_Calendar_Calendar::find($calid); diff --git a/apps/calendar/ajax/share/share.php b/apps/calendar/ajax/share/share.php index d892727701a..88885cd7c10 100644 --- a/apps/calendar/ajax/share/share.php +++ b/apps/calendar/ajax/share/share.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + $id = strip_tags($_GET['id']); $idtype = strip_tags($_GET['idtype']); switch($idtype){ diff --git a/apps/calendar/ajax/share/unshare.php b/apps/calendar/ajax/share/unshare.php index ec3150a89aa..97ef7ab2cb0 100644 --- a/apps/calendar/ajax/share/unshare.php +++ b/apps/calendar/ajax/share/unshare.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + $id = strip_tags($_GET['id']); $idtype = strip_tags($_GET['idtype']); switch($idtype){ diff --git a/apps/calendar/caldav.php b/apps/calendar/caldav.php index b710b99ea43..a319fd05223 100644 --- a/apps/calendar/caldav.php +++ b/apps/calendar/caldav.php @@ -9,7 +9,7 @@ // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../../lib/base.php'); + OC_Util::checkAppEnabled('calendar'); // Backends diff --git a/apps/calendar/export.php b/apps/calendar/export.php index 2736eec96c2..658df9db230 100644 --- a/apps/calendar/export.php +++ b/apps/calendar/export.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once ('../../lib/base.php'); + OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); $cal = isset($_GET['calid']) ? $_GET['calid'] : NULL; diff --git a/apps/calendar/import.php b/apps/calendar/import.php index b1c6f91df84..f4a40e3b427 100644 --- a/apps/calendar/import.php +++ b/apps/calendar/import.php @@ -7,7 +7,7 @@ */ //check for calendar rights or create new one ob_start(); -require_once ('../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); $nl = "\n"; diff --git a/apps/calendar/index.php b/apps/calendar/index.php index f964a13ef79..4aa1f695e31 100644 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once ('../../lib/base.php'); + OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); diff --git a/apps/calendar/resettimezone.php b/apps/calendar/resettimezone.php index 1ef9591ae39..0996924b5ad 100644 --- a/apps/calendar/resettimezone.php +++ b/apps/calendar/resettimezone.php @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/apps/contacts/ajax/activation.php b/apps/contacts/ajax/activation.php index d69e3dba3f8..06d1a7e24fc 100644 --- a/apps/contacts/ajax/activation.php +++ b/apps/contacts/ajax/activation.php @@ -7,7 +7,7 @@ * See the COPYING-README file. */ -require_once ("../../../lib/base.php"); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/addbook.php b/apps/contacts/ajax/addbook.php index f5852183cc3..f466d57e12e 100644 --- a/apps/contacts/ajax/addbook.php +++ b/apps/contacts/ajax/addbook.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); $book = array( diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php index 68da54655ae..152277181bb 100644 --- a/apps/contacts/ajax/addcontact.php +++ b/apps/contacts/ajax/addcontact.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); OC_Log::write('contacts','ajax/addcontact.php: '.$msg, OC_Log::DEBUG); diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index d2c0291e8c6..9a5e59692d6 100644 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/categories/categoriesfor.php b/apps/contacts/ajax/categories/categoriesfor.php index c02c37914a2..39a7758c8fb 100644 --- a/apps/contacts/ajax/categories/categoriesfor.php +++ b/apps/contacts/ajax/categories/categoriesfor.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/categories/delete.php b/apps/contacts/ajax/categories/delete.php index 3ba5aa16068..3cc2dea6638 100644 --- a/apps/contacts/ajax/categories/delete.php +++ b/apps/contacts/ajax/categories/delete.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/categories/list.php b/apps/contacts/ajax/categories/list.php index 64d74c82e69..98c1c705180 100644 --- a/apps/contacts/ajax/categories/list.php +++ b/apps/contacts/ajax/categories/list.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/categories/rescan.php b/apps/contacts/ajax/categories/rescan.php index 5f1057bab44..09208c3f685 100644 --- a/apps/contacts/ajax/categories/rescan.php +++ b/apps/contacts/ajax/categories/rescan.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/chooseaddressbook.php b/apps/contacts/ajax/chooseaddressbook.php index d6080791299..b47c872e9aa 100644 --- a/apps/contacts/ajax/chooseaddressbook.php +++ b/apps/contacts/ajax/chooseaddressbook.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/contactdetails.php b/apps/contacts/ajax/contactdetails.php index 03895c862aa..13c3f80c3b5 100644 --- a/apps/contacts/ajax/contactdetails.php +++ b/apps/contacts/ajax/contactdetails.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); OC_Log::write('contacts','ajax/contactdetails.php: '.$msg, OC_Log::DEBUG); diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index cf86764105f..3e75e4c80e3 100644 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php index 28944fe864c..5cdb9b49ef8 100644 --- a/apps/contacts/ajax/createaddressbook.php +++ b/apps/contacts/ajax/createaddressbook.php @@ -6,7 +6,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/cropphoto.php b/apps/contacts/ajax/cropphoto.php index 878fb5610c6..96e66ffb69c 100644 --- a/apps/contacts/ajax/cropphoto.php +++ b/apps/contacts/ajax/cropphoto.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/deletebook.php b/apps/contacts/ajax/deletebook.php index 46d8deb4868..b80df526f95 100644 --- a/apps/contacts/ajax/deletebook.php +++ b/apps/contacts/ajax/deletebook.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/deletecard.php b/apps/contacts/ajax/deletecard.php index 5675aef5f15..98cdb85f0fc 100644 --- a/apps/contacts/ajax/deletecard.php +++ b/apps/contacts/ajax/deletecard.php @@ -26,7 +26,7 @@ function bailOut($msg) { } // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index ab0958cac58..73786cb10cf 100644 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/editaddress.php b/apps/contacts/ajax/editaddress.php index 4e6456f6045..73f34ef5c6c 100644 --- a/apps/contacts/ajax/editaddress.php +++ b/apps/contacts/ajax/editaddress.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/editaddressbook.php b/apps/contacts/ajax/editaddressbook.php index a6262f39b23..ef797778d95 100644 --- a/apps/contacts/ajax/editaddressbook.php +++ b/apps/contacts/ajax/editaddressbook.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); $addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']); diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php index 31bdd125675..9e4d6814620 100644 --- a/apps/contacts/ajax/editname.php +++ b/apps/contacts/ajax/editname.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); function bailOut($msg) { diff --git a/apps/contacts/ajax/getdetails.php b/apps/contacts/ajax/getdetails.php index 4819916f4c3..aac69f4c52e 100644 --- a/apps/contacts/ajax/getdetails.php +++ b/apps/contacts/ajax/getdetails.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/importdialog.php b/apps/contacts/ajax/importdialog.php index 280e462f662..cde6bb2f5c4 100644 --- a/apps/contacts/ajax/importdialog.php +++ b/apps/contacts/ajax/importdialog.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); $tmpl = new OC_Template('contacts', 'part.import'); diff --git a/apps/contacts/ajax/loadcard.php b/apps/contacts/ajax/loadcard.php index 037fe2a6df2..4b2a65db911 100644 --- a/apps/contacts/ajax/loadcard.php +++ b/apps/contacts/ajax/loadcard.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); OC_Log::write('contacts','ajax/loadcard.php: '.$msg, OC_Log::DEBUG); diff --git a/apps/contacts/ajax/loadintro.php b/apps/contacts/ajax/loadintro.php index 8e5673655a1..7185c5cbe0a 100644 --- a/apps/contacts/ajax/loadintro.php +++ b/apps/contacts/ajax/loadintro.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); OC_Log::write('contacts','ajax/loadintro.php: '.$msg, OC_Log::DEBUG); diff --git a/apps/contacts/ajax/loadphoto.php b/apps/contacts/ajax/loadphoto.php index 2c8bb7bf1ed..669f9e2844d 100644 --- a/apps/contacts/ajax/loadphoto.php +++ b/apps/contacts/ajax/loadphoto.php @@ -20,7 +20,7 @@ * */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); diff --git a/apps/contacts/ajax/newcontact.php b/apps/contacts/ajax/newcontact.php index fcfd12ca80d..36c37e039e9 100644 --- a/apps/contacts/ajax/newcontact.php +++ b/apps/contacts/ajax/newcontact.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); OC_Log::write('contacts','ajax/newcontact.php: '.$msg, OC_Log::DEBUG); diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index 0df4e1998cb..36ba6a046dc 100644 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -22,7 +22,7 @@ * Remember to delete tmp file at some point. */ // Init owncloud -require_once('../../../lib/base.php'); + OC_Log::write('contacts','ajax/savecrop.php: Huzzah!!!', OC_Log::DEBUG); // Check if we are a user diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php index 99d55e7927a..e459ed733d8 100644 --- a/apps/contacts/ajax/saveproperty.php +++ b/apps/contacts/ajax/saveproperty.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php index 211df84b1d1..06028db479a 100644 --- a/apps/contacts/ajax/updateaddressbook.php +++ b/apps/contacts/ajax/updateaddressbook.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/contacts/ajax/uploadphoto.php b/apps/contacts/ajax/uploadphoto.php index 9780df46476..96231596222 100644 --- a/apps/contacts/ajax/uploadphoto.php +++ b/apps/contacts/ajax/uploadphoto.php @@ -20,7 +20,7 @@ * */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php index 654aeb66a72..794fb890898 100644 --- a/apps/contacts/carddav.php +++ b/apps/contacts/carddav.php @@ -23,7 +23,7 @@ // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../../lib/base.php'); + OC_Util::checkAppEnabled('contacts'); // Backends diff --git a/apps/contacts/dynphoto.php b/apps/contacts/dynphoto.php index 2beac15e143..c1646e483de 100644 --- a/apps/contacts/dynphoto.php +++ b/apps/contacts/dynphoto.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); + $tmp_path = $_GET['tmp_path']; $maxsize = isset($_GET['maxsize']) ? $_GET['maxsize'] : -1; header("Cache-Control: no-cache, no-store, must-revalidate"); diff --git a/apps/contacts/export.php b/apps/contacts/export.php index fb3e0a41ae7..95d02a9afd4 100644 --- a/apps/contacts/export.php +++ b/apps/contacts/export.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once ("../../lib/base.php"); + OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); $bookid = isset($_GET['bookid']) ? $_GET['bookid'] : NULL; diff --git a/apps/contacts/import.php b/apps/contacts/import.php index 04cfc397d56..8cf0a173db1 100644 --- a/apps/contacts/import.php +++ b/apps/contacts/import.php @@ -7,7 +7,7 @@ */ //check for addressbooks rights or create new one ob_start(); -require_once ('../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); $nl = "\n"; diff --git a/apps/contacts/index.php b/apps/contacts/index.php index 4039b8afd3d..d5545e76197 100644 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -6,7 +6,7 @@ * later. * See the COPYING-README file. */ -require_once('../../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php index 298f1215e3c..cd0ae350102 100644 --- a/apps/contacts/photo.php +++ b/apps/contacts/photo.php @@ -9,7 +9,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); + OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php index 5082626499b..c7d37b755fe 100644 --- a/apps/contacts/thumbnail.php +++ b/apps/contacts/thumbnail.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); + OC_JSON::checkLoggedIn(); //OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); diff --git a/apps/external/ajax/setsites.php b/apps/external/ajax/setsites.php index 0537b7ea581..3223bf68d9b 100644 --- a/apps/external/ajax/setsites.php +++ b/apps/external/ajax/setsites.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); + OC_Util::checkAdminUser(); $sites = array(); diff --git a/apps/external/index.php b/apps/external/index.php index 1c20f59eaff..0baa62a94b6 100644 --- a/apps/external/index.php +++ b/apps/external/index.php @@ -20,7 +20,7 @@ * License along with this library. If not, see . * */ -require_once('../../lib/base.php'); + require_once('lib/external.php'); OC_Util::checkLoggedIn(); diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index ba01adffb9a..c838895efbe 100644 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -1,7 +1,7 @@ 'Not enought arguments')); diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php index 184171f8fca..bf42fd2becb 100644 --- a/apps/gallery/ajax/thumbnail.php +++ b/apps/gallery/ajax/thumbnail.php @@ -21,7 +21,7 @@ * */ -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); diff --git a/apps/gallery/index.php b/apps/gallery/index.php index 7de7c094142..8c45cfb19fc 100644 --- a/apps/gallery/index.php +++ b/apps/gallery/index.php @@ -21,7 +21,7 @@ * */ -require_once('../../lib/base.php'); + OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('gallery'); diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php index ef361a37913..efc545f0205 100644 --- a/apps/gallery/lib/album.php +++ b/apps/gallery/lib/album.php @@ -92,7 +92,7 @@ class OC_Gallery_Album { } public static function changeThumbnailPath($oldname, $newname) { - require_once('../../../lib/base.php'); + $thumbpath = OC::$CONFIG_DATADIRECTORY.'/../gallery/'; rename($thumbpath.$oldname.'.png', $thumbpath.$newname.'.png'); } diff --git a/apps/gallery/lib/images_utils.php b/apps/gallery/lib/images_utils.php index 126298913be..6f3959a342d 100644 --- a/apps/gallery/lib/images_utils.php +++ b/apps/gallery/lib/images_utils.php @@ -22,7 +22,7 @@ */ if (file_exists('../../../lib/base.php')) - require_once('../../../lib/base.php'); + elseif (file_exists('lib/base.php')) require_once('lib/base.php'); diff --git a/apps/gallery/sharing.php b/apps/gallery/sharing.php index d7430becf43..2739f63d4e0 100644 --- a/apps/gallery/sharing.php +++ b/apps/gallery/sharing.php @@ -25,7 +25,7 @@ if (!isset($_GET['token']) || empty($_GET['token'])) { exit; } -require_once('../../lib/base.php'); + OC_Util::checkAppEnabled('gallery'); diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php index 9d9c14deb17..72235bf5db8 100644 --- a/apps/media/ajax/api.php +++ b/apps/media/ajax/api.php @@ -23,7 +23,7 @@ header('Content-type: text/html; charset=UTF-8') ; -require_once('../../../lib/base.php'); + OC_JSON::checkAppEnabled('media'); require_once('../lib_collection.php'); require_once('../lib_scanner.php'); diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php index a78b5e25dd1..ea7c5006e70 100644 --- a/apps/media/ajax/autoupdate.php +++ b/apps/media/ajax/autoupdate.php @@ -27,7 +27,7 @@ header('Content-type: text/html; charset=UTF-8') ; $RUNTIME_NOAPPS=true; $RUNTIME_NOSETUPFS=true; -require_once('../../../lib/base.php'); + OC_JSON::checkAppEnabled('media'); $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true'); diff --git a/apps/media/index.php b/apps/media/index.php index 419d4ae0bde..f51d62b77cd 100644 --- a/apps/media/index.php +++ b/apps/media/index.php @@ -22,7 +22,7 @@ */ -require_once('../../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index cb9b68fc422..83339c91af1 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -22,7 +22,7 @@ */ -require_once('../../../lib/base.php'); + OC_Util::checkAppEnabled('media'); require_once('../lib_collection.php'); require_once('../lib_ampache.php'); diff --git a/apps/media/tomahawk.php b/apps/media/tomahawk.php index 6dd41233f12..1ff2599e103 100644 --- a/apps/media/tomahawk.php +++ b/apps/media/tomahawk.php @@ -23,7 +23,7 @@ $_POST=$_GET; //debug -require_once('../../lib/base.php'); + OC_JSON::checkAppEnabled('media'); require_once('lib_collection.php'); diff --git a/apps/remoteStorage/WebDAV.php b/apps/remoteStorage/WebDAV.php index cad465181a9..3522d1ed683 100644 --- a/apps/remoteStorage/WebDAV.php +++ b/apps/remoteStorage/WebDAV.php @@ -29,7 +29,7 @@ // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../../lib/base.php'); + OC_Util::checkAppEnabled('remoteStorage'); require_once('Sabre/autoload.php'); require_once('lib_remoteStorage.php'); diff --git a/apps/remoteStorage/ajax/revokeToken.php b/apps/remoteStorage/ajax/revokeToken.php index ca56cf560ec..376fe29b3e7 100644 --- a/apps/remoteStorage/ajax/revokeToken.php +++ b/apps/remoteStorage/ajax/revokeToken.php @@ -29,7 +29,7 @@ // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../../../lib/base.php'); + OC_Util::checkAppEnabled('remoteStorage'); require_once('Sabre/autoload.php'); require_once('../lib_remoteStorage.php'); diff --git a/apps/remoteStorage/auth.php b/apps/remoteStorage/auth.php index c00f9d5555c..d2b9eece35b 100644 --- a/apps/remoteStorage/auth.php +++ b/apps/remoteStorage/auth.php @@ -29,7 +29,7 @@ // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../../lib/base.php'); + OC_Util::checkAppEnabled('remoteStorage'); require_once('Sabre/autoload.php'); require_once('lib_remoteStorage.php'); diff --git a/apps/user_migrate/ajax/export.php b/apps/user_migrate/ajax/export.php index 86745d6b162..99503cad142 100644 --- a/apps/user_migrate/ajax/export.php +++ b/apps/user_migrate/ajax/export.php @@ -21,7 +21,7 @@ * */ // Init owncloud -require_once('../../../lib/base.php'); + // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index 9ada473ca87..51686111bf7 100644 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -25,7 +25,7 @@ $SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT)); $WEBROOT=substr($SUBURI,0,-34); */ -require_once('../../lib/base.php'); + $request = urldecode($_GET['q']); if($_GET['q']) { $reqParts = explode('@', $request); diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index f815d710631..41e421b2fe4 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once ("../../lib/base.php"); + OC_JSON::checkLoggedIn(); $action=isset($_POST['action'])?$_POST['action']:$_GET['action']; $result=false; diff --git a/core/ajax/grouplist.php b/core/ajax/grouplist.php index cc15102bbc3..ba079e2dae1 100644 --- a/core/ajax/grouplist.php +++ b/core/ajax/grouplist.php @@ -22,7 +22,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps, yet -require_once('../../lib/base.php'); + if(!OC_User::isLoggedIn()){ if(!isset($_SERVER['PHP_AUTH_USER'])){ diff --git a/core/ajax/translations.php b/core/ajax/translations.php index a6433b1964a..3091926095f 100644 --- a/core/ajax/translations.php +++ b/core/ajax/translations.php @@ -22,7 +22,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); + $app = $_POST["app"]; diff --git a/core/ajax/userlist.php b/core/ajax/userlist.php index c8168eaf460..d9910d5a98f 100644 --- a/core/ajax/userlist.php +++ b/core/ajax/userlist.php @@ -22,7 +22,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps, yet -require_once('../../lib/base.php'); + if(!OC_User::isLoggedIn()){ if(!isset($_SERVER['PHP_AUTH_USER'])){ diff --git a/core/ajax/validateuser.php b/core/ajax/validateuser.php index 258bd50fcad..a55c54a9a46 100644 --- a/core/ajax/validateuser.php +++ b/core/ajax/validateuser.php @@ -22,7 +22,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps, yet -require_once('../../lib/base.php'); + if(!isset($_SERVER['PHP_AUTH_USER'])){ header('WWW-Authenticate: Basic realm="ownCloud Server"'); diff --git a/core/ajax/vcategories/add.php b/core/ajax/vcategories/add.php index a58489228d8..b0183af7fc5 100644 --- a/core/ajax/vcategories/add.php +++ b/core/ajax/vcategories/add.php @@ -14,7 +14,7 @@ function debug($msg) { OC_Log::write('core','ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG); } -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $category = isset($_GET['category'])?strip_tags($_GET['category']):null; $app = isset($_GET['app'])?$_GET['app']:null; diff --git a/core/ajax/vcategories/delete.php b/core/ajax/vcategories/delete.php index 75def433d30..f96add3d8c3 100644 --- a/core/ajax/vcategories/delete.php +++ b/core/ajax/vcategories/delete.php @@ -15,7 +15,7 @@ function debug($msg) { OC_Log::write('core','ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG); } -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $app = isset($_POST['app'])?$_POST['app']:null; $categories = isset($_POST['categories'])?$_POST['categories']:null; diff --git a/core/ajax/vcategories/edit.php b/core/ajax/vcategories/edit.php index 252b3d3454c..5b346bef28c 100644 --- a/core/ajax/vcategories/edit.php +++ b/core/ajax/vcategories/edit.php @@ -15,7 +15,7 @@ function debug($msg) { OC_Log::write('core','ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG); } -require_once('../../../lib/base.php'); + OC_JSON::checkLoggedIn(); $app = isset($_GET['app'])?$_GET['app']:null; diff --git a/core/lostpassword/index.php b/core/lostpassword/index.php index 89bb6cfa794..1400ec67cab 100644 --- a/core/lostpassword/index.php +++ b/core/lostpassword/index.php @@ -7,7 +7,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps -require_once('../../lib/base.php'); + // Someone lost their password: if (isset($_POST['user'])) { diff --git a/core/lostpassword/resetpassword.php b/core/lostpassword/resetpassword.php index 1c78d720947..5f16e854f42 100644 --- a/core/lostpassword/resetpassword.php +++ b/core/lostpassword/resetpassword.php @@ -7,7 +7,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps -require_once('../../lib/base.php'); + // Someone wants to reset their password: if(isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], 'owncloud', 'lostpassword') === $_GET['token']) { diff --git a/files/ajax/autocomplete.php b/files/ajax/autocomplete.php index 8d7a5b482bd..8cdb6188a02 100644 --- a/files/ajax/autocomplete.php +++ b/files/ajax/autocomplete.php @@ -3,7 +3,7 @@ // Init owncloud -require_once('../../lib/base.php'); + OC_JSON::checkLoggedIn(); diff --git a/files/ajax/delete.php b/files/ajax/delete.php index 1725201fdd9..d8a01d7acf1 100644 --- a/files/ajax/delete.php +++ b/files/ajax/delete.php @@ -1,7 +1,7 @@ Date: Wed, 18 Apr 2012 08:20:51 +0200 Subject: [PATCH 02/48] open app thru index.php --- index.php | 2 +- lib/base.php | 44 ++++++++++++++++++++++++++++++++------------ lib/helper.php | 11 +++++++++++ lib/util.php | 2 +- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index b4cac1879c6..1858865875b 100644 --- a/index.php +++ b/index.php @@ -57,7 +57,7 @@ elseif(OC_User::isLoggedIn()) { exit(); } else { - OC_Util::redirectToDefaultPage(); + OC::loadapp(); } } diff --git a/lib/base.php b/lib/base.php index f3dacdc0f76..c21ab973593 100644 --- a/lib/base.php +++ b/lib/base.php @@ -62,15 +62,22 @@ class OC{ * the root path of the 3rdparty folder for http requests (e.g. owncloud/3rdparty) */ public static $THIRDPARTYWEBROOT = ''; - /** - * The installation path of the apps folder on the server (e.g. /srv/http/owncloud) - */ - public static $APPSROOT = ''; - /** - * the root path of the apps folder for http requests (e.g. owncloud) - */ - public static $APPSWEBROOT = ''; - + /** + * The installation path of the apps folder on the server (e.g. /srv/http/owncloud) + */ + public static $APPSROOT = ''; + /** + * the root path of the apps folder for http requests (e.g. owncloud) + */ + public static $APPSWEBROOT = ''; + /* + * requested app + */ + public static $REQUESTEDAPP = ''; + /* + * requested file of app + */ + public static $REQUESTEDFILE = ''; /** * SPL autoload */ @@ -161,12 +168,15 @@ class OC{ } // search the apps folder - if(file_exists(OC::$SERVERROOT.'/apps')){ + if(OC_Config::getValue('appsroot', '')<>''){ + OC::$APPSROOT=OC_Config::getValue('appsroot', ''); + OC::$APPSWEBROOT=OC_Config::getValue('appsurl', ''); + }elseif(file_exists(OC::$SERVERROOT.'/apps')){ OC::$APPSROOT=OC::$SERVERROOT; OC::$APPSWEBROOT=OC::$WEBROOT; }elseif(file_exists(OC::$SERVERROOT.'/../apps')){ - OC::$APPSWEBROOT=rtrim(dirname(OC::$WEBROOT), '/'); OC::$APPSROOT=rtrim(dirname(OC::$SERVERROOT), '/'); + OC::$APPSWEBROOT=rtrim(dirname(OC::$WEBROOT), '/'); }else{ echo("apps directory not found! Please put the ownCloud apps folder in the ownCloud folder or the folder above. You can also configure the location in the config.php file."); exit; @@ -261,6 +271,13 @@ class OC{ ini_set('session.cookie_httponly','1;'); session_start(); } + + public static function loadapp(){ + if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP)){ + OC_App::loadApps(); + require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php'); + } + } public static function init(){ // register autoloader @@ -371,6 +388,9 @@ class OC{ //make sure temporary files are cleaned up register_shutdown_function(array('OC_Helper','cleanTmp')); + + self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files'); + self::$REQUESTEDFILE = (isset($_GET['file'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . $_GET['file'], OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?$_GET['file']:null):null); } } @@ -399,4 +419,4 @@ if(!function_exists('get_temp_dir')) { } } -OC::init(); +OC::init(); \ No newline at end of file diff --git a/lib/helper.php b/lib/helper.php index 412f0e6b764..52278f5c3a2 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -520,4 +520,15 @@ class OC_Helper { return $newname; } + + /* + * checks if $sub is a subdirectory of $parent + * + * @param $sub + * @param $parent + * @return bool + */ + public static function issubdirectory($sub, $parent){ + return (substr(realpath($sub), 0, strlen(realpath($parent))) == realpath($parent))?true:false; + } } diff --git a/lib/util.php b/lib/util.php index 2ea392ec31d..e3c20ddb858 100644 --- a/lib/util.php +++ b/lib/util.php @@ -292,7 +292,7 @@ class OC_Util { if(isset($_REQUEST['redirect_url'])) { header( 'Location: '.$_REQUEST['redirect_url']); } else { - header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php')); + header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files')); } exit(); } From dfc92675e0d76ad9550a274b712e084e1738831c Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 18 Apr 2012 17:25:44 +0200 Subject: [PATCH 03/48] make menu work with movable apps --- lib/helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/helper.php b/lib/helper.php index 61a57ec27e3..77b56051419 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -41,7 +41,11 @@ class OC_Helper { $app .= '/'; // Check if the app is in the app folder if( file_exists( OC::$APPSROOT . '/apps/'. $app.$file )){ - $urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file; + if(substr($app, -1, 1) == '/'){ + $app = substr($app, 0, strlen($app) - 1); + } + $urlLinkTo = OC::$WEBROOT . '?app=' . $app; + $urlLinkTo .= ($file!='index.php')?'&file=' . $file:''; } else{ $urlLinkTo = OC::$WEBROOT . '/' . $app . $file; From 45de7ad221f9e505abdabcc5084dd12c80851469 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 18 Apr 2012 17:27:34 +0200 Subject: [PATCH 04/48] move files to app folder --- {files => apps/files}/admin.php | 0 {files => apps/files}/ajax/autocomplete.php | 0 {files => apps/files}/ajax/delete.php | 0 {files => apps/files}/ajax/download.php | 0 {files => apps/files}/ajax/list.php | 0 {files => apps/files}/ajax/mimeicon.php | 0 {files => apps/files}/ajax/move.php | 0 {files => apps/files}/ajax/newfile.php | 0 {files => apps/files}/ajax/newfolder.php | 0 {files => apps/files}/ajax/rawlist.php | 0 {files => apps/files}/ajax/rename.php | 0 {files => apps/files}/ajax/scan.php | 0 {files => apps/files}/ajax/timezone.php | 0 {files => apps/files}/ajax/upload.php | 0 {files => apps/files}/appinfo/app.php | 0 {files => apps/files}/css/files.css | 0 {files => apps/files}/download.php | 0 {files => apps/files}/index.php | 0 {files => apps/files}/js/admin.js | 0 {files => apps/files}/js/fileactions.js | 0 {files => apps/files}/js/filelist.js | 0 {files => apps/files}/js/files.js | 0 {files => apps/files}/js/timezone.js | 0 {files => apps/files}/l10n/ar.php | 0 {files => apps/files}/l10n/bg_BG.php | 0 {files => apps/files}/l10n/ca.php | 0 {files => apps/files}/l10n/cs_CZ.php | 0 {files => apps/files}/l10n/da.php | 0 {files => apps/files}/l10n/de.php | 0 {files => apps/files}/l10n/el.php | 0 {files => apps/files}/l10n/eo.php | 0 {files => apps/files}/l10n/es.php | 0 {files => apps/files}/l10n/et_EE.php | 0 {files => apps/files}/l10n/eu.php | 0 {files => apps/files}/l10n/fr.php | 0 {files => apps/files}/l10n/gl.php | 0 {files => apps/files}/l10n/he.php | 0 {files => apps/files}/l10n/hr.php | 0 {files => apps/files}/l10n/hu_HU.php | 0 {files => apps/files}/l10n/ia.php | 0 {files => apps/files}/l10n/id.php | 0 {files => apps/files}/l10n/it.php | 0 {files => apps/files}/l10n/ja_JP.php | 0 {files => apps/files}/l10n/lb.php | 0 {files => apps/files}/l10n/lt_LT.php | 0 {files => apps/files}/l10n/ms_MY.php | 0 {files => apps/files}/l10n/nb_NO.php | 0 {files => apps/files}/l10n/nl.php | 0 {files => apps/files}/l10n/nn_NO.php | 0 {files => apps/files}/l10n/pl.php | 0 {files => apps/files}/l10n/pt_BR.php | 0 {files => apps/files}/l10n/ro.php | 0 {files => apps/files}/l10n/ru.php | 0 {files => apps/files}/l10n/sk_SK.php | 0 {files => apps/files}/l10n/sl.php | 0 {files => apps/files}/l10n/sr.php | 0 {files => apps/files}/l10n/sr@latin.php | 0 {files => apps/files}/l10n/sv.php | 0 {files => apps/files}/l10n/th_TH.php | 0 {files => apps/files}/l10n/tr.php | 0 {files => apps/files}/l10n/xgettextfiles | 0 {files => apps/files}/l10n/zh_CN.php | 0 {files => apps/files}/settings.php | 0 {files => apps/files}/templates/admin.php | 0 {files => apps/files}/templates/index.php | 0 {files => apps/files}/templates/part.breadcrumb.php | 0 {files => apps/files}/templates/part.list.php | 0 {files => apps/files}/webdav.php | 0 68 files changed, 0 insertions(+), 0 deletions(-) rename {files => apps/files}/admin.php (100%) rename {files => apps/files}/ajax/autocomplete.php (100%) rename {files => apps/files}/ajax/delete.php (100%) rename {files => apps/files}/ajax/download.php (100%) rename {files => apps/files}/ajax/list.php (100%) rename {files => apps/files}/ajax/mimeicon.php (100%) rename {files => apps/files}/ajax/move.php (100%) rename {files => apps/files}/ajax/newfile.php (100%) rename {files => apps/files}/ajax/newfolder.php (100%) rename {files => apps/files}/ajax/rawlist.php (100%) rename {files => apps/files}/ajax/rename.php (100%) rename {files => apps/files}/ajax/scan.php (100%) rename {files => apps/files}/ajax/timezone.php (100%) rename {files => apps/files}/ajax/upload.php (100%) rename {files => apps/files}/appinfo/app.php (100%) rename {files => apps/files}/css/files.css (100%) rename {files => apps/files}/download.php (100%) rename {files => apps/files}/index.php (100%) rename {files => apps/files}/js/admin.js (100%) rename {files => apps/files}/js/fileactions.js (100%) rename {files => apps/files}/js/filelist.js (100%) rename {files => apps/files}/js/files.js (100%) rename {files => apps/files}/js/timezone.js (100%) rename {files => apps/files}/l10n/ar.php (100%) rename {files => apps/files}/l10n/bg_BG.php (100%) rename {files => apps/files}/l10n/ca.php (100%) rename {files => apps/files}/l10n/cs_CZ.php (100%) rename {files => apps/files}/l10n/da.php (100%) rename {files => apps/files}/l10n/de.php (100%) rename {files => apps/files}/l10n/el.php (100%) rename {files => apps/files}/l10n/eo.php (100%) rename {files => apps/files}/l10n/es.php (100%) rename {files => apps/files}/l10n/et_EE.php (100%) rename {files => apps/files}/l10n/eu.php (100%) rename {files => apps/files}/l10n/fr.php (100%) rename {files => apps/files}/l10n/gl.php (100%) rename {files => apps/files}/l10n/he.php (100%) rename {files => apps/files}/l10n/hr.php (100%) rename {files => apps/files}/l10n/hu_HU.php (100%) rename {files => apps/files}/l10n/ia.php (100%) rename {files => apps/files}/l10n/id.php (100%) rename {files => apps/files}/l10n/it.php (100%) rename {files => apps/files}/l10n/ja_JP.php (100%) rename {files => apps/files}/l10n/lb.php (100%) rename {files => apps/files}/l10n/lt_LT.php (100%) rename {files => apps/files}/l10n/ms_MY.php (100%) rename {files => apps/files}/l10n/nb_NO.php (100%) rename {files => apps/files}/l10n/nl.php (100%) rename {files => apps/files}/l10n/nn_NO.php (100%) rename {files => apps/files}/l10n/pl.php (100%) rename {files => apps/files}/l10n/pt_BR.php (100%) rename {files => apps/files}/l10n/ro.php (100%) rename {files => apps/files}/l10n/ru.php (100%) rename {files => apps/files}/l10n/sk_SK.php (100%) rename {files => apps/files}/l10n/sl.php (100%) rename {files => apps/files}/l10n/sr.php (100%) rename {files => apps/files}/l10n/sr@latin.php (100%) rename {files => apps/files}/l10n/sv.php (100%) rename {files => apps/files}/l10n/th_TH.php (100%) rename {files => apps/files}/l10n/tr.php (100%) rename {files => apps/files}/l10n/xgettextfiles (100%) rename {files => apps/files}/l10n/zh_CN.php (100%) rename {files => apps/files}/settings.php (100%) rename {files => apps/files}/templates/admin.php (100%) rename {files => apps/files}/templates/index.php (100%) rename {files => apps/files}/templates/part.breadcrumb.php (100%) rename {files => apps/files}/templates/part.list.php (100%) rename {files => apps/files}/webdav.php (100%) diff --git a/files/admin.php b/apps/files/admin.php similarity index 100% rename from files/admin.php rename to apps/files/admin.php diff --git a/files/ajax/autocomplete.php b/apps/files/ajax/autocomplete.php similarity index 100% rename from files/ajax/autocomplete.php rename to apps/files/ajax/autocomplete.php diff --git a/files/ajax/delete.php b/apps/files/ajax/delete.php similarity index 100% rename from files/ajax/delete.php rename to apps/files/ajax/delete.php diff --git a/files/ajax/download.php b/apps/files/ajax/download.php similarity index 100% rename from files/ajax/download.php rename to apps/files/ajax/download.php diff --git a/files/ajax/list.php b/apps/files/ajax/list.php similarity index 100% rename from files/ajax/list.php rename to apps/files/ajax/list.php diff --git a/files/ajax/mimeicon.php b/apps/files/ajax/mimeicon.php similarity index 100% rename from files/ajax/mimeicon.php rename to apps/files/ajax/mimeicon.php diff --git a/files/ajax/move.php b/apps/files/ajax/move.php similarity index 100% rename from files/ajax/move.php rename to apps/files/ajax/move.php diff --git a/files/ajax/newfile.php b/apps/files/ajax/newfile.php similarity index 100% rename from files/ajax/newfile.php rename to apps/files/ajax/newfile.php diff --git a/files/ajax/newfolder.php b/apps/files/ajax/newfolder.php similarity index 100% rename from files/ajax/newfolder.php rename to apps/files/ajax/newfolder.php diff --git a/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php similarity index 100% rename from files/ajax/rawlist.php rename to apps/files/ajax/rawlist.php diff --git a/files/ajax/rename.php b/apps/files/ajax/rename.php similarity index 100% rename from files/ajax/rename.php rename to apps/files/ajax/rename.php diff --git a/files/ajax/scan.php b/apps/files/ajax/scan.php similarity index 100% rename from files/ajax/scan.php rename to apps/files/ajax/scan.php diff --git a/files/ajax/timezone.php b/apps/files/ajax/timezone.php similarity index 100% rename from files/ajax/timezone.php rename to apps/files/ajax/timezone.php diff --git a/files/ajax/upload.php b/apps/files/ajax/upload.php similarity index 100% rename from files/ajax/upload.php rename to apps/files/ajax/upload.php diff --git a/files/appinfo/app.php b/apps/files/appinfo/app.php similarity index 100% rename from files/appinfo/app.php rename to apps/files/appinfo/app.php diff --git a/files/css/files.css b/apps/files/css/files.css similarity index 100% rename from files/css/files.css rename to apps/files/css/files.css diff --git a/files/download.php b/apps/files/download.php similarity index 100% rename from files/download.php rename to apps/files/download.php diff --git a/files/index.php b/apps/files/index.php similarity index 100% rename from files/index.php rename to apps/files/index.php diff --git a/files/js/admin.js b/apps/files/js/admin.js similarity index 100% rename from files/js/admin.js rename to apps/files/js/admin.js diff --git a/files/js/fileactions.js b/apps/files/js/fileactions.js similarity index 100% rename from files/js/fileactions.js rename to apps/files/js/fileactions.js diff --git a/files/js/filelist.js b/apps/files/js/filelist.js similarity index 100% rename from files/js/filelist.js rename to apps/files/js/filelist.js diff --git a/files/js/files.js b/apps/files/js/files.js similarity index 100% rename from files/js/files.js rename to apps/files/js/files.js diff --git a/files/js/timezone.js b/apps/files/js/timezone.js similarity index 100% rename from files/js/timezone.js rename to apps/files/js/timezone.js diff --git a/files/l10n/ar.php b/apps/files/l10n/ar.php similarity index 100% rename from files/l10n/ar.php rename to apps/files/l10n/ar.php diff --git a/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php similarity index 100% rename from files/l10n/bg_BG.php rename to apps/files/l10n/bg_BG.php diff --git a/files/l10n/ca.php b/apps/files/l10n/ca.php similarity index 100% rename from files/l10n/ca.php rename to apps/files/l10n/ca.php diff --git a/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php similarity index 100% rename from files/l10n/cs_CZ.php rename to apps/files/l10n/cs_CZ.php diff --git a/files/l10n/da.php b/apps/files/l10n/da.php similarity index 100% rename from files/l10n/da.php rename to apps/files/l10n/da.php diff --git a/files/l10n/de.php b/apps/files/l10n/de.php similarity index 100% rename from files/l10n/de.php rename to apps/files/l10n/de.php diff --git a/files/l10n/el.php b/apps/files/l10n/el.php similarity index 100% rename from files/l10n/el.php rename to apps/files/l10n/el.php diff --git a/files/l10n/eo.php b/apps/files/l10n/eo.php similarity index 100% rename from files/l10n/eo.php rename to apps/files/l10n/eo.php diff --git a/files/l10n/es.php b/apps/files/l10n/es.php similarity index 100% rename from files/l10n/es.php rename to apps/files/l10n/es.php diff --git a/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php similarity index 100% rename from files/l10n/et_EE.php rename to apps/files/l10n/et_EE.php diff --git a/files/l10n/eu.php b/apps/files/l10n/eu.php similarity index 100% rename from files/l10n/eu.php rename to apps/files/l10n/eu.php diff --git a/files/l10n/fr.php b/apps/files/l10n/fr.php similarity index 100% rename from files/l10n/fr.php rename to apps/files/l10n/fr.php diff --git a/files/l10n/gl.php b/apps/files/l10n/gl.php similarity index 100% rename from files/l10n/gl.php rename to apps/files/l10n/gl.php diff --git a/files/l10n/he.php b/apps/files/l10n/he.php similarity index 100% rename from files/l10n/he.php rename to apps/files/l10n/he.php diff --git a/files/l10n/hr.php b/apps/files/l10n/hr.php similarity index 100% rename from files/l10n/hr.php rename to apps/files/l10n/hr.php diff --git a/files/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php similarity index 100% rename from files/l10n/hu_HU.php rename to apps/files/l10n/hu_HU.php diff --git a/files/l10n/ia.php b/apps/files/l10n/ia.php similarity index 100% rename from files/l10n/ia.php rename to apps/files/l10n/ia.php diff --git a/files/l10n/id.php b/apps/files/l10n/id.php similarity index 100% rename from files/l10n/id.php rename to apps/files/l10n/id.php diff --git a/files/l10n/it.php b/apps/files/l10n/it.php similarity index 100% rename from files/l10n/it.php rename to apps/files/l10n/it.php diff --git a/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php similarity index 100% rename from files/l10n/ja_JP.php rename to apps/files/l10n/ja_JP.php diff --git a/files/l10n/lb.php b/apps/files/l10n/lb.php similarity index 100% rename from files/l10n/lb.php rename to apps/files/l10n/lb.php diff --git a/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php similarity index 100% rename from files/l10n/lt_LT.php rename to apps/files/l10n/lt_LT.php diff --git a/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php similarity index 100% rename from files/l10n/ms_MY.php rename to apps/files/l10n/ms_MY.php diff --git a/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php similarity index 100% rename from files/l10n/nb_NO.php rename to apps/files/l10n/nb_NO.php diff --git a/files/l10n/nl.php b/apps/files/l10n/nl.php similarity index 100% rename from files/l10n/nl.php rename to apps/files/l10n/nl.php diff --git a/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php similarity index 100% rename from files/l10n/nn_NO.php rename to apps/files/l10n/nn_NO.php diff --git a/files/l10n/pl.php b/apps/files/l10n/pl.php similarity index 100% rename from files/l10n/pl.php rename to apps/files/l10n/pl.php diff --git a/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php similarity index 100% rename from files/l10n/pt_BR.php rename to apps/files/l10n/pt_BR.php diff --git a/files/l10n/ro.php b/apps/files/l10n/ro.php similarity index 100% rename from files/l10n/ro.php rename to apps/files/l10n/ro.php diff --git a/files/l10n/ru.php b/apps/files/l10n/ru.php similarity index 100% rename from files/l10n/ru.php rename to apps/files/l10n/ru.php diff --git a/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php similarity index 100% rename from files/l10n/sk_SK.php rename to apps/files/l10n/sk_SK.php diff --git a/files/l10n/sl.php b/apps/files/l10n/sl.php similarity index 100% rename from files/l10n/sl.php rename to apps/files/l10n/sl.php diff --git a/files/l10n/sr.php b/apps/files/l10n/sr.php similarity index 100% rename from files/l10n/sr.php rename to apps/files/l10n/sr.php diff --git a/files/l10n/sr@latin.php b/apps/files/l10n/sr@latin.php similarity index 100% rename from files/l10n/sr@latin.php rename to apps/files/l10n/sr@latin.php diff --git a/files/l10n/sv.php b/apps/files/l10n/sv.php similarity index 100% rename from files/l10n/sv.php rename to apps/files/l10n/sv.php diff --git a/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php similarity index 100% rename from files/l10n/th_TH.php rename to apps/files/l10n/th_TH.php diff --git a/files/l10n/tr.php b/apps/files/l10n/tr.php similarity index 100% rename from files/l10n/tr.php rename to apps/files/l10n/tr.php diff --git a/files/l10n/xgettextfiles b/apps/files/l10n/xgettextfiles similarity index 100% rename from files/l10n/xgettextfiles rename to apps/files/l10n/xgettextfiles diff --git a/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php similarity index 100% rename from files/l10n/zh_CN.php rename to apps/files/l10n/zh_CN.php diff --git a/files/settings.php b/apps/files/settings.php similarity index 100% rename from files/settings.php rename to apps/files/settings.php diff --git a/files/templates/admin.php b/apps/files/templates/admin.php similarity index 100% rename from files/templates/admin.php rename to apps/files/templates/admin.php diff --git a/files/templates/index.php b/apps/files/templates/index.php similarity index 100% rename from files/templates/index.php rename to apps/files/templates/index.php diff --git a/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php similarity index 100% rename from files/templates/part.breadcrumb.php rename to apps/files/templates/part.breadcrumb.php diff --git a/files/templates/part.list.php b/apps/files/templates/part.list.php similarity index 100% rename from files/templates/part.list.php rename to apps/files/templates/part.list.php diff --git a/files/webdav.php b/apps/files/webdav.php similarity index 100% rename from files/webdav.php rename to apps/files/webdav.php From b44bc9f4b289eda95ec94321c9698f3ce1a700be Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 18 Apr 2012 17:42:11 +0200 Subject: [PATCH 05/48] remove require once lib base in some more files --- apps/files/admin.php | 2 +- apps/files/download.php | 2 +- apps/files/index.php | 4 ---- apps/files/settings.php | 2 +- apps/files/webdav.php | 2 +- ocs/providers.php | 2 +- ocs/v1.php | 2 +- search/index.php | 2 +- settings/admin.php | 2 +- settings/apps.php | 2 +- settings/help.php | 2 +- settings/log.php | 2 +- settings/personal.php | 2 +- settings/settings.php | 2 +- settings/users.php | 2 +- 15 files changed, 14 insertions(+), 18 deletions(-) diff --git a/apps/files/admin.php b/apps/files/admin.php index 4ae3ee51236..bdea70506fb 100644 --- a/apps/files/admin.php +++ b/apps/files/admin.php @@ -23,7 +23,7 @@ // Init owncloud -require_once('../lib/base.php'); + OC_Util::checkAdminUser(); diff --git a/apps/files/download.php b/apps/files/download.php index d1f5ba486d7..ec4a6e1fc9c 100644 --- a/apps/files/download.php +++ b/apps/files/download.php @@ -22,7 +22,7 @@ */ // Init owncloud -require_once('../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/files/index.php b/apps/files/index.php index aea91542db6..46b511d66eb 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -21,10 +21,6 @@ * */ - -// Init owncloud -require_once('../lib/base.php'); - // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/files/settings.php b/apps/files/settings.php index c47eb130095..41017c064ef 100644 --- a/apps/files/settings.php +++ b/apps/files/settings.php @@ -23,7 +23,7 @@ // Init owncloud -require_once('../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/apps/files/webdav.php b/apps/files/webdav.php index 25e33024470..3418eba5a6c 100644 --- a/apps/files/webdav.php +++ b/apps/files/webdav.php @@ -29,7 +29,7 @@ $RUNTIME_NOSETUPFS = true; // only need filesystem apps $RUNTIME_APPTYPES=array('filesystem','authentication'); -require_once('../lib/base.php'); + // Backends $authBackend = new OC_Connector_Sabre_Auth(); diff --git a/ocs/providers.php b/ocs/providers.php index e1d6ef7ee1e..d4ccd4ef9f8 100644 --- a/ocs/providers.php +++ b/ocs/providers.php @@ -21,7 +21,7 @@ * */ -require_once('../lib/base.php'); + $url='http://'.substr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],0,-17).'ocs/v1.php/'; diff --git a/ocs/v1.php b/ocs/v1.php index f5ff6cb6054..ed97db2d9b3 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -21,7 +21,7 @@ * */ -require_once('../lib/base.php'); + @ob_clean(); OC_OCS::handle(); diff --git a/search/index.php b/search/index.php index 518695c56d2..d1f94f74a2e 100644 --- a/search/index.php +++ b/search/index.php @@ -23,7 +23,7 @@ // Init owncloud -require_once('../lib/base.php'); + // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/settings/admin.php b/settings/admin.php index a997bad4e3c..399ddd907ee 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); + OC_Util::checkAdminUser(); OC_Util::addStyle( "settings", "settings" ); diff --git a/settings/apps.php b/settings/apps.php index 0889b0c45ed..aed198c77c6 100644 --- a/settings/apps.php +++ b/settings/apps.php @@ -21,7 +21,7 @@ * */ -require_once('../lib/base.php'); + OC_Util::checkAdminUser(); // Load the files we need diff --git a/settings/help.php b/settings/help.php index 48fcec32782..00e93720eec 100644 --- a/settings/help.php +++ b/settings/help.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); + OC_Util::checkLoggedIn(); diff --git a/settings/log.php b/settings/log.php index ddbf72c4433..31e6f6ff371 100644 --- a/settings/log.php +++ b/settings/log.php @@ -20,7 +20,7 @@ * */ -require_once('../lib/base.php'); + OC_Util::checkAdminUser(); // Load the files we need diff --git a/settings/personal.php b/settings/personal.php index 41499657ac7..7717bb76667 100755 --- a/settings/personal.php +++ b/settings/personal.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); + OC_Util::checkLoggedIn(); // Highlight navigation entry diff --git a/settings/settings.php b/settings/settings.php index a49de85520b..c73d6b706ea 100644 --- a/settings/settings.php +++ b/settings/settings.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); + OC_Util::checkLoggedIn(); OC_Util::addStyle( 'settings', 'settings' ); diff --git a/settings/users.php b/settings/users.php index 96515a90ce4..591d85ff675 100644 --- a/settings/users.php +++ b/settings/users.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); + OC_Util::checkAdminUser(); // We have some javascript foo! From 3fb91a74112c00457d549c79d6908acdd32651c5 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 18 Apr 2012 17:49:50 +0200 Subject: [PATCH 06/48] restore require once command for non app files --- core/ajax/appconfig.php | 2 +- core/ajax/grouplist.php | 2 +- core/ajax/translations.php | 2 +- core/ajax/userlist.php | 2 +- core/ajax/validateuser.php | 2 +- core/ajax/vcategories/add.php | 2 +- core/ajax/vcategories/delete.php | 2 +- core/ajax/vcategories/edit.php | 2 +- core/lostpassword/index.php | 2 +- core/lostpassword/resetpassword.php | 2 +- ocs/providers.php | 2 +- ocs/v1.php | 2 +- search/ajax/search.php | 2 +- search/index.php | 2 +- settings/admin.php | 2 +- settings/ajax/changepassword.php | 2 +- settings/ajax/creategroup.php | 2 +- settings/ajax/createuser.php | 2 +- settings/ajax/disableapp.php | 2 +- settings/ajax/enableapp.php | 2 +- settings/ajax/getlog.php | 2 +- settings/ajax/lostpassword.php | 2 +- settings/ajax/openid.php | 2 +- settings/ajax/removegroup.php | 2 +- settings/ajax/removeuser.php | 2 +- settings/ajax/setlanguage.php | 2 +- settings/ajax/setloglevel.php | 2 +- settings/ajax/setquota.php | 2 +- settings/ajax/togglegroups.php | 2 +- settings/apps.php | 2 +- settings/help.php | 2 +- settings/log.php | 2 +- settings/personal.php | 2 +- settings/settings.php | 2 +- settings/users.php | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index 41e421b2fe4..f815d710631 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ - +require_once ("../../lib/base.php"); OC_JSON::checkLoggedIn(); $action=isset($_POST['action'])?$_POST['action']:$_GET['action']; $result=false; diff --git a/core/ajax/grouplist.php b/core/ajax/grouplist.php index ba079e2dae1..cc15102bbc3 100644 --- a/core/ajax/grouplist.php +++ b/core/ajax/grouplist.php @@ -22,7 +22,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps, yet - +require_once('../../lib/base.php'); if(!OC_User::isLoggedIn()){ if(!isset($_SERVER['PHP_AUTH_USER'])){ diff --git a/core/ajax/translations.php b/core/ajax/translations.php index 3091926095f..a6433b1964a 100644 --- a/core/ajax/translations.php +++ b/core/ajax/translations.php @@ -22,7 +22,7 @@ */ // Init owncloud - +require_once('../../lib/base.php'); $app = $_POST["app"]; diff --git a/core/ajax/userlist.php b/core/ajax/userlist.php index d9910d5a98f..c8168eaf460 100644 --- a/core/ajax/userlist.php +++ b/core/ajax/userlist.php @@ -22,7 +22,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps, yet - +require_once('../../lib/base.php'); if(!OC_User::isLoggedIn()){ if(!isset($_SERVER['PHP_AUTH_USER'])){ diff --git a/core/ajax/validateuser.php b/core/ajax/validateuser.php index a55c54a9a46..258bd50fcad 100644 --- a/core/ajax/validateuser.php +++ b/core/ajax/validateuser.php @@ -22,7 +22,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps, yet - +require_once('../../lib/base.php'); if(!isset($_SERVER['PHP_AUTH_USER'])){ header('WWW-Authenticate: Basic realm="ownCloud Server"'); diff --git a/core/ajax/vcategories/add.php b/core/ajax/vcategories/add.php index b0183af7fc5..a58489228d8 100644 --- a/core/ajax/vcategories/add.php +++ b/core/ajax/vcategories/add.php @@ -14,7 +14,7 @@ function debug($msg) { OC_Log::write('core','ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG); } - +require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); $category = isset($_GET['category'])?strip_tags($_GET['category']):null; $app = isset($_GET['app'])?$_GET['app']:null; diff --git a/core/ajax/vcategories/delete.php b/core/ajax/vcategories/delete.php index f96add3d8c3..75def433d30 100644 --- a/core/ajax/vcategories/delete.php +++ b/core/ajax/vcategories/delete.php @@ -15,7 +15,7 @@ function debug($msg) { OC_Log::write('core','ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG); } - +require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); $app = isset($_POST['app'])?$_POST['app']:null; $categories = isset($_POST['categories'])?$_POST['categories']:null; diff --git a/core/ajax/vcategories/edit.php b/core/ajax/vcategories/edit.php index 5b346bef28c..252b3d3454c 100644 --- a/core/ajax/vcategories/edit.php +++ b/core/ajax/vcategories/edit.php @@ -15,7 +15,7 @@ function debug($msg) { OC_Log::write('core','ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG); } - +require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); $app = isset($_GET['app'])?$_GET['app']:null; diff --git a/core/lostpassword/index.php b/core/lostpassword/index.php index 1400ec67cab..89bb6cfa794 100644 --- a/core/lostpassword/index.php +++ b/core/lostpassword/index.php @@ -7,7 +7,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps - +require_once('../../lib/base.php'); // Someone lost their password: if (isset($_POST['user'])) { diff --git a/core/lostpassword/resetpassword.php b/core/lostpassword/resetpassword.php index 5f16e854f42..1c78d720947 100644 --- a/core/lostpassword/resetpassword.php +++ b/core/lostpassword/resetpassword.php @@ -7,7 +7,7 @@ */ $RUNTIME_NOAPPS = TRUE; //no apps - +require_once('../../lib/base.php'); // Someone wants to reset their password: if(isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], 'owncloud', 'lostpassword') === $_GET['token']) { diff --git a/ocs/providers.php b/ocs/providers.php index d4ccd4ef9f8..e1d6ef7ee1e 100644 --- a/ocs/providers.php +++ b/ocs/providers.php @@ -21,7 +21,7 @@ * */ - +require_once('../lib/base.php'); $url='http://'.substr($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],0,-17).'ocs/v1.php/'; diff --git a/ocs/v1.php b/ocs/v1.php index ed97db2d9b3..f5ff6cb6054 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -21,7 +21,7 @@ * */ - +require_once('../lib/base.php'); @ob_clean(); OC_OCS::handle(); diff --git a/search/ajax/search.php b/search/ajax/search.php index 8f89256b827..326724d60c4 100644 --- a/search/ajax/search.php +++ b/search/ajax/search.php @@ -23,7 +23,7 @@ // Init owncloud - +require_once('../../lib/base.php'); // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/search/index.php b/search/index.php index d1f94f74a2e..518695c56d2 100644 --- a/search/index.php +++ b/search/index.php @@ -23,7 +23,7 @@ // Init owncloud - +require_once('../lib/base.php'); // Check if we are a user OC_Util::checkLoggedIn(); diff --git a/settings/admin.php b/settings/admin.php index 399ddd907ee..a997bad4e3c 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ - +require_once('../lib/base.php'); OC_Util::checkAdminUser(); OC_Util::addStyle( "settings", "settings" ); diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 0ed3c4919f5..860ea987871 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -1,7 +1,7 @@ Date: Thu, 19 Apr 2012 16:44:49 +0200 Subject: [PATCH 07/48] add loading of files --- index.php | 7 ++++++- lib/base.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 1858865875b..b85c49c76c2 100644 --- a/index.php +++ b/index.php @@ -57,7 +57,12 @@ elseif(OC_User::isLoggedIn()) { exit(); } else { - OC::loadapp(); + if(is_null(OC::$REQUESTEDFILE)){ + OC::loadapp(); + }else{ + OC::loadfile(); + } + } } diff --git a/lib/base.php b/lib/base.php index c21ab973593..2924a1da182 100644 --- a/lib/base.php +++ b/lib/base.php @@ -276,6 +276,17 @@ class OC{ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP)){ OC_App::loadApps(); require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php'); + }else{ + trigger_error('The requested App was not found.', E_USER_ERROR); + } + } + + public static function loadfile(){ + if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ + OC_App::loadApps(); + require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); + }else{ + header('404 Not Found'); } } From 909282c81edb98db304e1be09c8fd69a350a1cce Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 19 Apr 2012 22:25:21 +0200 Subject: [PATCH 08/48] remove parameters in file var before call require once --- lib/base.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/base.php b/lib/base.php index 2924a1da182..5478f084392 100644 --- a/lib/base.php +++ b/lib/base.php @@ -283,10 +283,9 @@ class OC{ public static function loadfile(){ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ - OC_App::loadApps(); require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); }else{ - header('404 Not Found'); + header('404 Not found'); } } @@ -401,7 +400,12 @@ class OC{ register_shutdown_function(array('OC_Helper','cleanTmp')); self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files'); - self::$REQUESTEDFILE = (isset($_GET['file'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . $_GET['file'], OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?$_GET['file']:null):null); + self::$REQUESTEDFILE = $_GET['file']; + if(substr_count(self::$REQUESTEDFILE, '?') != 0){ + $pos = strpos(self::$REQUESTEDFILE, '?'); + self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos); + } + self::$REQUESTEDFILE = (isset($_GET['file'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null); } } From 2e8531370102b33a072c6b981d2b1e6a1c9cf40e Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 19 Apr 2012 22:26:36 +0200 Subject: [PATCH 09/48] optimize code --- index.php | 1 + lib/base.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index b85c49c76c2..a3835c6d2f3 100644 --- a/index.php +++ b/index.php @@ -57,6 +57,7 @@ elseif(OC_User::isLoggedIn()) { exit(); } else { + OC_App::loadApps(); if(is_null(OC::$REQUESTEDFILE)){ OC::loadapp(); }else{ diff --git a/lib/base.php b/lib/base.php index 5478f084392..fa5287631d8 100644 --- a/lib/base.php +++ b/lib/base.php @@ -274,7 +274,6 @@ class OC{ public static function loadapp(){ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP)){ - OC_App::loadApps(); require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php'); }else{ trigger_error('The requested App was not found.', E_USER_ERROR); From 99a473bd628c08dc2f232c98b9220a029ad5ab99 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 20 Apr 2012 22:33:30 +0200 Subject: [PATCH 10/48] support file calls with parameter --- lib/base.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/base.php b/lib/base.php index fa5287631d8..df240dca6df 100644 --- a/lib/base.php +++ b/lib/base.php @@ -401,8 +401,12 @@ class OC{ self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files'); self::$REQUESTEDFILE = $_GET['file']; if(substr_count(self::$REQUESTEDFILE, '?') != 0){ - $pos = strpos(self::$REQUESTEDFILE, '?'); - self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos); + $pos_questionmark = strpos(self::$REQUESTEDFILE, '?'); + $pos_equal = strpos(self::$REQUESTEDFILE, '='); + $pos_and = strpos(self::$REQUESTEDFILE, '?'); + $_GET[substr(self::$REQUESTEDFILE, $pos_questionmark + 1, $pos_equal - $pos_questionmark - 1)] = substr(self::$REQUESTEDFILE, $pos_equal + 1, $pos_and); + self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos_questionmark); + $_GET['file'] = OC::$REQUESTEDFILE; } self::$REQUESTEDFILE = (isset($_GET['file'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null); } From c3d78cf77aa18b54cb2d1c9d0e16874a0fea804e Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 20 Apr 2012 22:34:13 +0200 Subject: [PATCH 11/48] remove require once lib base in files scan.php --- apps/files/ajax/scan.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php index db09b7d5c64..488f68e6b3c 100644 --- a/apps/files/ajax/scan.php +++ b/apps/files/ajax/scan.php @@ -1,7 +1,5 @@ Date: Fri, 20 Apr 2012 22:35:12 +0200 Subject: [PATCH 12/48] modify OC.filepath for movable apps --- core/js/js.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 019c40a0e1b..9b0a159b5c2 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -32,7 +32,7 @@ t.cache={}; OC={ webroot:oc_webroot, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, - coreApps:['files','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 @@ -51,16 +51,21 @@ OC={ */ filePath:function(app,type,file){ var isCore=OC.coreApps.indexOf(app)!=-1; - app+='/'; - var link=OC.webroot+'/'; - if(!isCore){ - link+='apps/'; + var link=OC.webroot; + if(file.substring(file.length-3) == 'php' && !isCore){ + link+='/?app=' + app + '&file=' + type + '/' + file; + }else{ + link+='/'; + app+='/'; + if(!isCore){ + link+='apps/'; + } + link+=app; + if(type){ + link+=type+'/'; + } + link+=file; } - link+=app; - if(type){ - link+=type+'/'; - } - link+=file; return link; }, /** From 08fe6bdb27878e0fd860969b4a3325e12cde22fc Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 16:17:35 +0200 Subject: [PATCH 13/48] fix path in /apps/files/js/timezone.php --- apps/files/js/timezone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/js/timezone.js b/apps/files/js/timezone.js index d569683f210..4749417199d 100644 --- a/apps/files/js/timezone.js +++ b/apps/files/js/timezone.js @@ -3,7 +3,7 @@ $(document).ready(function() { var visitortimezone = (-new Date().getTimezoneOffset()/60); $.ajax({ type: "GET", - url: "ajax/timezone.php", + url: OC.filePath('files', 'ajax', 'timezone.php'), data: 'time='+ visitortimezone, success: function(){ location.reload(); From c0df15367ff411bb8bf8c58f74027ed7c1275e9e Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 16:18:15 +0200 Subject: [PATCH 14/48] fix style.css of the files app --- apps/files/css/files.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index fd551b27625..d50d9aa9c5a 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -20,7 +20,7 @@ #new>ul>li>p { cursor:pointer; } #new>ul>li>input { padding:0.3em; margin:-0.3em; } -#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; } +#file_newfolder_name { background-image:url('../../../core/img/places/folder.svg'); font-weight:normal; width:7em; } .file_upload_start, .file_upload_filename { font-size:1em; } #file_newfolder_submit, #file_upload_submit { width:3em; } .file_upload_target { display:none; } @@ -81,7 +81,7 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } .selectedActions a img { position:relative; top:.3em; } /* add breadcrumb divider to the File item in navigation panel */ -#navigation>ul>li:first-child { background:url('../../core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; position:fixed; } +#navigation>ul>li:first-child { background:url('../../../core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; position:fixed; } #navigation>ul>li:first-child+li { padding-top:2.9em; } #scanning-message{ top:40%; left:40%; position:absolute; display:none } From 3b9d28324519993e032a8c743bd8caf52f99bf1e Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 16:25:07 +0200 Subject: [PATCH 15/48] fix path in apps/files/templats/index.php --- apps/files/templates/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index b21cf0aeb02..3571950467e 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -12,7 +12,7 @@
-
+ From aaedb23f055d0b6465743e79fa97cc8b02121a35 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 16:28:37 +0200 Subject: [PATCH 16/48] fix bug in lib/helper.php and fix file upload --- lib/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper.php b/lib/helper.php index 34f8faad4a5..d68830fe483 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -44,7 +44,7 @@ class OC_Helper { if(substr($app, -1, 1) == '/'){ $app = substr($app, 0, strlen($app) - 1); } - $urlLinkTo = OC::$WEBROOT . '?app=' . $app; + $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; $urlLinkTo .= ($file!='index.php')?'&file=' . $file:''; } else{ From 9226cb7a6a029ef1257eee46cd22044a294b0d5f Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 16:36:24 +0200 Subject: [PATCH 17/48] rename var file to getfile to prevent fails in files app --- core/js/js.js | 2 +- lib/base.php | 6 +++--- lib/helper.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 9b0a159b5c2..4abaced1ae0 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -53,7 +53,7 @@ OC={ var isCore=OC.coreApps.indexOf(app)!=-1; var link=OC.webroot; if(file.substring(file.length-3) == 'php' && !isCore){ - link+='/?app=' + app + '&file=' + type + '/' + file; + link+='/?app=' + app + '&getfile=' + type + '/' + file; }else{ link+='/'; app+='/'; diff --git a/lib/base.php b/lib/base.php index df240dca6df..4800a426217 100644 --- a/lib/base.php +++ b/lib/base.php @@ -399,16 +399,16 @@ class OC{ register_shutdown_function(array('OC_Helper','cleanTmp')); self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files'); - self::$REQUESTEDFILE = $_GET['file']; + self::$REQUESTEDFILE = $_GET['getfile']; if(substr_count(self::$REQUESTEDFILE, '?') != 0){ $pos_questionmark = strpos(self::$REQUESTEDFILE, '?'); $pos_equal = strpos(self::$REQUESTEDFILE, '='); $pos_and = strpos(self::$REQUESTEDFILE, '?'); $_GET[substr(self::$REQUESTEDFILE, $pos_questionmark + 1, $pos_equal - $pos_questionmark - 1)] = substr(self::$REQUESTEDFILE, $pos_equal + 1, $pos_and); self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos_questionmark); - $_GET['file'] = OC::$REQUESTEDFILE; + $_GET['getfile'] = OC::$REQUESTEDFILE; } - self::$REQUESTEDFILE = (isset($_GET['file'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null); + self::$REQUESTEDFILE = (isset($_GET['getfile'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null); } } diff --git a/lib/helper.php b/lib/helper.php index d68830fe483..2067190bca7 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -45,7 +45,7 @@ class OC_Helper { $app = substr($app, 0, strlen($app) - 1); } $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; - $urlLinkTo .= ($file!='index.php')?'&file=' . $file:''; + $urlLinkTo .= ($file!='index.php')?'&getfile=' . $file:''; } else{ $urlLinkTo = OC::$WEBROOT . '/' . $app . $file; From 6d92ebca454ab2e6533d0b7a08bfe30d20005820 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 17:09:28 +0200 Subject: [PATCH 18/48] use native functions of php to parse the string into the Var --- core/js/js.js | 2 +- lib/base.php | 13 ++++++------- lib/helper.php | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 4abaced1ae0..b4482185509 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -53,7 +53,7 @@ OC={ var isCore=OC.coreApps.indexOf(app)!=-1; var link=OC.webroot; if(file.substring(file.length-3) == 'php' && !isCore){ - link+='/?app=' + app + '&getfile=' + type + '/' + file; + link+='/?app=' + app + '&getfile=' + encodeURI(type + '/' + file); }else{ link+='/'; app+='/'; diff --git a/lib/base.php b/lib/base.php index 4800a426217..559d49ca997 100644 --- a/lib/base.php +++ b/lib/base.php @@ -284,7 +284,7 @@ class OC{ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); }else{ - header('404 Not found'); + echo "WTF"; } } @@ -401,12 +401,11 @@ class OC{ self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files'); self::$REQUESTEDFILE = $_GET['getfile']; if(substr_count(self::$REQUESTEDFILE, '?') != 0){ - $pos_questionmark = strpos(self::$REQUESTEDFILE, '?'); - $pos_equal = strpos(self::$REQUESTEDFILE, '='); - $pos_and = strpos(self::$REQUESTEDFILE, '?'); - $_GET[substr(self::$REQUESTEDFILE, $pos_questionmark + 1, $pos_equal - $pos_questionmark - 1)] = substr(self::$REQUESTEDFILE, $pos_equal + 1, $pos_and); - self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos_questionmark); - $_GET['getfile'] = OC::$REQUESTEDFILE; + $file = substr(self::$REQUESTEDFILE, 0, strpos(self::$REQUESTEDFILE, '?')); + $param = substr(self::$REQUESTEDFILE, strpos(self::$REQUESTEDFILE, '?') + 1); + parse_str($param, $_GET); + self::$REQUESTEDFILE = $file; + $_GET['getfile'] = $file; } self::$REQUESTEDFILE = (isset($_GET['getfile'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null); } diff --git a/lib/helper.php b/lib/helper.php index 2067190bca7..072a544a40a 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -45,7 +45,7 @@ class OC_Helper { $app = substr($app, 0, strlen($app) - 1); } $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; - $urlLinkTo .= ($file!='index.php')?'&getfile=' . $file:''; + $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; } else{ $urlLinkTo = OC::$WEBROOT . '/' . $app . $file; From d1110c62ef084d5d38b8770a26def88dd0976674 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 20:01:48 +0200 Subject: [PATCH 19/48] fix file path in apps/media/ajax/api.php --- apps/media/ajax/api.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php index 72235bf5db8..9c7b3efce75 100644 --- a/apps/media/ajax/api.php +++ b/apps/media/ajax/api.php @@ -23,10 +23,9 @@ header('Content-type: text/html; charset=UTF-8') ; - OC_JSON::checkAppEnabled('media'); -require_once('../lib_collection.php'); -require_once('../lib_scanner.php'); +require_once(OC::$APPSROOT . '/apps/media/lib_collection.php'); +require_once(OC::$APPSROOT . '/apps/media/lib_scanner.php'); error_reporting(E_ALL); //no script error reporting because of getID3 @@ -127,5 +126,4 @@ if($arguments['action']){ exit; } } - -?> +?> \ No newline at end of file From 19109afa79551e6dccbfc86ca27939b9df0fb7de Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 20:11:21 +0200 Subject: [PATCH 20/48] fix bug in lib base --- lib/base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 97b363b1fa9..0802e040c0f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -406,7 +406,9 @@ class OC{ if(substr_count(self::$REQUESTEDFILE, '?') != 0){ $file = substr(self::$REQUESTEDFILE, 0, strpos(self::$REQUESTEDFILE, '?')); $param = substr(self::$REQUESTEDFILE, strpos(self::$REQUESTEDFILE, '?') + 1); - parse_str($param, $_GET); + echo $param; + parse_str($param, $get); + $_GET = array_merge($_GET, $get); self::$REQUESTEDFILE = $file; $_GET['getfile'] = $file; } From 10eea3f4643ff0275d964ed7233d7a0c15afdf0a Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 20:13:55 +0200 Subject: [PATCH 21/48] fix pathes of shared calendars --- apps/calendar/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 66f51c97226..417d2b6c225 100644 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -22,8 +22,8 @@ foreach($calendars as $calendar){ $eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar); } -$eventSources[] = array('url' => 'ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true'); -$eventSources[] = array('url' => 'ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false'); +$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true'); +$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false'); OC_Hook::emit('OC_Calendar', 'getSources', array('sources' => &$eventSources)); $categories = OC_Calendar_App::getCategoryOptions(); From 95c220a246573e08428d8fd98252cef271bc7da3 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 20:31:03 +0200 Subject: [PATCH 22/48] remove debug code in lib base --- lib/base.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 0802e040c0f..f8f9362a64a 100644 --- a/lib/base.php +++ b/lib/base.php @@ -406,7 +406,6 @@ class OC{ if(substr_count(self::$REQUESTEDFILE, '?') != 0){ $file = substr(self::$REQUESTEDFILE, 0, strpos(self::$REQUESTEDFILE, '?')); $param = substr(self::$REQUESTEDFILE, strpos(self::$REQUESTEDFILE, '?') + 1); - echo $param; parse_str($param, $get); $_GET = array_merge($_GET, $get); self::$REQUESTEDFILE = $file; From 9092692b8eed596b53ea06f6bea626bb470c4c25 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 20:32:55 +0200 Subject: [PATCH 23/48] make calendar work with movable apps --- apps/calendar/templates/part.editevent.php | 6 +++--- apps/calendar/templates/part.newevent.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/calendar/templates/part.editevent.php b/apps/calendar/templates/part.editevent.php index 58314db1a6b..102366f8f08 100644 --- a/apps/calendar/templates/part.editevent.php +++ b/apps/calendar/templates/part.editevent.php @@ -5,9 +5,9 @@ inc("part.eventform"); ?>
- " onclick="Calendar.UI.validateEventForm('ajax/event/edit.php');"> - " onclick="Calendar.UI.submitDeleteEventForm('ajax/event/delete.php');"> - " onclick="window.location='export.php?eventid=';"> + " onclick="Calendar.UI.validateEventForm('?app=calendar&getfile=ajax/event/edit.php');"> + " onclick="Calendar.UI.submitDeleteEventForm('?app=calendar&getfile=ajax/event/delete.php');"> + " onclick="window.location='?app=calendar&getfile=export.php?eventid=';">
diff --git a/apps/calendar/templates/part.newevent.php b/apps/calendar/templates/part.newevent.php index 11416260344..f4bb867b180 100644 --- a/apps/calendar/templates/part.newevent.php +++ b/apps/calendar/templates/part.newevent.php @@ -3,7 +3,7 @@ inc("part.eventform"); ?>
- " onclick="Calendar.UI.validateEventForm('ajax/event/new.php');"> + " onclick="Calendar.UI.validateEventForm('?app=calendar&getfile=ajax/event/new.php');"> From fd47fbe17645b34448f38ac2819ac23ddbb405da Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 23 Apr 2012 20:39:04 +0200 Subject: [PATCH 24/48] fix contacts app a bit --- apps/contacts/css/contacts.css | 22 +++++++++++----------- apps/contacts/templates/index.php | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css index b0c68c96e67..4c5242f607f 100644 --- a/apps/contacts/css/contacts.css +++ b/apps/contacts/css/contacts.css @@ -11,7 +11,7 @@ #actionbar { height: 30px; width: 60px; position: fixed; right: 0px; top: 4em; margin: 0 0 0 0; padding: 0 0 0 0; z-index: 1000; } #contacts_deletecard {position:absolute;top:15px;right:25px;} #contacts_downloadcard {position:absolute;top:15px;right:50px;} -#contacts_propertymenu_button { position:absolute;top:15px;right:150px; background:url('../../../core/img/actions/add.svg') no-repeat center; } +#contacts_propertymenu_button { position:absolute;top:15px;right:150px; background:url('core/img/actions/add.svg') no-repeat center; } #contacts_propertymenu { background-color: #fff; position:absolute;top:40px;right:150px; overflow:hidden; text-overflow:ellipsis; /*border: thin solid #1d2d44;*/ -moz-box-shadow:0 0 10px #000; -webkit-box-shadow:0 0 10px #000; box-shadow:0 0 10px #000; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; } #contacts_propertymenu li { display: block; font-weight: bold; height: 20px; width: 100px; } #contacts_propertymenu li a { padding: 3px; display: block } @@ -34,20 +34,20 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; } #address.form dt { min-width: 5em; } #address.form dl { min-width: 10em; } -.loading { background: url('../../../core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; } -.ui-autocomplete-loading { background: url('../../../core/img/loading.gif') right center no-repeat; } +.loading { background: url('core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; } +.ui-autocomplete-loading { background: url('core/img/loading.gif') right center no-repeat; } .float { float: left; } .listactions { height: 1em; width:60px; float: left; clear: right; } .add,.edit,.delete,.mail, .globe, .upload, .cloud { cursor: pointer; width: 20px; height: 20px; margin: 0; float: left; position:relative; opacity: 0.1; } .add:hover,.edit:hover,.delete:hover,.mail:hover, .globe:hover, .upload:hover, .cloud:hover { opacity: 1.0 } -.add { background:url('../../../core/img/actions/add.svg') no-repeat center; clear: both; } -.delete { background:url('../../../core/img/actions/delete.svg') no-repeat center; } -.edit { background:url('../../../core/img/actions/rename.svg') no-repeat center; } -.mail { background:url('../../../core/img/actions/mail.svg') no-repeat center; } -.upload { background:url('../../../core/img/actions/upload.svg') no-repeat center; } -.cloud { background:url('../../../core/img/places/picture.svg') no-repeat center; } +.add { background:url('core/img/actions/add.svg') no-repeat center; clear: both; } +.delete { background:url('core/img/actions/delete.svg') no-repeat center; } +.edit { background:url('core/img/actions/rename.svg') no-repeat center; } +.mail { background:url('core/img/actions/mail.svg') no-repeat center; } +.upload { background:url('core/img/actions/upload.svg') no-repeat center; } +.cloud { background:url('core/img/places/picture.svg') no-repeat center; } /*.globe { background:url('../img/globe.svg') no-repeat center; }*/ -.globe { background:url('../../../core/img/actions/public.svg') no-repeat center; } +.globe { background:url('core/img/actions/public.svg') no-repeat center; } .transparent{ opacity: 0.6; } #edit_name_dialog { padding:0; } #edit_name_dialog > input { width: 15em; } @@ -63,7 +63,7 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; } .contactpart legend { width:auto; padding:.3em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; } #cropbox { margin: auto; } -#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; background: url(../../../core/img/loading.gif) no-repeat center center; display: block; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; } +#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; background: url(core/img/loading.gif) no-repeat center center; display: block; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; } #contacts_details_photo:hover { background: #fff; cursor: default; } #phototools { position:absolute; margin: 5px 0 0 10px; width:auto; height:22px; padding:0px; background-color:#fff; list-style-type:none; border-radius: 0.5em; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; } #phototools li { display: inline; } diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index 256d10afc07..d7aabbe76a5 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -16,8 +16,8 @@
- <?php echo $l->t('Add Contact'); ?> - <?php echo $l->t('Addressbooks'); ?> + <?php echo $l->t('Add Contact'); ?> + <?php echo $l->t('Addressbooks'); ?>
From 29b9e27078ea2a1ca404a7b7b32de7e7afc52274 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 20:14:42 +0200 Subject: [PATCH 25/48] fix linkto function in OC_Helper --- lib/helper.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/helper.php b/lib/helper.php index 072a544a40a..e532d5391f9 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -41,11 +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($app, -1, 1) == '/'){ - $app = substr($app, 0, strlen($app) - 1); + if(substr($file, -3) == 'php'){ + if(substr($app, -1, 1) == '/'){ + $app = substr($app, 0, strlen($app) - 1); + } + $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; + $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; + }else{ + $urlLinkTo = OC::$APPSWEBROOT . '/' . $app . $file; } - $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; - $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; } else{ $urlLinkTo = OC::$WEBROOT . '/' . $app . $file; From 0b06eff3a016a274b5f5f01ec1ff225da7d7b639 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 20:17:00 +0200 Subject: [PATCH 26/48] another fix for linkto function --- lib/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper.php b/lib/helper.php index e532d5391f9..2bc738e6650 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -48,7 +48,7 @@ class OC_Helper { $urlLinkTo = OC::$APPSWEBROOT . '/?app=' . $app; $urlLinkTo .= ($file!='index.php')?'&getfile=' . urlencode($file):''; }else{ - $urlLinkTo = OC::$APPSWEBROOT . '/' . $app . $file; + $urlLinkTo = OC::$APPSWEBROOT . '/apps/' . $app . $file; } } else{ From 684007bbaefe0bb415a1903e2807809623c4b250 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 21:33:34 +0200 Subject: [PATCH 27/48] fix pathes in contacts --- apps/contacts/css/contacts.css | 18 ++++--------- apps/contacts/js/contacts.js | 49 ++++++++++++++++++++++------------ core/js/js.js | 9 +++++++ core/templates/layout.user.php | 1 + 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css index 4c5242f607f..15f98cffbfb 100644 --- a/apps/contacts/css/contacts.css +++ b/apps/contacts/css/contacts.css @@ -11,7 +11,7 @@ #actionbar { height: 30px; width: 60px; position: fixed; right: 0px; top: 4em; margin: 0 0 0 0; padding: 0 0 0 0; z-index: 1000; } #contacts_deletecard {position:absolute;top:15px;right:25px;} #contacts_downloadcard {position:absolute;top:15px;right:50px;} -#contacts_propertymenu_button { position:absolute;top:15px;right:150px; background:url('core/img/actions/add.svg') no-repeat center; } +#contacts_propertymenu_button { position:absolute;top:15px;right:150px;} #contacts_propertymenu { background-color: #fff; position:absolute;top:40px;right:150px; overflow:hidden; text-overflow:ellipsis; /*border: thin solid #1d2d44;*/ -moz-box-shadow:0 0 10px #000; -webkit-box-shadow:0 0 10px #000; box-shadow:0 0 10px #000; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; } #contacts_propertymenu li { display: block; font-weight: bold; height: 20px; width: 100px; } #contacts_propertymenu li a { padding: 3px; display: block } @@ -34,20 +34,12 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; } #address.form dt { min-width: 5em; } #address.form dl { min-width: 10em; } -.loading { background: url('core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; } -.ui-autocomplete-loading { background: url('core/img/loading.gif') right center no-repeat; } +.loading {/*cursor: progress; */ cursor: wait; } .float { float: left; } .listactions { height: 1em; width:60px; float: left; clear: right; } .add,.edit,.delete,.mail, .globe, .upload, .cloud { cursor: pointer; width: 20px; height: 20px; margin: 0; float: left; position:relative; opacity: 0.1; } .add:hover,.edit:hover,.delete:hover,.mail:hover, .globe:hover, .upload:hover, .cloud:hover { opacity: 1.0 } -.add { background:url('core/img/actions/add.svg') no-repeat center; clear: both; } -.delete { background:url('core/img/actions/delete.svg') no-repeat center; } -.edit { background:url('core/img/actions/rename.svg') no-repeat center; } -.mail { background:url('core/img/actions/mail.svg') no-repeat center; } -.upload { background:url('core/img/actions/upload.svg') no-repeat center; } -.cloud { background:url('core/img/places/picture.svg') no-repeat center; } -/*.globe { background:url('../img/globe.svg') no-repeat center; }*/ -.globe { background:url('core/img/actions/public.svg') no-repeat center; } + .transparent{ opacity: 0.6; } #edit_name_dialog { padding:0; } #edit_name_dialog > input { width: 15em; } @@ -59,11 +51,11 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; } #identityprops { /*position: absolute; top: 2.5em; left: 0px;*/ } /*#contact_photo { max-width: 250px; }*/ #contact_identity { min-width: 30em; } -.contactsection { position: relative; float: left; /*max-width: 40em;*/ padding: 0.5em; height: auto: border: thin solid lightgray;/* -webkit-border-radius: 0.5em; -moz-border-radius: 0.5em; border-radius: 0.5em; background-color: #f8f8f8;*/ } +.contactsection { position: relative; float: left; /*max-width: 40em;*/ padding: 0.5em; height: auto; border: thin solid lightgray;/* -webkit-border-radius: 0.5em; -moz-border-radius: 0.5em; border-radius: 0.5em; background-color: #f8f8f8;*/ } .contactpart legend { width:auto; padding:.3em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; } #cropbox { margin: auto; } -#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; background: url(core/img/loading.gif) no-repeat center center; display: block; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; } +#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; display: block; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; } #contacts_details_photo:hover { background: #fff; cursor: default; } #phototools { position:absolute; margin: 5px 0 0 10px; width:auto; height:22px; padding:0px; background-color:#fff; list-style-type:none; border-radius: 0.5em; -moz-box-shadow: 0 1px 3px #777; -webkit-box-shadow: 0 1px 3px #777; box-shadow: 0 1px 3px #777; } #phototools li { display: inline; } diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index f03ae1e46d6..f684576b787 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -289,12 +289,12 @@ Contacts={ if (jsondata.status == 'success'){ $('#rightcontent').data('id',jsondata.data.id); var id = jsondata.data.id; - $.getJSON('ajax/contactdetails.php',{'id':id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':id},function(jsondata){ if(jsondata.status == 'success'){ Contacts.UI.loadHandlers(); Contacts.UI.Card.loadContact(jsondata.data); $('#leftcontent .active').removeClass('active'); - var item = '
  • '+Contacts.UI.Card.fn+'
  • '; + var item = '
  • '+Contacts.UI.Card.fn+'
  • '; var added = false; $('#leftcontent ul li').each(function(){ if ($(this).text().toLowerCase() > Contacts.UI.Card.fn.toLowerCase()) { @@ -335,7 +335,7 @@ Contacts={ $('#contacts_deletecard').tipsy('hide'); OC.dialogs.confirm(t('contacts', 'Are you sure you want to delete this contact?'), t('contacts', 'Warning'), function(answer) { if(answer == true) { - $.getJSON('ajax/deletecard.php',{'id':Contacts.UI.Card.id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'deletecard.php'),{'id':Contacts.UI.Card.id},function(jsondata){ if(jsondata.status == 'success'){ var newid = ''; var curlistitem = $('#leftcontent [data-id="'+jsondata.data.id+'"]'); @@ -357,7 +357,7 @@ Contacts={ Contacts.UI.Card.update(newid); } else { // load intro page - $.getJSON('ajax/loadintro.php',{},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'loadintro.php'),{},function(jsondata){ if(jsondata.status == 'success'){ id = ''; $('#rightcontent').data('id',''); @@ -616,7 +616,7 @@ Contacts={ q = q + '&checksum=' + checksum; console.log('Saving: ' + q); $(obj).attr('disabled', 'disabled'); - $.post('ajax/saveproperty.php',q,function(jsondata){ + $.post(OC.filePath('contacts', 'ajax', 'saveproperty.php'),q,function(jsondata){ if(jsondata.status == 'success'){ container.data('checksum', jsondata.data.checksum); Contacts.UI.Card.savePropertyInternal(name, fields, checksum, jsondata.data.checksum); @@ -634,7 +634,7 @@ Contacts={ } else { // add console.log('Adding: ' + q); $(obj).attr('disabled', 'disabled'); - $.post('ajax/addproperty.php',q,function(jsondata){ + $.post(OC.filePath('contacts', 'ajax', 'addproperty.php'),q,function(jsondata){ if(jsondata.status == 'success'){ container.data('checksum', jsondata.data.checksum); // TODO: savePropertyInternal doesn't know about new fields @@ -704,7 +704,7 @@ Contacts={ var checksum = Contacts.UI.checksumFor(obj); console.log('deleteProperty, id: ' + this.id + ', checksum: ' + checksum); if(checksum) { - $.getJSON('ajax/deleteproperty.php',{'id': this.id, 'checksum': checksum },function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){ if(jsondata.status == 'success'){ if(type == 'list') { Contacts.UI.propertyContainerFor(obj).remove(); @@ -1124,7 +1124,7 @@ Contacts={ }, cloudPhotoSelected:function(path){ console.log('cloudPhotoSelected: ' + path); - $.getJSON('ajax/oc_photo.php',{'path':path,'id':Contacts.UI.Card.id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'oc_photo.php'),{'path':path,'id':Contacts.UI.Card.id},function(jsondata){ if(jsondata.status == 'success'){ //alert(jsondata.data.page); Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp) @@ -1137,7 +1137,7 @@ Contacts={ }, loadPhoto:function(force){ //if(this.data.PHOTO||force==true) { - $.getJSON('ajax/loadphoto.php',{'id':this.id},function(jsondata){ + $.getJSON(OC.filePath('contact', 'ajax', 'loadphoto.php'),{'id':this.id},function(jsondata){ if(jsondata.status == 'success'){ //alert(jsondata.data.page); $('#contacts_details_photo_wrapper').data('checksum', jsondata.data.checksum); @@ -1157,7 +1157,7 @@ Contacts={ }*/ }, editCurrentPhoto:function(){ - $.getJSON('ajax/currentphoto.php',{'id':this.id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'currentphoto.php'),{'id':this.id},function(jsondata){ if(jsondata.status == 'success'){ //alert(jsondata.data.page); Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp) @@ -1170,7 +1170,7 @@ Contacts={ }, editPhoto:function(id, tmp_path){ //alert('editPhoto: ' + tmp_path); - $.getJSON('ajax/cropphoto.php',{'tmp_path':tmp_path,'id':this.id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'cropphoto.php'),{'tmp_path':tmp_path,'id':this.id},function(jsondata){ if(jsondata.status == 'success'){ //alert(jsondata.data.page); $('#edit_photo_dialog_img').html(jsondata.data.page); @@ -1378,7 +1378,7 @@ Contacts={ // Reload the contacts list. update:function(){ console.log('Contacts.update, start'); - $.getJSON('ajax/contacts.php',{},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'contacts.php'),{},function(jsondata){ if(jsondata.status == 'success'){ $('#contacts').html(jsondata.data.page); Contacts.UI.Card.update(); @@ -1394,12 +1394,12 @@ Contacts={ lazyupdate:function(){ $('#contacts li').live('inview', function(){ if (!$(this).find('a').attr('style')) { - $(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat'); + $(this).find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+$(this).data('id')+') no-repeat'); } }); }, refreshThumbnail:function(id){ - $('#contacts [data-id="'+id+'"]').find('a').css('background','url(thumbnail.php?id='+id+'&refresh=1'+Math.random()+') no-repeat'); + $('#contacts [data-id="'+id+'"]').find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+id+'&refresh=1'+Math.random()+') no-repeat'); } } } @@ -1431,7 +1431,7 @@ $(document).ready(function(){ if(oldid != 0){ $('#leftcontent li[data-id="'+oldid+'"]').removeClass('active'); } - $.getJSON('ajax/contactdetails.php',{'id':id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'contactsdetails.php'),{'id':id},function(jsondata){ if(jsondata.status == 'success'){ Contacts.UI.Card.loadContact(jsondata.data); } @@ -1454,7 +1454,7 @@ $(document).ready(function(){ // whole part of element is visible if (!$(this).find('a').attr('style')) { //alert($(this).data('id') + ' has background: ' + $(this).attr('style')); - $(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat'); + $(this).find('a').css('background','url('+OC.filePath('contacts', '', 'thumbnail.php')+'?id='+$(this).data('id')+') no-repeat'); }/* else { alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url')); }*/ @@ -1574,7 +1574,7 @@ $(document).ready(function(){ }; // Start loading indicator. //$('#contacts_details_photo_progress').show()(); - xhr.open("POST", 'ajax/uploadphoto.php?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true); + 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)); @@ -1604,3 +1604,18 @@ $(document).ready(function(){ $('#contacts_propertymenu').hide(); }); }); +$(document).ready(function() { + $('.add').css('background', 'url('+OC.filePath('core', 'img/actions', 'add.svg')+') no-repeat center'); + $('.delete').css('background', 'url('+OC.filePath('core', 'img/actions', 'delete.svg')+') no-repeat center'); + $('.edit').css('background', 'url('+OC.filePath('core', 'img/actions', 'rename.svg')+') no-repeat center'); + $('.mail').css('background', 'url('+OC.filePath('core', 'img/actions', 'mail.svg')+') no-repeat center'); + $('.upload').css('background', 'url('+OC.filePath('core', 'img/actions', 'upload.svg')+') no-repeat center'); + $('.cloud').css('background', 'url('+OC.filePath('core', 'img/actions', 'picture.svg')+') no-repeat center'); + /*$('.globe').css('background', 'url('+OC.filePath('core', 'img/actions', 'globe.svg')+') no-repeat center');*/ + $('.globe').css('background', 'url('+OC.filePath('core', 'img/actions', 'public.svg')+') no-repeat center'); + $('#contacts_propertymenu_button').css('background', 'url('+OC.filePath('core', 'img/actions', 'add.svg')+' no-repeat center'); + $('.loading').css('background', 'url('+OC.filePath('core', 'img', 'loading.gif')+' no-repeat center !important'); + $('.ui-autocomplete-loading').css('background', 'url('+OC.filePath('core', 'img', 'loading.gif')+' right center no-repeat'); + $('#contacts_details_photo').css('background', 'url('+OC.filePath('core', 'img', 'loading.gif')+' no-repeat center center'); + $('#contacts_propertymenu_button').css('background', 'url('+OC.filePath('core', 'img/actions', 'add.svg')+') no-repeat center'); +}); \ No newline at end of file diff --git a/core/js/js.js b/core/js/js.js index b4482185509..25de7c13b74 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -31,6 +31,7 @@ t.cache={}; OC={ webroot:oc_webroot, + appswebroot:oc_appswebroot, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, coreApps:['admin','log','search','settings','core','3rdparty'], /** @@ -54,6 +55,14 @@ OC={ var link=OC.webroot; if(file.substring(file.length-3) == 'php' && !isCore){ link+='/?app=' + app + '&getfile=' + encodeURI(type + '/' + file); + }else if(file.substring(file.length-3) != 'php' && !isCore){ + link=OC.appswebroot; + link+='apps/'; + link+=app; + if(type){ + link+=type+'/'; + } + link+=file; }else{ link+='/'; app+='/'; diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 61eb0de9f42..a5431ab6ab3 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -9,6 +9,7 @@ From 9b29bc96de688f1d3289444625ce5bb7e7d37ac5 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 21:36:54 +0200 Subject: [PATCH 28/48] remove debug message --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index f8f9362a64a..231819b36ab 100644 --- a/lib/base.php +++ b/lib/base.php @@ -287,7 +287,7 @@ class OC{ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); }else{ - echo "WTF"; + header('404 Not Found') } } From fb84d0aff803c77e65d2faa49f320c6e12639593 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 21:37:19 +0200 Subject: [PATCH 29/48] fix php fail --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 231819b36ab..a7b7d082460 100644 --- a/lib/base.php +++ b/lib/base.php @@ -287,7 +287,7 @@ class OC{ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); }else{ - header('404 Not Found') + header('404 Not Found'); } } From a85d49833b1aa4d616271cf0f168b5a4294d9810 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 21:52:44 +0200 Subject: [PATCH 30/48] fix position of Semicolon --- core/templates/layout.user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index a5431ab6ab3..df7897717f6 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -9,7 +9,7 @@ From d6346b5b0bece4feecc36b7b97308dd3a5a4d6cc Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 24 Apr 2012 21:54:09 +0200 Subject: [PATCH 31/48] fix OC.filePath in main js --- core/js/js.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 25de7c13b74..a4369deb283 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -54,15 +54,20 @@ OC={ var isCore=OC.coreApps.indexOf(app)!=-1; var link=OC.webroot; if(file.substring(file.length-3) == 'php' && !isCore){ - link+='/?app=' + app + '&getfile=' + encodeURI(type + '/' + file); + link+='/?app=' + app + '&getfile='; + if(type){ + link+=encodeURI(type + '/'); + } + link+= file; }else if(file.substring(file.length-3) != 'php' && !isCore){ link=OC.appswebroot; + link+='/'; link+='apps/'; - link+=app; + link+=app+'/'; if(type){ link+=type+'/'; } - link+=file; + link+=file; }else{ link+='/'; app+='/'; From 9ee2bb97197f1f5387260f25cb7b2e276324a005 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 25 Apr 2012 09:22:19 +0200 Subject: [PATCH 32/48] fix js fail in media player --- apps/media/js/collection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/media/js/collection.js b/apps/media/js/collection.js index c345d4d9944..0b5a9ef9a47 100644 --- a/apps/media/js/collection.js +++ b/apps/media/js/collection.js @@ -112,6 +112,7 @@ Collection={ Collection.parent.find('tr').removeClass('active'); $('tr[data-artist="'+artist.name+'"]').addClass('active'); }); + expander=''; if(artist.songs.length>1){ expander=$('>'); expander.data('expanded',false); From 476043ecb97ebf4f1a56985194c2b74b9473e276 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 25 Apr 2012 10:17:20 +0200 Subject: [PATCH 33/48] add a proper 404 --- lib/base.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index a7b7d082460..c8a99d3ac30 100644 --- a/lib/base.php +++ b/lib/base.php @@ -287,7 +287,8 @@ class OC{ if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){ require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE); }else{ - header('404 Not Found'); + header('HTTP/1.0 404 Not Found'); + exit; } } From 323b19a4a090b10ea55f0152180da5e6c7290776 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 25 Apr 2012 10:17:54 +0200 Subject: [PATCH 34/48] some fixes in contacts javascript files --- apps/contacts/js/contacts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index b94bf77c5ec..d93d337e469 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -1137,7 +1137,7 @@ Contacts={ }, loadPhoto:function(force){ //if(this.data.PHOTO||force==true) { - $.getJSON(OC.filePath('contact', 'ajax', 'loadphoto.php'),{'id':this.id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'loadphoto.php'),{'id':this.id},function(jsondata){ if(jsondata.status == 'success'){ //alert(jsondata.data.page); $('#contacts_details_photo_wrapper').data('checksum', jsondata.data.checksum); @@ -1519,7 +1519,7 @@ $(document).ready(function(){ if(oldid != 0){ $('#leftcontent li[data-id="'+oldid+'"]').removeClass('active'); } - $.getJSON(OC.filePath('contacts', 'ajax', 'contactsdetails.php'),{'id':id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':id},function(jsondata){ if(jsondata.status == 'success'){ Contacts.UI.Card.loadContact(jsondata.data); } From 1a913ac282477c0cb13860ccb813260863ebb2ae Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 25 Apr 2012 21:20:06 +0200 Subject: [PATCH 35/48] bookmarks app seems to work now :) --- apps/bookmarks/ajax/addBookmark.php | 2 +- apps/bookmarks/js/bookmarks.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index 4daed58af3b..ceeb034ec9d 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -30,6 +30,6 @@ $RUNTIME_NOSETUPFS=true; OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('bookmarks'); -require_once('../bookmarksHelper.php'); +require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php'); $id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']); OC_JSON::success(array('data' => $id)); \ No newline at end of file diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js index 16ed14c89b2..38b8c43eb7d 100644 --- a/apps/bookmarks/js/bookmarks.js +++ b/apps/bookmarks/js/bookmarks.js @@ -20,7 +20,7 @@ function getBookmarks() { } $.ajax({ - url: 'ajax/updateList.php', + url: OC.filePath('bookmarks', 'ajax', 'updateList.php'), data: 'tag=' + encodeURIComponent($('#bookmarkFilterTag').val()) + '&page=' + bookmarks_page + '&sort=' + bookmarks_sorting, success: function(bookmarks){ if (bookmarks.data.length) { @@ -63,7 +63,7 @@ function addOrEditBookmark(event) { if (id == 0) { $.ajax({ - url: 'ajax/addBookmark.php', + url: OC.filePath('bookmarks', 'ajax', 'addBookmark.php'), data: 'url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags), success: function(response){ $('.bookmarks_input').val(''); @@ -75,7 +75,7 @@ function addOrEditBookmark(event) { } else { $.ajax({ - url: 'ajax/editBookmark.php', + url: OC.filePath('bookmarks', 'ajax', 'editBookmark.php'), data: 'id=' + id + '&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&tags=' + encodeURIComponent(tags), success: function(){ $('.bookmarks_input').val(''); @@ -92,7 +92,7 @@ function addOrEditBookmark(event) { function delBookmark(event) { var record = $(this).parent().parent(); $.ajax({ - url: 'ajax/delBookmark.php', + url: OC.filePath('bookmarks', 'ajax', 'delBookmark.php'), data: 'url=' + encodeURIComponent($(this).parent().parent().children('.bookmark_url:first').text()), success: function(data){ record.remove(); @@ -164,7 +164,7 @@ function updateOnBottom() { function recordClick(event) { $.ajax({ - url: 'ajax/recordClick.php', + url: OC.filePath('bookmarks', 'ajax', 'recordClick.php'), data: 'url=' + encodeURIComponent($(this).attr('href')), }); } From b75f680b8e560be82f5c63bfc5480452a3de12d9 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 25 Apr 2012 21:20:30 +0200 Subject: [PATCH 36/48] gallery app seems to work now :) --- apps/gallery/templates/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php index cf654b68c0b..43ba5131864 100644 --- a/apps/gallery/templates/index.php +++ b/apps/gallery/templates/index.php @@ -24,7 +24,7 @@ $l = OC_L10N::get('gallery');