configuring the webmail properly

This commit is contained in:
Benjamin Sonntag 2012-08-26 17:55:44 +00:00
parent 7399963cfd
commit a1b33c1ce1
9 changed files with 85 additions and 18 deletions

4
.gitattributes vendored
View File

@ -286,6 +286,7 @@ bureau/admin/menu_quota.php -text
bureau/admin/menu_sql.php -text
bureau/admin/menu_web.php -text
bureau/admin/mxlist.php -text
bureau/admin/nowebmail.php -text
bureau/admin/phpinfo.php -text
bureau/admin/piwik_addaccount.php -text
bureau/admin/piwik_addsites.php -text
@ -318,8 +319,7 @@ bureau/admin/stats_members.php -text
bureau/admin/styles/passwordStrengthMeter.css -text
bureau/admin/styles/style.css -text
bureau/admin/trash_dateselect.php -text
bureau/admin/webmail/.htaccess -text
bureau/admin/webmail/index.php -text
bureau/admin/webmail-redirect.php -text
bureau/class/config.php -text
bureau/class/config_nochk.php -text
bureau/class/config_real.php -text

View File

@ -41,7 +41,7 @@ if (!$charset) $charset="UTF-8";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>AlternC Desktop</title>
<link rel="stylesheet" href="styles/style.css" type="text/css" />
@ -83,19 +83,11 @@ if (!$_SERVER[HTTPS]) {
</td></tr>
<tr><td>
<?php __("If you want to read your mail, enter your Email address and password in the following form and click 'Enter'"); ?>
<?php if (variable_get("webmail_redirect","")) { ?>
<p><a href="/webmail"><?php __("If you want to read your mail, click here and enter your Email address and password in the next form, then click 'Enter'."); ?></a></p>
<?php } ?>
</td><td>
<form action="/webmail/src/redirect.php" method="post">
<table border="0" style="border: 1px solid #202020;" cellspacing="0" cellpadding="3" width="300px" >
<tr><th colspan="2" align="center"><?php __("Webmail Access"); ?></th></tr>
<tr><th align="right"><label for="login_username"><?php __("Email Address"); ?></label></th><td><input type="text" class="int" name="login_username" id="login_username" value="" maxlength="128" size="15" /></td></tr>
<tr><th align="right"><label for="secretkey"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="secretkey" id="secretkey" value="" maxlength="128" size="15" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Enter"); ?>" /> </td></tr>
</table>
</form>
</td></tr>
</table>

View File

@ -0,0 +1,31 @@
<?php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Purpose of file: Show a message when there is no webmail configured
----------------------------------------------------------------------
*/
require_once("../class/config.php");
require_once("head.php");
$error="_("There is currently no webmail configured. If you need one, contact your server administrator");
include("index.php");

View File

@ -0,0 +1,33 @@
<?php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Purpose of file: listing of mail accounts for one domain.
----------------------------------------------------------------------
*/
require_once("../class/config_nochk.php");
if ($webmail=variable_get("webmail_redirect","")) {
header("Location: /$webmail");
} else {
header("Location: /nowebmail.php");
}

View File

@ -1,3 +0,0 @@
<?php
header ("Location: /webmail/") ;
?>

View File

@ -8,6 +8,9 @@
alias /alternc-sql /usr/share/phpmyadmin
RewriteEngine On
RewriteRule ^webmail /webmail-redirect.php [L]
# will be used to define aliases such as /javascript /webmail /squirrelmail ...
Include /etc/alternc/apache-panel.d/*.conf

View File

@ -8,7 +8,10 @@
alias /alternc-sql /usr/share/phpmyadmin
# will be used to define aliases such as /javascript /webmail /squirrelmail ...
RewriteEngine On
RewriteRule ^webmail /webmail-redirect.php [L]
# will be used to define aliases such as /javascript /squirrelmail ...
Include /etc/alternc/apache-panel.d/*.conf
</VirtualHost>

View File

@ -28,6 +28,14 @@ then
cp -f /etc/alternc/templates/squirrelmail/avelsieve-config.php /etc/alternc/templates/squirrelmail/apache.conf /etc/squirrelmail/
cp -f /etc/alternc/templates/javascript-common/javascript-common.conf /etc/javascript-common/
echo "Done"
. /usr/lib/alternc/functions.sh
echo "Setting squirrelmail as default webmail"
mysql_query "REPLACE INTO variable SET name='webmail_redirect', value='squirrelmail', comment='Set it to the name of your preferred webmail, /webmail will point to it';"
echo "Done"
fi