reindent
authorx2000habouzit <x2000habouzit>
Sun, 2 Jan 2005 14:02:51 +0000 (14:02 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 2 Jan 2005 14:02:51 +0000 (14:02 +0000)
install.d/profile.inc.php
install.d/session.inc.php

index 7d62c5e..f04bf47 100644 (file)
@@ -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;
 }
 ?>
index 46f4dae..ff34711 100644 (file)
@@ -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;
 }
+
 ?>