Skip to content
Extraits de code Groupes Projets
Valider 32d1ed90 rédigé par JamesRezo's avatar JamesRezo :tada:
Parcourir les fichiers

- on renomme donc config/ en etc/ et tmp_img/ en var/ :)

- l'installateur est corrigé en conséquence
- une solution, à tester, qui permet de créer certains sous-répertoires de tmp/ (sessions/ et CACHE/)
parent 5b1b73ff
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de avec 151 ajouts et 111 suppressions
* text=auto !eol
/INSTALL.txt -text
/UPGRADE.txt -text
config/remove.txt -text
dist/favicon.ico -text
dist/feed.png -text
dist/formulaires/choix_mots.html -text
......@@ -523,11 +522,11 @@ ecrire/win_png.htc -text
ecrire/xml/atom.php -text
ecrire/xml/ical.php -text
ecrire/xml/rss.php -text
etc/remove.txt -text
/inc-public.php3 -text
/index.php -text
/rien.gif -text
/spip.php -text
tmp/remove.txt -text
tmp/sessions/remove.txt -text
tmp_img/remove.txt -text
var/remove.txt -text
/win_png.htc -text
......@@ -14,9 +14,6 @@ IMG/siteon*
IMG/test_*
ecrire/inc_connect.php3
ecrire/inc_meta_cache.php3
tmp/CACHE/?
tmp/CACHE/lang_*
tmp/CACHE/skel_*
tmp/data/.htaccess
tmp/data/.htpasswd
tmp/data/.htpasswd-admin
......
......@@ -20,7 +20,7 @@ function exec_install_dist()
{
$etape = _request('etape');
if (_FILE_CONNECT && $etape != 'unpack')
minipres(_T('avis_espace_interdit'));
minipres('AUTO', _T('avis_espace_interdit'));
else {
// On va supprimer les eventuelles vieilles valeurs de meta,
......
......@@ -45,15 +45,20 @@ function install_debut_html($titre = 'AUTO') {
<style type='text/css'><!--\n/*<![CDATA[*/\n\n\n",
"body { background: #FFF; color: #000; }\n",
"h1 { color: #970038; margin-top: 50px; font-family: Verdana; font-weigth: bold; font-size: 18px }\n",
"h2 { font-family: Verdana,Arial,Sans,sans-serif; font-weigth: normal; font-size: 100%; }\n",
"a { color: #E86519; text-decoration: none; }\n",
"a:visited { color: #6E003A; }\n",
"a:active { color: #FF9900; }\n",
"img { border: 0; }\n",
"p { text-align: justify; }\n",
"ul { text-align: justify; list-style-type: none; }\n",
"fieldset, .fieldset { font-weigth: bold; text-align: justify; border: 1px solid #444; paddind: 10px; margin-top: 1em; }\n",
"legend { font-weight: bold; }\n",
"label {}\n",
"#minipres { width: 30em; text-align: center; margin-left: auto; margin-right: auto; }\n",
"ul, p, label { text-align: justify; margin: 0;}\n",
"fieldset { margin: 0.5em 0; }\n",
".suivant { text-align: $spip_lang_right; }\n",
".sans_puce { list-style-type: none; }\n",
".petit-centre { font-family: Verdana,Arial,Sans,sans-serif; font-size: 10px; }\n",
".petit-centre p { text-align: center; }\n",
".suivant { text-align: $spip_lang_right; display: block; margin-top: 1em; }\n",
".fondl { padding: 3px; background-color: #eee; border: 1px solid #333;
background-position: center bottom;
font-size: 0.8em;
......@@ -81,10 +86,28 @@ function install_fin_html() {
echo "\n\t</div>\n\t</div>\n</body>\n</html>";
}
function bouton_suivant() {
return "<p class='suivant'><input type='submit' class='fondl' value='" .
_T('bouton_suivant') .
" >>' /></p>";
function info_etape($titre, $complement = ''){
return "\n<h2>".$titre."</h2>\n" .
($complement ? "<p>".$complement."</p>\n":'');
}
function fieldset($legend, $champs = array()) {
$fieldset = "<fieldset>\n" .
($legend ? "<legend>".$legend."</legend>\n" : '');
foreach($champs as $nom => $contenu) {
$type = $contenu['hidden'] ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text');
$class = $contenu['hidden'] ? '' : "class='formo' size='40' ";
$fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n";
$fieldset .= "<input ".$class."type='".$type."' name='".$nom."' value='".$contenu['valeur']."' />\n";
}
$fieldset .= "</fieldset>\n";
return $fieldset;
}
function bouton_suivant($code = 'bouton_suivant') {
return "\n<span class='suivant'><input type='submit' class='fondl' value=\"" .
_T($code) .
" >>\" /></span>\n";
}
// http://doc.spip.org/@minipres
......
......@@ -160,7 +160,13 @@ function rejouer_session()
function fichier_session($id_session, $alea) {
if (ereg("^([0-9]+_)", $id_session, $regs))
$id_auteur = $regs[1];
return _DIR_SESSIONS . 'session_'.$id_auteur.md5($id_session.' '.$alea). '.php';
$repertoire = _DIR_SESSIONS;
if(!@file_exists($repertoire)) {
$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
}
return $repertoire . 'session_'.$id_auteur.md5($id_session.' '.$alea). '.php';
}
//
......
......@@ -979,6 +979,12 @@ function spip_initialisation($pi=NULL, $pa=NULL, $ti=NULL, $ta=NULL) {
: (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php3') ? $f
: false))));
// Le fichier de connexion a la base de donnees
define('_FILE_CHMOD_INS', _DIR_ETC . 'chmod');
define('_FILE_CHMOD',
(@is_readable($f = _FILE_CHMOD_INS . '.php') ? $f
: false));
// la taille maxi des logos (0 : pas de limite)
define('_LOGO_MAX_SIZE', 0); # poids en ko
define('_LOGO_MAX_WIDTH', 0); # largeur en pixels
......
......@@ -20,16 +20,11 @@ function install_etape__dist()
redirige_par_entete(generer_url_action('test_dirs'));
else {
install_debut_html();
echo "<p align='center'><img alt='SPIP' src='" . _DIR_IMG_PACK . "logo-spip.gif' /></p>\n",
"<p style='text-align: center; font-family: Verdana,Arial,Sans,sans-serif; font-size: 10px;'>",
info_copyright(),
"</p>\n",
"<p>" . _T('install_select_langue'),
"</p><div align='center'>",
$menu_langues,
"</div>\n",
"<form action='", generer_url_action('test_dirs'),
"'>",
echo "<div><img alt='SPIP' src='" . _DIR_IMG_PACK . "logo-spip.gif' /></div>\n",
"<div class='petit-centre'><p>",info_copyright(),"</p></div>\n",
"<p>" . _T('install_select_langue'),"</p>",
"<div>",$menu_langues,"</div>\n",
"<form action='", generer_url_action('test_dirs'),"'>\n",
'<input type="hidden" name="action" value="test_dirs" />',
bouton_suivant(),
"</form>";
......
......@@ -20,11 +20,7 @@ function install_etape_1_dist()
// stopper en cas de grosse incompatibilite de l'hebergement
tester_compatibilite_hebergement();
echo "<BR />\n<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('info_connexion_mysql')."</FONT>";
echo "<P>"._T('texte_connexion_mysql');
echo aide ("install1");
echo info_etape(_T('info_connexion_mysql'), _T('texte_connexion_mysql').aide ("install1"));
list($adresse_db, $login_db) = login_hebergeur();
$pass_db = '';
......@@ -52,17 +48,32 @@ function install_etape_1_dist()
echo generer_url_post_ecrire('install');
echo "<INPUT TYPE='hidden' NAME='etape' VALUE='2' />";
echo "<INPUT TYPE='hidden' NAME='chmod' VALUE='$chmod' />";
echo "<fieldset><label><B>"._T('entree_base_donnee_1')."</B><BR />\n</label>";
echo "<p>"._T('entree_base_donnee_2')."</p>\n";
echo "<INPUT TYPE='text' NAME='adresse_db' CLASS='formo' VALUE=\"$adresse_db\" SIZE='40' /></fieldset>";
echo fieldset(_T('entree_base_donnee_1'),
array(
'adresse_db' => array(
'label' => _T('entree_base_donnee_2'),
'value' => $adresse_db
),
)
);
echo "<fieldset><label><B>"._T('entree_login_connexion_1')."</B><BR />\n</label>";
echo "<p>"._T('entree_login_connexion_2')."</p>\n";
echo "<INPUT TYPE='text' NAME='login_db' CLASS='formo' VALUE=\"$login_db\" SIZE='40' /></fieldset>";
echo fieldset(_T('entree_login_connexion_1'),
array(
'login_db' => array(
'label' => _T('entree_login_connexion_2'),
'value' => $login_db
),
)
);
echo "<fieldset><label><B>"._T('entree_mot_passe_1')."</B><BR />\n</label>";
echo "<p>"._T('entree_mot_passe_2')."</p>\n";
echo "<INPUT TYPE='password' NAME='pass_db' CLASS='formo' VALUE=\"$pass_db\" SIZE='40' /></fieldset>";
echo fieldset(_T('entree_mot_passe_1'),
array(
'pass_db' => array(
'label' => _T('entree_mot_passe_2'),
'value' => $pass_db
),
)
);
echo bouton_suivant();
echo "</FORM>";
......
......@@ -17,34 +17,30 @@ function install_etape_2_dist()
install_debut_html();
echo "<BR />\n<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('info_connexion_base')."</FONT>";
echo info_etape(_T('info_connexion_base'));
echo "<!--";
$link = mysql_connect("$adresse_db","$login_db","$pass_db");
$db_connect = mysql_errno();
echo "-->";
echo "<P>";
if (($db_connect=="0") && $link){
echo "<B>"._T('info_connexion_ok')."</B><P> "._T('info_etape_suivante_2');
echo "<p><b>"._T('info_connexion_ok')."</b></p><p> "._T('info_etape_suivante_2')."</p>";
echo generer_url_post_ecrire('install');
echo "<INPUT TYPE='hidden' NAME='etape' VALUE='3' />";
echo "<INPUT TYPE='hidden' NAME='chmod' VALUE='$chmod' />";
echo "<INPUT TYPE='hidden' NAME='adresse_db' VALUE=\"$adresse_db\" SIZE='40' />";
echo "<INPUT TYPE='hidden' NAME='adresse_db' VALUE=\"$adresse_db\" />";
echo "<INPUT TYPE='hidden' NAME='login_db' VALUE=\"$login_db\" />";
echo "<INPUT TYPE='hidden' NAME='pass_db' VALUE=\"$pass_db\" />";
echo "</p>".bouton_suivant();
echo bouton_suivant();
echo "</FORM>";
}
else {
echo "<B>"._T('avis_connexion_echec_1')."</B>";
echo "<P>"._T('avis_connexion_echec_2');
echo "<P><FONT SIZE=2>"._T('avis_connexion_echec_3')."</FONT>";
echo "<p><b>"._T('avis_connexion_echec_1')."</b></p>";
echo "<p>"._T('avis_connexion_echec_2')."</p>";
echo "<p style='font-size: small;'>"._T('avis_connexion_echec_3')."</p>";
}
install_fin_html();
......
......@@ -17,26 +17,23 @@ function install_etape_3_dist()
install_debut_html();
echo "<BR />\n<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('info_choix_base')." <B>"._T('menu_aide_installation_choix_base')."</B></FONT>";
echo aide ("install2");
echo "\n";
echo info_etape(_T('info_choix_base')." "._T('menu_aide_installation_choix_base').aide ("install2"));
echo generer_url_post_ecrire('install');
echo "<INPUT TYPE='hidden' NAME='etape' VALUE='4' />";
echo "<INPUT TYPE='hidden' NAME='chmod' VALUE='$chmod' />";
echo "<INPUT TYPE='hidden' NAME='adresse_db' VALUE=\"$adresse_db\" SIZE='40' />";
echo "<INPUT TYPE='hidden' NAME='adresse_db' VALUE=\"$adresse_db\" />";
echo "<INPUT TYPE='hidden' NAME='login_db' VALUE=\"$login_db\" />";
echo "<INPUT TYPE='hidden' NAME='pass_db' VALUE=\"$pass_db\" />\n";
$link = mysql_connect("$adresse_db","$login_db","$pass_db");
$result = @mysql_list_dbs();
echo "<fieldset><label><B>"._T('texte_choix_base_1')."</B></label>\n";
echo "<fieldset><legend>"._T('texte_choix_base_1')."</legend>\n";
if ($result AND (($n = @mysql_num_rows($result)) > 0)) {
echo "<B>"._T('texte_choix_base_2')."</B><P> "._T('texte_choix_base_3');
echo "<ul class='sans_puce'>";
echo "<label for='choix_db'><b>"._T('texte_choix_base_2')."</b><br />"._T('texte_choix_base_3')."</label>";
echo "<ul>";
$bases = "";
for ($i = 0; $i < $n; $i++) {
$table_nom = mysql_dbname($result, $i);
......@@ -69,7 +66,7 @@ function install_etape_3_dist()
if ($ok) {
echo _T('avis_lecture_noms_bases_3');
echo "<ul class='sans_puce'>";
echo "<ul>";
echo "<li><INPUT NAME=\"choix_db\" VALUE=\"".$test_base."\" TYPE=Radio id='stand' CHECKED>";
echo "<label for='stand'>".$test_base."</label></li>\n";
echo "</UL>";
......
......@@ -17,8 +17,7 @@ function install_etape_4_dist()
install_debut_html();
echo "<BR />\n<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('info_creation_tables')."</FONT>";
echo "<P>\n";
echo info_etape(_T('info_creation_tables'));
$link = mysql_connect("$adresse_db", "$login_db", "$pass_db");
......@@ -94,7 +93,7 @@ function install_etape_4_dist()
$conn))
redirige_par_entete(generer_url_ecrire('install'));
echo "<B>"._T('info_base_installee')."</B><P>\n"._T('info_etape_suivante_1');
echo "<p><b>"._T('info_base_installee')."</b></p><p>\n"._T('info_etape_suivante_1');
echo generer_url_post_ecrire('install');
echo "<INPUT TYPE='hidden' NAME='etape' VALUE='5' />";
......
......@@ -27,49 +27,62 @@ function install_etape_5_dist()
else
redirige_par_entete(generer_url_ecrire('install'));
echo "<BR />\n<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('info_informations_personnelles')."</FONT>\n";
echo "<b>"._T('texte_informations_personnelles_1')."</b>";
echo aide ("install5");
echo "<p>\n"._T('texte_informations_personnelles_2')." ";
echo _T('info_laisser_champs_vides');
echo info_etape(_T('info_informations_personnelles'),
"<b>"._T('texte_informations_personnelles_1')."</b>" .
aide ("install5") .
"</p><p>" .
_T('texte_informations_personnelles_2') . " " .
_T('info_laisser_champs_vides')
);
echo generer_url_post_ecrire('install');
echo "<INPUT TYPE='hidden' NAME='etape' VALUE='6' />";
echo "<fieldset><label><B>"._T('info_identification_publique')."</B><BR />\n</label>";
echo "<B>"._T('entree_signature')."</B><BR />\n";
echo _T('entree_nom_pseudo_1')."<BR />\n";
echo "<INPUT TYPE='text' NAME='nom' CLASS='formo' VALUE=\"$nom\" SIZE='40' /><P>\n";
echo "<B>"._T('entree_adresse_email')."</B><BR />\n";
echo "<INPUT TYPE='text' NAME='email' CLASS='formo' VALUE=\"$email\" SIZE='40' /></fieldset>\n";
echo "<fieldset><label><B>"._T('entree_identifiants_connexion')."</B><BR />\n</label>";
echo "<B>"._T('entree_login')."</B><BR />\n";
echo _T('info_plus_trois_car')."<BR />\n";
echo "<INPUT TYPE='text' NAME='login' CLASS='formo' VALUE=\"$login\" SIZE='40' />\n";
echo "<B>"._T('entree_mot_passe')."</B> <BR />\n";
echo _T('info_plus_cinq_car_2')."<BR />\n";
echo "<INPUT TYPE='password' NAME='pass' CLASS='formo' VALUE=\"$pass\" SIZE='40' /></fieldset>\n";
echo fieldset(_T('info_identification_publique'),
array(
'nom' => array(
'label' => "<b>"._T('entree_signature')."</b><br />\n"._T('entree_nom_pseudo_1')."\n",
'value' => $nom
),
'email' => array(
'label' => "<b>"._T('entree_adresse_email')."</b>\n",
'value' => $email
)
)
);
echo fieldset(_T('entree_identifiants_connexion'),
array(
'login' => array(
'label' => "<b>"._T('entree_login')."</b><br />\n"._T('info_plus_trois_car')."\n",
'value' => $login
),
'pass' => array(
'label' => "<b>"._T('entree_mot_passe')."</b><br />\n"._T('info_plus_cinq_car_2')."\n",
'value' => $pass
)
)
);
echo bouton_suivant();
echo "</FORM>\n";
echo "</form>\n";
if (function_exists('ldap_connect') AND !$ldap_present) {
echo "<div style='border: 1px solid #404040; padding: 10px; text-align: left;'>";
echo "<b>"._T('info_authentification_externe')."</b>";
echo "<p>\n"._T('texte_annuaire_ldap_1');
echo generer_url_post_ecrire('install');
echo "<INPUT TYPE='hidden' NAME='etape' VALUE='ldap1' />";
echo "<DIV align='$spip_lang_right'><INPUT TYPE='submit' CLASS='fondl' VALUE=\""._T('bouton_acces_ldap')."\" /></div>";
echo "</FORM>
</div>";
echo fieldset(_T('info_authentification_externe'),
array(
'etape' => array(
'label' => _T('texte_annuaire_ldap_1').bouton_suivant('bouton_acces_ldap'),
'value' => 'ldap1',
'hidden' => true
)
)
);
echo "</form>\n";
}
install_fin_html();
}
?>
?>
\ No newline at end of file
......@@ -17,11 +17,10 @@ function install_etape_6_dist()
install_debut_html();
echo "<p><FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3>"._T('info_derniere_etape')."</B></FONT></p>";
echo "<P>";
echo "<B>"._T('info_code_acces')."</B>";
echo "</p><P>"._T('info_utilisation_spip')."</p>";
echo info_etape(_T('info_derniere_etape'),
"<b>"._T('info_code_acces')."</b></p><p>" .
_T('info_utilisation_spip')
);
if (@file_exists(_FILE_CONNECT_INS . _FILE_TMP . '.php'))
include(_FILE_CONNECT_INS . _FILE_TMP . '.php');
......@@ -77,22 +76,22 @@ function install_etape_6_dist()
ecrire_acces();
if (!@rename(_FILE_CONNECT_INS . _FILE_TMP . '.php',
_FILE_CONNECT_INS . '.php')) {
_DIR_ETC . 'connect.php')) {
copy(_FILE_CONNECT_INS . _FILE_TMP . '.php',
_FILE_CONNECT_INS . '.php');
_DIR_ETC . 'connect.php');
@unlink(_FILE_CONNECT_INS . _FILE_TMP . '.php');
}
if (!@rename(_FILE_CHMOD_INS . _FILE_TMP . '.php',
_FILE_CHMOD_INS . '.php')) {
_DIR_ETC . 'chmod.php')) {
copy(_FILE_CHMOD_INS . _FILE_TMP . '.php',
_FILE_CHMOD_INS . '.php');
_DIR_ETC . 'chmod.php');
@unlink(_FILE_CHMOD_INS . _FILE_TMP . '.php');
}
echo "<form action='./' method='post'>";
echo bouton_suivant();
echo "</FORM>";
echo "</form>";
ecrire_metas();
......
......@@ -55,7 +55,12 @@ function generer_nom_fichier_cache($contexte) {
$fichier_cache .= '.'.substr($md_cache, 1, 8);
// Sous-repertoires 0...9a..f ; ne pas prendre la base _DIR_CACHE
$subdir = sous_repertoire(_DIR_CACHE, substr($md_cache, 0, 1), true);
$repertoire = _DIR_CACHE;
if(!@file_exists($repertoire)) {
$repertoire = preg_replace(','._DIR_TMP.',', '', $repertoire);
$repertoire = sous_repertoire(_DIR_TMP, $repertoire);
}
$subdir = sous_repertoire($repertoire, substr($md_cache, 0, 1), true);
return $subdir.$fichier_cache;
}
......
Fichier déplacé
Vous pouvez effacer ce fichier sans dommages.
You can safely remove this file.
Vous pouvez effacer ce fichier sans dommages.
You can safely remove this file.
Fichier déplacé
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter