* @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
*/
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;
}
?>
// 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;
}
+
?>