Hello,
I try to find a issue for bug 1388203 (http://trac.roundcube.net/trac.cgi/ticket/1388203)
Diff explanation :
'http_authent'. False : use the standard login page. (default) True : use $_SERVER["PHP_AUTH_USER"] to log user.
remove logout button when used http_authent
roundcube:if in included file. (Else my roundcube:if in taskbar.html not work!)
index.php : Add code to allow http authent.
program/steps/error.inc : Add "Allow cookies" in browser
requirement page. (I display this page (409) if the user disable cookies with http_authent)
Black Myst
--- config/main.inc.php.dist (revision 414) +++ config/main.inc.php.dist (working copy) @@ -77,6 +77,9 @@ // best server supported one) $rcmail_config['smtp_auth_type'] = '';
+// use http authentication : get login and pass from PHP variables +$rcmail_config['http_authent'] = FALSE;
// Log sent messages $rcmail_config['smtp_log'] = TRUE;
--- program/include/main.inc (revision 414) +++ program/include/main.inc (working copy) @@ -1265,7 +1265,7 @@ { $incl = fread($fp, filesize($path)); fclose($fp);
return parse_rcube_xml($incl);
return parse_rcube_xml(parse_rcube_conditions($incl));
}
break;
--- program/steps/error.inc (revision 414) +++ program/steps/error.inc (working copy) @@ -35,6 +35,7 @@
<br /> » JavaScript enabled<br /> » Support for XMLHTTPRequest<br /> +» Allow cookies<br />
<p><i>Your configuration:</i><br /> $user_agent</p> @@ -115,4 +116,4 @@ </html> EOF;
-?> \ No newline at end of file +?> Index: skins/default/includes/taskbar.html =================================================================== --- skins/default/includes/taskbar.html (revision 414) +++ skins/default/includes/taskbar.html (working copy) @@ -2,5 +2,7 @@ <roundcube:button command="mail" label="mail" class="button-mail" /> <roundcube:button command="addressbook" label="addressbook" class="button-addressbook" /> <roundcube:button command="settings" label="settings" class="button-settings" /> +<roundcube:if condition="config:http_authent != true" /> <roundcube:button command="logout" label="logout" class="button-logout" /> -</div> \ No newline at end of file +<roundcube:endif /> +</div> Index: index.php =================================================================== --- index.php (revision 414) +++ index.php (working copy) @@ -162,8 +162,42 @@ }
+// try to log in if http_authen +if ($CONFIG['http_authent'] && (!isset($_SESSION['user_id']) || !rcmail_authenticate_session()))
array('code' => 409,
'type' => 'php',
'message' => "User not allow cookies"),
FALSE,
TRUE);
rcmail_login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"],
rcmail_autoselect_host()))
array('code' => 401,
'type' => 'imap',
'message' => "Http_authent faild for user :".$_SERVER['PHP_AUTH_USER']),
TRUE,
TRUE);
// try to log in -if ($_action=='login' && $_task=='mail') +else if (!$CONFIG['http_authent'] && $_action=='login' && $_task=='mail') { $host = rcmail_autoselect_host();