summaryrefslogtreecommitdiff
path: root/roundcubemail/index.php
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-05-07 09:38:44 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-05-07 09:38:44 +0000
commitb45dc036d214d3cfb0f320921f510f6b85c9fdac (patch)
tree12abf256bccef3e795a80023d163f18c4c253392 /roundcubemail/index.php
parentab80b06250eb55781e96d70d6b52622c073ca13f (diff)
More code cleanup + oop-ization
git-svn-id: https://svn.roundcube.net/trunk@1360 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/index.php')
-rw-r--r--roundcubemail/index.php27
1 files changed, 11 insertions, 16 deletions
diff --git a/roundcubemail/index.php b/roundcubemail/index.php
index ebf5193a2..257910a7b 100644
--- a/roundcubemail/index.php
+++ b/roundcubemail/index.php
@@ -2,7 +2,7 @@
/*
+-----------------------------------------------------------------------+
| RoundCube Webmail IMAP Client |
- | Version 0.1-20080430 |
+ | Version 0.1-20080506 |
| |
| Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
@@ -83,7 +83,7 @@ if ($RCMAIL->action=='error' && !empty($_GET['_code'])) {
// try to log in
if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
- $host = rcmail_autoselect_host();
+ $host = $RCMAIL->autoselect_host();
// check if client supports cookies
if (empty($_COOKIE)) {
@@ -97,7 +97,7 @@ if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
sess_regenerate_id();
// send auth cookie if necessary
- rcmail_authenticate_session();
+ $RCMAIL->authenticate_session();
// send redirect
header("Location: {$RCMAIL->comm_path}");
@@ -105,35 +105,30 @@ if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
}
else {
$OUTPUT->show_message($IMAP->error_code == -1 ? 'imaperror' : 'loginfailed', 'warning');
- rcmail_kill_session();
+ $RCMAIL->kill_session();
}
}
// end session
else if (($RCMAIL->task=='logout' || $RCMAIL->action=='logout') && isset($_SESSION['user_id'])) {
$OUTPUT->show_message('loggedout');
- rcmail_logout_actions();
- rcmail_kill_session();
+ $RCMAIL->logout_actions();
+ $RCMAIL->kill_session();
}
// check session and auth cookie
else if ($RCMAIL->action != 'login' && $_SESSION['user_id'] && $RCMAIL->action != 'send') {
- if (!rcmail_authenticate_session()) {
+ if (!$RCMAIL->authenticate_session()) {
$OUTPUT->show_message('sessionerror', 'error');
- rcmail_kill_session();
+ $RCMAIL->kill_session();
}
}
// log in to imap server
if (!empty($RCMAIL->user->ID) && $RCMAIL->task == 'mail') {
- $conn = $IMAP->connect($_SESSION['imap_host'], $_SESSION['username'], decrypt_passwd($_SESSION['password']), $_SESSION['imap_port'], $_SESSION['imap_ssl']);
- if (!$conn) {
- $OUTPUT->show_message($IMAP->error_code == -1 ? 'imaperror' : 'sessionerror', 'error');
- rcmail_kill_session();
- }
- else {
- $RCMAIL->set_imap_prop();
+ if (!$RCMAIL->imap_connect()) {
+ $RCMAIL->kill_session();
}
}
@@ -143,7 +138,7 @@ if (empty($RCMAIL->user->ID)) {
if ($OUTPUT->ajax_call)
$OUTPUT->remote_response("setTimeout(\"location.href='\"+this.env.comm_path+\"'\", 2000);");
- $RCMAIL->task = 'login';
+ $RCMAIL->set_task('login');
}