source: trunk/install/newone.php @ 908

Revision 908, 2.3 KB checked in by nahuel, 7 years ago (diff)

Correction du bug #593

  • Creation des codes retour dans newone.php
  • Gestion du code retour de newone.php dans alternc.install
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 :)
33if(!chdir("/var/alternc/bureau"))
34  exit(1);
35require("/var/alternc/bureau/class/config_nochk.php");
36
37// On passe super-admin
38$admin->enabled=1;
39
40// On crée le compte admin :
41if (!$admin->add_mem("admin","admin","Administrateur", "Admin", "postmaster@".$L_FQDN)) {
42        echo $err->errstr()."\n";
43        exit(1);
44}
45
46if(!$db->query("update membres set su=1 where login='admin';"))
47  exit(1);
48
49// On lui attribue des quotas par defaut
50// 10 domains, 10 stats, 10 bases mysql, 20 ftp et 100 emails
51if(!($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='admin' ;")
52  && $db->query("update quotas,membres set quotas.total=20 where quotas.name='ftp' and quotas.uid=membres.uid and membres.login='admin' ;")
53  && $db->query("update quotas,membres set quotas.total=100 where quotas.name='mail' and quotas.uid=membres.uid and membres.login='admin' ;")))
54  exit(1);
55
56exit(0);
57?>
Note: See TracBrowser for help on using the repository browser.