示例#1
0
文件: etape_3.php 项目: rhertzog/lcs
function install_etape_3_dist()
{
	$ldap_present = _request('ldap_present');

	if (!$ldap_present) {
		$adresse_db = defined('_INSTALL_HOST_DB')
		? _INSTALL_HOST_DB
		: _request('adresse_db');

		$login_db = defined('_INSTALL_USER_DB')
		? _INSTALL_USER_DB
		: _request('login_db');

		$pass_db = defined('_INSTALL_PASS_DB')
		? _INSTALL_PASS_DB
		: _request('pass_db');

		$server_db = defined('_INSTALL_SERVER_DB')
		? _INSTALL_SERVER_DB
		: _request('server_db');

		$chmod_db = defined('_SPIP_CHMOD')
		? _SPIP_CHMOD
		: _request('chmod');

		$choix_db = defined('_INSTALL_NAME_DB')
		? _INSTALL_NAME_DB
		: _request('choix_db');

		$sel_db = ($choix_db == "new_spip")
		? _request('table_new') : $choix_db;

		$res = install_bases($adresse_db, $login_db, $pass_db,  $server_db, $choix_db, $sel_db, $chmod_db);

		if ($res) {
			$res .= info_progression_etape(2,'etape_','install/', true);

			$res .= "<p class='resultat echec'><b>"._T('avis_operation_echec')."</b></p>"._T('texte_operation_echec');
		}
	
	} else { 
		$res = '';
		list($adresse_db, $login_db, $pass_db, $sel_db, $server_db)
		= analyse_fichier_connection(_FILE_CONNECT_TMP);
	}

	if (!$res) {
		if (file_exists(_FILE_CONNECT_TMP))
			include(_FILE_CONNECT_TMP);
		else
			redirige_url_ecrire('install');
	
		if (file_exists(_FILE_CHMOD_TMP))
			include(_FILE_CHMOD_TMP);
		else
			redirige_url_ecrire('install');

		$hidden = predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db)
		  . (defined('_INSTALL_NAME_DB') ? ''
		     : "\n<input type='hidden' name='sel_db' value='$sel_db' />");
		$res =  "<p class='resultat ok'><b>"
		. _T('info_base_installee')
		. "</b></p>"
		. install_premier_auteur(_request('email'),
					_request('login'),
					_request('nom'),
					_request('pass'),
					 $hidden)
		  . (($ldap_present  OR !function_exists('ldap_connect'))
		     ?  '' : install_propose_ldap());
	}

	echo install_debut_html();
	echo $res;
	echo install_fin_html();
}
示例#2
0
文件: etape_3.php 项目: spip/SPIP
function install_etape_3_dist()
{
    $ldap_present = _request('ldap_present');
    if (!$ldap_present) {
        $adresse_db = defined('_INSTALL_HOST_DB') ? _INSTALL_HOST_DB : _request('adresse_db');
        $login_db = defined('_INSTALL_USER_DB') ? _INSTALL_USER_DB : _request('login_db');
        $pass_db = defined('_INSTALL_PASS_DB') ? _INSTALL_PASS_DB : _request('pass_db');
        $server_db = defined('_INSTALL_SERVER_DB') ? _INSTALL_SERVER_DB : _request('server_db');
        $chmod_db = defined('_SPIP_CHMOD') ? _SPIP_CHMOD : _request('chmod');
        $choix_db = defined('_INSTALL_NAME_DB') ? _INSTALL_NAME_DB : _request('choix_db');
        $sel_db = $choix_db == "new_spip" ? _request('table_new') : $choix_db;
        $res = install_bases($adresse_db, $login_db, $pass_db, $server_db, $choix_db, $sel_db, $chmod_db);
        if ($res) {
            $res = info_progression_etape(2, 'etape_', 'install/', true) . "<div class='error'><h3>" . _T('avis_operation_echec') . "</h3>" . $res . "<p>" . _T('texte_operation_echec') . "</p>" . "</div>";
        }
    } else {
        $res = '';
        list($adresse_db, $login_db, $pass_db, $sel_db, $server_db) = analyse_fichier_connection(_FILE_CONNECT_TMP);
        $GLOBALS['connexions'][$server_db] = spip_connect_db($adresse_db, $sel_db, $login_db, $pass_db, $sel_db, $server_db);
    }
    if (!$res) {
        if (file_exists(_FILE_CONNECT_TMP)) {
            include _FILE_CONNECT_TMP;
        } else {
            redirige_url_ecrire('install');
        }
        if (file_exists(_FILE_CHMOD_TMP)) {
            include _FILE_CHMOD_TMP;
        } else {
            redirige_url_ecrire('install');
        }
        $hidden = predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) . (defined('_INSTALL_NAME_DB') ? '' : "\n<input type='hidden' name='sel_db' value='{$sel_db}' />");
        $auteur_obligatoire = $ldap_present ? 0 : !sql_countsel('spip_auteurs', '', '', '', $server_db);
        $res = "<div class='success'><b>" . _T('info_base_installee') . "</b></div>" . install_premier_auteur(_request('email'), _request('login'), _request('nom'), _request('pass'), $hidden, $auteur_obligatoire) . (($ldap_present or !function_exists('ldap_connect')) ? '' : install_propose_ldap());
    }
    echo install_debut_html();
    echo $res;
    echo install_fin_html();
}