get rid of session.inc.php
authorx2000habouzit <x2000habouzit>
Mon, 3 Jan 2005 10:40:25 +0000 (10:40 +0000)
committerx2000habouzit <x2000habouzit>
Mon, 3 Jan 2005 10:40:25 +0000 (10:40 +0000)
include/.cvsignore
include/banana.inc.php.in
include/misc.inc.php
install.d/session.inc.php [deleted file]

index c8cf4f6..84cd208 100644 (file)
@@ -5,4 +5,3 @@ format.inc.php
 header.inc.php
 profile_form.inc.php
 profile.inc.php
-session.inc.php
index cbe4d6d..4e25e7d 100644 (file)
@@ -7,7 +7,6 @@
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
 
-require_once("include/session.inc.php");
 require_once("include/misc.inc.php");
 require_once("include/groups.inc.php");
 require_once("include/format.inc.php");
@@ -70,6 +69,18 @@ class Banana
 
 $banana = new Banana;
 
+switch (basename($_SERVER['SCRIPT_NAME'])) {
+    case "thread.php":
+        if (!isset($_SESSION['bananapostok'])) {
+            $_SESSION['bananapostok']=true;
+        }
+        break;
+
+    default:
+        $_SESSION['bananapostok']=true;
+        break;
+}
+
 if (empty($css)) {
 $css = array(
         'bananashortcuts' => 'bananashortcuts',
index 767d739..abb15dd 100644 (file)
@@ -78,12 +78,13 @@ function formatDisplayHeader($_header,$_text) {
             $text    = preg_split("/[ \t]/",strtr($text,$banana->spool->ids));
             $parents = preg_grep("/^\d+$/",$text);
             $p       = array_pop($parents);
+            $par_ok  = Array();
             
             while ($p) {
-                $valid_parents[]=$p;
+                $par_ok[]=$p;
                 $p = $banana->spool->overview[$p]->parent;
             }
-            foreach (array_reverse($valid_parents) as $p) {
+            foreach (array_reverse($par_ok) as $p) {
                 $rsl .= "<a href=\"article.php?group={$banana->spool->group}&amp;id=$p\">$ndx</a> ";
                 $ndx++;
             }
diff --git a/install.d/session.inc.php b/install.d/session.inc.php
deleted file mode 100644 (file)
index e08b5ee..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/********************************************************************************
-* include/session.inc.php : sessions for profile
-* -------------------------
-*
-* This file is part of the banana distribution
-* Copyright: See COPYING files that comes with this distribution
-********************************************************************************/
-
-session_start();
-
-// verify if a profile has been submitted
-if (!isset($_SESSION['profile']) && isset($_POST['action']) && $_POST['action']=="OK") {
-    $_SESSION['name'] = $_POST['profile_name'];
-    $_SESSION['mail'] = $_POST['profile_mail'];
-    $_SESSION['org'] = $_POST['profile_org'];
-    $_SESSION['sig'] = $_POST['profile_sig'];
-    $_SESSION['login'] = $_POST['profile_login'];
-    $_SESSION['passwd'] = $_POST['profile_passwd'];
-    $_SESSION['displaytype'] = $_POST['displaytype'];
-    $_SESSION['profile'] = true;
-}
-
-//sets sessions variables
-if (!isset($_SESSION['profile'])) {
-    require_once("include/profile.inc.php");
-    $profile=getprofile();
-    require_once("header.inc.php");
-    require_once("profile_form.inc.php");
-    require_once("footer.inc.php");
-    exit;
-}
-
-// refresh-post protection
-switch (basename($_SERVER['SCRIPT_NAME'])) {
-    case "thread.php":
-        if (!isset($_SESSION['bananapostok'])) {
-            $_SESSION['bananapostok']=true;
-        }
-        break;
-
-    default:
-        $_SESSION['bananapostok']=true;
-        break;
-}
-
-?>