From 3863a44589582950d818094f5d69acffd6212d54 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 17 Apr 2012 19:31:29 +0200 Subject: [PATCH] remove the require_once lib base from all (or nearly all) files --- ajax/activation.php | 2 +- ajax/addbook.php | 2 +- ajax/addcontact.php | 2 +- ajax/addproperty.php | 2 +- ajax/categories/categoriesfor.php | 2 +- ajax/categories/delete.php | 2 +- ajax/categories/list.php | 2 +- ajax/categories/rescan.php | 2 +- ajax/chooseaddressbook.php | 2 +- ajax/contactdetails.php | 2 +- ajax/contacts.php | 2 +- ajax/createaddressbook.php | 2 +- ajax/cropphoto.php | 2 +- ajax/deletebook.php | 2 +- ajax/deletecard.php | 2 +- ajax/deleteproperty.php | 2 +- ajax/editaddress.php | 2 +- ajax/editaddressbook.php | 2 +- ajax/editname.php | 2 +- ajax/getdetails.php | 2 +- ajax/importdialog.php | 2 +- ajax/loadcard.php | 2 +- ajax/loadintro.php | 2 +- ajax/loadphoto.php | 2 +- ajax/newcontact.php | 2 +- ajax/savecrop.php | 2 +- ajax/saveproperty.php | 2 +- ajax/updateaddressbook.php | 2 +- ajax/uploadphoto.php | 2 +- carddav.php | 2 +- dynphoto.php | 2 +- export.php | 2 +- import.php | 2 +- index.php | 2 +- photo.php | 2 +- thumbnail.php | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/ajax/activation.php b/ajax/activation.php index d69e3dba..06d1a7e2 100644 --- a/ajax/activation.php +++ b/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/ajax/addbook.php b/ajax/addbook.php index f5852183..f466d57e 100644 --- a/ajax/addbook.php +++ b/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/ajax/addcontact.php b/ajax/addcontact.php index 68da5465..15227718 100644 --- a/ajax/addcontact.php +++ b/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/ajax/addproperty.php b/ajax/addproperty.php index d2c0291e..9a5e5969 100644 --- a/ajax/addproperty.php +++ b/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/ajax/categories/categoriesfor.php b/ajax/categories/categoriesfor.php index c02c3791..39a7758c 100644 --- a/ajax/categories/categoriesfor.php +++ b/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/ajax/categories/delete.php b/ajax/categories/delete.php index 3ba5aa16..3cc2dea6 100644 --- a/ajax/categories/delete.php +++ b/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/ajax/categories/list.php b/ajax/categories/list.php index 64d74c82..98c1c705 100644 --- a/ajax/categories/list.php +++ b/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/ajax/categories/rescan.php b/ajax/categories/rescan.php index 5f1057ba..09208c3f 100644 --- a/ajax/categories/rescan.php +++ b/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/ajax/chooseaddressbook.php b/ajax/chooseaddressbook.php index d6080791..b47c872e 100644 --- a/ajax/chooseaddressbook.php +++ b/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/ajax/contactdetails.php b/ajax/contactdetails.php index 03895c86..13c3f80c 100644 --- a/ajax/contactdetails.php +++ b/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/ajax/contacts.php b/ajax/contacts.php index cf867641..3e75e4c8 100644 --- a/ajax/contacts.php +++ b/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/ajax/createaddressbook.php b/ajax/createaddressbook.php index 28944fe8..5cdb9b49 100644 --- a/ajax/createaddressbook.php +++ b/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/ajax/cropphoto.php b/ajax/cropphoto.php index 878fb561..96e66ffb 100644 --- a/ajax/cropphoto.php +++ b/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/ajax/deletebook.php b/ajax/deletebook.php index 46d8deb4..b80df526 100644 --- a/ajax/deletebook.php +++ b/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/ajax/deletecard.php b/ajax/deletecard.php index 5675aef5..98cdb85f 100644 --- a/ajax/deletecard.php +++ b/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/ajax/deleteproperty.php b/ajax/deleteproperty.php index ab0958ca..73786cb1 100644 --- a/ajax/deleteproperty.php +++ b/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/ajax/editaddress.php b/ajax/editaddress.php index 4e6456f6..73f34ef5 100644 --- a/ajax/editaddress.php +++ b/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/ajax/editaddressbook.php b/ajax/editaddressbook.php index a6262f39..ef797778 100644 --- a/ajax/editaddressbook.php +++ b/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/ajax/editname.php b/ajax/editname.php index 31bdd125..9e4d6814 100644 --- a/ajax/editname.php +++ b/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/ajax/getdetails.php b/ajax/getdetails.php index 4819916f..aac69f4c 100644 --- a/ajax/getdetails.php +++ b/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/ajax/importdialog.php b/ajax/importdialog.php index 280e462f..cde6bb2f 100644 --- a/ajax/importdialog.php +++ b/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/ajax/loadcard.php b/ajax/loadcard.php index 037fe2a6..4b2a65db 100644 --- a/ajax/loadcard.php +++ b/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/ajax/loadintro.php b/ajax/loadintro.php index 8e567365..7185c5cb 100644 --- a/ajax/loadintro.php +++ b/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/ajax/loadphoto.php b/ajax/loadphoto.php index 2c8bb7bf..669f9e28 100644 --- a/ajax/loadphoto.php +++ b/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/ajax/newcontact.php b/ajax/newcontact.php index fcfd12ca..36c37e03 100644 --- a/ajax/newcontact.php +++ b/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/ajax/savecrop.php b/ajax/savecrop.php index 0df4e199..36ba6a04 100644 --- a/ajax/savecrop.php +++ b/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/ajax/saveproperty.php b/ajax/saveproperty.php index 99d55e79..e459ed73 100644 --- a/ajax/saveproperty.php +++ b/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/ajax/updateaddressbook.php b/ajax/updateaddressbook.php index 211df84b..06028db4 100644 --- a/ajax/updateaddressbook.php +++ b/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/ajax/uploadphoto.php b/ajax/uploadphoto.php index 9780df46..96231596 100644 --- a/ajax/uploadphoto.php +++ b/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/carddav.php b/carddav.php index 654aeb66..794fb890 100644 --- a/carddav.php +++ b/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/dynphoto.php b/dynphoto.php index 2beac15e..c1646e48 100644 --- a/dynphoto.php +++ b/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/export.php b/export.php index fb3e0a41..95d02a9a 100644 --- a/export.php +++ b/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/import.php b/import.php index 04cfc397..8cf0a173 100644 --- a/import.php +++ b/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/index.php b/index.php index 4039b8af..d5545e76 100644 --- a/index.php +++ b/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/photo.php b/photo.php index 298f1215..cd0ae350 100644 --- a/photo.php +++ b/photo.php @@ -9,7 +9,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); + OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); diff --git a/thumbnail.php b/thumbnail.php index 50826264..c7d37b75 100644 --- a/thumbnail.php +++ b/thumbnail.php @@ -21,7 +21,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); + OC_JSON::checkLoggedIn(); //OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts');