Need help with CLIPPER

JEFFREY T -  
 faycal -
Hello everyone,

I'm having problems with CLIPPER

I have to create a password management program to enter a program!!!

HOW CAN I DO THIS???

PLEASE HELP ME, IT'S VERY IMPORTANT FOR MY SCHOOL YEAR thank you in advance to all

4 answers

Bernard.Mouille
 
Hello,

Try this (by changing the characters)

* Password.PRG - Password.
* ----------------------------
*
* This is the program where I need to enter with a password.
*
@ 10,10 SAY "Enter your password: " && To indicate where to display the MOT function.
*
PasswordOk="dupont" && Good password that may come from a file.
*
IF MOT(PasswordOk) && If the return is correct.
@ 20,10 SAY "The password is correct, welcome."
ELSE
@ 20,10 SAY "Incorrect password! Access denied"
WAIT "Press any key to exit"
RETURN
ENDIF
*
WAIT "Press any key to continue this program"
*
* Program to execute.
*
RETURN && Or QUIT.
*
* --------------------------------------------------------------
*
FUNC MOT(Password)
*
* PASSWORD = String of the password to enter.
*
LOCAL E:=SAVESCREEN(0,0,MAXROW(),MAXCOL()), ; && Save screen.
R:= .F. , ; && Return incorrect password
V:="" , ; && String that builds up with keyboard strokes.
C:=0 && Value of the character typed on the keyboard.
*
CLEA TYPE && Clear the keyboard buffer to avoid errors.
*
DO WHIL C<>13 && Exit on <RETURN>.
C=INKEY()
IF (C>47 .AND. C<91) .OR. (C>96 .AND. C<123) && List of accepted characters.
V=V+CHR(C) && The string is being built.
@ ROW(), COL() SAY "X"
C=0
ENDI
ENDD
IF V==Password && If it's the right word.
R=.T. && It's true.
ENDIF
RETURN R

Happy coding!
0
JEFFREY T Posted messages 1 Status Member
 
Bernard Mouille,

Still on vacation or have you forgotten me?

LoL

I really need your lanterns


JEFFREY T
0
Bernard.Mouille > JEFFREY T Posted messages 1 Status Member
 
Hello Jeffrey,


No, I haven't forgotten you, but I have a lot of work at the moment.

Look a bit, I've made some modifications to your program, but I don't have time to go into detail:

http://bernard.mouille.free.fr/jeffrey/mpassw.txt

As I told you the other day, pay close attention to your loops to exit with "EXIT" or go back to the top of the loop "LOOP".


Happy coding


Bernard
0
JEFFREY T
 
Bernard,

I need a hand; PLEASE it’s still JUST AS IMPORTANT!!!!!!

use pass
index on pass to ind_pass

set wrap on

set color to ("w/b","w/r")

set message to 24 center

public fin
test=0

v_nom=space(15)
v_statut=space(10)
v_pass=space(10)
v_id=0
v_rep=space(1)

PUBLIC options[2]
options[1]="YES"
options[2]="NO"

PUBLIC statut[3]
statut[1]="ADMINISTRATOR"
statut[2]="EMPLOYEE"
statut[3]="MANAGER"

PUBLIC super[5]
super[1]="Add"
super[2]="Pack"
super[3]="Recall"
super[4]="Edit"
super[5]="Delete"

test=0

DO WHILE .T.

go top
blank()
locate for (id=1)

if (id <> 1)
clear
alert("There is no ADMINISTRATOR")
droit={.T.,.F.,.F.}
resu=achoice(9,15,9,27,statut,droit)

@07,5 say "Name : " get v_nom
@09,5 say "Status : "
@11,5 say "Pass : " get v_pass
@13,5 say "On : " get v_rep PICTURE "Y"
resu1=1
read

if v_rep = "Y"
append blank
replace nom with v_nom
replace stat with statut[resu]
replace pass with v_pass
replace id with resu
alert("Record created")
fin=.F.

else

alert("Record not saved")
blank()
fin=.F.
end if
else
end if

blank()
clear
@1,5 say "**********************************"
@2,5 say "** PASSWORD MANAGEMENT **"
@3,5 say "**********************************"

@5,5 say "Name : " get v_nom PICTURE "@A"
@7,5 say "Pass : " get v_pass PICTURE "@A"
read

seek(v_nom)
if found()
if v_pass = pass
if id=1
clear
menu to test
test=1
fin=.F.
else
clear
menu to test
test=2
fin=.F.
blank()
end if
else
clear
alert("Incorrect password")
fin=.F.
blank()
end if
else
alert(v_nom+", does not exist in our database")
fin=.F.
blank()
end if

do while .T.

DO CASE
Case test = 1
screen()
menu to main

DO CASE

case main = 1

droit={.T.,.T.,.T.,.T.}
resu=achoice(2,3,10,15,super,droit)
fin=.T.

do while fin

if resu = 1
screen()
blank()
droit={.T.,.T.,.T.}
resu1=achoice(9,18,9,30,statut,droit)

@07,5 say "Name : "
get v_nom
@09,5 say "Status : "
@11,5 say "Pass : "
get v_pass
@13,5 say "On : "
get v_rep PICTURE "Y"
read

if v_rep = "Y"
append blank
replace nom with v_nom
replace stat with statut[resu1]
replace pass with v_pass
replace id with resu1
alert("Record created")
fin=.F.

else

alert("Record not saved")
blank()
fin=.F.
end if

elseif resu=2
screen()
pack
alert("Records deleted permanently!")
fin = .F.

