Hello,
I just implemented to bring two data details that the active directory osticket plugin does not bring me, and it's the office and the department.
through an api json. edit the file user.tmpl.php and add these lines ..
http://prntscr.com/n70zr9

?php

$url = 'http://misite.com/aad/api/userbasic/';
$respuesta_del_servicio = file_get_contents($url);
$objecto_completo = json_decode($respuesta_del_servicio, true);

// var_dump($result);

$datos_de_la_persona = $objecto_completo["data"];

$array_auxiliar = json_encode($datos_de_la_persona, true);

$array_de_datos_decodificados = json_decode($array_auxiliar,true);

echo "<b>Nombre</b>: ", $array_de_datos_decodificados["Fullname"];
echo "<br>";
echo "<br>";
echo "<b>Departamento</b>: ", $array_de_datos_decodificados["Department"];
echo "<br>";
echo "<br>";
echo "<b>Oficina: </b>", $array_de_datos_decodificados["Office"];
echo "<br>";
?>

what I can not do or find is that the user is detected ..
for example in $ url = 'http: //mysite.com/aad/api/userbasic/;
at the end of the / would have to add something like <? php echo $ user-> getUser (); ?>

ntozier changed the title to [mod] help implementation of ad.

@krvam

I guess I need more information on what you're trying to accomplish. I don't understand what you need help with rn.

Cheers.

    KevinTheJedi by default, your active directory plugin does not bring the user information I need.
    which is the following: Department and Office.

    what I did was create an api json that brings me that data..
    in the following file /user.tmpl.php add the lines above

    in which I request through the api those data ..
    What I need to do is correct the url so that it automatically detects the user
    for example: http://misite.com/aad/api/userbasic/NameOfUser

    There is a command where you can pull the local UID:

    $user = $_SERVER['AUTH_USER'];

    is what I've seen used before. Now unless I am not remembering correctly (I think I am) osTicket requires the UID in Ad and osTicket UID to match.

      Rich_C I did not understand very well where I have to put that code.

      I still can not find the way .. ?

      5 days later

      @krvam

      Being as I have VERY little free time, I would say no just due to the fact that I don't have time. Maybe someone else can chime in and assist but I just don't have the time right now. ?

      Cheers.

        8 days later
        3 months later

        krvam where is your AD connection string? - IE HOW are you connecting to AD in the call?

        $user = $_SERVER['AUTH_USER'];

        Above this code will (per my understanding) store the local authorized user as a var $user. I posted back in 1.6 an AD pass thru mod (prior to plugins being a thing) and this code was in it.

          Rich_C who AD connecting?
          i am using the plugin official of osticket AD..

            2 months later

            krvam I thought one of your issues was that you were trying to "pull" or copy the user object and match it to the AD login. The code above which I posted SHOULD capture the logged in users AD ID which you can then compare. osTicket's AD plugin and osTicket itself requires that the login ID and the AD ID match for AD auth.

            Write a Reply...