Esempio n. 1
0
// +----------------------------------------------------------------+
// | AtMail Open - Licensed under the Apache 2.0 Open-source License|
// | http://opensource.org/licenses/apache2.0.php                   |
// +----------------------------------------------------------------+
require_once 'header.php';
require_once 'Session.php';
require_once 'Global.php';
require_once 'Log.php';
require_once 'SendMsg.php';
require_once 'Mail/RFC822.php';
session_start();
// get global settings from config file
global $settings, $pref;
$var = array();
$atmail = new AtmailGlobal();
$auth =& $atmail->getAuthObj();
$atmail->httpheaders();
$atmail->status = $auth->getuser($atmail->SessionID);
$atmail->username = $auth->username;
$atmail->pop3host = $auth->pop3host;
// check for language version
if (!$atmail->Language) {
    $atmail->Language = $pref['Language'];
}
// Print the error screen if the account has auth errors, or session timeout.
if ($atmail->status == 1) {
    $atmail->auth_error();
}
if ($atmail->status == 2) {
    $atmail->session_error();
}
Esempio n. 2
0
// +----------------------------------------------------------------+
require_once 'header.php';
require_once 'Global.php';
// Check for account sent as one string
if (isset($_REQUEST['account'])) {
    list($_REQUEST['username'], $_REQUEST['pop3host']) = explode('@', $_REQUEST['account']);
}
// sanitize some vars
if (isset($_REQUEST['username'])) {
    $_REQUEST['username'] = htmlspecialchars($_REQUEST['username']);
}
if (isset($_REQUEST['pop3host'])) {
    $_REQUEST['pop3host'] = htmlspecialchars($_REQUEST['pop3host']);
}
$atmail = new AtmailGlobal();
$atmail->getAuthObj(false);
$atmail->auth();
// Only start session if user is authentcated
require_once 'Session.php';
session_start();
// force refresh of imap folder cache
// so we see all folders once logged in
$_SESSION['ForceImapRefresh'] = 1;
$atmail->auth->update_session();
$_SESSION['auth'] =& $atmail->auth;
$lang = $atmail->logintype();
$atmail->loadprefs();
// Toggle which MailType to use. IMAP or POP3
$atmail->mailtype();
$atmail->Language = $lang ? $lang : $_REQUEST['Language'];
if (!$atmail->Language) {