elseif resu=3
screen()
recall
alert("Records restored")
fin = .F.

elseif resu=4
fin=.T.
do while fin
screen()
blank()
@07,5 say "Name : "
get v_nom
read

seek (v_nom)

if found()
@07,5 say "Name : "
get v_nom
@09,5 say "Status : "
get stat
@11,5 say "Pass : "
get v_pass
@13,5 say "Delete? : "
get v_rep PICTURE "Y"
read

if v_rep="Y"
replace nom with v_nom
replace stat with statut[resu1]
replace pass with v_pass
replace id with resu1
screen()
alert("Record modified")
fin=.F.
else
screen()
alert("Record not modified")
fin=.F.
end if
fin=.F.

else
alert(v_nom+", does not exist in our database")
screen()
fin=.F.
end if

end do

else
fin=.T.
do while fin
screen()
blank()
@07,5 say "Name : "
get v_nom
read

seek (v_nom)

if found()
@07,5 say "Name : "
get nom
@09,5 say "Status : "
get stat
@11,5 say "Pass : "
get pass
@13,5 say "Delete? : "
get v_rep PICTURE "Y"
read

if v_rep="Y"
screen()
delete
alert("Record being deleted")
else
alert("Record not deleted")
end if
fin=.F.

else
alert(v_nom+", does not exist in our database")
screen()
fin=.F.
end if

end if
end do
end do

case main = 2

screen()
blank()
seek (v_nom)

if found()
@07,5 say "Name : "
get nom
@09,5 say "Status : "
get stat
@11,5 say "Pass : "
get v_pass
@13,5 say "Delete? : "
get v_rep PICTURE "Y"
read

if v_rep="Y"
screen()
replace nom with v_nom
replace stat with statut[resu1]
replace pass with v_pass
replace id with resu1
alert("Your record has been modified")
else
alert("Your record has not been deleted")
end if
fin=.F.

else
alert(v_nom+", does not exist in our database")
screen()
fin=.F.
end if

case main = 3
go top
acColumns={"name","status","pass","id"}
dbedit(2,1,24,79,acColumns)

case main = 4
RETURN

END CASE

case test=2
wait

END CASE

enddo
ENDDO

**************************************************************
function screen()
clear
@1,02 prompt "SUPER USER"
@1,23 prompt "MANAGER/EMPLOYEE"
@1,45 prompt "USER LIST"
@1,65 prompt "RETURN TO BACK"
return

function blank()
v_nom=space(15)
v_statut=space(10)
v_pass=space(10)
v_id=0
v_rep=space(1)
return
0
Bernard.Mouille
 
Hello Jeffrey,

I don't have much time at the moment, but try to modify:

INDE ON NOM TO (your index) you put pass
SET INDE TO (your index)
for the first loop .T. doesn't exit, try to set
DO WHILE end


I'll check after my vacation

Happy holidays

BM
0
JEFFREY T
 
Can someone other than Bernard help me???????????

PLEASE???
0
faycal > JEFFREY T
 
Hi Jeffrey, I see that Bernard's program on the password is really really really really really really complicated. If you haven't found an answer, contact me at my email
faycal.trans@yahoo.fr
0
faycal
 
For your password, after compilation, it showed the following errors:
declaration problem
1. You declared v_id=0
2. In locate for (id=1)
there is a declaration of id

solution either you declare id=0
and you leave the loop for (id=1)

or you leave v_id=0
and you change locate for (v_id=1)

If it's another problem, contact me at my email
faycal.trans@yahoo.fr
0
rezak la lumiere
 
```html use this function to verify the accuracy of a password
Function PWORD(mp)
local ret_val:=.T.
tone(500,1)
setcursor(1)
Set Color To 15/1, 0/7
dispbox(12,19,14,55,1)

For j:= 1 To 3

@ 13, 20 Say "ENTER THE PASSWORD: "
b:= ""

@ 13,45 Say " "
@ 13,45 Say ""
For i:= 45 To 52
a:= 0
a:= InKey(0)
If (a == 13)
Exit
EndIf
b:= b + Chr(a)

@ 13, i Say "."
sound(350,1)
Next
if ( ret_val := (upper(alltrim(b)) == upper(alltrim(mp))) )
b:= "1"
Exit
j:= 4
EndIf
sound(350,1)
InKey(0.1)
sound(300,1)
Next

If (b != "1")
Set Color To 7/0
quit

Else
sound(300,1)
Return ret_val
Endif

(lib funkcy et ct3 ) ```
0
rezak la lumiere
 
You ask the user to select or enter their "USER"
It's up to you, and then you will read the "USER" from a file and retrieve the password preferably encrypted with the CRYPT AND DECRYPT functions into a variable and pword(variable)
The user will enter the password; if they are authenticated, they gain access; otherwise, they retry this 3 times and then exit the program

Good luck!
0
JEFFREY T > rezak la lumiere
 
Bouh it's in 1 week and I can't get anything done!!!!!!!

Who created this fucking PROGRAMMING LANGUAGE!!!!!!

Bouhhhhhhhhhhhh I’m discouraged! On top of that, I haven't made any progress in 2 weeks because it’s not working!

What’s wrong with my program above and how can I improve it!???

I'm turning to you!

Thanks in advance

JEFFREY T
0
babords Posted messages 2 Status Member
 
Hello Rezak, I'm looking for libraries for Clipper 5, I'm a self-taught programmer, thank you for your response...
0
faycal
 
Hi Jeffrey, if you haven't found the pass program for this morning, contact me at my email
faycal.trans@yahoo.fr
0