INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Password Validation PowerBuilder 6

Password Validation PowerBuilder 6

(OP)
Hi all,

i'm newly join the company and i got task to do with password validation.

1- Min 8 Character
2- must consist (A-Z, a-z, 0-9)

We use PowerBuilder 6 and connect to ODBC. I plan to change in Window Object. Anyone can help me? Attach are the fully script for that window

RE: Password Validation PowerBuilder 6

The code you provided is from some sort of log on window which gets the user id and password from the registry, encrypts it, then attempts to connect to the database.

Your question appears to be about enforcing some rules on password length and contents.

You should enforce the password rules in whichever window is used to change passwords.

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: Password Validation PowerBuilder 6

(OP)
Thanks for reply. So, i need to find which window that that used to change password right.

RE: Password Validation PowerBuilder 6

yes

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: Password Validation PowerBuilder 6

i made login and password for user

string ls_name[],ls_nama[],ls_pass[]
decimal ldec_nilai[]

dw_1.accepttext()
ls_name[1] = dw_1.Object.uslognm[dw_1.GetRow()] // login user
ls_nama[1] = dw_1.Object.usfullnm[dw_1.GetRow()] // full name user
ls_pass[1] = dw_1.Object.uspass[dw_1.GetRow()] // password user

// for check if login has used
SELECT ISNULL(COUNT(USERLOG.USLOGNM),0)
INTO :ldec_nilai[1]
FROM USERLOG
WHERE USERLOG.USLOGNM = :ls_name ;
COMMIT USING SQLCA;

// for check if full name user has used
SELECT ISNULL(COUNT(USERLOG.USFULLNM),0)
INTO :ldec_nilai[2]
FROM USERLOG
WHERE USERLOG.USFULLNM = :ls_nama ;
COMMIT USING SQLCA;

// dw_3 = dw_1 and for check between dw_3 and dw_1
if dw_3.Retrieve(is_userlog) > 0 then
ls_name[2] = dw_3.Object.uslognm[dw_1.GetRow()]
ls_nama[2] = dw_3.Object.usfullnm[dw_1.GetRow()]
ls_pass[2] = dw_3.Object.uspass[dw_1.GetRow()]
end if

if ls_name <> 'ADMIN' then
//nama login // login user
If dw_1.object.uslognm[dw_1.getRow()] = '' Or &
IsNull(dw_1.object.uslognm[dw_1.getRow()]) Then
MessageBox('Data belum lengkap','Nama Login Masih Kosong ~n' &
+'Silahkan di Isi Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uslognm')
Return
End If

if ldec_nilai[1] > 0 and ls_name1 <> ls_name then
MessageBox('Data belum lengkap','Nama Login Sudah Ada ~n' &
+'Silahkan Buat Yang Baru',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uslognm')
Return
End If

if len(ls_name) < 3 then
MessageBox('Data belum lengkap','Nama Login Minimal 3 Digit ~n' &
+'Silahkan di Ubah Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uslognm')
Return
End If

if match(ls_name, '^[a-zA-Z0-9 ]+$') = FALSE then
MessageBox('Data belum lengkap',+ 'Nama Login di Isi Dengan Angka dan atau Huruf ~n' &
+ 'Silahkan di Ubah Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uslognm')
Return
End If

//nama pemakai // full name user
If dw_1.object.uslognm[dw_1.getRow()] = '' Or &
IsNull(dw_1.object.usfullnm[dw_1.getRow()]) Then
MessageBox('Data belum lengkap','Nama Pemakai Masih Kosong ~n' &
+'Silahkan di Isi Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('usfullnm')
Return
End If

if ldec_nilai[2] > 0 and ls_nama1 <> ls_nama then
MessageBox('Data belum lengkap','Nama Pemakai Sudah Ada ~n' &
+'Silahkan Buat Yang Baru',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('usfullnm')
Return
End If

if len(ls_nama) < 3 then
MessageBox('Data belum lengkap','Nama Pemakai Minimal 3 Digit ~n' &
+'Silahkan di Ubah Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('usfullnm')
Return
End If

if match(ls_nama, '^[a-zA-Z0-9 ]+$') = FALSE then
MessageBox('Data belum lengkap',+ 'Nama Pemakai di Isi Dengan Angka dan atau Huruf ~n' &
+ 'Silahkan di Ubah Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('usfullnm')
Return
End If

//Password
If dw_1.object.uspass[dw_1.getRow()] = '' Or &
IsNull(dw_1.object.uspass[dw_1.getRow()]) Then
MessageBox('Data belum lengkap','Password Masih Kosong ~n' &
+'Silahkan di Isi Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uspass')
Return
End If

if len(ls_pass) < 3 then
MessageBox('Data belum lengkap','Password Minimal 3 Digit ~n' &
+'Silahkan di Ubah Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uspass')
Return
End If

//first digit must filled number or alphabet
if match(ls_pass, '^[a-zA-Z0-9 ]+$') = FALSE then
MessageBox('Data belum lengkap',+ 'Password di Isi Dengan Angka dan atau Huruf ~n' &
+ 'Silahkan di Ubah Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uspass')
Return
End If

// login not must be same with full name
if ls_name = ls_nama then
MessageBox('Data belum lengkap',+ 'Nama Login dan Nama Pemakai Tidak Boleh Sama ~n' &
+ 'Silahkan di Ubah Salah Satu Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('usfullnm')
Return
end if

// login not must be same with password
if ls_name = ls_pass then
MessageBox('Data belum lengkap',+ 'Nama Login dan Password Tidak Boleh Sama ~n' &
+ 'Silahkan di Ubah Salah Satu Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('uspass')
Return
end if

// password not must be same with full name
if ls_nama = ls_pass then
MessageBox('Data belum lengkap',+ 'Nama Pemakai dan Password Tidak Boleh Sama ~n' &
+ 'Silahkan di Ubah Salah Satu Dahulu',StopSign! )
dw_1.SetFocus()
dw_1.SetColumn('usfullnm')
Return
end if
end if

If dw_1.Update() <> 1 Then
Rollback using sqlca;
Return
End If

Commit Using sqlca;
MessageBox('Data Lengkap','Simpan Data Sukses')

note : for messagebox used BAHASA INDONESIA

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close