AlternC/bureau/admin/adm_email.php

81 lines
2.6 KiB
PHP
Raw Permalink Normal View History

2012-08-22 14:02:37 +00:00
<?php
/*
----------------------------------------------------------------------
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
----------------------------------------------------------------------
*/
/**
* Show a form to send a mail to another account's owner
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
2012-08-22 14:02:37 +00:00
require_once("../class/config.php");
include("head.php");
if (!$admin->enabled) {
$msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
echo $msg->msg_html_all();
2012-08-22 14:02:37 +00:00
exit();
}
$fields = array (
"subject" => array ("post", "string", ""),
"message" => array ("post", "string", ""),
"from" => array ("post", "string", ""),
"submit" => array ("post", "string", ""),
2012-08-22 14:02:37 +00:00
);
getFields($fields);
?>
<h3><?php __("Send an email to all members"); ?></h3>
<?php
if ( !empty($submit) ) {
if ($admin->mailallmembers($subject,$message,$from)) {
$msg->raise("INFO", "admin", _("The email was successfully sent"));
2012-08-22 14:02:37 +00:00
} else {
$msg->raise("INFO", "admin", _("There was an error"));
2012-08-22 14:02:37 +00:00
}
}
echo $msg->msg_html_all();
2012-08-22 14:02:37 +00:00
?>
<form method="post" action="adm_email.php">
<?php csrf_get(); ?>
2013-02-04 08:42:06 +00:00
<table cellspacing="1" cellpadding="4" border="0" align="center" class='tedit'>
2012-08-22 14:02:37 +00:00
<tr>
2013-02-04 08:42:06 +00:00
<th align="right"><b><?php __("From");?></b></th>
2012-08-22 14:02:37 +00:00
<td><span><input type="text" name="from" size="45" maxlength="100" tabindex="2" value="<?php echo "no-reply@$L_FQDN" ?>" /></span></td>
</tr>
<tr>
2013-02-04 08:42:06 +00:00
<th align="right"><b><?php __("Subject");?></b></th>
2012-08-22 14:02:37 +00:00
<td><span><input type="text" name="subject" size="45" maxlength="100" tabindex="2" value="" /></span></td>
</tr>
<tr>
2013-04-23 23:32:55 +00:00
<th align="right" valign="top"> <span><b><?php __("Mail"); ?></b></span></th>
<td><span> <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"></textarea></span></td>
2012-08-22 14:02:37 +00:00
</tr>
<tr>
<td class="catBottom" align="center" colspan="2"><input type="submit" value="<?php __("Send");?>" name="submit" /></td>
</tr>
</table>
</form>
<?php include_once('foot.php');?>