Author Topic: Access to Zentyal API via PHP  (Read 2622 times)

ap1821

  • Zen Monk
  • **
  • Posts: 72
  • Karma: +4/-0
    • View Profile
Access to Zentyal API via PHP
« on: September 24, 2013, 09:55:51 am »
Hi. I have custom made PHP application to add new users, currently I'm typing them by hand into the Zentyal administration panel. It would be awesome and time-saving to automatically add them into the Zentyal server. I'm not familiar to perl, but probably would manage to write a tiny script based on what can be found on the internet. The problem would be launching that perl script (which uses zentyal api) with passed parameters (userame, password, name, surname) from PHP. Maybe anyone has done something like that?
Thanks in advance!

Marcus

  • Forum Moderator
  • Zen Samurai
  • *****
  • Posts: 395
  • Karma: +12/-0
    • View Profile
    • Professional IT Service
Re: Access to Zentyal API via PHP
« Reply #1 on: December 08, 2013, 10:23:59 pm »
Hello ap1821,

This HowTo should get you happy:
http://trac.zentyal.org/wiki/Documentation/Community/HowTo/ImportUsersInBulk

And to give you a little bit more, I'm mostly using exec in order to perform shell cmd.

i.e.
Code: [Select]
<?php
// Will echo the Apache user
echo exec('whoami');
?>

Happy hacking

Marcus