]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if the application is actually enabled
authorBart Visscher <bartv@thisnet.nl>
Fri, 30 Sep 2011 21:05:10 +0000 (23:05 +0200)
committerBart Visscher <bartv@thisnet.nl>
Fri, 30 Sep 2011 21:17:18 +0000 (23:17 +0200)
57 files changed:
apps/admin_export/settings.php
apps/bookmarks/addBm.php
apps/bookmarks/ajax/addBookmark.php
apps/bookmarks/ajax/delBookmark.php
apps/bookmarks/ajax/editBookmark.php
apps/bookmarks/ajax/getMeta.php
apps/bookmarks/ajax/recordClick.php
apps/bookmarks/ajax/updateList.php
apps/bookmarks/index.php
apps/calendar/ajax/activation.php
apps/calendar/ajax/changeview.php
apps/calendar/ajax/choosecalendar.php
apps/calendar/ajax/createcalendar.php
apps/calendar/ajax/deletecalendar.php
apps/calendar/ajax/deleteevent.php
apps/calendar/ajax/editcalendar.php
apps/calendar/ajax/editevent.php
apps/calendar/ajax/editeventform.php
apps/calendar/ajax/getcal.php
apps/calendar/ajax/newcalendar.php
apps/calendar/ajax/newevent.php
apps/calendar/ajax/neweventform.php
apps/calendar/ajax/settimezone.php
apps/calendar/ajax/updatecalendar.php
apps/calendar/caldav.php
apps/calendar/export.php
apps/calendar/index.php
apps/contacts/ajax/addcard.php
apps/contacts/ajax/addproperty.php
apps/contacts/ajax/deletebook.php
apps/contacts/ajax/deletecard.php
apps/contacts/ajax/deleteproperty.php
apps/contacts/ajax/getdetails.php
apps/contacts/ajax/setproperty.php
apps/contacts/ajax/showaddcard.php
apps/contacts/ajax/showaddproperty.php
apps/contacts/ajax/showsetproperty.php
apps/contacts/carddav.php
apps/contacts/index.php
apps/contacts/photo.php
apps/files_sharing/ajax/getitem.php
apps/files_sharing/ajax/setpermissions.php
apps/files_sharing/ajax/share.php
apps/files_sharing/ajax/unshare.php
apps/files_sharing/ajax/userautocomplete.php
apps/files_sharing/get.php
apps/files_sharing/list.php
apps/media/ajax/api.php
apps/media/ajax/autoupdate.php
apps/media/index.php
apps/media/server/xml.server.php
apps/media/tomahawk.php
apps/unhosted/compat.php
apps/user_openid/user.php
lib/json.php
lib/util.php
settings/ajax/openid.php

index 2d1bc66a2968e0a5a9b780cbf04cd6552e3b655c..565c4b3db976036778cadecf7d95d9f642c3b9c8 100644 (file)
@@ -20,6 +20,7 @@
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
+OC_Util::checkAppEnabled('admin_export');
 if (isset($_POST['admin_export'])) {
     $root = OC::$SERVERROOT . "/";
     $zip = new ZipArchive();
@@ -91,4 +92,4 @@ function zipAddDir($dir, $zip, $recursive=true, $internalDir='') {
     } else {
        error_log("Was not able to open directory: " . $dir);
     }
-}
\ No newline at end of file
+}
index b62fcdfbeb0852fddc0970dccc52bc6032c3a82f..a2a39134eab5ca0e6e59b8f157efbb74dcf126de 100644 (file)
@@ -25,6 +25,7 @@ require_once('../../lib/base.php');
 
 // Check if we are a user
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('bookmarks');
 
 require_once('bookmarksHelper.php');
 
index 9b0beb388a0875f8773fa6841bae8f9801b487eb..0dc83d9014d223295f49b7630d5139ced6590a88 100644 (file)
@@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
 
 $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
 if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
