From d06beb143150940a51784697dd5d72354fda2d8e Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Tue, 23 Jun 2015 12:32:35 +0200 Subject: [PATCH] install: load htconfig template from templates/ --- mod/install.php | 8 +++-- view/templates/htconfig.tpl | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 view/templates/htconfig.tpl diff --git a/mod/install.php b/mod/install.php index ed07c4ea6a..99ebfc6bab 100755 --- a/mod/install.php +++ b/mod/install.php @@ -73,7 +73,7 @@ function install_post(&$a) { // connect to db $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true); - $tpl = get_intltext_template('htconfig.tpl'); + $tpl = get_markup_template('htconfig.tpl'); $txt = replace_macros($tpl,array( '$dbhost' => $dbhost, '$dbuser' => $dbuser, @@ -84,13 +84,15 @@ function install_post(&$a) { '$phpath' => $phpath, '$adminmail' => $adminmail )); + $result = file_put_contents('.htconfig.php', $txt); if(! $result) { $a->data['txt'] = $txt; } - + $errors = load_database($db); + if($errors) $a->data['db_failed'] = $errors; @@ -148,7 +150,7 @@ function install_content(&$a) { return replace_macros($tpl, array( '$title' => $install_title, '$pass' => '', - '$status' => t('Permission denied.'), + '$status' => t('Database already in use.'), '$text' => '', )); } diff --git a/view/templates/htconfig.tpl b/view/templates/htconfig.tpl new file mode 100644 index 0000000000..7c71623dda --- /dev/null +++ b/view/templates/htconfig.tpl @@ -0,0 +1,71 @@ +path = '{{$urlpath}}'; + +// Choose a legal default timezone. If you are unsure, use "America/Los_Angeles". +// It can be changed later and only applies to timestamps for anonymous viewers. + +$default_timezone = '{{$timezone}}'; + +// What is your site name? + +$a->config['sitename'] = "My Friend Network"; + +// Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. +// Be certain to create your own personal account before setting +// REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on +// the registration page. REGISTER_APPROVE requires you set 'admin_email' +// to the email address of an already registered person who can authorise +// and/or approve/deny the request. + +$a->config['register_policy'] = REGISTER_OPEN; +$a->config['register_text'] = ''; +$a->config['admin_email'] = '{{$adminmail}}'; + +// Maximum size of an imported message, 0 is unlimited + +$a->config['max_import_size'] = 200000; + +// maximum size of uploaded photos + +$a->config['system']['maximagesize'] = 800000; + +// Location of PHP command line processor + +$a->config['php_path'] = '{{$phpath}}'; + +// Location of global directory submission page. + +$a->config['system']['directory_submit_url'] = 'http://dir.friendica.com/submit'; +$a->config['system']['directory_search_url'] = 'http://dir.friendica.com/directory?search='; + +// PuSH - aka pubsubhubbub URL. This makes delivery of public posts as fast as private posts + +$a->config['system']['huburl'] = '[internal]'; + +// Server-to-server private message encryption (RINO) is allowed by default. +// Encryption will only be provided if this setting is true and the +// PHP mcrypt extension is installed on both systems + +$a->config['system']['rino_encrypt'] = true; + +// default system theme + +$a->config['system']['theme'] = 'duepuntozero'; + +// By default allow pseudonyms + +$a->config['system']['no_regfullname'] = true;