CSS/JS updates, initial page rendering

This commit is contained in:
Deon George 2020-08-22 22:26:06 +10:00
parent 4c90ce11f2
commit f8717480fd
14 changed files with 164 additions and 60278 deletions

View File

@ -4,12 +4,12 @@ root = true
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
indent_style = space indent_style = tab
indent_size = 4 indent_size = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.md] [*.md]
trim_trailing_whitespace = false trim_trailing_whitespace = false
[*.yml] [*.{yml,yaml}]
indent_size = 2 indent_size = 2

View File

@ -4,9 +4,15 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Leenooks\LDAP;
class HomeController extends Controller class HomeController extends Controller
{ {
public function home() { public function home() {
return view('home'); $o = new LDAP\Server;
return view('home')
->with('server',config('ldap.connections.default.name')) // @todo This connection name should be a config item
->with('bases',$o->getBaseDN());
} }
} }

View File

@ -236,6 +236,7 @@ return [
], ],
'name' => 'OpenLDAP',
], ],
], ],

54
ldap/src/Server.php Normal file
View File

@ -0,0 +1,54 @@
<?php
namespace Leenooks\LDAP;
use Adldap\Adldap;
use Adldap\Models\Entry;
class Server
{
/**
* Gets the root DN of the specified LDAPServer, or NULL if it
* can't find it (ie, the server won't give it to us, or it isnt
* specified in the configuration file).
*
* @return array array|NULL The root DN(s) of the server on success (string) or NULL if it cannot be determine.
* @todo Sort the entries, so that they are in the correct DN order.
*/
public function getBaseDN(): ?array
{
// If the base is set in the configuration file, then just return that after validating it exists.
// @todo
if (false) {
// We need to work out the baseDN
} else {
$result = $this->getDNAttrValues('',['namingcontexts']);
return $result ? $result->namingcontexts : NULL;
}
}
/**
* Search for a DN and return its attributes
*
* @param $dn
* @param array $attrs
* @param int $deref // @todo
* @return Entry|bool
*/
protected function getDNAttrValues(string $dn,array $attrs=['*','+'],int $deref=LDAP_DEREF_NEVER): ?Entry
{
try {
return ($x=(new Adldap)
->addProvider(config('ldap.connections.default.settings'))
->search()
->select($attrs)
->findByDn($dn)) ? $x : NULL;
// @todo Tidy up this exception
} catch (\Exception $e) {
dd(['e'=>$e,'s'=>$s]);
}
}
}

File diff suppressed because one or more lines are too long

10671
public/css/app.css vendored

File diff suppressed because one or more lines are too long

13
public/css/fixes.css vendored
View File

@ -39,19 +39,10 @@ table.dataTable thead .sorting {
outline-color: lightgreen; outline-color: lightgreen;
} }
div.login-box .input-group .input-group-append span.fa {
line-height: 0;
}
*:disabled { *:disabled {
cursor: not-allowed; cursor: not-allowed;
} }
/* Login Box, icons when inputs disabled */
div.login-box .input-group-append .fa {
width: 2.5em;
}
#favourite.selected { #favourite.selected {
color: orange; color: orange;
} }
@ -60,6 +51,10 @@ div.login-box .input-group-append .fa {
cursor: pointer; cursor: pointer;
} }
.card-header h3.card-title {
font-size: 1.0rem;
}
body { body {
font-size: 0.85em; font-size: 0.85em;
} }

View File

@ -2,7 +2,7 @@
body { body {
color: #333; color: #333;
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 0.85em;
} }
label { label {

BIN
public/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

49448
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -3,16 +3,34 @@
@section('htmlheader_title') @section('htmlheader_title')
Home Home
@endsection @endsection
@section('page_title')
{{ $user }}
@endsection
@section('contentheader_title') @section('contentheader_title')
Home
@endsection @endsection
@section('contentheader_description') @section('contentheader_description')
Client Home
@endsection @endsection
@section('main-content') @section('main-content')
@dump($user) <div class="card card-solid">
<div class="card-body">
<div class="row">
<div class="col-12 col-sm-6">
<h3 class="d-inline-block d-sm-none">phpLDAPadmin</h3>
<div class="col-12">
<img src="img/logo.png" class="product-image" alt="PLA Logo">
</div>
</div>
<div class="col-12 col-sm-6">
<h3 class="my-3">Welcome to phpLDAPadmin</h3>
<h4 class="my-3">Updated to v2</h4>
<p>phpLDAPadmin (or PLA for short) is an LDAP data management tool for administrators.</p>
<p>PLA aims to adhere to the LDAP standards (RFC4511) so that it can interact with any LDAP server that implements those standards.</p>
<hr>
<p>Version 2 is a complete re-write of PLA, leveraging the advancements and modernisation of web tools and methods, libraries since version 1 was released.</p>
<p>You can support this application by letting us know which LDAP server you use (including version and platform).</p>
</div>
</div>
</div>
</div>
@endsection @endsection

View File

@ -0,0 +1,17 @@
<li class="nav-header">{{ $server ?? 'Server Name' }}</li>
@foreach (($bases ?? []) as $base)
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-tree"></i>
<p>
{{ $base }}
<i class="fas fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview">
<div id="{{ $base }}">
</ul>
</li>
@endforeach

View File

@ -1,99 +0,0 @@
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 200;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 13px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ route('login') }}">Login</a>
@if (Route::has('register'))
<a href="{{ route('register') }}">Register</a>
@endif
@endauth
</div>
@endif
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div class="links">
<a href="https://laravel.com/docs">Docs</a>
<a href="https://laracasts.com">Laracasts</a>
<a href="https://laravel-news.com">News</a>
<a href="https://blog.laravel.com">Blog</a>
<a href="https://nova.laravel.com">Nova</a>
<a href="https://forge.laravel.com">Forge</a>
<a href="https://github.com/laravel/laravel">GitHub</a>
</div>
</div>
</div>
</body>
</html>