Commit 43ce9c41 authored by Alan Garcia's avatar Alan Garcia
Browse files

Fix #470

parent d42843ad
......@@ -34,6 +34,7 @@ bureau/admin/adm_donosu.php -text
bureau/admin/adm_dorenew.php -text
bureau/admin/adm_dosu.php -text
bureau/admin/adm_edit.php -text
bureau/admin/adm_email.php -text
bureau/admin/adm_list.php -text
bureau/admin/adm_login.php -text
bureau/admin/adm_mxaccount.php -text
$Id: adm_email.php,v 1.1 2005/09/05 10:55:48 arnodu59 Exp $
AlternC - Web Hosting System
Copyright (C) 2005 by the AlternC Development Team.
Based on:
Valentin Lacambre's web hosting softwares:
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
GNU General Public License for more details.
To read the license please visit
Original Author of file: Benjamin Sonntag
Purpose of file: Show a form to edit a member
if (!$admin->enabled) {
__("This page is restricted to authorized staff");
$fields = array (
"subject" => array ("post", "string", ""),
"message" => array ("post", "string", ""),
"from" => array ("post", "string", ""),
"submit" => array ("post", "string", ""),
<h3><?php __("Send an email to all members"); ?></h3>
if ( !empty($submit) ) {
if ($admin->mailallmembers($subject,$message,$from)) {
$error=_("The email was successfully sent");
} else {
$error=_("There was an error");
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
<form method="post" action="adm_email.php">
<table cellspacing="1" cellpadding="4" border="0" align="center">
<td align="right"><b><?php __("From");?></b></td>
<td><span><input type="text" name="from" size="45" maxlength="100" tabindex="2" value="<?php echo "no-reply@$L_FQDN" ?>" /></span></td>
<td align="right"><b><?php __("Subject");?></b></td>
<td><span><input type="text" name="subject" size="45" maxlength="100" tabindex="2" value="" /></span></td>
<td align="right" valign="top"> <span><b><?php __("Mail"); ?></b></span>
<td><span> <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"></textarea></span>
<td class="catBottom" align="center" colspan="2"><input type="submit" value="<?php __("Send");?>" name="submit" /></td>
<?php include_once('foot.php');?>
......@@ -53,6 +53,7 @@ if (isset($error) && $error) {
<li class="lst1"><a href="adm_doms.php"><?php __("Manage installed domains"); ?></a></li>
<li class="lst2"><a href="adm_defquotas.php"><?php __("Change the default quotas"); ?></a></li>
<li class="lst1"><a href="adm_authip_whitelist.php"><?php __("Manage IP whitelist"); ?></a></li>
<li class="lst2"><a href="adm_email.php"><?php __("Send an email to all members"); ?></a></li>
......@@ -216,6 +216,37 @@ class m_admin {
function mailallmembers($subject,$message,$from) {
global $err,$mem,$cuid,$db;
if (!$this->enabled) {
return false;
if (empty($subject) || empty($message) || empty($from) ){
return false;
if (checkmail($from) != 0) {
return false;
$db->query("select distinct mail from membres;");
while ($db->next_record()) {
// Can't do BCC due to postfix limitation
mail($db->f('mail'), $subject, $message, null, "-f$from");
return true;
* Returns an array with the known information about resellers (uid, login, number of accounts)
* Does not include account 2000 in the list.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment