root/alternc/trunk/bureau/admin/adm_doadd.php

Revision 2247, 2.4 kB (checked in by azerttyu, 8 months ago)

Création d'un nouveau compte avec son sous domaine

Permettre à un (sous) administrateur d'affecter au choix le domaine entre ceux déclarés pour son compte ou celui générique du serveur (défini par l'admin général).

close #1087

Line 
1 <?php
2 /*
3  $Id: adm_doadd.php,v 1.8 2006/01/24 05:03:30 joe Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2006 Le réseau Koumbit Inc.
7  http://koumbit.org/
8  Copyright (C) 2002 by the AlternC Development Team.
9  http://alternc.org/
10  ----------------------------------------------------------------------
11  Based on:
12  Valentin Lacambre's web hosting softwares: http://altern.org/
13  ----------------------------------------------------------------------
14  LICENSE
15
16  This program is free software; you can redistribute it and/or
17  modify it under the terms of the GNU General Public License (GPL)
18  as published by the Free Software Foundation; either version 2
19  of the License, or (at your option) any later version.
20
21  This program is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  GNU General Public License for more details.
25
26  To read the license please visit http://www.gnu.org/copyleft/gpl.html
27  ----------------------------------------------------------------------
28  Original Author of file: Benjamin Sonntag
29  Purpose of file: Create a new member
30  ----------------------------------------------------------------------
31 */
32 require_once("../class/config.php");
33
34 if (!$admin->enabled) {
35     __("This page is restricted to authorized staff");
36     exit;
37 }
38
39 if ($pass != $passconf) {
40     $error = _("Passwords do not match");
41     include("adm_add.php");
42     exit();
43 }
44 if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type))) {
45     $error=$err->errstr();
46     include ("adm_add.php");
47     exit;
48 } else {
49
50   // Add here all what you want when an account is created !
51   $mem->su($u);
52  
53   /*
54    * 0 = pas d'hébergement dns, en effet, pas besoin vu que les
55    * domaines *.koumbit.net sont bien sur le serveur
56    *
57    * 1 = noerase = empêche à l'utilisateur de modifier le dns ou de
58    * supprimer le domaine
59    *
60    * 1 = force = ne tient pas compte du whois ou des droits de tld
61    */
62
63   if (($create_dom == 1)  && !is_null($create_dom_list)) {
64       # make sure we don't have multiple dots there
65       $dom->lock();
66       $dom->add_domain($login.".".preg_replace("/^\.\.*/", "", $create_dom_list),1,1,1);
67       $dom->unlock();
68   }
69
70   $ftp->add_ftp($login,"",$pass,"/");
71   $mem->unsu();
72  
73  $error=_("The new member has been successfully created");
74
75  include("adm_list.php");
76  exit;
77 }
78 ?>
79
Note: See TracBrowser for help on using the browser.