Subversion Repositories ALCASAR

Rev

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

Rev 1805 Rev 1831
Line 1... Line 1...
1
<?php
1
<?php
2
require('../lib/sql/attrmap.php');
2
require('../lib/sql/attrmap.php');
3
if ((isset($login) && $login != '') && (isset($user_type) && $user_type !== 'group')){
3
if ((isset($login) && $login != '') && (isset($user_type) && $user_type !== 'group')){
-
 
4
 
4
	if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
5
	if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
5
		include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
6
		include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
6
	else{
7
	else{
7
		echo "<b>Could not include SQL library</b><br>\n";
8
		echo "<b>Could not include SQL library</b><br>\n";
8
		exit();
9
		exit();
Line 64... Line 65...
64
							if ($use_op){
65
							if ($use_op){
65
								$oper = $row['op'];
66
								$oper = $row['op'];
66
								$tmp["$attr"]['operator'][]="$oper";
67
								$tmp["$attr"]['operator'][]="$oper";
67
							}
68
							}
68
							$tmp["$attr"][] = "$val";
69
							$tmp["$attr"][] = "$val";
-
 
70
							if(isset($tmp["$attr"]['count']))
-
 
71
							{
69
							$tmp["$attr"]['count']++;
72
								$tmp["$attr"]['count']++;
-
 
73
							}
70
						}
74
						}
71
					}
75
					}
72
					else
76
					else
73
						echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
77
						echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n";
74
				}
78
				}
Line 122... Line 126...
122
		exit();
126
		exit();
123
	}
127
	}
124
	unset($member_groups);
128
	unset($member_groups);
125
	$link = da_sql_pconnect($config);
129
	$link = da_sql_pconnect($config);
126
	if ($link){
130
	if ($link){
-
 
131
		if(isset($login) && $login != '')
-
 
132
		{	
-
 
133
			#affiche le groupe appartenant à l'utilisateur
127
		$res = da_sql_query($link,$config,
134
			$res = da_sql_query($link,$config,
-
 
135
			"SELECT DISTINCT groupname FROM $config[sql_usergroup_table] WHERE username = '$login';");
-
 
136
		}
-
 
137
		else
-
 
138
		{
-
 
139
			#affiche la liste de groupe disponible (dans le cas de la creation d'un utilisateur)
-
 
140
			$res = da_sql_query($link,$config,
128
		"SELECT DISTINCT groupname FROM $config[sql_usergroup_table];");
141
			"SELECT DISTINCT groupname FROM $config[sql_usergroup_table] ;");
-
 
142
		}
-
 
143
 
129
		if ($res){
144
		if ($res){
130
			while(($row = da_sql_fetch_array($res,$config)))
145
			while(($row = da_sql_fetch_array($res,$config))){
131
				$member_groups[] = $row['groupname'];
146
				$member_groups[] = $row['groupname'];
-
 
147
			}
132
		}
148
		}
133
		else
149
		else
134
			echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
150
			echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
135
	}
151
	}
136
	else
152
	else