[Building Sakai] Deleting Users From A Course

Nkululeko Phakela nonkululeko.phakela at wits.ac.za
Thu Jul 14 04:01:21 PDT 2011


Hi David,

Thank you for the response. I will try that and see how it works out. 

Regards,
Nguni


On Thu, 2011-07-14 at 12:59 +0200, David Horwitz wrote:
> It looks right with one possible error: site.removeUser takes the user's 
> internal id not their enterprise id. So you may need to do
> 
> String userId  = userDirectoryService.getUserId(studentNumber);
> 
> That is if student number is your campus id and not the internal id.
> 
> Regards
> 
> David
> 
> On 07/14/2011 12:53 PM, Nkululeko Phakela wrote:
> > Hi All,
> >
> > I am trying to delete users from the course. Would this be correct or am
> > I on the wrong path. Your help is greatly appreciated!
> >
> > 	for (String studentNumber : studentNumbers) {
> >              // remove student from site
> > 	    site.removeMember(studentNumber);
> >
> >              //save site
> >              try {
> >                  siteService.save(site);
> >              } catch (IdUnusedException ex) {
> >                  ex.printStackTrace();
> >                  return false;
> >              } catch (PermissionException ex) {
> >                  ex.printStackTrace();
> >                  return false;
> >              }
> >          }
> >
> > Regards,
> > Nguni
> > <html><p><font face = "verdana" size = "0.8" color = "navy">This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorized signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.</font></p></html>
> >
> > _______________________________________________
> > 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"
> _______________________________________________
> 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"

<html><p><font face = "verdana" size = "0.8" color = "navy">This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorized signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.</font></p></html>



More information about the sakai-dev mailing list