diff --git a/README.md b/README.md index 98450c0..f1bb47a 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Some of the creations planned to be used in v2 include: * JQuery (https://jquery.com) * FancyTree (https://github.com/mar10/fancytree) * ArchitectUI (https://architectui.com) +* Fontawesome Icons (https://fontawesome.com) PLA v1.2.x will be archived into [BRANCH-1.2](https://github.com/leenooks/phpLDAPadmin/tree/BRANCH-1.2), and `master` will be changed to reflect the new v2 work and effort. diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 740cd2f..44132f2 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -3,9 +3,12 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Crypt; use App\Classes\LDAP\Server; +use Illuminate\Support\Facades\File; class HomeController extends Controller { @@ -32,4 +35,29 @@ class HomeController extends Controller ->with('dn',$dn) ->with('leaf',(new Server())->fetch($dn)); } + + /** + * Return the image for the logged in user or anonymous + * + * @param Request $request + * @return mixed + */ + public function user_image(Request $request) + { + $image = NULL; + $content = NULL; + + if (Auth::check()) { + $image = Arr::get(Auth::user()->getAttribute('jpegphoto'),0); + $content = 'image/jpeg'; + } + + if (! $image) { + $image = File::get('../resources/images/user-secret-solid.svg'); + $content = 'image/svg+xml'; + } + + return response($image) + ->header('Content-Type',$content); + } } diff --git a/resources/images/user-secret-solid.svg b/resources/images/user-secret-solid.svg new file mode 100644 index 0000000..905d0fe --- /dev/null +++ b/resources/images/user-secret-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/themes/architect/views/auth/login.blade.php b/resources/themes/architect/views/auth/login.blade.php index 9159526..ce60f6e 100644 --- a/resources/themes/architect/views/auth/login.blade.php +++ b/resources/themes/architect/views/auth/login.blade.php @@ -5,33 +5,23 @@ @endsection @section('content') - @if(isset($login_note) AND $login_note) -