Alternc  latest
Alternc logiel libre pour l'hébergement
sql_doadd.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Create a new MySQL database for the account
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 $fields = array (
29  "dbn" => array ("post", "string", ""),
30 );
31 
33 
34 if (!$quota->cancreate("mysql")) {
35  $msg->raise("ALERT", "mysql", _("Can't create a database: your quota is over"));
36  include("sql_list.php");
37  exit;
38 }
39 
40 $q=$quota->getquota("mysql");
41 
42 if($q['u'] > 0){
43  $dbname=$mem->user["login"]."_".$dbn;
44 } else {
45  $dbname=$mem->user["login"];
46 }
47 
48 if($mysql->add_db($dbname)) {
49  $msg->raise("INFO", "mysql", _("The database '%s' has been created."),$dbname);
50 }
51 
52 header('Location: sql_getparam.php?dbname='.htmlentities($dbname));
53 
54 ?>
exit
Definition: adm_doadd.php:70
$mem
Definition: bootstrap.php:71
$msg
Definition: bootstrap.php:75
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
if(! $quota->cancreate("mysql")) $q
Definition: sql_doadd.php:40
$fields
Create a new MySQL database for the account.
Definition: sql_doadd.php:28