[Building Sakai] Fwd: Changing user status to inactive

Diego del Blanco Orobitg diego.delblanco.sakai at gmail.com
Wed May 15 01:34:26 PDT 2013


You can use this, put this in sakaiScript.jws where status is true if you
want to active and false to inactive. YOU will need the list of users and
call this ina loop.

public String changeActiveStatusForAMemberFromSite(String sessionid, String
siteid, String eid, Boolean status) throws AxisFault {

    Session session = establishSession(sessionid);
    try {
        Site site = siteService.getSite(siteid);
String userid = userDirectoryService.getUserByEid(eid).getId();
 Member member=site.getMember(userid);
member.setActive(status);
siteService.save(site);
    } catch (Exception e) {
    LOG.error("WS changeActiveStatusFormAMemberFromSite(): " +
e.getClass().getName() + " : " + e.getMessage());
        return e.getClass().getName() + " : " + e.getMessage();
    }
    return "success";
}




2013/5/14 Omer A Piperdi <omer at rice.edu>

> Hi,
>
> We have a site which has about 3500 members that we want to switch to
> inactive. Is there a Web Service function to do that (not
> removeMemberFromSite, just flipping to inactive)? Or deleting them from
> sakai_site_user table would work? Any suggestion.
>
> Thanks
> Omer
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>



-- 
Diego del Blanco Orobitg
Tutormedia IT & Training Manager
Apereo LATAM Representative



-- 
Diego del Blanco Orobitg
Tutormedia IT & Training Manager
Apereo LATAM Representative
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130515/235332e9/attachment.html 


More information about the sakai-dev mailing list