include_once("include.html");
require_once("inc/function.accounts.php");
require_once("inc/function.login.php");
//**** sha1 pass
if ($xcipher && $mdpass && $uid && checkuid($uid)) {
$password=$mdpass;
$method = "SHA1";
}
else
$uid="";
$skindata['logusername']=htmlspecialchars($username);
$username = trim(strtolower($username));
if ($ddomain) $username = $ddomain . "/" . $username;
$dologin = true;
if (!$otherconfig["FULLMERAK"] && $integrate) $dologin = authenticateuser($username, $password);
if ($dologin && ($id = loginuser($username, $password, $method, $uid))){
if ($otherconfig["LOGGING"]) dolog($username,1);
if ($pass_expired)
$location = "expiredpass.html?id=". $id;
elseif ($otherconfig["WELCOMEPAGE"] && file_exists("welcome.html"))
$location = "welcome.html?id=". $id;
else
$location = "blankskin.html?id=".$id;
//first login, path FIX
@mkdir(getfolderpath($username, inboxfolder), 0750);
//delete ~upload dir
deltree(uploadfolder,1);
header("Location: " . $location);
exit;
}
else {
if($otherconfig["LOGGING"]) dolog($username,0);
if (!strcasecmp($scheme, "Basic"))
{
header("Status: 401 Access Denied");
header("WWW-Authenticate: Basic realm=\"" . webmailname . "\"");
}
}
$skindata['title'] = $otherconfig["TITLETEXT"] . nametitle();
if (!checklicense())
$skindata['message'] = showmessage($nolicense["MESSAGE"], $nolicense["TEXT"], $nolicense["URL"], true, $showmessage_errorcolor, true);
elseif (!$id)
$skindata['message'] = showmessage($nologin["MESSAGE"], '','' , true, $showmessage_errorcolor, true);
require_once("index.html"); // zobrazeni login page
die();
?>