Example #1
0
function absent_dirs($bad_dirs, $test_dir)
{
    install_html_start();
    $titre = _T('directories_setup_start');
    $bad_url = "lcm_test_dirs.php";
    if ($test_dir) {
        $bad_url .= '?test_dir=' . $test_dir;
    }
    echo "<h3>" . $titre . "</h3>\n";
    echo "<div align='right'>" . menu_languages('var_lang_lcm') . "</div>\n";
    echo "<div class='box_error'>\n";
    echo "<p>" . _T('directories_missing') . _T('typo_column') . "</p>\n";
    echo "<ul>" . $bad_dirs . "</ul>\n";
    echo "<p>" . _T('directories_missing_possible_cause') . "</p>\n";
    echo "</div>\n";
    // if ($install)
    //	echo aide ("install0");
    echo "<p>" . _T('directories_continue') . "</p>\n";
    echo "<form action='{$bad_urls}' method='get'>\n";
    echo "<div align='right'><input type='submit' class='fondl' name='Valider' value='" . _T('button_reload_page') . "'></div>";
    echo "</form>";
    install_html_end();
}
Example #2
0
function install_step_1()
{
    install_html_start('AUTO', '', 1);
    echo "<h3><small>" . _T('install_step_one') . "</small> " . _T('install_title_sql_connection') . "</h3>\n";
    echo show_all_errors($_SESSION['errors']);
    echo "<p class='simple_text'>" . _T('install_info_sql_connection') . " " . lcm_help("install_database") . "</p>\n";
    $db_address = _session('db_address', 'localhost');
    $db_login = _session('db_login');
    $db_password = _session('db_password');
    $db_choice = _session('db_choice');
    // Fetch the previous configuration data to make things easier (if possible)
    $lcm_config_prefix = isset($_SERVER['LcmConfigDir']) ? $_SERVER['LcmConfigDir'] : 'inc/config';
    if (@file_exists($lcm_config_prefix . '/inc_connect_install.php')) {
        $s = @join('', @file($lcm_config_prefix . '/inc_connect_install.php'));
        if (ereg("mysql_connect\\([\"'](.*)[\"'],[\"'](.*)[\"'],[\"'](.*)[\"']\\)", $s, $regs)) {
            $db_address = $regs[1];
            $db_login = $regs[2];
        } else {
            if (ereg("lcm_connect_db\\('(.*)','(.*)','(.*)','(.*)','(.*)'\\)", $s, $regs)) {
                $db_address = $regs[1];
                if ($port_db = $regs[2]) {
                    $db_address .= ':' . $port_db;
                }
                $db_login = $regs[3];
            }
        }
    }
    echo "<form action='install.php' method='post'>\n";
    echo "<input type='hidden' name='step' value='2' />\n";
    echo "<fieldset class='fs_box'>\n";
    echo "<div><label for='db_address'><strong>" . f_err_star('address') . _T('install_database_address') . "</strong></label></div>\n";
    echo "<input type='text' id='db_address' name='db_address' value=\"{$db_address}\" size='40' class='txt_lmnt' />\n";
    echo "<br />\n";
    echo "<br />\n";
    echo "<div><label for='db_login'><strong>" . f_err_star('login') . _T('install_connection_login') . "</strong></label></div>\n";
    echo "<input type='text' id='db_login' name='db_login' value=\"{$db_login}\" size='40' class='txt_lmnt' />\n";
    echo "<br />\n";
    echo "<br />\n";
    echo "<div><label for='db_password'><strong>" . f_err_star('password') . _T('install_connection_password') . "</strong></label></div>\n";
    echo "<input type='password' id='db_password' name='db_password' value=\"{$db_password}\" size='40' class='txt_lmnt' />\n";
    // Afaik, there is no way to get a list of databases in PgSQL
    // without logging in first, and to login, you must provide DBname
    if (preg_match("/^PostgreSQL/", lcm_sql_server_info())) {
        echo "<br />\n";
        echo "<br />\n";
        echo "<div><label for='db_choice'><strong>" . f_err_star('dbname') . "Database name" . "</strong></label></div>\n";
        // TRAD
        echo "<input type='text' id='db_choice' name='db_choice' value=\"{$db_choice}\" size='40' class='txt_lmnt' />\n";
    }
    echo "</fieldset>\n";
    echo "<div align='" . $GLOBALS['lcm_lang_right'] . "'>" . "<button type='submit' name='Next'>" . _T('button_next') . " >></button>&nbsp;" . "</div>\n";
    echo "</form>\n";
    install_html_end();
}
Example #3
0
function print_registration_form()
{
    install_html_start(_T('pass_title_register'), 'login');
    $link = new Link();
    $url = $link->getUrl();
    echo '<p align="left" class="normal_text">' . _T('pass_info_why_register') . "</p>\n";
    echo show_all_errors();
    echo "<form method='post' action='{$url}' style='border: 0px; margin: 0px;'>\n";
    echo '<input type="hidden" name="register" value="data" />' . "\n";
    echo "<fieldset><label><b>" . _T('info_your_contact_information') . "</b><br></label>\n";
    // [ML] Altough not most problematic, could be better. But if someone
    // fixes here, please fix install.php also (step 4)
    echo "<table border='0'>\n";
    echo "<tr>\n";
    echo "<td>\n\t\t\t<label for='name_first'>" . f_err_star('name_first') . _Ti('person_input_name_first') . "</label><br />\n\t\t\t<input type='text' style='width: 100%;' id='name_first' name='name_first' class='formo' value='" . _session('name_first') . "' size='20'>\n\t\t</td>\n";
    echo "<td>\n\t\t\t<label for='name_last'>" . f_err_star('name_last') . _Ti('person_input_name_last') . "</label><br />\n\t\t\t<input type='text' style='width: 100%;' id='name_last' name='name_last' class='formo' value='" . _session('name_last') . "' size='20'>\n\t\t</td>\n";
    echo "</tr>\n";
    echo "<tr>\n";
    echo "<td colspan='2'>";
    echo "<p><label for='email'>" . f_err_star('email') . _Ti('input_email') . "</label><br />";
    echo "<input type='text' id='email' name='email' class='formo' value='" . _session('email') . "' size='40'></p>\n";
    echo "<p><label for='username'>" . f_err_star('username') . _Ti('authoredit_input_username') . "</label> ";
    echo "<small>" . _T('info_more_than_three') . "</small><br />";
    echo "<input type='text' id='username' name='username' class='formo' value='" . _session('username') . "' size='40'></p>\n";
    echo "<small>" . _T('pass_info_password_by_mail') . "</small>\n";
    echo "</fieldset>\n";
    echo "<p align=\"right\">";
    echo '<button type="submit" name="Validate">' . _T('button_validate') . "</button>";
    echo "</p>";
    echo "</form>\n";
    $_SESSION['form_data'] = array();
    $_SESSION['errors'] = array();
}