source: extensions/ContactForm/admin/emails.php @ 17483

Revision 17483, 1.0 KB checked in by mistic100, 7 years ago (diff)

entirely rewrite the plugin

  • send mail in html format (configurable to plain)
  • fully configurable email list
  • more...
Line 
1<?php
2if (!defined('CONTACT_FORM_PATH')) die('Hacking attempt!');
3
4// save emails
5if (isset($_POST['save_emails']))
6{
7  $emails = array();
8  foreach ($_POST['emails'] as $entry)
9  {
10    if (isset($entry['delete'])) continue;
11   
12    if ( empty($entry['email']) or !check_email_validity($entry['email']) )
13    {
14      array_push($page['errors'], l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));
15    }
16    else
17    {
18      array_push($emails, array(
19        'name' => $entry['name'],
20        'email' => $entry['email'],
21        'active' => isset($entry['active']),
22        ));
23    }
24  }
25 
26  $conf['ContactForm']['cf_admin_mails'] = $emails;
27  conf_update_param('ContactForm', serialize($conf['ContactForm']));
28  array_push($page['infos'], l10n('Information data registered in database'));
29}
30
31
32// display emails
33$template->assign('EMAILS', $conf['ContactForm']['cf_admin_mails']);
34
35$template->set_filename('contact_form', dirname(__FILE__).'/template/emails.tpl');
36
37?>
Note: See TracBrowser for help on using the repository browser.