X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finstall%2Fetape_sup2.php;fp=www%2Fecrire%2Finstall%2Fetape_sup2.php;h=e5f6b25bfa263252a0ba653db1ccf74c877f4cea;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c
diff --git a/www/ecrire/install/etape_sup2.php b/www/ecrire/install/etape_sup2.php
new file mode 100644
index 0000000..e5f6b25
--- /dev/null
+++ b/www/ecrire/install/etape_sup2.php
@@ -0,0 +1,126 @@
+";
+
+ $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']]
+ = $GLOBALS['spip_' . $server_db .'_functions_' . $GLOBALS['spip_sql_version']];
+
+ if (!sql_selectdb($sup_db, $server_db))
+ return "";
+
+ $tables = sql_alltable('%', $server_db);
+
+ if (!$tables)
+ $res = _T('install_pas_table');
+ else {
+ $res = _T('install_tables_base')
+ . "
\n- "
+ . join("
\n- ", $tables)
+ . "
\n
\n";
+ }
+
+ if (preg_match(',(.*):(.*),', $adresse_db, $r))
+ list(,$adresse_db, $port) = $r;
+ else
+ $port = '';
+
+ $adresse_db = addcslashes($adresse_db,"'\\");
+ $port = addcslashes($port,"'\\");
+ $login_db = addcslashes($login_db,"'\\");
+ $pass_db = addcslashes($pass_db,"'\\");
+ $sup_db = addcslashes($sup_db,"'\\");
+ $server_db = addcslashes($server_db,"'\\");
+
+ $conn = install_mode_appel($server_db)
+ . "spip_connect_db("
+ . "'$adresse_db','$port','$login_db',"
+ . "'$pass_db','$sup_db'"
+ . ",'$server_db', '');\n";
+
+ install_fichier_connexion(_DIR_CONNECT . $sup_db . '.php', $conn);
+
+ return '' . $res . '
';
+}
+
+// http://doc.spip.org/@install_etape_sup2_dist
+function install_etape_sup2_dist()
+{
+ $adresse_db = _request('adresse_db');
+ if (!$adresse_db AND defined('_INSTALL_HOST_DB'))
+ $adresse_db =_INSTALL_HOST_DB;
+
+ $login_db = _request('login_db');
+ if (!$login_db AND defined('_INSTALL_USER_DB'))
+ $login_db = _INSTALL_USER_DB;
+
+ $pass_db = _request('pass_db');
+ if (!$pass_db AND defined('_INSTALL_PASS_DB'))
+ $pass_db = _INSTALL_PASS_DB;
+
+ $server_db =_request('server_db');
+ if (!$server_db AND defined('_INSTALL_SERVER_DB'))
+ $server_db = _INSTALL_SERVER_DB;
+
+ // Ceci indique la base principale (passe en hidden)
+ // pour qu'on la refuse comme choix de base secondaire a chaque tour.
+
+ $sel_db =_request('sel_db');
+ if (!$sel_db AND defined('_INSTALL_NAME_DB'))
+ $sel_db = _INSTALL_NAME_DB;
+
+ // le choix
+ $choix_db = _request('choix_db');
+ if (is_numeric($choix_db))
+ $choix_db = _request('table_new');
+
+ if (!$choix_db)
+ $res = "";
+ else {
+ $res = install_bases_sup($adresse_db, $login_db, $pass_db, $server_db, $choix_db);
+
+ if ($res[1]=='!')
+ $res .= ""._T('avis_operation_echec')."
";
+
+ else {
+ $res = ""
+ . _T('install_base_ok',
+ array('base' => $choix_db))
+ . "
"
+ . $res;
+ }
+ }
+
+ $res .= generer_form_ecrire('admin_declarer',
+ (defined('_INSTALL_NAME_DB') ? ''
+ : ("\n"))
+ . predef_ou_cache($adresse_db,$login_db,$pass_db, $server_db)
+ . bouton_suivant());
+
+ echo install_debut_html(_T('config_titre_base_sup'));
+ echo $res;
+ echo install_fin_html();
+}
+
+?>