diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2014-02-04 06:04:21 -0800 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2014-02-04 06:04:21 -0800 |
commit | 3c8007180715b75d2b1a6597f31eeda1770b8762 (patch) | |
tree | c5459d6f79c7cec4a149d171e4f816aec7f4528d /lib | |
parent | a27529709b3c666b89fa7e435c400f9937ee2efa (diff) | |
parent | 5844d682a74533be8577160860758709bef706ba (diff) | |
download | nextcloud-server-3c8007180715b75d2b1a6597f31eeda1770b8762.tar.gz nextcloud-server-3c8007180715b75d2b1a6597f31eeda1770b8762.zip |
Merge pull request #4795 from owncloud/setup
Move core setup code to controller class
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/private/helper.php | 23 | ||||
-rwxr-xr-x | lib/private/util.php | 8 |
3 files changed, 8 insertions, 26 deletions
diff --git a/lib/base.php b/lib/base.php index b54b2973551..f2d9251294d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -691,7 +691,8 @@ class OC { // Check if ownCloud is installed or in maintenance (update) mode if (!OC_Config::getValue('installed', false)) { - require_once 'core/setup.php'; + $controller = new OC\Core\Setup\Controller(); + $controller->run($_POST); exit(); } diff --git a/lib/private/helper.php b/lib/private/helper.php index 58bee9c6300..ce5708e2bb9 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -448,29 +448,6 @@ class OC_Helper { * */ - //FIXME: should also check for value validation (i.e. the email is an email). - public static function init_var($s, $d = "") { - $r = $d; - if (isset($_REQUEST[$s]) && !empty($_REQUEST[$s])) { - $r = OC_Util::sanitizeHTML($_REQUEST[$s]); - } - - return $r; - } - - /** - * returns "checked"-attribute if request contains selected radio element - * OR if radio element is the default one -- maybe? - * - * @param string $s Name of radio-button element name - * @param string $v Value of current radio-button element - * @param string $d Value of default radio-button element - */ - public static function init_radio($s, $v, $d) { - if ((isset($_REQUEST[$s]) && $_REQUEST[$s] == $v) || (!isset($_REQUEST[$s]) && $v == $d)) - print "checked=\"checked\" "; - } - /** * detect if a given program is found in the search PATH * diff --git a/lib/private/util.php b/lib/private/util.php index 8aa7a074d0d..0585749d615 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -788,8 +788,12 @@ class OC_Util { } $fp = @fopen($testFile, 'w'); - @fwrite($fp, $testContent); - @fclose($fp); + if (!$fp) { + throw new OC\HintException('Can\'t create test file to check for working .htaccess file.', + 'Make sure it is possible for the webserver to write to '.$testFile); + } + fwrite($fp, $testContent); + fclose($fp); // accessing the file via http $url = OC_Helper::makeURLAbsolute(OC::$WEBROOT.'/data'.$fileName); |