Forum OpenACS Q&A: Response to Survey, who needs help customizing OpenACS 3.2.4?

Don't want the thread to wander too far from the topic, but maybe these will be useful for someone to avoid re-creating the wheel.

I did an implementation similar to what Phil is describing.  For a home page, I replaced the <index.tcl> file with an <index.adp> file at the top level of the ACS tree -- an HTML file would also work fine, but I hacked it with a login link that, once logged in, shows a user name instead of the login graphic:

<%

set user_id [ad_get_user_id]

set db [ns_db gethandle]

if { $user_id != 0 } {

        set user_name [database_to_tcl_string $db "select first_names || ' ' || last_name as name from users where user_id = $user_id and user_state <> 'deleted'"]

        ns_puts "<P ALIGN=Center> <A href="/pvt/home"><BIG><B><font color="#0000c0">$user_name</A>

        "

        } else {

        ns_puts "<P ALIGN=Center> <A href="/register"><IMG src="graphics/sign-in.jpg" width="137" height="30"  alt="Sign In" align="middle"></A>

        "

}

%>

I also put a call to:

# Intranet security added by RF, 20000925

set user_id [ad_verify_and_get_user_id]

ad_maybe_redirect_for_registration

at the top of each level (bboard, etc.) to redirect folks if they hadn't logged in.  The top level of the site is on the web, but the contents aren't visible unless one is a member.

The third minor mod I made was to add a grep function to the sign-in (/register/to allow members of my organization to create their own accounts as long as they have an email address at my company:

# user-new.tcl,v 3.0.4.1 2000/03/15 17:24:38 jsalz Exp

#

# user-new.tcl

#

# presents a registration form to a new user

#

set_the_usual_form_variables

# email, return_url, maybe password

# Hack for titan added by RF, 20000924

if {![regexp (.+)titan.com $email] } {

    ns_returnredirect "index.tcl"

    return
}

Unless a requester is from mycompany.com, they just keep getting thrown back to the login prompt.