Subversion Repositories ALCASAR

Rev

Rev 534 | Rev 768 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 534 Rev 584
Line 150... Line 150...
150
					$RS_out = fopen ("$file_out", "wb");
150
					$RS_out = fopen ("$file_out", "wb");
151
					foreach ($RS_in as $no => $ligne)
151
					foreach ($RS_in as $no => $ligne)
152
						{
152
						{
153
						$tligne = split(" ",$ligne);
153
						$tligne = split(" ",$ligne);
154
						$login  = str_replace("%0D","",str_replace("%0A","",urlencode ($tligne[0])));
154
						$login  = str_replace("%0D","",str_replace("%0A","",urlencode ($tligne[0])));
-
 
155
						if ($login != '')
-
 
156
							{
155
						$password = GenPassword();		
157
							$password = GenPassword();		
156
						$passwd = da_encrypt($password);
158
							$passwd = da_encrypt($password);
157
						$passwd = da_sql_escape_string($passwd);
159
							$passwd = da_sql_escape_string($passwd);
158
/* insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe) */
160
/* insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe) */
159
						$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_check_table] (attribute,value,username $text) VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
161
							$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_check_table] (attribute,value,username $text) VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
Line 201... Line 203...
201
								} # end if
203
										} # end if
202
								else
204
									else
203
									echo "<b>Could not add user to group $group: " . da_sql_error($link,$config) . "</b><br>\n";
205
										echo "<b>Could not add user to group $group: " . da_sql_error($link,$config) . "</b><br>\n";
204
							} # end if ($group)
206
									} # end if ($group)
205
						 } # end if ($config)		
207
						 		} # end if ($config)		
-
 
208
							} # end if ($login !='')
206
					} # end foreach
209
						} # end foreach
207
					fclose($RS_out);
210
					fclose($RS_out);
208
				}
211
					} # end if (is file)
209
				} # end if (is_file ...
212
				} # end if (link)
210
			}
213
			}
211
		}
214
		}
212
	else if ($choix == "bdd")
215
	else if ($choix == "bdd")
213
//import d'une Bdd
216
//import d'une Bdd
214
		{
217
		{