ns_register_proc GET /demo/time getTime
proc getTime {} {
set headers [ns_conn headers]
set browser [ns_set iget \$headers User-Agent]
set page < html> < body>
append page "Time: [clock seconds]
"
append page "Browser: $browser"
append page "< body>< /html>"
ns_return 200 text/html $page
}
ns_register_proc GET /time my_time
maps the procedure my_time to the URL /time on the AOLserverns_db 0or1row "select first_name, last_name from users where user_id=1"
queries the database for the first and lastname of User #1ns_schedule_proc 3600 hourlyCheck
calls the procedure "hourlyCheck" every hour
# main index page for notes. ad_page_contract { @author you @cvs-id $Id: permissions.html,v 1.7.2.1 2002/05/15 23:26:18 vinodk Exp $ } -properties { notes:multirow context_bar:onevalue create_p:onevalue } set package_id [ad_conn package_id] set user_id [ad_conn user_id] set context_bar [ad_context_bar] set create_p [ad_permission_p $package_id create] db_multirow notes notes { select note_id, owner_id, title, body, decode(acs_permission.permission_p(note_id, :user_id, 'write'), 't', 1, 'f', 0) as write_p, decode(acs_permission.permission_p(note_id, :user_id, 'admin'), 't', 1, 'f', 0) as admin_p, decode(acs_permission.permission_p(note_id, :user_id, 'delete'), 't', 1, 'f', 0) as delete_p from notes n, acs_objects o where n.note_id = o.object_id and o.context_id = :package_id and acs_permission.permission_p(note_id, :user_id, 'read') = 't' order by creation_date } ad_return_template
And respondingly in the .adp page:
if <@notes.write_p@ eq 1>
< a [email protected]_id@>@notes.title@< /a>
< /if>
< else<
@notes.title@
< /else>