From 597170feb25f5c2e5a90a9c0b1fd62001f169afb Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Tue, 04 Oct 2005 16:28:01 -0400 Subject: [PATCH] Added new languages, hierarchical folder tree and attachments in forwarded messages --- index.php | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index ba2692c..31c39ea 100644 --- a/index.php +++ b/index.php @@ -68,10 +68,10 @@ // catch some url/post parameters -$_auth = strlen($_POST['_auth']) ? $_POST['_auth'] : $_GET['_auth']; -$_task = strlen($_POST['_task']) ? $_POST['_task'] : ($_GET['_task'] ? $_GET['_task'] : 'mail'); -$_action = strlen($_POST['_action']) ? $_POST['_action'] : $_GET['_action']; -$_framed = ($_GET['_framed'] || $_POST['_framed']); +$_auth = !empty($_POST['_auth']) ? $_POST['_auth'] : $_GET['_auth']; +$_task = !empty($_POST['_task']) ? $_POST['_task'] : (!empty($_GET['_task']) ? $_GET['_task'] : 'mail'); +$_action = !empty($_POST['_action']) ? $_POST['_action'] : (!empty($_GET['_action']) ? $_GET['_action'] : ''); +$_framed = (!empty($_GET['_framed']) || !empty($_POST['_framed'])); // start session with requested task rcmail_startup($_task); @@ -83,7 +83,7 @@ // add framed parameter -if ($_GET['_framed'] || $_POST['_framed']) +if ($_framed) { $COMM_PATH .= '&_framed=1'; $SESS_HIDDEN_FIELD = "\n".'<input type="hidden" name="_framed" value="1" />'; @@ -95,7 +95,7 @@ // error steps -if ($_action=='error' && strlen($_GET['_code'])) +if ($_action=='error' && !empty($_GET['_code'])) { raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE); } @@ -107,11 +107,11 @@ $host = $_POST['_host'] ? $_POST['_host'] : $CONFIG['default_host']; // check if client supports cookies - if (!$_COOKIE[session_name()]) + if (empty($_COOKIE)) { show_message("cookiesdisabled", 'warning'); } - else if ($_POST['_user'] && $_POST['_pass'] && rcmail_login($_POST['_user'], $_POST['_pass'], $host)) + else if (isset($_POST['_user']) && isset($_POST['_pass']) && rcmail_login($_POST['_user'], $_POST['_pass'], $host)) { // send redirect header("Location: $COMM_PATH"); @@ -143,7 +143,7 @@ // log in to imap server -if ($_SESSION['user_id'] && $_task=='mail') +if (!empty($_SESSION['user_id']) && $_task=='mail') { $conn = $IMAP->connect($_SESSION['imap_host'], $_SESSION['username'], decrypt_passwd($_SESSION['password'])); if (!$conn) @@ -155,12 +155,12 @@ // not logged in -> set task to 'login -if (!$_SESSION['user_id']) +if (empty($_SESSION['user_id'])) $_task = 'login'; -// set taask and action to client +// set task and action to client $script = sprintf("%s.set_env('task', '%s');", $JS_OBJECT_NAME, $_task); if (!empty($_action)) $script .= sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action); -- Gitblit v1.9.1