source: alternc/trunk/bureau/admin/mail_doadd.php @ 2905

Revision 2905, 2.1 KB checked in by benjamin, 2 years ago (diff)

trash ok for yes/no (was buggy)

Line 
1<?php
2/*
3 $Id: mail_doadd.php,v 1.3 2006/01/12 01:10:48 anarcat Exp $
4 ----------------------------------------------------------------------
5 AlternC - Web Hosting System
6 Copyright (C) 2002 by the AlternC Development Team.
7 http://alternc.org/
8 ----------------------------------------------------------------------
9 Based on:
10 Valentin Lacambre's web hosting softwares: http://altern.org/
11 ----------------------------------------------------------------------
12 LICENSE
13
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License (GPL)
16 as published by the Free Software Foundation; either version 2
17 of the License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 GNU General Public License for more details.
23
24 To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 ----------------------------------------------------------------------
26 Original Author of file: Benjamin Sonntag
27 Purpose of file: Create a new mail account
28 ----------------------------------------------------------------------
29*/
30require_once("../class/config.php");
31$trash->getfromform();
32
33$fields = array (
34        "domain"    => array ("request", "string", ""),
35        "email"       => array ("request", "string", ""),
36        "pop"       => array ("request", "integer", 0),
37        "pass"       => array ("request", "string", ""),
38        "passconf"       => array ("request", "string", ""),
39        "alias"       => array ("request", "string", ""),
40);
41getFields($fields);
42
43
44if ($pass != $passconf) {
45        $error = _("Passwords do not match");
46        include("mail_add.php");
47        exit();
48}
49
50if (!$mail->add_mail($domain,$email,$pop,$pass,$alias,$trash->expiration_date_db)) {
51        $error=$err->errstr();
52        $addok=0;
53        include ("mail_add.php");
54} else {
55        $addok=1;
56        $error=sprintf (_("The email address <b>%s</b> has been successfully created"),"$email@$domain");
57        if ($many) {
58                unset($email,$pass,$alias);
59                include("mail_add.php");
60        } else {
61                include("mail_list.php");
62        }
63        exit();
64}
65
66?>
Note: See TracBrowser for help on using the repository browser.