I created a nice security module class (visually), which i just drop it on a form that needs to be authenticated.
in the Init() of the Class, i get the form name, and call a Authenticate() method (of the class).
Basically, in the init() of the class..
LOCAL lcFormName
lcFormName = UPPER(JUSTSTEM(SYS(1271,this.Parent)))
This.FormName = lcFormName
IF NOT This.Authenticate()
MESSAGEBOX("Access denied." + CHR(13) + CHR(13)+;
"You do not have permission to access the specified form."+CHR(13)+;
"Please contact your system administrator for support.",16,"Access denied")
ENDIF
However, after the messagebox(), i want to close the form.
i tried:
This.Parent.Release() && that didn't work.
how can i close the form if Authenticate() is not valid? without messing with the form's Init() or other methods of the form?
all i want to do is drop the class on the form, and now, it will authenticate?
my Forms are all sub-classed.. i thought, of dropping the authenticate class on the main class of my form, and in the main class form's init() i do that, and i return .f. in there..
then, i would have to do the following in everyform i have something in the init()
Subclassed form's init()
DODEFAULT() && i will have to do that if i have code in the init(), right?
Ali Koumaiha
TeknoPCS Inc.
Dearborn heights, MI 48127
in the Init() of the Class, i get the form name, and call a Authenticate() method (of the class).
Basically, in the init() of the class..
LOCAL lcFormName
lcFormName = UPPER(JUSTSTEM(SYS(1271,this.Parent)))
This.FormName = lcFormName
IF NOT This.Authenticate()
MESSAGEBOX("Access denied." + CHR(13) + CHR(13)+;
"You do not have permission to access the specified form."+CHR(13)+;
"Please contact your system administrator for support.",16,"Access denied")
ENDIF
However, after the messagebox(), i want to close the form.
i tried:
This.Parent.Release() && that didn't work.
how can i close the form if Authenticate() is not valid? without messing with the form's Init() or other methods of the form?
all i want to do is drop the class on the form, and now, it will authenticate?
my Forms are all sub-classed.. i thought, of dropping the authenticate class on the main class of my form, and in the main class form's init() i do that, and i return .f. in there..
then, i would have to do the following in everyform i have something in the init()
Subclassed form's init()
DODEFAULT() && i will have to do that if i have code in the init(), right?
Ali Koumaiha
TeknoPCS Inc.
Dearborn heights, MI 48127