root/alternc/branches/larpoux-unstable/install/newone.php

Revision 849, 2.2 kB (checked in by olivier, 3 years ago)

Suite correction bug initialisation quotas par defaut

Line 
1 #!/usr/bin/php4 -q
2 <?php
3 /*
4  $Id: newone.php,v 1.6 2006/02/17 15:15:54 olivier Exp $
5  ----------------------------------------------------------------------
6  AlternC - Web Hosting System
7  Copyright (C) 2002 by the AlternC Development Team.
8  http://alternc.org/
9  ----------------------------------------------------------------------
10  Based on:
11  Valentin Lacambre's web hosting softwares: http://altern.org/
12  ----------------------------------------------------------------------
13  LICENSE
14
15  This program is free software; you can redistribute it and/or
16  modify it under the terms of the GNU General Public License (GPL)
17  as published by the Free Software Foundation; either version 2
18  of the License, or (at your option) any later version.
19
20  This program is distributed in the hope that it will be useful,
21  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  GNU General Public License for more details.
24
25  To read the license please visit http://www.gnu.org/copyleft/gpl.html
26  ----------------------------------------------------------------------
27  Original Author of file: Benjamin Sonntag
28  Purpose of file: Create the first admin account on a new AlternC server
29  ----------------------------------------------------------------------
30 */
31
32 // Ne vérifie pas ma session :)
33 chdir("/var/alternc/bureau");
34 require("/var/alternc/bureau/class/config_nochk.php");
35
36 // On passe super-admin
37 $admin->enabled=1;
38
39 // On crée le compte admin :
40 if (!$admin->add_mem("root","root","Administrateur", "Admin", "root@".$L_FQDN)) {
41     echo $err->errstr()."\n";
42     exit();
43 }
44
45 $db->query("update membres set su=1 where login='root';");
46
47 // On lui attribue des quotas par defaut
48 // 10 domains, 10 stats, 10 bases mysql, 20 ftp et 100 emails
49 $db->query("update quotas,membres set quotas.total=10 where (quotas.name='stats' or quotas.name='sta2' or quotas.name='mysql' or quotas.name='dom') and quotas.uid=membres.uid and membres.login='root' ;");
50 $db->query("update quotas,membres set quotas.total=20 where quotas.name='ftp' and quotas.uid=membres.uid and membres.login='root' ;");
51 $db->query("update quotas,membres set quotas.total=100 where quotas.name='mail' and quotas.uid=membres.uid and membres.login='root' ;");
52
53 ?>
54
Note: See TracBrowser for help on using the browser.