[Building Sakai] Import available users from a file to Sakai

Steve Swinsburg s.swinsburg at lancaster.ac.uk
Wed May 13 05:09:39 PDT 2009


Hi Phuc,

Best to use the API. You can use the web services to iterate over a  
file and create user accounts.

I've attached a (crude) Perl script and a sample CSV file.





Replace data in users.csv with your own values. Add the proper values  
to the top of the Perl script ie for username, password and domain.  
Make sure you have web services enabled in Sakai. ie have this in  
sakai.properties for ~2.4-2.5:

webservices.allowlogin=true

And something like this for 2.6+:
webservices.allowlogin=true
webservices.log-allowed=true
webservices.log-denied=true
webservices.allow=localhost,127\.0\.0\.1,192\.168\.[0-9.]+,some\.domain 
\.ac\.uk,123\.45\.67\.890

where you add your own domain/IP addresses that you want to allow  
access to the webservices.allow line


cheers,
Steve

---
Steve Swinsburg
Portal Systems Developer
Centre for e-Science
Lancaster University
Lancaster
LA1 4YT

email: s.swinsburg at lancaster.ac.uk
phone: +44 (0) 1524 594870







On 13 May 2009, at 12:38, Phuc Bui wrote:

> Dear all,
> How can I create a list of user to Sakai with the data from a file.
> Can I insert data directly into database or I have to use Sakai API  
> or whether there is any tool or not ?
> I think the user’s data is store in 2 tables ‘sakai_user’ and  
> ‘sakai_user_id_map’ ?
> Thanks.
> Phuc Bui
> _______________________________________________
> 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"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090513/c9e7c18d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create-users.pl
Type: text/x-perl-script
Size: 1061 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090513/c9e7c18d/attachment.bin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090513/c9e7c18d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: users.csv
Type: application/octet-stream
Size: 395 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090513/c9e7c18d/attachment.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090513/c9e7c18d/attachment-0002.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2437 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090513/c9e7c18d/attachment-0001.bin 


More information about the sakai-dev mailing list