Subversion Repositories ALCASAR

Rev

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

Rev 587 Rev 768
Line 152... Line 152...
152
					$RS_out = fopen ("$file_out", "wb");
152
					$RS_out = fopen ("$file_out", "wb");
153
					foreach ($RS_in as $no => $ligne)
153
					foreach ($RS_in as $no => $ligne)
154
						{
154
						{
155
						$tligne = split(" ",$ligne);
155
						$tligne = split(" ",$ligne);
156
						$login  = str_replace("%0D","",str_replace("%0A","",urlencode ($tligne[0])));
156
						$login  = str_replace("%0D","",str_replace("%0A","",urlencode ($tligne[0])));
-
 
157
						$password  = str_replace("%0D","",str_replace("%0A","",urlencode ($tligne[1])));
157
						if ($login != '')
158
						if ($login != '')
158
							{
159
							{
-
 
160
							if ($password == "")
-
 
161
								{
159
							$password = GenPassword();		
162
								$password = GenPassword();
-
 
163
								}	
160
							$passwd = da_encrypt($password);
164
							$passwd = da_encrypt($password);
161
							$passwd = da_sql_escape_string($passwd);
165
							$passwd = da_sql_escape_string($passwd);
162
/* insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe) */
166
/* insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe) */
163
							$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);");
167
							$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);");
164
							if (!$res || !@da_sql_affected_rows($link,$res,$config))
168
							if (!$res || !@da_sql_affected_rows($link,$res,$config))