Re-Bonjour !
Je suis entrain de m'arracher les cheveux, j'ai ma procédure,
je veux que "if" le mot de passe est egal a ****** (valeur par defaut) le mot de passe ne se change pas, donc dans ma requête SQL j'ai enlever la valeur du mot de passe.
"else" le mot de passe doit se changer par la valeur courante.
Hors il ne se change pas, au lieu de continuer ma requête quand le mot de passe est egal à autre chose que ******, il vas direct au end final (mode pas à pas)...
Voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66 procedure TFrmGui.Button1Click(Sender: TObject); begin {============================================================================= REQUETE DE LA MISE A JOUR DES COMPTES Création de mon login : passe "UPPER" avant d'être hasher ==============================================================================} Action12.Caption := UpperCase( EditModLogC.Text + ':' + EditModPassC.Text ); //Création de mon login : passe "UPPER" avant d'être hasher Action6.Caption := SHA1ToStr( SHA1(Action12.Caption) ); // Verification, Burning crusade coché ou non If CheckBox2.Checked = True then Begin Action10.Caption := IntTostr(1) End Else Action10.Caption := IntTostr(0); //Verification du type de compte coché If RadioButton5.Checked = True Then Begin// Joueur Action8.Caption := IntTostr(0); End; If RadioButton6.Checked = True Then // Modérateur Begin Action8.Caption := IntTostr(1); End; If RadioButton7.Checked = True Then // Game Master Begin Action8.Caption := IntTostr(2); End; If RadioButton8.Checked = True Then Begin // Administrateur Action8.Caption := IntTostr(3); End; {=============================================================================== Information // Mon mot de passe est: Action6.Caption issu de SHA1(login:pass) > Action6.Caption // Mon gmlevel est Action8.Caption // Mon "tbc" est Action10.Caption ==================================================================================} Statut.SimpleText := 'Vérification de la connexion au serveur MySql.'; DbPort := StrToInt(EditMySqlPort.Text); DbCompte := EditMySqlLogin.Text; DbPasse := EditMySqlPasse.Text; DbHost := EditMySqlServeur.Text; DbBase := EditMySqlBd.Text; If EditModPassC.Text = '******' Then If (ListeCompte.ItemIndex <> -1) AND (Sql.Connexion(0)) Then Begin If Sql.Query('UPDATE account SET username = "' + EditModLogC.Text + '",' + 'gmlevel = ' + Action8.Caption + ', '+ 'email = "' + EditModMailC.Text + '", '+ 'tbc = ' + Action10.Caption + ' WHERE username = "'+ListeCompte.Items.Strings[ListeCompte.ItemIndex]+'";') <> 0 Then Begin Sql.Fermeture; Statut.SimpleText := 'Erreur durant la mise à jour du compte.'; End Else Statut.SimpleText := 'Mise à jour du compte effectuée avec succès.'; End Else If (ListeCompte.ItemIndex <> -1) AND (Sql.Connexion(0)) Then Begin If Sql.Query('UPDATE account SET username = "' + EditModLogC.Text + '",' + 'sha_pass_hash = "' + Action6.Caption + '", ' + 'gmlevel = ' + Action8.Caption + ', '+ 'email = "' + EditModMailC.Text + '", '+ 'tbc = ' + Action10.Caption + ' WHERE username = "'+ListeCompte.Items.Strings[ListeCompte.ItemIndex]+'";') <> 0 Then Begin Sql.Fermeture; Statut.SimpleText := 'Erreur durant la mise à jour du compte.'; End Else Statut.SimpleText := 'Mise à jour du compte effectuée avec succès.'; End; End;
Partager