subsite::sweep_expired_approvals (private)

 subsite::sweep_expired_approvals -days days

Defined in packages/acs-subsite/tcl/approval-expiration-procs.tcl

Sweep for expired approvals and bump them to the 'needs approval' state.

Switches:
-days
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 acs_user::change_state acs_user::change_state (public) db_list db_list (public) subsite::sweep_expired_approvals subsite::sweep_expired_approvals subsite::sweep_expired_approvals->acs_user::change_state subsite::sweep_expired_approvals->db_list

Testcases:
No testcase defined.
Source code:
    # We don't have a transaction, because it shouldn't cause any harm if we only get halfway through

    # Find the expired users
    set expired_user_ids [db_list select_expired_user_ids {}]

    foreach user_id $expired_user_ids {
        # Bump the state
        acs_user::change_state -user_id $user_id -state "needs approval"

        # We could've sent an email to the user, but we don't
    }
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="subsite::sweep_expired_approvals.select_expired_user_ids">
    <querytext>
        select u.user_id
        from   cc_users u,
               acs_objects relo
        where  relo.object_id = u.rel_id
        and    u.last_visit < current_timestamp - interval :days day
        and    relo.last_modified < current_timestamp - interval :days day
        and    u.member_state = 'approved'
    </querytext>
</fullquery>
packages/acs-subsite/tcl/approval-expiration-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: