public static function showShare($args) { \OC_Util::checkAppEnabled('files_sharing'); $token = $args['token']; \OC_App::loadApp('files_sharing'); \OC_User::setIncognitoMode(true); require_once \OC_App::getAppPath('files_sharing') . '/public.php'; }
<?php /** * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ 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) { OC_Calendar_Calendar::addCalendar(OC_User::getUser(), 'default', 'Default calendar'); $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); } OC_UTIL::addScript('calendar', 'calendar'); OC_UTIL::addStyle('calendar', 'style'); OC_UTIL::addScript('', 'jquery.multiselect'); OC_UTIL::addStyle('', 'jquery.multiselect'); OC_APP::setActiveNavigationEntry('calendar_index'); $output = new OC_TEMPLATE('calendar', 'calendar', 'user'); $output->printPage();
* License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ // Init owncloud require_once '../../lib/base.php'; OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); $id = $_GET['id']; $l10n = new OC_L10N('contacts'); $card = OC_Contacts_VCard::find($id); if ($card === false) { echo $l10n->t('Contact could not be found.'); exit; } $addressbook = OC_Contacts_Addressbook::find($card['addressbookid']); if ($addressbook === false || $addressbook['userid'] != OC_USER::getUser()) { echo $l10n->t('This is not your contact.'); // This is a weird error, why would it come up? (Better feedback for users?) exit; } $content = OC_Contacts_VCard::parse($card['carddata']); // invalid vcard
* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ require_once '../../../lib/base.php'; OC_Util::checkAppEnabled('media'); require_once '../lib_collection.php'; require_once '../lib_ampache.php'; $arguments = $_POST; if (!isset($_POST['action']) and isset($_GET['action'])) { $arguments = $_GET; } foreach ($arguments as &$argument) { $argument = stripslashes($argument); } ob_clean(); if (isset($arguments['action'])) { if (defined("DEBUG") && DEBUG) { error_log($arguments['action']); } switch ($arguments['action']) {
* @author Arthur Schiwon * @copyright 2011 Arthur Schiwon blizzz@arthur-schiwon.de * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ require_once '../../lib/base.php'; // Check if we are a user OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('bookmarks'); require_once 'bookmarksHelper.php'; OC_App::setActiveNavigationEntry('bookmarks_index'); OC_Util::addScript('bookmarks', 'addBm'); OC_Util::addStyle('bookmarks', 'bookmarks'); $tmpl = new OC_Template('bookmarks', 'addBm', 'user'); $url = isset($_GET['url']) ? urldecode($_GET['url']) : ''; $metadata = getURLMetadata($url); $tmpl->assign('URL', htmlentities($metadata['url'])); $tmpl->assign('TITLE', htmlentities($metadata['title'])); $tmpl->printPage();
/** * Check if the app is enabled, redirects to home if not * @param string $app * @return void * @since 4.0.0 */ public static function checkAppEnabled($app) { \OC_Util::checkAppEnabled($app); }
<?php /** * ownCloud - Compress plugin * * @author Xavier Beurois * @copyright 2012 Xavier Beurois www.djazz-lab.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ $app_id = 'compress'; OC_Util::checkAppEnabled($app_id); OC_App::register(array('order' => 70, 'id' => $app_id, 'name' => ucfirst($app_id))); OC_Util::addScript($app_id, 'actlink.min'); OC_Util::addScript('3rdparty', 'chosen/chosen.jquery.min'); OC_Util::addStyle('3rdparty', 'chosen/chosen'); if (!OC_App::isEnabled('files_sharing')) { OC_Util::addStyle($app_id, 'styles'); }
* License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ // Do not load FS ... $RUNTIME_NOSETUPFS = true; require_once '../../lib/base.php'; OC_Util::checkAppEnabled('remoteStorage'); require_once 'Sabre/autoload.php'; require_once 'lib_remoteStorage.php'; require_once 'oauth_ro_auth.php'; ini_set('default_charset', 'UTF-8'); #ini_set('error_reporting', ''); @ob_clean(); $path = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["SCRIPT_NAME"])); $pathParts = explode('/', $path); if (count($pathParts) == 2 && $pathParts[0] == '') { //TODO: input checking. these explodes may fail to produces the desired arrays: $subPathParts = explode('?', $pathParts[1]); $ownCloudUser = $subPathParts[0]; foreach ($_GET as $k => $v) { if ($k == 'user_address') { $userAddress = $v;
} else { $pathInfo = trim($pathInfo, '/'); list($service) = explode('/', $pathInfo); } $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($service)); if (is_null($file)) { header('HTTP/1.0 404 Not Found'); exit; } $parts = explode('/', $file, 2); $app = $parts[0]; // Load all required applications \OC::$REQUESTEDAPP = $app; OC_App::loadApps(array('authentication')); OC_App::loadApps(array('filesystem', 'logging')); OC_Util::checkAppEnabled($app); OC_App::loadApp($app); OC_User::setIncognitoMode(true); $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; require_once OC_App::getAppPath($app) . '/' . $parts[1]; } catch (\OC\ServiceUnavailableException $ex) { //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); OC_Template::printExceptionErrorPage($ex); } catch (Exception $ex) { //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); OC_Template::printExceptionErrorPage($ex); }
* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OC_Util::checkAppEnabled('storage_charts'); OC_Util::checkLoggedIn(); $tmpl = new OC_Template('storage_charts', 'settings.tpl'); if (isset($_POST['storage_charts_disp']) && count($_POST['storage_charts_disp']) <= 3) { $c = $_POST['storage_charts_disp']; $c_disp = array('cpie_rfsus' => 0, 'clines_usse' => 0, 'chisto_us' => 0); foreach (array_keys($c_disp) as $chart) { if (in_array($chart, $c)) { $c_disp[$chart] = 1; } } OC_DLStCharts::setUConfValue('c_disp', serialize($c_disp)); $tmpl->assign('stc_save_ok', TRUE); } $displays = OC_DLStCharts::getUConfValue('c_disp', array('uc_val' => 'a:3:{s:10:"cpie_rfsus";i:1;s:11:"clines_usse";i:1;s:9:"chisto_us";i:1;}')); $tmpl->assign('displays', unserialize($displays['uc_val']));
<?php /** * ownCloud - Internal Bookmarks plugin * * @author Xavier Beurois * @copyright 2012 Xavier Beurois www.djazz-lab.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OC_Util::checkAppEnabled('internal_bookmarks'); OC_Util::checkLoggedIn(); $tmpl = new OC_Template('internal_bookmarks', 'settings.tpl'); $tmpl->assign('bk_list', OC_IntBks::getAllItemsByUser()); return $tmpl->fetchPage();
<?php /** * ownCloud * * @author Michael Gapczynski * @copyright 2011 Michael Gapczynski GapczynskiM@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ require_once '../../lib/base.php'; require_once 'lib_share.php'; OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('files_sharing'); OC_App::setActiveNavigationEntry("files_sharing_list"); OC_Util::addScript("files_sharing", "list"); $tmpl = new OC_Template("files_sharing", "list", "user"); $tmpl->assign("shared_items", OC_Share::getMySharedItems()); $tmpl->printPage();
<?php // Init owncloud require_once '../../lib/base.php'; OCP\User::checkLoggedIn(); OC_Util::checkAppEnabled('files_svgedit'); // load required style sheets: OCP\Util::addStyle('files_svgedit', 'ocsvg'); // load required javascripts: OCP\Util::addScript('files_svgedit', 'svg-edit/embedapi'); OCP\Util::addScript('files_svgedit', 'ocsvgEditor'); OCP\Util::addScript('files_svgedit', 'canvg/canvg'); OCP\Util::addScript('files_svgedit', 'canvg/rgbcolor'); OCP\Util::addScript('files_svgedit', 'base64'); //OCP\Util::addScript('files_svgedit', 'jsPDF/libs/sprintf'); //OCP\Util::addScript('files_svgedit', 'jsPDF/jspdf'); OCP\Util::addScript('files_svgedit', 'jsPDF/jspdf.min'); OCP\Util::addScript('files_svgedit', 'svgToPdf'); OCP\App::setActiveNavigationEntry('files_index'); $path = $_GET['file']; $writable = \OC\Files\Filesystem::isUpdatable($path); if (isset($_GET['file']) and $writable) { $filecontents = \OC\Files\Filesystem::file_get_contents($path); $filemtime = \OC\Files\Filesystem::filemtime($path); } else { $filecontents = ""; $filemtime = 0; } $tmpl = new OCP\Template("files_svgedit", "editor", "user"); $tmpl->assign('fileContents', json_encode($filecontents)); $tmpl->assign('filemTime', $filemtime);
* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OC_Util::checkAppEnabled('ocdownloader'); OC_Util::checkLoggedIn(); if (isset($_POST['ocdownloader']) && $_POST['ocdownloader'] == 1) { foreach ($_POST as $key => $value) { $value = trim($value); if (strcmp(substr($key, 0, 19), 'ocdownloader_pr_un_') == 0) { $pr_id = substr($key, strrpos($key, '_') + 1); if (strlen($value) != 0) { if (is_numeric($pr_id)) { $pwd = trim($_POST['ocdownloader_pr_pw_' . $pr_id]); if (strlen($pwd) != 0) { OC_ocDownloader::updateUserInfo($pr_id, $value, $pwd); } } } else { if (is_numeric($pr_id)) {
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ $USERNAME = substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], '.php/') + 5); if (strpos($USERNAME, '?') !== false) { $USERNAME = substr($USERNAME, 0, strpos($USERNAME, '?')); } if (substr($USERNAME, -1, 1) == '/') { //openid sometimes add slashes to the username $USERNAME = substr($USERNAME, 0, -1); } if ($USERNAME == '' and isset($_SERVER['PHP_AUTH_USER'])) { $USERNAME = $_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'); } $USERNAME = ''; } $IDENTITY = OC_Helper::linkTo("user_openid", "user.php", null, true) . '/' . $USERNAME; require_once 'phpmyid.php';
* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. * * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ OC_Util::checkAdminUser(); OC_Util::checkAppEnabled('admin_export'); if (isset($_POST['admin_export'])) { $root = OC::$SERVERROOT . "/"; $zip = new ZipArchive(); $filename = sys_get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip"; error_log("Creating export file at: " . $filename); if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) { exit("Cannot open <{$filename}>\n"); } if (isset($_POST['owncloud_system'])) { // adding owncloud system files error_log("Adding owncloud system files to export"); zipAddDir($root, $zip, false); foreach (array(".git", "3rdparty", "apps", "core", "files", "l10n", "lib", "ocs", "search", "settings", "tests") as $dirname) { zipAddDir($root . $dirname, $zip, true, basename($root) . "/"); }