/* Regdb Editor - DMS - nov 98 - by Patrice FAVRE */ typeof dbname=ObjText;; typeof dblogin=ObjText;; typeof dbpassw=ObjText;; typeof logp2=ObjCheck;; typeof logp3=ObjCheck;; typeof maxlog=ObjText;; typeof fmaxlog=ObjText;; typeof ltab=ObjText;; typeof llength=ObjText;; typeof lcolname=ObjText;; typeof lcolemail=ObjText;; typeof lcolpasswd=ObjText;; typeof lcolIP=ObjText;; typeof lcoltime=ObjText;; typeof lfcolnum=ObjText;; typeof lcolnum=ObjText;; typeof lglcolname=ObjText;; typeof lglcolemail=ObjText;; typeof lglcolpasswd=ObjText;; typeof lglcolIP=ObjText;; typeof lglcoltime=ObjText;; typeof wftab=ObjText;; typeof wtab=ObjText;; typeof wlength=ObjText;; typeof wcolname=ObjText;; typeof wcolword=ObjText;; typeof wfcolname=ObjText;; typeof wfcolword=ObjText;; typeof lgwcolname=ObjText;; typeof lgwcolword=ObjText;; typeof wflist=ObjText;; typeof wlist=ObjText;; typeof savepwd=ObjCheck;; /* Nom des champs */ var F_DBNAME="DataBase Name";; var F_DBLOGIN="DataBase Login";; var F_DBPASSW="DataBase Password";; var F_LOGP2="LoginP or P2 policy";; var F_LOGP3="LoginP3 policy";; var F_MAXLOG="Max successful logins";; var F_LTABLE="Login Table";; var F_LCOLNAME="Login column";; var F_LCOLEMAIL="E-Mail column";; var F_LCOLPASSWD="Password column";; var F_LCOLIP="IP addr column";; var F_LCOLTIME="Timestamp column";; var F_LCOLNUM="Number column";; var F_LENGTH="Length";; var F_WTABLE="Key Words Table";; var F_WCOLNAME="Login column";; var F_WCOLWORD="Key word column";; var F_WLIST="Available key words :";; var F_SAVEPWD="Create cookies";; /* Valeurs par défaut */ var DFT_TABLE="Table";; var DFT_LEN="50";; var DFT_LGIP="15";; var DFT_LGTIME="24";; typeof editWin= ObjWin;; /*-----------------------*/ fun save(s,n)= let strextr strlowercase _GETtext wlist -> lst in let TraitLgLig lst atoi _GETtext lgwcolword -> res in if res != nil then ( _DLGrflmessage _DLGMessageBox _channel editWin TIT_ERREUR strcatn "\""::res::"\""::E_WLONG::(_GETtext lgwcolword)::nil 0 nil nil; nil ) else ( TraitDblLig lst; _SETtext wlist strbuild lst; ("action"::ACT_START::ACT_START::nil):: ("action"::ACT_DESTROY::ACT_DESTROY::nil):: ("action"::ACT_SHOW_ADMIN::ACT_SHOW_ADMIN::nil):: ("action"::ACT_HIDE_ADMIN::ACT_HIDE_ADMIN::nil):: ("action"::ACT_RET_CHECK_UPDATE::ACT_RET_CHECK_UPDATE::nil):: ("action"::ACT_RET_CHECK_FETCH_UPD::ACT_RET_CHECK_FETCH_UPD::nil):: ("action"::ACT_RET_INIT_UPDATE::ACT_RET_INIT_UPDATE::nil):: ("action"::ACT_RET_INIT_FETCH_UPD::ACT_RET_INIT_FETCH_UPD::nil):: ("actionC"::ACT_SHOW_INSERT::ACT_SHOW_INSERT::nil):: ("actionC"::ACT_SHOW_UPDATE::ACT_SHOW_UPDATE::nil):: ("actionC"::ACT_HIDE_INSERT::ACT_HIDE_INSERT::nil):: ("actionC"::ACT_HIDE_UPDATE::ACT_HIDE_UPDATE::nil):: ("event"::EVT_DESTROYED::EVT_DESTROYED::nil):: ("event"::EVT_ADMIN_SHOWN::EVT_ADMIN_SHOWN::nil):: ("event"::EVT_ADMIN_HIDDEN::EVT_ADMIN_HIDDEN::nil):: ("event"::EVT_ADMIN_UPDATED::EVT_ADMIN_UPDATED::nil):: ("event"::EVT_ADMIN_DELETED::EVT_ADMIN_DELETED::nil):: ("event"::EVT_INIT_UPDATE::EVT_INIT_UPDATE::nil):: ("eventC"::EVT_STARTED::EVT_STARTED::nil):: ("eventC"::EVT_INSERTED::EVT_INSERTED::nil):: ("eventC"::EVT_UPDATED::EVT_UPDATED::nil):: ("eventC"::EVT_INSERT_SHOWN::EVT_INSERT_SHOWN::nil):: ("eventC"::EVT_UPDATE_SHOWN::EVT_UPDATE_SHOWN::nil):: ("eventC"::EVT_INSERT_HIDDEN::EVT_INSERT_HIDDEN::nil):: ("eventC"::EVT_UPDATE_HIDDEN::EVT_UPDATE_HIDDEN::nil):: ("zoneC"::Z_FORM_ADM::nil):: ("zoneC"::Z_FORM_INS::nil):: ("zoneC"::Z_FORM_UPD::nil):: (KW_DBNAME::(_GETtext dbname)::nil):: (KW_DBLOGIN::(_GETtext dblogin)::nil):: (KW_DBPASSW::(_GETtext dbpassw)::nil):: (KW_LTABLE::(_GETtext ltab)::nil):: (KW_LCOLNAME::(_GETtext lcolname)::nil):: (KW_LCOLEMAIL::(_GETtext lcolemail)::nil):: (KW_LCOLPASSWD::(_GETtext lcolpasswd)::nil):: (KW_LCOLIP::(_GETtext lcolIP)::nil):: (KW_LCOLTIME::(_GETtext lcoltime)::nil):: (KW_LGLCOLNAME::(_GETtext lglcolname)::nil):: (KW_LGLCOLEMAIL::(_GETtext lglcolemail)::nil):: (KW_LGLCOLPASSWD::(_GETtext lglcolpasswd)::nil):: (KW_WTABLE::(_GETtext wtab)::nil):: (KW_WCOLNAME::(_GETtext wcolname)::nil):: (KW_WCOLWORD::(_GETtext wcolword)::nil):: (KW_LGWCOLWORD::(_GETtext lgwcolword)::nil):: (KW_WLIST::(_GETtext wlist)::nil):: (KW_SAVEPWD::(itoa _GETcheck savepwd)::nil):: if (_GETcheck logp2)==1 then (KW_POLICY::"P2"::nil)::nil else (KW_POLICY::"P3"::nil)::(KW_MAXLOG::(_GETtext maxlog)::nil)::(KW_LCOLNUM::(_GETtext lcolnum)::nil)::nil );; /*-----------------------*/ fun rflChkP2(a,b,c)= if c==1 then ( _SHOWtext fmaxlog WINDOW_HIDDEN; _SHOWtext maxlog WINDOW_HIDDEN; _SHOWtext lfcolnum WINDOW_HIDDEN; _SHOWtext lcolnum WINDOW_HIDDEN ) else nil;; /*-----------------------*/ fun rflChkP3(a,b,c)= if c==1 then ( _SHOWtext fmaxlog WINDOW_UNHIDDEN; _SHOWtext maxlog WINDOW_UNHIDDEN; _SHOWtext lfcolnum WINDOW_UNHIDDEN; _SHOWtext lcolnum WINDOW_UNHIDDEN ) else nil;; /*-----------------------*/ fun load (l)= _SETtext dbname getInfo l KW_DBNAME; _SETtext dblogin getInfo l KW_DBLOGIN; _SETtext dbpassw getInfo l KW_DBPASSW; _SETtext ltab getInfo l KW_LTABLE; _SETtext lcolname getInfo l KW_LCOLNAME; _SETtext lcolemail getInfo l KW_LCOLEMAIL; _SETtext lcolpasswd getInfo l KW_LCOLPASSWD; _SETtext lcolIP getInfo l KW_LCOLIP; _SETtext lcoltime getInfo l KW_LCOLTIME; _SETtext lglcolname getInfo l KW_LGLCOLNAME; _SETtext lglcolemail getInfo l KW_LGLCOLEMAIL; _SETtext lglcolpasswd getInfo l KW_LGLCOLPASSWD; _SETtext wtab getInfo l KW_WTABLE; _SETtext wcolname getInfo l KW_WCOLNAME; _SETtext wcolword getInfo l KW_WCOLWORD; _SETtext lgwcolword getInfo l KW_LGWCOLWORD; _SETtext wlist getInfo l KW_WLIST; _SETcheck savepwd atoi getInfo l KW_SAVEPWD; if !strcmp getInfo l KW_POLICY "P3" then ( _SETcheck logp2 0; _SETcheck logp3 1; rflChkP3 nil nil 1; _SETtext maxlog getInfo l KW_MAXLOG; _SETtext lcolnum getInfo l KW_LCOLNUM ) else nil; 0;; /*-----------------------*/ fun rflSizeEditWin (wn, blurp, w, h)= _POSITIONtext dbname 95 5 w-110 20; _POSITIONtext dblogin 95 30 w-110 20; _POSITIONtext dbpassw 115 55 w-130 20; _POSITIONtext ltab 90 155 w/2-95 20; _POSITIONtext llength w/2-50 180 40 20; _POSITIONtext lcolname 115 200 w/2-165 20; _POSITIONtext lglcolname w/2-50 200 40 20; _POSITIONtext lcolemail 115 225 w/2-165 20; _POSITIONtext lglcolemail w/2-50 225 40 20; _POSITIONtext lcolpasswd 115 250 w/2-165 20; _POSITIONtext lglcolpasswd w/2-50 250 40 20; _POSITIONtext lcolIP 115 275 w/2-165 20; _POSITIONtext lglcolIP w/2-50 275 40 20; _POSITIONtext lcoltime 115 300 w/2-165 20; _POSITIONtext lglcoltime w/2-50 300 40 20; _POSITIONtext lcolnum 115 325 w/2-165 20; if (_GETcheck logp2)==1 then _SHOWtext lcolnum WINDOW_HIDDEN else nil; _POSITIONtext wftab w/2+5 155 90 20; _POSITIONtext wtab w/2+95 155 w/2-100 20; _POSITIONtext wlength w-50 180 40 20; _POSITIONtext wfcolname w/2+5 200 110 20; _POSITIONtext wcolname w/2+115 200 w/2-165 20; _POSITIONtext lgwcolname w-50 200 40 20; _POSITIONtext wfcolword w/2+5 225 110 20; _POSITIONtext wcolword w/2+115 225 w/2-165 20; _POSITIONtext lgwcolword w-50 225 40 20; _POSITIONtext wflist w/2+5 250 150 20; _POSITIONtext wlist w/2+5 270 w/2-10 h-280;; /*-----------------------*/ fun rflSetLg(a,b)= _SETtext lgwcolname _GETtext lglcolname;; /*-----------------------*/ fun IniEditor (filename)= let [620 480] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL filename "dms/db/regdb/regdb.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; _CRtext _channel editWin 5 5 85 20 ET_ALIGN_LEFT F_DBNAME; set dbname= _CReditLine _channel editWin 95 5 w-110 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 30 85 20 ET_ALIGN_LEFT F_DBLOGIN; set dblogin= _CReditLine _channel editWin 95 30 w-110 20 ET_DOWN|ET_AHSCROLL ""; _CRtext _channel editWin 5 55 110 20 ET_ALIGN_LEFT F_DBPASSW; set dbpassw= _CReditLine _channel editWin 115 55 w-130 20 ET_PASSWORD|ET_DOWN|ET_AHSCROLL ""; set logp2= _CRcheck _channel editWin 5 85 150 20 CH_RADIO F_LOGP2; set logp3= _CRcheck _channel editWin 5 110 150 20 CH_RADIO F_LOGP3; set fmaxlog= _CRtext _channel editWin 160 110 125 20 ET_ALIGN_LEFT F_MAXLOG; set maxlog= _CReditLine _channel editWin 290 110 45 20 ET_NUMBER|ET_DOWN "1000"; _CRtext _channel editWin 5 155 85 20 ET_ALIGN_LEFT F_LTABLE; set ltab= _CReditLine _channel editWin 90 155 w/2-95 20 ET_DOWN|ET_AHSCROLL strcat DFT_TABLE "1"; set llength= _CRtext _channel editWin w/2-50 180 40 20 ET_ALIGN_LEFT F_LENGTH; _CRtext _channel editWin 5 200 110 20 ET_ALIGN_LEFT F_LCOLNAME; set lcolname= _CReditLine _channel editWin 115 200 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lglcolname= _CReditLine _channel editWin w/2-50 200 40 20 ET_DOWN|ET_NUMBER DFT_LEN; _CRtext _channel editWin 5 225 110 20 ET_ALIGN_LEFT F_LCOLEMAIL; set lcolemail= _CReditLine _channel editWin 115 225 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lglcolemail= _CReditLine _channel editWin w/2-50 225 40 20 ET_DOWN|ET_NUMBER DFT_LEN; _CRtext _channel editWin 5 250 110 20 ET_ALIGN_LEFT F_LCOLPASSWD; set lcolpasswd= _CReditLine _channel editWin 115 250 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lglcolpasswd= _CReditLine _channel editWin w/2-50 250 40 20 ET_DOWN|ET_NUMBER DFT_LEN; _CRtext _channel editWin 5 275 110 20 ET_ALIGN_LEFT F_LCOLIP; set lcolIP= _CReditLine _channel editWin 115 275 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lglcolIP= _CRtext _channel editWin w/2-50 275 40 20 ET_DOWN DFT_LGIP; _CRtext _channel editWin 5 300 110 20 ET_ALIGN_LEFT F_LCOLTIME; set lcoltime= _CReditLine _channel editWin 115 300 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lglcoltime= _CRtext _channel editWin w/2-50 300 40 20 ET_DOWN DFT_LGTIME; set lfcolnum= _CRtext _channel editWin 5 325 110 20 ET_ALIGN_LEFT F_LCOLNUM; set lcolnum= _CReditLine _channel editWin 115 325 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set wftab= _CRtext _channel editWin w/2+5 155 90 20 ET_ALIGN_LEFT F_WTABLE; set wtab= _CReditLine _channel editWin w/2+95 155 w/2-100 20 ET_DOWN|ET_AHSCROLL strcat DFT_TABLE "2"; set wlength= _CRtext _channel editWin w-50 180 40 20 ET_ALIGN_LEFT F_LENGTH; set wfcolname= _CRtext _channel editWin w/2+5 200 110 20 ET_ALIGN_LEFT F_WCOLNAME; set wcolname= _CReditLine _channel editWin w/2+115 200 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lgwcolname= _CRtext _channel editWin w-50 200 40 20 ET_DOWN DFT_LEN; set wfcolword= _CRtext _channel editWin w/2+5 225 110 20 ET_ALIGN_LEFT F_WCOLWORD; set wcolword= _CReditLine _channel editWin w/2+115 225 w/2-165 20 ET_DOWN|ET_AHSCROLL ""; set lgwcolword= _CReditLine _channel editWin w-50 225 40 20 ET_DOWN|ET_NUMBER DFT_LEN; set wflist= _CRtext _channel editWin w/2+5 250 150 20 ET_ALIGN_LEFT F_WLIST; set wlist= _CReditText _channel editWin w/2+5 270 w/2-10 h-280 ET_DOWN|ET_HSCROLL|ET_VSCROLL ""; set savepwd= _CRcheck _channel editWin 5 350 100 20 0 F_SAVEPWD; _CBwinSize editWin @rflSizeEditWin 0; _CBcheck logp2 @rflChkP2 nil; _SETcheck logp2 1; _CBcheck logp3 @rflChkP3 nil; rflChkP2 nil nil 1; rflSetLg nil nil; _CBtext lglcolname @rflSetLg nil; _SETtextSize wlist DFT_LGWLIST; if filename==nil then nil else openDMI ed ); 0;;