| 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 | */ |
|---|
| 30 | require_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 | ); |
|---|
| 41 | getFields($fields); |
|---|
| 42 | |
|---|
| 43 | if ($pass != $passconf) { |
|---|
| 44 | $error = _("Passwords do not match"); |
|---|
| 45 | include("mail_add.php"); |
|---|
| 46 | exit(); |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | if (!$mail->add_mail($domain,$email,$pop,$pass,$alias,$trash->expiration_date_db)) { |
|---|
| 50 | $error=$err->errstr(); |
|---|
| 51 | $addok=0; |
|---|
| 52 | include ("mail_add.php"); |
|---|
| 53 | } else { |
|---|
| 54 | $addok=1; |
|---|
| 55 | $error=sprintf (_("The email address <b>%s</b> has been successfully created"),"$email@$domain"); |
|---|
| 56 | if ($many) { |
|---|
| 57 | unset($email,$pass,$alias); |
|---|
| 58 | include("mail_add.php"); |
|---|
| 59 | } else { |
|---|
| 60 | include("mail_list.php"); |
|---|
| 61 | } |
|---|
| 62 | exit(); |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | ?> |
|---|