function there to check if the user is logged in without having to
connect to the IMAP server. Using this function in compose.php as a
test.
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@570
7612ce4b-ef26-0410-bec9-
ea0150e637f0
--- /dev/null
+<?php
+
+/**
+ ** auth.php
+ **
+ ** Contains functions used to do authentication.
+ **
+ **/
+
+ $auth_php = true;
+
+ function is_logged_in () {
+ if (!session_is_registered("user_is_logged_in")) {
+ echo _("You must login first.");
+ echo "</body></html>\n\n";
+ exit;
+ } else {
+ return true;
+ }
+ }
+
+?>
include("../functions/smtp.php");
if (!isset($display_messages_php))
include("../functions/display_messages.php");
include("../functions/smtp.php");
if (!isset($display_messages_php))
include("../functions/display_messages.php");
+ if (!isset($auth_php))
+ include ("../functions/auth.php");
include("../src/load_prefs.php");
include("../src/load_prefs.php");
showInputForm();
}
} else if ($html_addr_search_done) {
showInputForm();
}
} else if ($html_addr_search_done) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
displayPageHeader($color, $mailbox);
$body = stripslashes($body);
displayPageHeader($color, $mailbox);
$body = stripslashes($body);
//* can think of a better way, please implement it.
include ("addrbook_search_html.php");
} else if (isset($attach)) {
//* can think of a better way, please implement it.
include ("addrbook_search_html.php");
} else if (isset($attach)) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
displayPageHeader($color, $mailbox);
$localfilename = md5("$attachfile, $attachfile_name, $REMOTE_IP, $REMOTE_PORT, $UNIQUE_ID, and everything else that may add entropy");
displayPageHeader($color, $mailbox);
$localfilename = md5("$attachfile, $attachfile_name, $REMOTE_IP, $REMOTE_PORT, $UNIQUE_ID, and everything else that may add entropy");
showInputForm();
} else if (isset($do_delete)) {
showInputForm();
} else if (isset($do_delete)) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
displayPageHeader($color, $mailbox);
while (list($key, $localname) = each($delete)) {
displayPageHeader($color, $mailbox);
while (list($key, $localname) = each($delete)) {
showInputForm();
} else {
showInputForm();
} else {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
displayPageHeader($color, $mailbox);
$newmail = true;
displayPageHeader($color, $mailbox);
$newmail = true;
include ("../functions/imap.php");
if (!isset($plugin_php))
include ("../functions/plugin.php");
include ("../functions/imap.php");
if (!isset($plugin_php))
include ("../functions/plugin.php");
+ if (!isset($auth_php))
+ include ("../functions/auth.php");
- if ($is_logged_in != true) {
+ if (session_is_registered("user_is_logged_in")) {
do_hook ("login_before");
// verify that username and password are correct
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
do_hook ("login_verified");
}
do_hook ("login_before");
// verify that username and password are correct
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
do_hook ("login_verified");
}
- session_register ("is_logged_in");
- $is_logged_in = true;
+ session_register ("user_is_logged_in");
+ $user_is_logged_in = true;
include ("../src/load_prefs.php");
include ("../src/load_prefs.php");
echo "<TITLE>";
echo "$org_title";
echo "</TITLE>";
echo "<TITLE>";
echo "$org_title";
echo "</TITLE>";