var dbtypes; $(document).ready(function() { dbtypes={ sqlite:!!$('#hasSQLite').val(), mysql:!!$('#hasMySQL').val(), postgresql:!!$('#hasPostgreSQL').val(), oracle:!!$('#hasOracle').val() }; $('#selectDbType').buttonset(); // change links inside an info box back to their default appearance $('#selectDbType p.info a').button('destroy'); if($('#hasSQLite').val()){ $('#use_other_db').hide(); $('#use_oracle_db').hide(); } else { $('#sqliteInformation').hide(); } $('#adminlogin').change(function(){ $('#adminlogin').val($.trim($('#adminlogin').val())); }); $('#sqlite').click(function() { $('#use_other_db').slideUp(250); $('#use_oracle_db').slideUp(250); $('#sqliteInformation').show(); $('#dbname').attr('pattern','[0-9a-zA-Z$_-]+'); }); $('#mysql,#pgsql').click(function() { $('#use_other_db').slideDown(250); $('#use_oracle_db').slideUp(250); $('#sqliteInformation').hide(); $('#dbname').attr('pattern','[0-9a-zA-Z$_-]+'); }); $('#oci').click(function() { $('#use_other_db').slideDown(250); $('#use_oracle_db').show(250); $('#sqliteInformation').hide(); $('#dbname').attr('pattern','[0-9a-zA-Z$_-.]+'); }); $('input[checked]').trigger('click'); $('#showAdvanced').click(function(e) { e.preventDefault(); $('#datadirContent').slideToggle(250); $('#databaseBackend').slideToggle(250); $('#databaseField').slideToggle(250); }); $("form").submit(function(){ // Save form parameters var post = $(this).serializeArray(); // Show spinner while finishing setup $('.float-spinner').show(250); // Disable inputs $(':submit', this).attr('disabled','disabled').val($(':submit', this).data('finishing')); $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); // only disable buttons if they are present if($('#selectDbType').find('.ui-button').length > 0) { $('#selectDbType').buttonset('disable'); } $('.strengthify-wrapper, .tipsy') .css('-ms-filter', '"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"') .css('filter', 'alpha(opacity=30)') .css('opacity', .3); // Create the form var form = $('
'); form.attr('action', $(this).attr('action')); form.attr('method', 'POST'); for(var i=0; i'); input.attr(post[i]); form.append(input); } // Add redirect_url var redirectURL = getURLParameter('redirect_url'); if (redirectURL) { var redirectURLInput = $(''); redirectURLInput.attr({ name: 'redirect_url', value: redirectURL }); form.append(redirectURLInput); } // Submit the form form.appendTo(document.body); form.submit(); return false; }); // Expand latest db settings if page was reloaded on error var currentDbType = $('input[type="radio"]:checked').val(); if (currentDbType === undefined){ $('input[type="radio"]').first().click(); } if ( currentDbType === 'sqlite' || (dbtypes.sqlite && currentDbType === undefined) ){ $('#datadirContent').hide(250); $('#databaseBackend').hide(250); $('#databaseField').hide(250); $('.float-spinner').hide(250); } $('#adminpass').strengthify({ zxcvbn: OC.linkTo('core','vendor/zxcvbn/dist/zxcvbn.js'), titles: [ t('core', 'Very weak password'), t('core', 'Weak password'), t('core', 'So-so password'), t('core', 'Good password'), t('core', 'Strong password') ], drawTitles: true, }); // centers the database chooser if it is too wide if($('#databaseBackend').width() > 300) { // this somehow needs to wait 250 milliseconds // otherwise it gets overwritten setTimeout(function(){ // calculate negative left margin // half of the difference of width and default bix width of 300 // add 10 to clear left side padding of button group var leftMargin = (($('#databaseBackend').width() - 300) / 2 + 10 ) * -1; $('#databaseBackend').css('margin-left', Math.floor(leftMargin) + 'px'); }, 250); } }); ing_metadata'>artonge/feat/allow_deleting_metadata Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
blob: 858e8af778233d8df46fa31f67e0c8fbeadb8727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
 * @author Björn Schießle <schiessle@owncloud.com>
 * @author Christopher Schäpers <kondou@ts.unde.re>
 * @author Georg Ehrke <georg@owncloud.com>
 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
 * @author Lukas Reschke <lukas@owncloud.com>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin Appelman <icewind@owncloud.com>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
 * @author Vincent Petry <pvince81@owncloud.com>
 *
 * @copyright Copyright (c) 2015, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program 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, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
try {

	require_once 'lib/base.php';
	if (\OCP\Util::needUpgrade()) {
		// since the behavior of apps or remotes are unpredictable during
		// an upgrade, return a 503 directly
		OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
		OC_Template::printErrorPage('Service unavailable');
		exit;
	}

	OC::checkMaintenanceMode();
	OC::checkSingleUserMode(true);
	$request = \OC::$server->getRequest();
	$pathInfo = $request->getPathInfo();

	if (!$pathInfo && $request->getParam('service', '') === '') {
		header('HTTP/1.0 404 Not Found');
		exit;
	} elseif ($request->getParam('service', '')) {
		$service = $request->getParam('service', '');
	} 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'));

	if (!\OC::$server->getAppManager()->isInstalled($app)) {
		throw new Exception('App not installed: ' . $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);
}