Python Script for Creating Mass Users in ownCloud

Ask all your questions regarding OC 6.x Please read the Support Forum Rules
Forum rules
Before you post; make sure you are using at least PHP Version 5.3.x - Also read How To Solve Problems By Yourself

Python Script for Creating Mass Users in ownCloud

Postby osamak » Mon Mar 24, 2014 1:02 pm

Hello,

I noticed that there was only an old PHP script that was originally written for ownCloud 4.x, so I created a new Python script that was tested for ownCloud 6.x for creating a bulk of users from a comma-separated file. It imitates the browser, and does not deal directly with the database. It should be easy to use either as a standalone script, or by calling its createuser method from another Python script.

Hope someone will find it useful:
https://gitorious.org/osama-scripts/osa ... oc_user.py
osamak
Newbie
 
Posts: 1
Joined: Mon Mar 24, 2014 12:56 pm

Re: Python Script for Creating Mass Users in ownCloud

Postby PedroTx25 » Tue Apr 08, 2014 10:31 am

Great Job!!!! Thanks for sharing
PedroTx25
Newbie
 
Posts: 8
Joined: Mon Mar 31, 2014 4:55 pm
ownCloud version: 6.0.1
Webserver: Apache
Database: MySQL
OS: Linux

Re: Python Script for Creating Mass Users in ownCloud

Postby PedroTx25 » Tue Apr 08, 2014 11:54 am

Hi there,

I'm trying without success to run your script on my test-drive installation of owncloud. The system is up and running, can do the user management so no problems on onwcloud configuration side.

I'm a newbie in python and somehow I though that would be just a question of
to create the "createuser_page.text" ,
move the script to .\owncloud,
set the right parameters on line 62 and then
run this on the bash "python create_oc_user.py"

Well, its not and it triggers error on Line 16 (import request). Sure is something I was supposed to do and I didnt.

Would be much appreciated for some guidance on this.
Thanks in advance
PedroTx25
Newbie
 
Posts: 8
Joined: Mon Mar 31, 2014 4:55 pm
ownCloud version: 6.0.1
Webserver: Apache
Database: MySQL
OS: Linux

Re: Python Script for Creating Mass Users in ownCloud

Postby RandolphCarter » Tue Apr 08, 2014 9:35 pm

Most probably a python package you need to install. Usually those are named something with python and something similar to what comes after the "import". In case you're using Ubuntu, it's probably the "python-requests" package you need to install.
RandolphCarter
Inventory
 
Posts: 3933
Joined: Wed May 30, 2012 7:42 am
ownCloud version: 6.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x


Return to ownCloud Community Edition 6.x

Who is online

Users browsing this forum: AlanMcCright, brantje and 13 guests