LOGINTEST.A5W

Purpose

Pages that require a login use A5W_INCLUDE() to add LOGINTEST.A5W. This page determines the user's identity and access level rights.

Description

LOGINTEST.A5W contains Xbasic code only. Pages that require a login include LOGINTEST.A5W. LOGINTEST.A5W takes the value in the session cookie login and parses out three possible values: loginid, logintype, and loginlevel. If it does find acceptible values, LOGINTEST.A5W redirects users to the LOGIN.A5W page.

loginid and logintype have character values. loginlevel is numeric.

Note : Do not open this page in the WYSIWYG tab of the HTML Editor and then save it. This will result in the loss of Xbasic code, which the underlying Microsoft ActiveX control does not properly support.

Links

The AWSCUSTDET.A5W, ASWCUSTOMERS.A5W, ASWCUSTONE.A5W, ASWINDEX.A5W, ASWINVOICES.A5W, ASWMAINT.A5W, ASWPRINTRPT.A5W, ASWPROCESSING.A5W, ASWPRODONE.A5W, ASWPRODUCTS.A5W, ASWSALESHIST.A5W, ASWSEARCH.A5W, ASWSENDEMAIL.A5W, ASWSPECLIST.A5W, ASWUSERLIST.A5W, ASWUSERONE.A5W, ASWVENDORS.A5W, CUSTOMER.A5W, SALESHIST.A5W, TEMPLATEINT.A5W, and USERINFO.A5W pages call the LOGINTEST.A5W page.

Edits to the Page Source

First, the page script clears existing values.

loginid = ""

logintype = ""

loginlevel = 1 ' all users, public and internal, have a minimum level of 1

Then, if it finds that the session cookie login does not exist, is NULL, or is incorrectly formatted, the code redirects to LOGIN.A5W.

if eval_valid("login") = .F.

    response.redirect("login.a5w")

    end

elseif login = "" ' cookie set, but no value returned

    response.redirect("login.a5w")

    end

elseif occurs("|",login) <> 2 ' cookie set, but formatted incorrectly

    response.redirect("login.a5w")

    end

end if

These variable values are now available to the page that includes this code.

loginid = word(login,1,"|") 'character

logintype = word(login,2,"|") 'character

loginlevel = val(word(login,3,"|")) 'numeric

Finally, the code sets the session variable for components that need a security level.

session.__protected__SecurityLevel = loginlevel

See Also

Web Pages

Supported By

Alpha Five Version 7 and Above