maltes
committed
on 01 Jun 05
Added application and application data linking functionality written by Timo. This allows you to link packages together (e.g. project-manageā€¦ Show more
Added application and application data linking functionality written by Timo. This allows you to link packages together (e.g. project-manager and logger) or data of packages (e.g. a project and a file-storage folder)

Show less

/tcl/membership-rel-procs.tcl (+13 -2)
19 19                 "approved" { db_exec_plsql approve {} }
20 20                 "banned" { db_exec_plsql ban {} }
21 21                 "rejected" { db_exec_plsql reject {} }
22 22                 "deleted" { db_exec_plsql delete {} }
23 23                 "needs approval" { db_exec_plsql unapprove {} }
24 24             }
25 25
26 26             # Record who changed the state
27 27             # This will trigger an update of the acs_objects.modified_date column.
28 28             # We use this in the ApprovalExpiration feature to make sure that a user isn't
29 29             # bumped back to needs_approval right after an administrator has approved them,
30 30             # even if the user doesn't log in in the meantime.
31 31
32 32             if { [ad_conn isconnected] } {
33 33                 set user_id [ad_conn user_id]
34 34             } else {
35 35                 set user_id [db_null]
36 36             }
37 37             db_dml update_modifying_user {}
38 38         }
39           acs_user::flush_cache -user_id $user_id
  39
  40         set rel_user_id [db_string select_rel_user_id {
  41             select u.user_id
  42             from   acs_rels r,
  43                    users u
  44             where  r.rel_id = :rel_id
  45             and    u.user_id = r.object_id_two
  46         } -default {}]
  47
  48         if { ![empty_string_p $rel_user_id] } {
  49             acs_user::flush_cache -user_id $rel_user_id
40 50         }
  51     }
41 52
42 53     ad_proc -public approve {
43 54         {-rel_id:required}
44 55     } {
45 56         Approve a membership relation
46 57     } {
47 58         change_state -rel_id $rel_id -state "approved"
48 59     }
49 60
50 61     ad_proc -public ban {
51 62         {-rel_id:required}
52 63     } {
53 64         Ban a membership relation
54 65     } {
55 66         change_state -rel_id $rel_id -state "banned"
56 67     }
57 68
58 69     ad_proc -public reject {
59 70         {-rel_id:required}
60 71     } {