The requested page has been restricted to Members Only
<# restrict access to members using /members/auth; #>
<form action="sign-in?restricted_page=<#[url.restricted_page as html]#>" method="post" class="form-horizontal"> <div class="form-group"> <label for="username" class="col-sm-2 control-label">Username</label> <div class="col-sm-5"> <input type="text" name="username" required class="form-control" id="username"> </div> </div> <div class="form-group"> <label for="password" class="col-sm-2 control-label">Password</label> <div class="col-sm-5"> <input type="password" name="password" required class="form-control" id="password"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-5"> <input type="submit" class="btn btn-primary" value="Sign In"> </div> </div> </form>
<#: look up the member ID so it can salt the password for hashing :#> <# start list for members; include when username is "<#[post.username]#>"; #> <# set member.id to "<# id #>"; #> <# end list #> <# start list for members; include when username is "<#[post.username]#>" and password is "<#[post.password as hash salted by member.id]#>"; relate id to group_memberships.member_id; relate group_memberships.group_id to groups.id; #> <# start header #> <# set session.username to "<#[post.username]#>"; #> <# grant access to members; #> <# end header #> <# start row #> <# grant access to <# groups.name #>; #> <# end row #> <# start footer #> <# redirect to "<#[url.restricted_page]#>"; #> <# end footer #> <# start no results #> <# redirect to "/members/auth?message=invalid&restricted_page=<#[url.restricted_page as url]#>"; #> <# end no results #> <# end list #>
The Members Mini-App uses the Hashtag Markup Language to demonstrate a user authentication process for #WebApps.
Member, Group, and Group Membership records are all stored in an SQL Database. Methods are provided to create, update, and delete all of these records.
Members Only pages restrict access based on group membership.