ProjetosController.php 1.2 KB
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Adldap\Contracts\AdldapInterface;
use App\Projetos;

class ProjetosController extends Controller
{
      protected $adldap;
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct(AdldapInterface $adldap)
    {
        $this->adldap = $adldap;
    }

    /**
     * Displays the all LDAP users.
     *
     * @return \Illuminate\View\View
     */
    public function index()
    {		
        $users = $this->adldap->getDefaultProvider()->search()->users()->find('emerson');
		$users = $this->adldap->getDefaultProvider()->search()->where('sn','=','*warley*')->get();
		/*if($this->adldap->user()->inGroup($username,"SIRKit Staff")) {
            $ldap_user_info = $this->adldap->user()->info($username);
            $ldap_user_name = $ldap_user_info[0]["displayname"][0];
		}*/
		dd($users);
		//dd($ldap_user_name);*/
		
		//$users = $this->adldap->getDefaultProvider()->groups("1674170")->get();
		//dd($users);
		//$projeto = Projetos::orderBy('id', 'desc')->paginate(10);
        //return view('index2')->withProjetos($projeto);
		
        return view('index2', compact('users'));
    }
}