index afe60f7d1bf7f919fbcec7bf9120d31059859a8d..4aef86e771b4b125b71fe56bc3bc1ef7fe1fc7fd 100644 (file)
@@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
 
 $params=array(
        htmlspecialchars_decode($_GET["url"]),
index 5125f9ce8989b2e55a62bf7fd96ec462c3a81b0a..b427a175e5f5bf3ba97e18b072c95416e11e5368 100644 (file)
@@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
 
 $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
 if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
index 4583ef204b477922298ac2d7a90a8c6d96e381fa..ca797315ef47cc54b1601e1feb35319fb1b509a6 100644 (file)
@@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
 
 // $metadata = array();
 
index f5f7c20c6a005118ec034b1e6dd7f850a3709013..e6fdfe043e1dcd6691e4c55f87da376dbc2f6933 100644 (file)
@@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
 
 $query = OC_DB::prepare("
        UPDATE *PREFIX*bookmarks
index de3480d6c3a5b6c3399d66aa7b9781171deba570..8e9bda0bc201d7d0b0b4fb27656b7278b68c24f0 100644 (file)
@@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
 
 $params=array(OC_User::getUser());
 $CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
index 45c9a52f5577ae2fac249f3a60fcc3f56b045bc8..50fea3fddbd68b4966838690799a434c730530b9 100644 (file)
@@ -25,6 +25,7 @@ require_once('../../lib/base.php');
 
 // Check if we are a user
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('bookmarks');
 
 OC_App::setActiveNavigationEntry( 'bookmarks_index' );
 
index 38f727e9488c15a01065ae2f59a647c4cd912bb5..89239f21759bd06f06c6c1ecfe71230c9e393065 100644 (file)
@@ -10,6 +10,7 @@ require_once ("../../../lib/base.php");
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 $calendarid = $_POST['calendarid'];
 OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
 $cal = OC_Calendar_Calendar::findCalendar($calendarid);
index d19a11585a0d0b5fa3ffa8f6c62dad3f4ad3d4e1..b396ff4945b8635529dc51386bf223c834d57203 100644 (file)
@@ -10,6 +10,7 @@ require_once ("../../../lib/base.php");
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 $currentview = $_GET["v"];
 OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
 ?>
index 44ff22906f108e69cb7d7216b58679fb5cba0548..0935a4c42ade0eb9036ba75ed714fffa6ccef44e 100644 (file)
@@ -11,6 +11,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 $output = new OC_TEMPLATE("calendar", "part.choosecalendar");
 $output -> printpage();
 ?>
index 7d80333b258a3cf426d08f4231b192124ec062e5..82176d4368aeaede37e8e390f074718ce35d6208 100644 (file)
@@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('calendar');
 
 $userid = OC_User::getUser();
 $calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
index 30607b92e6fdaa585c708bbf0a93a7358bf9b92d..e8ffe0d0598c28e94345ab3892b03aee62a7f9f5 100644 (file)
@@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die('<script type="text/javascript">document.location = oc_webroot;</script>');
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $cal = $_POST["calendarid"];
 $calendar = OC_Calendar_Calendar::findCalendar($cal);
index a6750267bd218a0fcdfee864c3c9b9e2d5972321..9e3c7dd87dd0edfaebef275f6626a164f3c1e7a3 100644 (file)
@@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die('<script type="text/javascript">document.location = oc_webroot;</script>');
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $id = $_POST['id'];
 $data = OC_Calendar_Object::find($id);
index 8f798d1bbf2301fc078f744d501403a97570499c..7ff869f8885dcecfb9e579c0c9be62c22fd13c23 100644 (file)
@@ -11,6 +11,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 $calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
 $tmpl = new OC_Template("calendar", "part.editcalendar");
 $tmpl->assign('new', false);
index 7187e05d56f6b078be87fa9ac623141cafa325f7..3abf4de98b3934252d10047cfeb726223f7113e3 100644 (file)
@@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die('<script type="text/javascript">document.location = oc_webroot;</script>');
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $errarr = OC_Calendar_Object::validateRequest($_POST);
 if($errarr){
index e2d32d03d3de0a5e763003e86ddc43fa23fab3ed..34d6c657cecac79c521222e5a6b72316f421c078 100644 (file)
@@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die('<script type="text/javascript">document.location = oc_webroot;</script>');
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
 $category_options = OC_Calendar_Object::getCategoryOptions($l10n);
index 7fa4f87cd3136ce3b14aca1a46174f242cc57f36..c59cb873fdcc357645d2af0f7a275092d6e6b605 100644 (file)
@@ -10,6 +10,7 @@ require_once ("../../../lib/base.php");
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
 $events = array();
index ffcffb8afd795ef96c17650945ccde0f36f7a035..199f95fb4635df4a825e93f52e2f4dcb3db7f7ed 100644 (file)
@@ -11,6 +11,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 $calendar = array(
        'id' => 'new',
        'displayname' => 'Test',
index 9ac3b0aaff6fd1e45b9e4a1657781fa1c917bd2a..1a696cf7780f8e9a25392a7717227bd955af8960 100644 (file)
@@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $errarr = OC_Calendar_Object::validateRequest($_POST);
 if($errarr){
index 7099ea718e97a9ba27322a30e52cba1849ecc87d..9bab2cd4846522dda48de2c9aab5dc0f35c37c69 100644 (file)
@@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
 if(!OC_USER::isLoggedIn()) {
        die('<script type="text/javascript">document.location = oc_webroot;</script>');
 }
+OC_JSON::checkAppEnabled('calendar');
 
 $calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
 $category_options = OC_Calendar_Object::getCategoryOptions($l10n);
index 2b82bc8e4bca9fd57d790447be607497c9a99354..c726a11471d2c3c11876d545fefa7d62018595ed 100644 (file)
@@ -13,6 +13,7 @@ $l=new OC_L10N('calendar');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('calendar');
 
 // Get data
 if( isset( $_POST['timezone'] ) ){
index d53515d0deb707562fb70666badbf6a5f4427b5d..5cf48d50ea12eabb074760284861028fc21b40d2 100644 (file)
@@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('calendar');
 
 $calendarid = $_POST['id'];
 OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
index 83f6a5ab51d18689433ebc98734657db7106bd9f..b581274398ddb99b1270a18cef06c8faa1493526 100644 (file)
@@ -10,6 +10,7 @@
 $RUNTIME_NOSETUPFS = true;
 
 require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('calendar');
 
 // Backends
 $authBackend = new OC_Connector_Sabre_Auth();
index a6fdaba1d2fac9f4ffcc67c9515b5db99143b16e..feb4755a3aa95c7fe8bc07eaa2059ebd442905a1 100644 (file)
@@ -8,6 +8,7 @@
 
 require_once ("../../lib/base.php");
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('calendar');
 $cal = $_GET["calid"];
 $calendar = OC_Calendar_Calendar::findCalendar($cal);
 if($calendar["userid"] != OC_User::getUser()){
index 39f961d1bb934eb69c12ce3a5fc8ce763b1574fd..1e4d724b307a1cad1d78d1b825efe6f9c84ed0bc 100644 (file)
@@ -8,6 +8,7 @@
 
 require_once ('../../lib/base.php');
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('calendar');
 // Create default calendar ...
 $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
 if( count($calendars) == 0){
index cfae3327f5694019e001fe656d24e7aa72707bb6..ee95513732de9277f98243221d6c544048eac73b 100644 (file)
@@ -28,6 +28,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $addressbook = OC_Contacts_Addressbook::find( $aid );
 if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
index 5a37f77f858ddfe890d886f527813e01f5562e3a..0b218c6298f64489cd3e1fb4ad956eab50ecb65f 100644 (file)
@@ -28,6 +28,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $card = OC_Contacts_VCard::find( $id );
 if( $card === false ){
index 13be33eb5a9ef114ceb838dba8651b8a631fcb18..c13217ef2e22e6aa719cde9037c6819de735db65 100644 (file)
@@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $addressbook = OC_Contacts_Addressbook::find( $id );
 if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
index c69638320ed3519e8636aae751ef29adcba57d64..a0a6b8c3ea8d352dc313d32162eb1bb1d88b7da1 100644 (file)
@@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $card = OC_Contacts_VCard::find( $id );
 if( $card === false ){
index 40b765cf845e934abcb3c3dd6250e44b5f0a577c..0a3a3c293a0439e5b4a54ba2f9f32bd2d9718bc2 100644 (file)
@@ -31,6 +31,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $card = OC_Contacts_VCard::find( $id );
 if( $card === false ){
index 47d88a771e61075440834953c426dfee4a861468..0e76de61afb0b23ac1a673be23047fff250c2cda 100644 (file)
@@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 
 $card = OC_Contacts_VCard::find( $id );
index b4fc2162d90e4979ea1d0f1467ab3f2c551ef3a9..18e00872473c90721258edadd0b0a647fd5556b6 100644 (file)
@@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $card = OC_Contacts_VCard::find( $id );
 if( $card === false ){
index 58567392d7c19f9d12c7fbbc2f6fba0bdb4434ac..2f534f0fe2d0bc772a8ae81a17317b6c67b4d8fa 100644 (file)
@@ -27,6 +27,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
 $tmpl = new OC_Template('contacts','part.addcardform');
index 0d01b37d8efacffa811d3f318d807c36755b8241..f87cd05359bdd8aca03a17b4fb106e2461f63cdb 100644 (file)
@@ -28,6 +28,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $card = OC_Contacts_VCard::find( $id );
 if( $card === false ){
index 0b30a8e68eceb38de3c3b210eebf963b0f408492..6188f4773c3771b745184719cf75a7197fc5d0f0 100644 (file)
@@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
 
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
 
 $card = OC_Contacts_VCard::find( $id );
 if( $card === false ){
index b17a939535514fc917c2143f5e236d7e8e5f2903..df7c858b1a00346b45cf4790b173a5d838f40deb 100644 (file)
@@ -24,6 +24,7 @@
 $RUNTIME_NOSETUPFS = true;
 
 require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('contacts');
 
 // Backends
 $authBackend = new OC_Connector_Sabre_Auth();
index c9cf348dfd7d4f3cdd5d25c19ac47bda2296e84f..7e8eb8e6951fc93e0f1efee1df0fca5e5eaadf6f 100644 (file)
@@ -29,6 +29,7 @@ require_once('../../lib/base.php');
 
 // Check if we are a user
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('contacts');
 
 // Check if the user has an addressbook
 $addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
index 7ba2002b13dfe073bf897af9e00fde2b981aa4df..1bdfbe3a27f0f2507b53c960685c2cd3da91562c 100644 (file)
@@ -22,6 +22,7 @@
 
 // Init owncloud
 require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('contacts');
 
 $id = $_GET['id'];
 
index e7bda0f6144fefcb82c71660636c55fdc6323087..8d51c1465232f4f2e84b3d3b030ccdfc435c2f07 100644 (file)
@@ -2,6 +2,7 @@
 $RUNTIME_NOAPPS = true;
 
 require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_sharing');
 require_once('../lib_share.php');
 
 $userDirectory = "/".OC_User::getUser()."/files";
index 8e0bac0b06f6dca8d2bd73cdfe26743ece80e826..7ee8f0e57bd21e9a308060f44ececfa8894c0c46 100644 (file)
@@ -2,6 +2,7 @@
 $RUNTIME_NOAPPS = true;
 
 require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_sharing');
 require_once('../lib_share.php');
 
 $source = "/".OC_User::getUser()."/files".$_GET['source'];
@@ -9,4 +10,4 @@ $uid_shared_with = $_GET['uid_shared_with'];
 $permissions = $_GET['permissions'];
 OC_Share::setPermissions($source, $uid_shared_with, $permissions);
 
-?>
\ No newline at end of file
+?>
index e672cf0240342e5903205cf52b9a00eb7ec2f672..6a2b45b3a7df6979815ea1b93c0339953a6c9ea2 100644 (file)
@@ -2,6 +2,7 @@
 $RUNTIME_NOAPPS = true;
 
 require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_sharing');
 require_once('../lib_share.php');
 
 $userDirectory = "/".OC_User::getUser()."/files";
@@ -26,4 +27,4 @@ foreach ($sources as $source) {
        }
 }
 
-?>
\ No newline at end of file
+?>
index b9230d257b767d9c32f01cb8446f9b34fedc082b..a19a85cfda3639b20a917abbbb7237116d1c3826 100644 (file)
@@ -2,10 +2,11 @@
 $RUNTIME_NOAPPS = true;
 
 require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_sharing');
 require_once('../lib_share.php');
 
 $source = "/".OC_User::getUser()."/files".$_GET['source'];
 $uid_shared_with = $_GET['uid_shared_with'];
 OC_Share::unshare($source, $uid_shared_with);
 
-?>
\ No newline at end of file
+?>
index a3158cf72d6d283423ef92c2e0656980d5defde3..21516c3d091a4bedd1f2c74186f4de6fb519f08c 100644 (file)
@@ -4,6 +4,7 @@ $RUNTIME_NOAPPS = true;
 require_once('../../../lib/base.php');
 
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('files_sharing');
 
 $users = array();
 $ocusers = OC_User::getUsers();
index 33918bf9e7dcefda74428565be422404688a9d58..083f48e1127c458e93456a63048d245a6e2a8c92 100644 (file)
@@ -3,6 +3,7 @@ $RUNTIME_NOAPPS=true; //no need to load the apps
 $RUNTIME_NOSETUPFS=true; //don't setup the fs yet
 
 require_once '../../lib/base.php';
+OC_JSON::checkAppEnabled('files_sharing');
 require_once 'lib_share.php';
 
 //get the path of the shared file
index a5f99f3804110131b148853f915bbfe43a294be6..721620dc92253b3c8313272380972d5e8c0f0288 100644 (file)
@@ -24,6 +24,7 @@ require_once('../../lib/base.php');
 require_once('lib_share.php');
 
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('files_sharing');
 
 OC_App::setActiveNavigationEntry("files_sharing_list");
 
index 84ee63344637e7959411d46c04949ffbfb041b56..29f61a2207faa2a54f2edfba50db82d5371d692f 100644 (file)
@@ -27,6 +27,7 @@ header('Content-type: text/html; charset=UTF-8') ;
 $RUNTIME_NOAPPS=true;
 
 require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('media');
 require_once('../lib_collection.php');
 require_once('../lib_scanner.php');
 
index ad103d1c39be197863c77a246b845edcb8ff30f5..ff0923ca03209875ce1730d9bfc514f931c844a6 100644 (file)
@@ -28,6 +28,7 @@ $RUNTIME_NOAPPS=true;
 $RUNTIME_NOSETUPFS=true;
 
 require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('media');
 
 if(defined("DEBUG") && DEBUG) {error_log($_GET['autoupdate']);}
 $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true');
index d5273ae45cb6b0b10f1ea0c181bc685b8a630005..419d4ae0bde1bbc70ef0be4232201132236fc23f 100644 (file)
@@ -26,6 +26,7 @@ require_once('../../lib/base.php');
 
 // Check if we are a user
 OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('media');
 
 require_once('lib_collection.php');
 require_once('lib_scanner.php');
index 387c3480047557f8bca02024d1ea845b3dded5d6..44a16793bf23a131c54ef7a6e83281e750244183 100644 (file)
@@ -23,6 +23,7 @@
 
 
 require_once('../../../lib/base.php');
+OC_Util::checkAppEnabled('media');
 require_once('../lib_collection.php');
 require_once('../lib_ampache.php');
 
index 1db982a35048e9a459140468af079b8750d5d4f0..68401db67ae184e07b9e5302eb2e3b3c015d3152 100644 (file)
@@ -24,6 +24,7 @@
 $_POST=$_GET; //debug
 
 require_once('../../lib/base.php');
+OC_JSON::checkAppEnabled('media');
 require_once('lib_collection.php');
 
 $user=isset($_POST['user'])?$_POST['user']:'';
index 00d6a7c2eeb19174f34c39d02b0a7a2c6d5aa4bb..a514018f71adbcdfed1460c977881528be9a59bc 100644 (file)
@@ -30,6 +30,7 @@
 $RUNTIME_NOSETUPFS = true;
 
 require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('unhosted');
 require_once('Sabre/autoload.php');
 require_once('lib_unhosted.php');
 require_once('oauth_ro_auth.php');
index d90e0b71900b813deb3ec3c3a10d2ddb4050a784..3cbc38491ca2808ca248ed58213e6f29e7a4ca29 100644 (file)
@@ -37,6 +37,7 @@ if($USERNAME=='' and isset($_SERVER['PHP_AUTH_USER'])){
 $RUNTIME_NOAPPS=true;
 $RUNTIME_NOAPPS=false;
 require_once '../../lib/base.php';
+OC_Util::checkAppEnabled('user_openid');
 
 if(!OC_User::userExists($USERNAME)){
        if(defined("DEBUG") && DEBUG) {error_log($USERNAME.' doesn\'t exist');}
index 6ab0404c081a20385fc2fd25b771a3e9d0ea6ccc..cedf79fd7c3fe5951dd5201ba69bb66c86052886 100644 (file)
@@ -19,6 +19,17 @@ class OC_JSON{
                }
        }
 
+       /**
+       * Check if the app is enabled, send json error msg if not
+       */
+       public static function checkAppEnabled($app){
+               if( !OC_App::isEnabled($app)){
+                       $l = new OC_L10N('core');
+                       self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled') )));
+                       exit();
+               }
+       }
+
        /**
        * Check if the user is logged in, send json error msg if not
        */
index c17f346c2bec884de4301b7d8efac59983e2f6af..26d718da94471b0c7d6af6a5c95a04e72eceb665 100644 (file)
@@ -276,6 +276,16 @@ class OC_Util {
         }
 
 
+       /**
+       * Check if the app is enabled, send json error msg if not
+       */
+       public static function checkAppEnabled($app){
+               if( !OC_App::isEnabled($app)){
+                       header( 'Location: '.OC_Helper::linkTo( '', 'index.php' , true));
+                       exit();
+               }
+       }
+
        /**
        * Check if the user is logged in, redirects to home if not
        */
index 4226ae740f01e452aae4a96adc1a3edf949274e3..c4b119b448dd1bdf9d9100d5e815ad97723b4cbc 100644 (file)
@@ -6,6 +6,7 @@ require_once('../../lib/base.php');
 $l=new OC_L10N('settings');
 
 OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('user_openid');
 
 // Get data
 if( isset( $_POST['identity'] ) ){