w3Admin.w3User.form

subroutine w3Admin.w3User.form(users, messages)

*************************************************************************

* w3Admin.w3User.form: Display the specified user entries

*

* Users: data to be displayed, one user per attribute

*   a1 = user file item-id

*   a2 = User name

*   a3 = groups   (multi-value)

*   a4 = password (already encrypted)

* messages: any messages to display. Each attribute is it's owm message

*

**************************************************************************

* [00] 06feb01 cnguyen initial creation

*

include wbp w3Include

include bp w3Admin.Include

status = ""

call w3Admin.Housekeeping(status)

call w3HtmlInit(w3Admin.background, "")

subs = ""

subs<-1> = "##TITLE##":@vm:"FlashCONNECT User Maintenance"

subs<-1> = "#HEADLINE#":@vm:"FlashCONNECT User Maintenance"

call w3HtmlHeader("", subs)

call w3HtmlInsertSection("w3User", "", "head")

** Insert Messages

msgs = dcount(messages, @am)

if msgs > 0 then

    call w3HtmlInsertSection("w3User", "", "Messages.start")

    for i = 1 to msgs

         text = trim(messages<i>)

         if text # "" then

              subs = "#text#":@vm:messages<i>

              call w3HtmlInsertSection("w3User", subs, "Messages.text")

         end

    next i

    call w3HtmlInsertSection("w3User", "", "Messages.end")

end

call w3HtmlFormBeg(w3_NP, "w3Admin")

** get group's ids and descriptions

open "w3groups" to f.w3groups else exit

 

groupId   = ""

groupDesc = ""

dummy1    = ""

dummy2    = ""

call w3Admin.w3Groups.GetInfo(groupId, groupDesc, dummy1, dummy2)

cntGroupId = dcount(groupId, @am)

** Start data table

call w3HtmlInsertSection("w3User", "", "table.head")

rows = dcount(users<1>, @vm)

ids=""

for i = 1 to rows

    ids<-1> = users<1, i>        ;*userid's

    subs = ""

    subs<-1> = "#NAME#":@vm:users<2, i>

    subs<-1> = "#USERID#":@vm:users<1, i>

    subs<-1> = "#PASSWORD#":@vm:users<4,i>

    subs<-1> = "#ID#":@vm:users<1, i>

    subs<-1> =  "#ROW#":@vm:i

    call w3HtmlInsertSection("w3user", subs, "table.detail1")

** build ingroups and notingroups for current user

    numGroups = dcount(users<3, i>, @svm)

    notInId = groupId

    notInDesc = groupDesc

    inId=""

    inDesc=""

    for j = 1 to numGroups

        locate(users<3, i, j>,notInId;loc) then

           inId<-1> = notInId<loc>

           inDesc<-1> = notInDesc<loc>

           notInId = delete(notInId,loc)

           notInDesc = delete(notInDesc,loc)

        end

    next j

   call w3HtmlSelect("MEMBER":i, inId, inDesc,"","","MULTIPLE SIZE=2","")

   call w3HtmlInsertSection("w3user","","table.detail2")

   call w3HtmlSelect("NONMEMBER":i, notInId, notInDesc,"","","MULTIPLE SIZE=2","")

next i

subs = "#ROW#":@vm: rows+1

call w3HtmlInsertSection("w3User", subs, "table.add")

convert @am to "~" in ids

subs =""

subs<-1> = "#IDS#":@vm:ids

call w3HtmlSelect("ADDGROUP", groupId, groupDesc,"","","MULTIPLE SIZE=3","")

call w3HtmlInsertSection("w3User", subs, "table.end")

call w3HtmlFormEnd

call w3HtmlInsertSection("w3User", subs, "foot")

Action = ""

call w3Action(Action, "")

subs = "#ACTION#":@vm:Action

call w3HtmlFooter("", subs)

return