user headers
[banana.git] / install.d / session.inc.php
CommitLineData
c87d7e96 1<?php
2/********************************************************************************
3* include/session.inc.php : sessions for profile
4* -------------------------
5*
6* This file is part of the banana distribution
7* Copyright: See COPYING files that comes with this distribution
8********************************************************************************/
9
10session_start();
11
12//sets sessions variables
13if (!isset($_SESSION['profile']) && (!isset($_POST['action']) ||
14(isset($_POST['action']) && ($_POST['action']!="OK")))) {
69b36029 15 require("include/profile.inc.php");
16 $profile=getprofile();
c87d7e96 17 require("header.inc.php");
18 require("profile_form.inc.php");
19 require("footer.inc.php");
20 exit;
21} elseif (!isset($_SESSION['profile'])) {
22 $_SESSION['name'] = $_POST['profile_name'];
23 $_SESSION['mail'] = $_POST['profile_mail'];
24 $_SESSION['org'] = $_POST['profile_org'];
25 $_SESSION['sig'] = $_POST['profile_sig'];
26 $_SESSION['login'] = $_POST['profile_login'];
27 $_SESSION['passwd'] = $_POST['profile_passwd'];
28 $_SESSION['displaytype'] = $_POST['displaytype'];
29 $_SESSION['profile'] = true;
30}
25d27cb7 31
32// refresh-post protection
33$sname = $_SERVER['SCRIPT_NAME'];
34$array = explode('/',$sname);
35$sname = array_pop($array);
36unset($array);
37switch ($sname) {
38 case "thread.php":
39 if (!isset($_SESSION['bananapostok']))
40 $_SESSION['bananapostok']=true;
41 break;
42 default:
43 $_SESSION['bananapostok']=true;
44 break;
45}
c87d7e96 46?>