* 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();
} else {
error_log("Was not able to open directory: " . $dir);
}
-}
\ No newline at end of file
+}
// Check if we are a user
OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('bookmarks');
require_once('bookmarksHelper.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' ){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
$params=array(
htmlspecialchars_decode($_GET["url"]),
// 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' ){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
// $metadata = array();
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('bookmarks');
$query = OC_DB::prepare("
UPDATE *PREFIX*bookmarks
// 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' );
// Check if we are a user
OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('bookmarks');
OC_App::setActiveNavigationEntry( 'bookmarks_index' );
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);
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);
?>
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();
?>
// 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']);
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);
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);
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);
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){
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);
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();
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
+OC_JSON::checkAppEnabled('calendar');
$calendar = array(
'id' => 'new',
'displayname' => 'Test',
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){
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);
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('calendar');
// Get data
if( isset( $_POST['timezone'] ) ){
// 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']);
$RUNTIME_NOSETUPFS = true;
require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('calendar');
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
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()){
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){
// 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()){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
if( $card === false ){
// 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()){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
if( $card === false ){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
if( $card === false ){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
if( $card === false ){
// 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');
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
if( $card === false ){
// Check if we are a user
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
$card = OC_Contacts_VCard::find( $id );
if( $card === false ){
$RUNTIME_NOSETUPFS = true;
require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('contacts');
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
// 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());
// Init owncloud
require_once('../../lib/base.php');
+OC_Util::checkAppEnabled('contacts');
$id = $_GET['id'];
$RUNTIME_NOAPPS = true;
require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_sharing');
require_once('../lib_share.php');
$userDirectory = "/".OC_User::getUser()."/files";
$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'];
$permissions = $_GET['permissions'];
OC_Share::setPermissions($source, $uid_shared_with, $permissions);
-?>
\ No newline at end of file
+?>
$RUNTIME_NOAPPS = true;
require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('files_sharing');
require_once('../lib_share.php');
$userDirectory = "/".OC_User::getUser()."/files";
}
}
-?>
\ No newline at end of file
+?>
$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
+?>
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('files_sharing');
$users = array();
$ocusers = OC_User::getUsers();
$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
require_once('lib_share.php');
OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('files_sharing');
OC_App::setActiveNavigationEntry("files_sharing_list");
$RUNTIME_NOAPPS=true;
require_once('../../../lib/base.php');
+OC_JSON::checkAppEnabled('media');
require_once('../lib_collection.php');
require_once('../lib_scanner.php');
$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');
// Check if we are a user
OC_Util::checkLoggedIn();
+OC_Util::checkAppEnabled('media');
require_once('lib_collection.php');
require_once('lib_scanner.php');
require_once('../../../lib/base.php');
+OC_Util::checkAppEnabled('media');
require_once('../lib_collection.php');
require_once('../lib_ampache.php');
$_POST=$_GET; //debug
require_once('../../lib/base.php');
+OC_JSON::checkAppEnabled('media');
require_once('lib_collection.php');
$user=isset($_POST['user'])?$_POST['user']:'';
$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');
$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');}
}
}
+ /**
+ * 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
*/
}
+ /**
+ * 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
*/
$l=new OC_L10N('settings');
OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('user_openid');
// Get data
if( isset( $_POST['identity'] ) ){