PlaySMS and integrating users from an AD, adding contacts through .csv and group management

Hey there!

I’m working on a project regarding getting contacts from another Windows Based server through its AD.

The task at hand is to extract teachers’ information using their mail, name and the password they use for their school-system. That way the teachers won’t have to register at all and will be able to login with the information they’re used to.

The students’ info isnt as accurate so we probably won’t fetch that straight from the AD, the students won’t have users either, they’re only to be added through as contacts in the phonebook. (I’ve seen it’s possible to send to contacts through a .csv file, is it possible to add contacts this way as well? Cause this would be a good way to solve the student side of things.

Group wise we’ll have administrators (aka the IT-department), the teachers, the entire school network, the specific schools as well as the specific classes. This way the teachers can contact whoever they want in the network. (We manage all public schools in our area, hence why we’ll add several schools.) Regarding this, say we add all the teachers as one group, then the specific classes, is it then possible to make groups of those groups. Say for example add class A, B, C and D as groups, can I then make a larger group by adding those together, basically making a group out of several groups?

Summarized:

  • I want to add teachers as USERS from a windows-based server through Active Directory (AD)
  • I want to add CONTACTS through comma-separated .csv-files
  • I want to make smaller groups of contacts and users to then make larger groups of those groups

Please let me know what of this is possible, specially the user part of things (aka the interaction with AD) and if you know: how to do it.

Cheers for help,
Robin

Hi,

Let me answer your question quickly:

I want to add teachers as USERS from a windows-based server through Active Directory (AD)

this can be done using a script, but I dont know how to make it, so googling, probably you’ll found somewhere how to do it

I want to add CONTACTS through comma-separated .csv-files

this can be done from phonebook menu, theres an import from csv

I want to make smaller groups of contacts and users to then make larger groups of those groups

this cannot be done exactly like that, but you can add a user to 2 groups, the smaller group and larger group

anton

Thanks for the quick answer!

Since you wrote that you don’t know how to write the script I presume you have no experience with using PlaySMS with AD? Cause if you got any suggestions regarding that, it’d make my googling for further details considerably easier.

Cheers,
Robin

yes, I never work with AD before

anton

Do you know of anyone that has similar projects? Maybe I can contact that person specifically. This project can’t possibly be the first that attempts this. Quick googling hasnt given me any results yet, cheers for any further help.

do you need to be “always in sync” between AD and playSMS, or you can just export it manually and re-format the export (using something we can build) and upload it to playSMS ?

anton

Well we’d prefer it to be relatively automated through a script or so, maybe like once a day, once a week, something along those lines. Looked a bit further into it, found something called LDAP Synchronization Connector (LSC) which seemingly syncs between an AD and for example a database.

The script will obviously need to limit down the information to fit the PlaySMS format, but that shouldnt be too much of a problem.

if you can find someone (or your self) to export the users into a file (regardless of the original format), then thats something I can help further, before that nothing I can say more

anton

Giving you the users in a file-format like that is easier said than done as AD is not easely translated to that. I’ll try to use a ldapimport plugin for playsms that will hopefully work. (http://bartik.wikidot.com/playsms:ldapimport) it says its compatible with version 0.9.5.2, 0.9.5.3, hopefully it’ll work for 1.0 as well.

I didnt have time to test properly before the end of the day, as far as I could see it didnt pop up in the plugin menu though, so doubt it works in 1.0. I’m fairly sure I put the files in the correct folder (directly into the plugin folder).

I can see on http://playsms.org/sponsorships/ that you want to support ldap directly, I presume none has started/sponsored it yet?

yes, currently no one ask for it

to be exact the wanted feature is about updating auth-backend engine (which is currently only lookup to internal DB table) and example implementation such as with LDAP backend

anton

Hey again!

I’m testing to add contacts through .csv files and have a small problem.

When I add contacts through the file, the groupcode defined does not show up. Which is important, due to it defining the class the student is in, as well as contacts/groups showing up for all users.

EDIT: Small thing: is it possible to share message templates with all users? Cause as far as I see, its personalized.

what do you mean by “does not show up” ?

anton

I figured it out, I thought it would automatically create a group for some reason, thinking back on it that would make no sense as access to whether or not a user sees the specfic group or not would be defined there. After I made the test group it worked out fine.

One thing though: is it possible to get users to show up in the phonebook? As far as I can see it only shows contacts, and not users.

I see you want to include users (as in accounts in playSMS) in phonebook ? Unfortunately that is not available right now

anton

Ok, so if teachers for example would want to send sms to another user they’d have to add that teacher manually then (as a contact)? Fair enough.

Regarding getting the user-info from AD: when inserting the user-info into the playsms_tblUser, which values are actually vital? Some are a given, while others arent. Presume ID for example would crash stuff if several users has the same ID. While address is an example of something that isnt vital. Is there an overview of what the different collumns actually mean?

When looking through the collumn name I noticed fwd_to_mobile, I presume this means that a user will get notified on their cellphone number along with their email and their inbox (presuming fwd_to_mail and fwd_to_inbox is 1 of course) ?

EDIT: Is it possible to add a contact into several groups from a csv-file? Comma-separated obviously won’t work as that will translate into the next value (the tags)

EDIT2: Is there a plugin/script for transferring csv files into the playsms database? Or is that something I’ll have to write some scratch.

Actually a user need to add a mobile phone which is belongs to another user to be able to send message to that other user

This “buddy” system is my early work, its a mess :slight_smile: suggestion welcomed

anton

Guessing the easiest fix on your end would be to have the ability to add users to the phonebook. How you’d implement that I dont know, as I haven’t really studied the code at all.

Regarding my others questions, could you please answer them?

ok, here it is:

Regarding getting the user-info from AD: when inserting the user-info
into the playsms_tblUser, which values are actually vital? Some are a
given, while others arent. Presume ID for example would crash stuff if
several users has the same ID. While address is an example of something
that isnt vital. Is there an overview of what the different collumns
actually mean?

ID is autoincrement, so dont touch it. username, password, mobile and email are mandatory, username, mobile and email must be unique

When looking through the collumn name I noticed fwd_to_mobile, I presume
this means that a user will get notified on their cellphone number
along with their email and their inbox (presuming fwd_to_mail and
fwd_to_inbox is 1 of course) ?

yes

EDIT: Is it possible to add a contact into several groups from a
csv-file? Comma-separated obviously won’t work as that will translate
into the next value (the tags)

no, this is not possible at the moment

EDIT2: Is there a plugin/script for transferring csv files into the
playsms database? Or is that something I’ll have to write some scratch.

this is also not available, so you need write it your self

anton

Cheers for the answers, regarding the autoincrement on the ID, I’m a bit rusty with sql statements, with the INSERT-statement would I leave the uid empty like ( … , ’ ’ , … ). ’ ’ meaning the uid value? Or would it be completely empty like (… , , … ). (Or, I presume not, as that would add a value: (… , ‘NULL’, …) )?