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
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.yml]
[*.{yml,yaml}]
indent_size = 2

View File

@ -4,9 +4,15 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Leenooks\LDAP;
class HomeController extends Controller
{
public function home() {
return view('home');
}
public function 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

@ -225,8 +225,8 @@ return [
| If you need to be able to change user passwords on your server, then an
| SSL or TLS connection is required. All other operations are allowed
| on unsecured protocols.
|
| One of these options are definitely recommended if you
|
| One of these options are definitely recommended if you
| have the ability to connect to your server securely.
|
*/
@ -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

47
public/css/fixes.css vendored
View File

@ -1,65 +1,60 @@
/* Fixes for data tables */
.dataTables_wrapper .dataTables_paginate .paginate_button {
padding: 0em 0em;
margin-left: 0px;
border: 0px solid;
padding: 0em 0em;
margin-left: 0px;
border: 0px solid;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
border: 0px solid;
background: #fff;
border: 0px solid;
background: #fff;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:active {
box-shadow: 0 0 0px #fff;
background-color: #fff;
box-shadow: 0 0 0px #fff;
background-color: #fff;
}
table.dataTable thead .sorting_asc {
background-image: none !important;
background-image: none !important;
}
table.dataTable thead .sorting_desc {
background-image: none !important;
background-image: none !important;
}
table.dataTable thead .sorting {
background-image: none !important;
background-image: none !important;
}
/* Remove blue border from chrome on buttons */
/* Remove outline for non-keyboard :focus */
*:focus:not(.focus-visible) {
outline: none !important;
box-shadow: none !important;
outline: none !important;
box-shadow: none !important;
}
/* Optional: Customize .focus-visible */
.focus-visible {
outline-color: lightgreen;
}
div.login-box .input-group .input-group-append span.fa {
line-height: 0;
outline-color: lightgreen;
}
*:disabled {
cursor: not-allowed;
}
/* Login Box, icons when inputs disabled */
div.login-box .input-group-append .fa {
width: 2.5em;
cursor: not-allowed;
}
#favourite.selected {
color: orange;
color: orange;
}
#favourite:hover {
cursor: pointer;
cursor: pointer;
}
.card-header h3.card-title {
font-size: 1.0rem;
}
body {
font-size: 0.85em;
font-size: 0.85em;
}

30
public/css/print.css vendored
View File

@ -1,19 +1,19 @@
@media print {
body {
color: #333;
font-weight: 400;
font-size: 12px;
}
body {
color: #333;
font-weight: 400;
font-size: 0.85em;
}
label {
font-weight: bold;
}
label {
font-weight: bold;
}
tr { page-break-inside:avoid; }
thead { display:table-header-group; }
tfoot { display:table-footer-group; }
tr { page-break-inside:avoid; }
thead { display:table-header-group; }
tfoot { display:table-footer-group; }
.table-responsive {
overflow: visible !important;
}
}
.table-responsive {
overflow: visible !important;
}
}

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

@ -1,18 +1,36 @@
@extends('adminlte::layouts.app')
@section('htmlheader_title')
Home
@endsection
@section('page_title')
{{ $user }}
Home
@endsection
@section('contentheader_title')
Home
@endsection
@section('contentheader_description')
Client Home
@endsection
@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

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>