From efec50ec04e5707bd692373d0ce7e5ad9606ac3a Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sun, 2 Jan 2005 14:02:51 +0000 Subject: [PATCH] reindent --- install.d/profile.inc.php | 24 ++++++++++----------- install.d/session.inc.php | 53 +++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/install.d/profile.inc.php b/install.d/profile.inc.php index 7d62c5e..f04bf47 100644 --- a/install.d/profile.inc.php +++ b/install.d/profile.inc.php @@ -11,9 +11,8 @@ * @param $_headers OBJECT headers of message to cancel * @return BOOLEAN true if user has right to cancel message */ - function checkcancel($_headers) { - return ($_headers->from == $_SESSION['name']." <".$_SESSION['mail'].">"); + return ($_headers->from == $_SESSION['name']." <".$_SESSION['mail'].">"); } /** getprofile : sets profile variables @@ -23,16 +22,15 @@ function checkcancel($_headers) { */ function getprofile() { - $array['name'] = $_SESSION['name']." <" - .htmlentities($_SESSION['mail']).">"; - $array['sig'] = $_SESSION['sig']; - $array['org'] = $_SESSION['org']; - $array['customhdr'] = ""; - $array['display'] = $_SESSION['displaytype']; - $array['lastnews'] = time()-86400; - $array['locale'] = "locales/fr.inc.php"; - $array['subscribe'] = array(); - $array['dropsig'] = true; - return $array; + $array['name'] = $_SESSION['name']." <".htmlentities($_SESSION['mail']).">"; + $array['sig'] = $_SESSION['sig']; + $array['org'] = $_SESSION['org']; + $array['customhdr'] = ""; + $array['display'] = $_SESSION['displaytype']; + $array['lastnews'] = time()-86400; + $array['locale'] = "locales/fr.inc.php"; + $array['subscribe'] = array(); + $array['dropsig'] = true; + return $array; } ?> diff --git a/install.d/session.inc.php b/install.d/session.inc.php index 46f4dae..ff34711 100644 --- a/install.d/session.inc.php +++ b/install.d/session.inc.php @@ -11,39 +11,38 @@ 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; + $_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($profile['locale']); - require_once("header.inc.php"); - require_once("profile_form.inc.php"); - require_once("footer.inc.php"); - exit; + require_once("include/profile.inc.php"); + $profile=getprofile(); + require_once($profile['locale']); + require_once("header.inc.php"); + require_once("profile_form.inc.php"); + require_once("footer.inc.php"); + exit; } // refresh-post protection -$sname = $_SERVER['SCRIPT_NAME']; -$array = explode('/',$sname); -$sname = array_pop($array); -unset($array); -switch ($sname) { - case "thread.php": - if (!isset($_SESSION['bananapostok'])) - $_SESSION['bananapostok']=true; - break; - default: - $_SESSION['bananapostok']=true; - break; +switch (basename($_SERVER['SCRIPT_NAME'])) { + case "thread.php": + if (!isset($_SESSION['bananapostok'])) { + $_SESSION['bananapostok']=true; + } + break; + + default: + $_SESSION['bananapostok']=true; + break; } + ?> -- 2.1.4