inc.php3 inc_auth.php3 inc_session.php3 inc_version.php3 1.90 1.63 1.47 1.397 1.91 1.64 1.48 1.398

Update of /home/spip-cvs/spip/ecrire
In directory alan:/tmp/cvs-serv4573/ecrire

Modified Files:
  inc.php3 inc_auth.php3 inc_session.php3 inc_version.php3
Log Message:
correction de la classe Link, et suppressions d'appel superflus

Index: inc.php3

RCS file: /home/spip-cvs/spip/ecrire/inc.php3,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- inc.php3 29 Oct 2004 16:57:45 -0000 1.90
+++ inc.php3 30 Oct 2004 09:59:09 -0000 1.91
@@ -1,7 +1,7 @@
<?php

if (!defined('_ECRIRE_INC_VERSION')) { include ("inc_version.php3"); }
-spip_log("version lue " . _DIR_PREFIX1);
+
include_ecrire("inc_auth.php3");
include_ecrire("inc_presentation.php3");
include_ecrire("inc_texte.php3");
@@ -12,10 +12,8 @@
include_ecrire("inc_calendrier.php");
include_ecrire("inc_forum.php3");

-
if (!@file_exists(_DIR_SESSIONS . "inc_meta_cache.php3")) ecrire_metas();

-
//
// Preferences de presentation
//

Index: inc_auth.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_auth.php3,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- inc_auth.php3 29 Oct 2004 16:57:45 -0000 1.63
+++ inc_auth.php3 30 Oct 2004 09:59:09 -0000 1.64
@@ -110,9 +110,9 @@

   // Si pas authentifie, demander login / mdp
   if (!$auth_login) {
- spip_log("redirection AUTH " . _DIR_PREFIX1 . $clean_link->getUrl());
- $url = str_replace('/./', '/', _DIR_RESTREINT_ABS .$clean_link->getUrl());
- redirige_par_entete("../spip_login.php3?var_url=".urlencode($url));
+ $url = (str_replace('/./', '/', _DIR_RESTREINT_ABS .$clean_link->getUrl()));
+ redirige_par_entete(lire_meta("adresse_site") .
+ "/spip_login.php3?var_url=$url");
   }

Index: inc_session.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_session.php3,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- inc_session.php3 23 Oct 2004 10:12:42 -0000 1.47
+++ inc_session.php3 30 Oct 2004 09:59:09 -0000 1.48
@@ -52,7 +52,7 @@
     fputs($f, $texte);
      fclose($f);
   } else {
- redirige_par_entete((_DIR_RESTREINT ? "" : "../") .
+ redirige_par_entete(lire_meta("adresse_site") .
             "spip_test_dirs.php3");
   }
}

Index: inc_version.php3

RCS file: /home/spip-cvs/spip/ecrire/inc_version.php3,v
retrieving revision 1.397
retrieving revision 1.398
diff -u -d -r1.397 -r1.398
--- inc_version.php3 29 Oct 2004 16:57:45 -0000 1.397
+++ inc_version.php3 30 Oct 2004 09:59:09 -0000 1.398
@@ -11,18 +11,20 @@
define('_DIR_RESTREINT_ABS', 'ecrire/');
define('_DIR_RESTREINT',
        (!@is_dir(_DIR_RESTREINT_ABS) ? "" : _DIR_RESTREINT_ABS));
-
-if ($d = ($GLOBALS['HTTP_GET_VARS']['var_install']))
+/* + tard
+if ($d = urldecode($GLOBALS['HTTP_GET_VARS']['var_install']))
   {
     $d = substr($d,0,strrpos($d,'/')+1);
     if (!ereg('^(.*)' . _DIR_RESTREINT_ABS . '$', $d))
       $d .= _DIR_RESTREINT_ABS;
     if (!@file_exists($d . 'mes_options.php3'))
- { header("Location: install.php3?var_install=$d");
- exit;}
+ {
+ header("Location: " . _DIR_RESTREINT . "install.php3?var_install=$d");
+ exit;
+ }
     define('_FILE_OPTIONS', $d . 'mes_options.php3');
     define('_FILE_CONNECT_INS', ($d . "inc_connect"));
- } else {
+ } else */ {
   define('_FILE_OPTIONS', 'mes_options.php3');
   define('_FILE_CONNECT_INS', (_DIR_RESTREINT . "inc_connect"));
  }
@@ -36,7 +38,7 @@

if (!(_FILE_CONNECT OR defined('_ECRIRE_INSTALL') OR defined('_TEST_DIRS'))) {
   if (!defined("_INC_PUBLIC"))
- header("Location: install.php3");
+ header("Location: " . _DIR_RESTREINT . "install.php3");
   else
     {
     $db_ok = 0;
@@ -786,14 +788,21 @@
       // (HTTP_GET_VARS may contain additional variables
       // introduced by rewrite-rules)
       $url = $GLOBALS['REQUEST_URI'];
- $url = substr($url, strrpos($url, '/') + 1);
+ // Warning !!!!
+ // since non encoded arguments may be present
+ // (especially those coming from Rewrite Rule)
+ // find the begining of the query string
+ // to compute the script-name
+ if ($v = strpos($url,'?'))
+ $v = strrpos(substr($url, 0, $v), '/');
+ else $v = strrpos($url, '/');
+ $url = substr($url, $v + 1);
       if (!$url) $url = "./";
       if (count($GLOBALS['HTTP_POST_VARS']))
         $vars = $GLOBALS['HTTP_POST_VARS'];
     }
     $v = split('[\?\&]', $url);
     list(, $this->file) = each($v);
-
     if (!$vars) {
       while (list(,$var) = each($v)) {
         list($name, $value) = split('=', $var, 2);
@@ -1180,6 +1189,7 @@
{
# $base=lire_meta("adresse_site");
# if ($base) $url = "$base/$url"; # + tard
+# spip_log("red $url");
   header("Location: $url");
   taches_de_fond();
   exit;