Home
The Toolkit for Online Communities
17478 Community Members, 0 members online, 1956 visitors today
Log In Register
OpenACS Home : Forums : .LRN Q&A : "Unarchives a community. ** not done yet **" : One Message

Forum .LRN Q&A: Re: "Unarchives a community. ** not done yet **"

Collapse
Posted by Cato Kolås on
The following code seems to work (notice the rel_segments_grant_permission as its also needed):

ad_proc -public unarchive {
    {-community_id:required}
} {
    Unarchives a community.
} {
  #error
  #ad_script_abort
  db_dml update_archive_p {}
  rel_segments_grant_permission -community_id $community_id
}

FYI: Just an addendum (found that some more code is need to complete it - I hope :)

dotlrn/tcl/community-procs.tcl:

ad_proc -public unarchive {
    {-community_id:required}
} {
  Unarchives a community.
} {
        db_dml update_archive_p {}

    rel_segments_grant_permission -community_id $community_id

    # Must also execute AddUserToCommunity
    foreach user [list_users $community_id] {
        set user_id [ns_set get $user user_id]
        applets_dispatch \
        -community_id $community_id \
        -op AddUserToCommunity \
        -list_args [list $community_id $user_id]
    }
}