ad_verify_and_get_user_id

one of the documented procedures in this installation of the ACS
Usage:
ad_verify_and_get_user_id { -secure f } { db "" }
What it does:
Returns the current user's ID, verifying its validity (or returning 0 if unable to do so).
Defined in: /web/philip/packages/acs-core/security-procs.tcl

Source code:

arg_parser_for_ad_verify_and_get_user_id $args

    if { ![ad_validate_security_info -secure $secure] } {
	return 0
    } else {
        set user_id [ad_get_user_id]
	# check if the user is registered
	if { $user_id==0 } { 
	    # is user is not registered return 0
	    return 0
	}
        set release_db 0
        if { [empty_string_p $db] } {
            set db [ns_db gethandle log]
            set release_db 1
        }
        if { [string compare [database_to_tcl_string $db "select user_state from users where user_id = $user_id"] authorized] } {
            ad_returnredirect "/global/banned"
            return
        }
    }
    if { $release_db } {
        ns_db releasehandle $db
    }
    return $user_id



philg@mit.edu