]> git.mxchange.org Git - friendica.git/blobdiff - mod/install.php
Merge pull request #1950 from annando/1510-contact-menu
[friendica.git] / mod / install.php
index 484846ccd6a1f798d6252ca55c28be25e83693a7..182495d258cb7c74b53c517c6eee2e31b65fc47b 100755 (executable)
@@ -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' => '',
                        ));
                }
@@ -231,11 +233,11 @@ function install_content(&$a) {
 
                                '$status' => $wizard_status,
 
-                               '$dbhost' => array('dbhost', t('Database Server Name'), $dbhost, ''),
-                               '$dbuser' => array('dbuser', t('Database Login Name'), $dbuser, ''),
-                               '$dbpass' => array('dbpass', t('Database Login Password'), $dbpass, ''),
-                               '$dbdata' => array('dbdata', t('Database Name'), $dbdata, ''),
-                               '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
+                               '$dbhost' => array('dbhost', t('Database Server Name'), $dbhost, '', 'required'),
+                               '$dbuser' => array('dbuser', t('Database Login Name'), $dbuser, '', 'required', 'autofocus'),
+                               '$dbpass' => array('dbpass', t('Database Login Password'), $dbpass, '', 'required'),
+                               '$dbdata' => array('dbdata', t('Database Name'), $dbdata, '', 'required'),
+                               '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'),
 
 
 
@@ -274,7 +276,7 @@ function install_content(&$a) {
                                '$dbdata' => $dbdata,
                                '$phpath' => $phpath,
 
-                               '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')),
+                               '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'),
 
 
                                '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''),
@@ -390,6 +392,7 @@ function check_funcs(&$checks) {
        check_add($ck_funcs, t('OpenSSL PHP module'), true, true, "");
        check_add($ck_funcs, t('mysqli PHP module'), true, true, "");
        check_add($ck_funcs, t('mb_string PHP module'), true, true, "");
+       check_add($ck_funcs, t('mcrypt PHP module'), true, true, "");
 
 
        if(function_exists('apache_get_modules')){
@@ -420,7 +423,13 @@ function check_funcs(&$checks) {
                $ck_funcs[4]['status']= false;
                $ck_funcs[4]['help']= t('Error: mb_string PHP module required but not installed.');
        }
+       if(! function_exists('mcrypt_create_iv')){
+               $ck_funcs[5]['status']= false;
+               $ck_funcs[5]['help']= t('Error: mcrypt PHP module required but not installed.');
+       }
 
+       
+       
        $checks = array_merge($checks, $ck_funcs);
 
        /*if((x($_SESSION,'sysmsg')) && is_array($_SESSION['sysmsg']) && count($_SESSION['sysmsg']))
@@ -466,16 +475,19 @@ function check_htaccess(&$checks) {
        $status = true;
        $help = "";
        if (function_exists('curl_init')){
-        $test = fetch_url($a->get_baseurl()."/install/testrewrite");
-        if ($test!="ok") {
-            $status = false;
-            $help = t('Url rewrite in .htaccess is not working. Check your server configuration.');
-        }
-        check_add($checks, t('Url rewrite is working'), $status, true, $help);
-    } else {
-        // cannot check modrewrite if libcurl is not installed
-    }
+               $test = fetch_url($a->get_baseurl()."/install/testrewrite");
+
+               if ($test!="ok")
+                       $test = fetch_url(normalise_link($a->get_baseurl()."/install/testrewrite"));
 
+               if ($test!="ok") {
+                       $status = false;
+                       $help = t('Url rewrite in .htaccess is not working. Check your server configuration.');
+               }
+               check_add($checks, t('Url rewrite is working'), $status, true, $help);
+       } else {
+               // cannot check modrewrite if libcurl is not installed
+       }
 }