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

well you should look for better info on this :slight_smile:


Seems like NULL works for it, either that or you can also just ignore the collumn completely in the insert and the autoincrement will do +1.

One more question, where is the contacts database located? So I can add contacts through a script instead of the application.

tables with phonebook word in it, there are several tables


Ok, seems like I should insert the contact-information into playsms_featurePhonebook. Not the group phonebook, as the contacts will automatically be part of the groups with the generated grouptags I’ll have in my script.

EDIT: checked through the columns of the user table again, what is the token out of curiousity?

Cheers again!

token is webservices token, take a look at user configuration, from web


And what significance would this have when I insert the info into the database? Would it be automatically generated? (Presuming I ignore that specific column in the insert)

no need to fill it


Hey again,

How do you change the language of the service?

I’ve changed it on a test-user to another language (under user preferences) and the language of the interface didnt actually change.

I double checked in the database to check if the change was actually written, and it was.

Also before I googled how to add more languages for the service I simply copied the en_US folder to another language I’ll eventually translate to, how do I actually add this to the dropdown menu? Where is this information stored? (this is not the language I tested it on, as that would obviously still show english)

Ive successfully gotten the data from the AD to csv then written for csv to the mysql database through a php script.

I’m now in the process of manually adding the groupnames of the users in the playsms service.

Some of the groupnames however has special chars (æøå/ÆØÅ) which works when I write to the database. It does not however work when I try to add a group with one of those characters in the service itself (Group name supports the chars, the group code does not). Would it work to manually add these groups through queries with the info, or is this something I’ll have to find another way to work around?

EDIT: When I actually write this to the user database (I’ve currently only written to a test-database), would it actually “translate” itself from for example @AØE to @AE? Cause the database will show @AØE, but if i try to add one named that in the create group function itll change to @AE.

EDIT2: Is this a choice on your end? Is the group-code table/column not supporting special chars intentionally? If so, is there an easy way to change that? (I’m home for the weekend at the moment so I’m unable to check it)

Group code did sanitized by using core_sanitize_alphanumeric()


Alright, cool, so the core_sanitize_alphanumeric just removes all letters and signs that arent “normal”. So I presume if I simply remove the core_sanitize part itll work just fine.


it will accept your group code whatever characters it contained, try it, whether its working on SMS (when using #groupcode) or search on compose message on web, or viewing on phonebook

if all good I suppose I will just remove it as I have no bases on deciding to sanitize with alphanumeric (or at least I forgot why)


Cool, I’ll give you feedback as soon as I’ve gotten to test it!

Commenting out line 700 didn’t seem to fix it, I’m still not able to use æøå/ÆØÅ or any special characters like _ for example. Anywhere else you think you might do more sanitizing?

One question regarding adding contacts through script, I can see that the groups arent actually listed in playsms_featurePhonebook, but in playsms_featurePhonebook_group_contacts, and in contacts theres gids instead of the actual group names. What’s the easiest way for me to add the contacts with groups added to them? Where does the groupname to gid actually happen? I guess the easiest way for me to do this would be to use the php script that you wrote for the add contacts through csv and do the edits I need on that? (Whats the name of this script?)

its simple SQL, you may want to ask in PHP or MySQL forum instead

contacts in playsms_featurePhonebook
groups in playsms_featurePhonebook_group
contacts belongs to groups in playsms_featurePhonebook_group_contacts


Alright, will do.

About the character sanitizing in the footer for user groups/contact groups, you know of anywhere else you do this, related to groups obviously?

sorry, which one are we talking about ?

line 700 ? you meant 200 ?
footer ? which footer ?


I have no idea why I said 700, yes I meant 200.

footer = groupcode, my bad. @GROUPNAME

To give you an example, theres two schools in the county that has fairly similar names, one is named Øberg and the other one is named Berg, if the Ø gets removed they both get named @BERG code wise, which is the main reason this is a big issue.

you meant #groupcode. ic, so that one didn’t work. lemme check.


I think this one:

try to remove core_sanitize_alphanumeric() on that line