X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Finstall.php;h=78e537cfe261a82ec4d0c56fb9ad5d5fe3c0908d;hb=bcb672e7ff859168b639ffffc38553bbcf7e918c;hp=740df6ca98b5c5b6645c49573e73c94c5b87385a;hpb=e35a5bac55e0e259c7c587adfaf546484b032c92;p=friendica.git diff --git a/mod/install.php b/mod/install.php index 740df6ca98..78e537cfe2 100644 --- a/mod/install.php +++ b/mod/install.php @@ -12,6 +12,7 @@ function install_post(&$a) { $dbdata = notags(trim($_POST['dbdata'])); $timezone = notags(trim($_POST['timezone'])); $phpath = notags(trim($_POST['phpath'])); + $adminmail = notags(trim($_POST['adminmail'])); require_once("dba.php"); unset($db); @@ -35,9 +36,9 @@ function install_post(&$a) { } } - notice( t('Connected to database.') . EOL); + info( t('Connected to database.') . EOL); - $tpl = load_view_file('view/htconfig.tpl'); + $tpl = get_intltext_template('htconfig.tpl'); $txt = replace_macros($tpl,array( '$dbhost' => $dbhost, '$dbuser' => $dbuser, @@ -45,11 +46,13 @@ function install_post(&$a) { '$dbdata' => $dbdata, '$timezone' => $timezone, '$urlpath' => $urlpath, - '$phpath' => $phpath + '$phpath' => $phpath, + '$adminmail' => $adminmail )); + $result = file_put_contents('.htconfig.php', $txt); if(! $result) { - $a->data = $txt; + $a->data['txt'] = $txt; } $errors = load_database($db); @@ -95,7 +98,7 @@ function install_content(&$a) { } } - notice( t('Welcome to Friendika.') . EOL); + info( t('Welcome to Friendika.') . EOL); check_funcs(); @@ -104,7 +107,7 @@ function install_content(&$a) { if(strlen($o)) return $o; - if(strlen($a->data)) { + if(strlen($a->data['txt'])) { $o .= manual_config($a); return; } @@ -116,18 +119,19 @@ function install_content(&$a) { require_once('datetime.php'); - $tpl = load_view_file('view/install_db.tpl'); + $tpl = get_markup_template('install_db.tpl'); $o .= replace_macros($tpl, array( '$lbl_01' => t('Friendika Social Network'), '$lbl_02' => t('Installation'), - '$lbl_03' => t('In order to install Friendika we need to know how to contact your database.'), + '$lbl_03' => t('In order to install Friendika we need to know how to connect to your database.'), '$lbl_04' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'), - '$lbl_05' => t('The database you specify below must already exist. If it does not, please create it before continuing.'), + '$lbl_05' => t('The database you specify below should already exist. If it does not, please create it before continuing.'), '$lbl_06' => t('Database Server Name'), '$lbl_07' => t('Database Login Name'), '$lbl_08' => t('Database Login Password'), '$lbl_09' => t('Database Name'), '$lbl_10' => t('Please select a default timezone for your website'), + '$lbl_11' => t('Site administrator email address. Your account email address must match this in order to use the web admin panel.'), '$baseurl' => $a->get_baseurl(), '$tzselect' => ((x($_POST,'timezone')) ? select_timezone($_POST['timezone']) : select_timezone()), '$submit' => t('Submit'), @@ -135,7 +139,8 @@ function install_content(&$a) { '$dbuser' => notags(trim($_POST['dbuser'])), '$dbpass' => notags(trim($_POST['dbpass'])), '$dbdata' => notags(trim($_POST['dbdata'])), - '$phpath' => $phpath + '$phpath' => $phpath, + '$adminmail' => notags(trim($_POST['adminmail'])) )); return $o; @@ -194,8 +199,11 @@ function check_funcs() { if(! function_exists('openssl_public_encrypt')) notice( t('Error: openssl PHP module required but not installed.') . EOL); if(! function_exists('mysqli_connect')) - notice( t('Error: mysqli PHP module required but not installed.') . EOL); - if((x($_SESSION,'sysmsg')) && strlen($_SESSION['sysmsg'])) + notice( t('Error: mysqli PHP module required but not installed.') . EOL); + if(! function_exists('mb_strlen')) + notice( t('Error: mb_string PHP module required but not installed.') . EOL); + + if((x($_SESSION,'sysmsg')) && is_array($_SESSION['sysmsg']) && count($_SESSION['sysmsg'])) notice( t('Please see the file "INSTALL.txt".') . EOL); } @@ -216,7 +224,7 @@ function check_htconfig() { function manual_config(&$a) { - $data = htmlentities($a->data); + $data = htmlentities($a->data['txt']); $o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'); $o .= ""; return $o; @@ -238,4 +246,4 @@ function load_database($db) { } } return $errors; -} \ No newline at end of file +}