Subversion Repositories ALCASAR

Rev

Rev 901 | Rev 2333 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 901 Rev 1805
Line 4... Line 4...
4
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
4
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
5
else{
5
else{
6
	echo "<b>Could not include SQL library</b><br>\n";
6
	echo "<b>Could not include SQL library</b><br>\n";
7
	exit();
7
	exit();
8
}
8
}
9
if ($config[sql_use_operators] == 'true'){
9
if ($config['sql_use_operators'] == 'true'){
10
	$op = ',op';
10
	$op = ',op';
11
	$use_op = 1;
11
	$use_op = 1;
12
}else{
12
}else{
13
	$op = "";
13
	$op = "";
14
	$use_op = 0;
14
	$use_op = 0;
15
}
15
}
16
$group_exists = 'no';
16
$group_exists = 'no';
17
$link = @da_sql_pconnect($config);
17
$link = da_sql_pconnect($config);
18
if ($link){
18
if ($link){
19
	if ($login == ''){
19
	if (!isset($login) || $login == ''){
20
		unset($existing_groups);
20
		unset($existing_groups);
21
 
21
 
22
		$res = @da_sql_query($link,$config,
22
		$res = da_sql_query($link,$config,
23
		"SELECT COUNT(*) as counter,groupname FROM $config[sql_usergroup_table]
23
		"SELECT COUNT(*) as counter,groupname FROM $config[sql_usergroup_table]
24
		GROUP BY groupname;");
24
		GROUP BY groupname;");
25
		if ($res){
25
		if ($res){
26
			while(($row = @da_sql_fetch_array($res,$config))){
26
			while(($row = da_sql_fetch_array($res,$config))){
27
				$name = $row[groupname];
27
				$name = $row['groupname'];
28
				$existing_groups["$name"] = $row[counter];
28
				$existing_groups["$name"] = $row['counter'];
29
			}
29
			}
30
			if (isset($existing_groups))
30
			if (isset($existing_groups))
31
				ksort($existing_groups);
31
				ksort($existing_groups);
32
		}
32
		}
33
		else
33
		else
Line 37... Line 37...
37
		unset($item_vals);
37
		unset($item_vals);
38
		unset($tmp);
38
		unset($tmp);
39
		unset($group_members);
39
		unset($group_members);
40
		unset($existing_groups);
40
		unset($existing_groups);
41
 
41
 
42
		$res = @da_sql_query($link,$config,
42
		$res = da_sql_query($link,$config,
43
		"SELECT attribute,value $op FROM $config[sql_groupcheck_table] WHERE groupname = '$login';");
43
		"SELECT attribute,value $op FROM $config[sql_groupcheck_table] WHERE groupname = '$login';");
44
		if ($res){
44
		if ($res){
45
			if (@da_sql_num_rows($res,$config))
45
			if (da_sql_num_rows($res,$config))
46
				$group_exists = 'yes';
46
				$group_exists = 'yes';
47
			while(($row = @da_sql_fetch_array($res,$config))){
47
			while(($row = da_sql_fetch_array($res,$config))){
48
				$attr = $row[attribute];
48
				$attr = $row['attribute'];
49
				$val = $row[value];
49
				$val = $row['value'];
-
 
50
				if(!isset($tmp["$attr"]['count'])) $tmp["$attr"]['count'] = 0;
50
				/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/
51
				/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/
51
				if($attr == "Max-All-Session") $mas_imp = $val;
52
				if($attr == "Max-All-Session") $mas_imp = $val;
52
				if($attr == "Max-Daily-Session") $mds_imp = $val;
53
				if($attr == "Max-Daily-Session") $mds_imp = $val;
53
				if($attr == "Max-Monthly-Session") $mms_imp = $val;
54
				if($attr == "Max-Monthly-Session") $mms_imp = $val;
54
				if($attr == "Expiration") $Expiration = $val;
55
				if($attr == "Expiration") $Expiration = $val;
55
				/*Fin Ajout*/
56
				/*Fin Ajout*/
56
				if ($use_op){
57
				if ($use_op){
57
					$oper = $row[op];
58
					$oper = $row['op'];
58
					$tmp["$attr"][operator][]="$oper";
59
					$tmp["$attr"]['operator'][]="$oper";
59
				}
60
				}
60
				$tmp["$attr"][]="$val";
61
				$tmp["$attr"][]="$val";
61
				$tmp["$attr"][count]++;
62
				$tmp["$attr"]['count']++;
62
			}
63
			}
63
			$res = @da_sql_query($link,$config,
64
			$res = da_sql_query($link,$config,
64
			"SELECT attribute,value $op FROM $config[sql_groupreply_table] WHERE groupname = '$login';");
65
			"SELECT attribute,value $op FROM $config[sql_groupreply_table] WHERE groupname = '$login';");
65
			if ($res){
66
			if ($res){
66
				if (@da_sql_num_rows($res,$config))
67
				if (da_sql_num_rows($res,$config))
67
					$group_exists = 'yes';
68
					$group_exists = 'yes';
68
				while(($row = @da_sql_fetch_array($res,$config))){
69
				while(($row = da_sql_fetch_array($res,$config))){
69
					$attr = $row[attribute];
70
					$attr = $row['attribute'];
70
					$val = $row[value];
71
					$val = $row['value'];
-
 
72
					if(!isset($tmp["$attr"]['count'])) $tmp["$attr"]['count'] = 0;
71
					/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/
73
					/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/
72
					if($attr == "Session-Timeout") $sto_imp = $val;
74
					if($attr == "Session-Timeout") $sto_imp = $val;
73
					/*Fin Ajout*/
75
					/*Fin Ajout*/
74
					if ($use_op){
76
					if ($use_op){
75
						$oper = $row[op];
77
						$oper = $row['op'];
76
						$tmp["$attr"][operator][]="$oper";
78
						$tmp["$attr"]['operator'][]="$oper";
77
					}
79
					}
78
					$tmp["$attr"][] = "$val";
80
					$tmp["$attr"][] = "$val";
79
					$tmp["$attr"][count]++;
81
					$tmp["$attr"]['count']++;
80
				}
82
				}
81
			}
83
			}
82
			else
84
			else
83
				echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
85
				echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
84
			$res = @da_sql_query($link,$config,
86
			$res = da_sql_query($link,$config,
85
			"SELECT username FROM $config[sql_usergroup_table] WHERE groupname = '$login' ORDER BY username;");
87
			"SELECT username FROM $config[sql_usergroup_table] WHERE groupname = '$login' ORDER BY username;");
86
			if ($res){
88
			if ($res){
87
				if (@da_sql_num_rows($res,$config))
89
				if (da_sql_num_rows($res,$config))
88
					$group_exists = 'yes';
90
					$group_exists = 'yes';
89
				while(($row = @da_sql_fetch_array($res,$config))){
91
				while(($row = da_sql_fetch_array($res,$config))){
90
					$member = $row[username];
92
					$member = $row['username'];
91
					$group_members[] = "$member";
93
					$group_members[] = "$member";
92
				}
94
				}
93
			}
95
			}
94
			else
96
			else
95
				echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
97
				echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
Line 103... Line 105...
103
						$attrmap["$key"] = $val;
105
						$attrmap["$key"] = $val;
104
						$attr_type["$key"] = 'replyItem';
106
						$attr_type["$key"] = 'replyItem';
105
						$rev_attrmap["$val"] = $key;
107
						$rev_attrmap["$val"] = $key;
106
					}
108
					}
107
					$item_vals["$key"] = $tmp[$val];
109
					$item_vals["$key"] = $tmp[$val];
108
					$item_vals["$key"][count] = $tmp[$val][count];
110
					$item_vals["$key"]['count'] = $tmp[$val]['count'];
109
					if ($use_op)
111
					if ($use_op)
110
						$item_vals["$key"][operator] = $tmp[$val][operator];
112
						$item_vals["$key"]['operator'] = $tmp[$val]['operator'];
111
				}
113
				}
112
			}
114
			}
113
		}
115
		}
114
		else
116
		else
115
			echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
117
			echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";