Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
sql_users_dorights.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: sql_users_dorights.php,v 1.8 2006/02/16 16:26:28 nahuel 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: Nahuel ANGELINETTI
27  Purpose of file: Manage the MySQL users of a member
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 
32 
33 $fields = array (
34  "id" => array ("post", "string", ""),
35 );
37 
38 foreach($_POST as $k=>$v) {
39  $keys[$k]=$v;
40 }
41 
42 $cleanrights=$mysql->available_sql_rights();
43 foreach($mysql->get_dblist() as $d){
44  $rights=array();
45  foreach ($cleanrights as $r) {
46  if (isset($keys[$d['db'].'_'.$r])) {
47  $rights[]=$r;
48  }
49  }
50  //add if empty rights
51  $mysql->set_user_rights($id,$d['db'],$rights);
52 }
53 
54 $error=_("The rights has been successfully applied to the user");
55 include("sql_users_list.php");
56 
57 ?>