Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

ldap fields physicalDeliveryOfficeName

I wanted to know if there is a mod of osTicket which allows auto fill
additional fields taken from AD.

In particular, I would "physicalDeliveryOfficeName "



  • There is no way to do that currently in the ui/plugin.
    However @Chefkeks posted about how they do it a couple times here on the forums.  They export and import the information nightly iirc using cron and custom scripts.
  • edited July 2015
    Ntozier is correct.

    We sync ldap attributes every night from ldap to osTicket.
    You can find our script here:

    Let me know if it works out for you ;)

  • I installed the "mod " but the information
    " is not auto filled

  • I know there is not really a manual, but you need to configure the addon, before it works.

    Trying to add a quick manual when I found some time ;)
  • I opened the page "config_ui.php" and I set all the parameters , I associated the parameter "office" (which I created in the user details ) with physicalDeliveryOfficeName.

    When I insert the user only the fields name , email and telephone are auto filled

  • edited July 2015

    I opened the page
    "config_ui.php" and I set all the parameters , I associated the
    parameter "office" (which I created in the user details ) with 



    Then everything should be
    done. The script works completely independent and is not related to osTicket's
    "create new user" mechanism. We run it as cronjob and it updates the
    database directly - that's why the database credentials are needed in the
    config_ui page ;)


    If I had not mentioned yet or
    you have not read it over at github:

    PLEASE make a clone of your osTicket
    installation and try with the clone, instead of your real/live system!




    Now do the following to test
    the script - Set the Debug to ON to see detailed log on the screen:





    And the hit the "Execute update and send logfile

    (To configure email you'll need to edit the smtp.php
    file - not implemented in the interface yet)


    If everything is the working correctly you shall see
    that the script is going thru all your osTicket agent and users and will update
    the missing info by inserting it directly to the database. When everything is
    running smoothly you can create a cronjob / scheduled task for the script, e.g.

    /usr/bin/php /srv/www/htdocs/ticket/addons/ldap_user_info/cron.php


    Let me know how it works out for you ;)

  • I config it on a test osticket installation.

    this is my "config_ui.php" page, when i click on "Execute Update and send logfile" nothing happen
  • Hmmm :(

    Did you check your PHP error log?
  • no, i don't have config smtp
  • PHP error log has nothing to do with the SMTP.php file. So please check your PHP error log ;)

    Beside, can you provide more info about your osTicket version, used database software/version and PHP version so I can better assist you?

  • osTicket vers:

    PHP: 5.5

    MySQL: 5.5

    SO: Windows Server 2008 R2

    No error, simply nothing happen when i click "Execute Update and send logfile" 

  • edited July 2015
    Ok, so all I can say is that we never tested the script under IIS - since we're using linux+apache - but mysql and php version shall work since we've been using 5.5 versions for a long time and never had any issues. 

    Unfortunately even though it's my own script and not related to official osTicket I do not have any idea what's going wrong :(

    Really sorry about that.
  • ok thanks :(
  • @keep .i had issues with it and in the end i got it working.
    I would check the config.php file as a few of the changes that are written to that file from the config_ui.php were not written properly
    one example is the file to logpath .
    php translates backslashes as special characters and you need to escape them .
    my file path has to be written out like this
    public $logpath = "c:\\xampp\\apache\\logs\\"; 

  • While a cron job will update this it doesn't truly "fix" what the real issue is. Ideally the LDAP plugin would just allow and open number of filters to be added and the LDAP search would simply just search those values. It has been a while since i have been on these forums but I am in the process of installing a new OSticket at a new place of employment so I will be delving back into OSticket and modding it shortly. 

    In addition if LDAP is an option for you more often than not SSO or auto auth is also an option for you. I have not used the latest and greatest version of OSTicket but there was always a challenge when enterprise users were to look into OSticket as their needs differed from those who are independent or smaller companies. 

    For example: If I am servicing external clients AD or LDAP is not the Auth method I would need or want for OSticket. As a result I would never use it. In an enterprise option not only would LDAP be my preferred method but I'd also want the option to disable alternative methods of authentication form the system. With a few changes to the core code in OSticket both scenarios can or could be accommodated.

    Right now, unless something has changed in a BIG way, is to do the following:

    1. You must unpack and manually edit the LDAP plugin to include all fields you wish to pull from AD
    2. You must Mod the various new ticket screens to pull the AD values and populate them
    3.  For true SSO with AD you must also mod the login page and force a new account to be created if a user is not added to the DB of users but only after a check is done against AD. If memory serves this code or concept already exists when a user emails in a ticket...but I might be wrong.

    So the checks are:

    1. On login page read the users LDAP auth ticket/token
    if User is there check user name in OSticket DB and authenticate to next screen using that userID
    else if user is not there read user ID
    create UserID
    redirect user back to Login page and user will auth to OSticket going forward

    2. On the new ticket page:
    read users LDAP ID
    set all LDAP filters you wish to read
    ensure the new ticket page you are on has the needed variables associated with the fields for the LDAP var pulls
    That will auto populate the ticket details dynamically.

    *this is key particularly in changing offices. This will allow for a dynamic profile of sorts for your employees. This means that for the IT dept that AD must be kept up-to-date 100% of the time.

    In a few months time once I figure out what the newest version of OSTicket has or doesn't have I will post some of my mods again. Love this system and I am always happy to contribute.
Sign In or Register to comment.