Implemented more attribute classes
This commit is contained in:
@@ -7,6 +7,6 @@ use App\Classes\LDAP\Attribute;
|
||||
/**
|
||||
* Represents an attribute whose values are binary
|
||||
*/
|
||||
abstract class Binary extends Attribute
|
||||
class Binary extends Attribute
|
||||
{
|
||||
}
|
@@ -5,7 +5,7 @@ namespace App\Classes\LDAP\Attribute\Binary;
|
||||
use App\Classes\LDAP\Attribute\Binary;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are jpeg pictures
|
||||
* Represents an JpegPhoto Attribute
|
||||
*/
|
||||
final class JpegPhoto extends Binary
|
||||
{
|
||||
|
@@ -20,13 +20,24 @@ class Factory
|
||||
* Map of attributes to appropriate class
|
||||
*/
|
||||
public const map = [
|
||||
'createtimestamp' => Internal\Timestamp::class,
|
||||
'creatorsname' => Internal\EntryDN::class,
|
||||
'entrycsn' => Internal\EntryCSN::class,
|
||||
'entrydn' => Internal\EntryDN::class,
|
||||
'entryuuid' => Internal\EntryUUID::class,
|
||||
'gidnumber' => GidNumber::class,
|
||||
'hassubordinates' => Internal\HasSubordinates::class,
|
||||
'jpegphoto' => Binary\JpegPhoto::class,
|
||||
'modifytimestamp' => Internal\Timestamp::class,
|
||||
'modifiersname' => Internal\EntryDN::class,
|
||||
'objectclass' => ObjectClass::class,
|
||||
'structuralobjectclass' => Internal\StructuralObjectClass::class,
|
||||
'subschemasubentry' => Internal\SubschemaSubentry::class,
|
||||
'supportedcontrol' => Schema\OID::class,
|
||||
'supportedextension' => Schema\OID::class,
|
||||
'supportedfeatures' => Schema\OID::class,
|
||||
'supportedsaslmechanisms' => Schema\Mechanisms::class,
|
||||
'userpassword' => Password::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
12
app/Classes/LDAP/Attribute/GidNumber.php
Normal file
12
app/Classes/LDAP/Attribute/GidNumber.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute;
|
||||
|
||||
use App\Classes\LDAP\Attribute;
|
||||
|
||||
/**
|
||||
* Represents an GidNumber Attribute
|
||||
*/
|
||||
final class GidNumber extends Attribute
|
||||
{
|
||||
}
|
12
app/Classes/LDAP/Attribute/Internal/EntryCSN.php
Normal file
12
app/Classes/LDAP/Attribute/Internal/EntryCSN.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an EntryCSN Attribute
|
||||
*/
|
||||
final class EntryCSN extends Internal
|
||||
{
|
||||
}
|
12
app/Classes/LDAP/Attribute/Internal/EntryDN.php
Normal file
12
app/Classes/LDAP/Attribute/Internal/EntryDN.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an EntryDN Attribute
|
||||
*/
|
||||
final class EntryDN extends Internal
|
||||
{
|
||||
}
|
@@ -5,7 +5,7 @@ namespace App\Classes\LDAP\Attribute\Internal;
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are binary
|
||||
* Represents an EntryUUID Attribute
|
||||
*/
|
||||
final class EntryUUID extends Internal
|
||||
{
|
||||
|
12
app/Classes/LDAP/Attribute/Internal/HasSubordinates.php
Normal file
12
app/Classes/LDAP/Attribute/Internal/HasSubordinates.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an HasSubordinates Attribute
|
||||
*/
|
||||
final class HasSubordinates extends Internal
|
||||
{
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an StructuralObjectClass Attribute
|
||||
*/
|
||||
final class StructuralObjectClass extends Internal
|
||||
{
|
||||
}
|
12
app/Classes/LDAP/Attribute/Internal/SubschemaSubentry.php
Normal file
12
app/Classes/LDAP/Attribute/Internal/SubschemaSubentry.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an SubschemaSubentry Attribute
|
||||
*/
|
||||
final class SubschemaSubentry extends Internal
|
||||
{
|
||||
}
|
18
app/Classes/LDAP/Attribute/Internal/Timestamp.php
Normal file
18
app/Classes/LDAP/Attribute/Internal/Timestamp.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
use App\Classes\LDAP\Attribute\Internal;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are timestamps
|
||||
*/
|
||||
final class Timestamp extends Internal
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
return Carbon::createFromTimestamp(strtotime($this->values[0]))->format(config('ldap.datetime_format','Y-m-d H:i:s'));
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@ namespace App\Classes\LDAP\Attribute;
|
||||
use App\Classes\LDAP\Attribute;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are jpeg pictures
|
||||
* Represents an ObjectClass Attribute
|
||||
*/
|
||||
final class ObjectClass extends Attribute
|
||||
{
|
||||
|
17
app/Classes/LDAP/Attribute/Password.php
Normal file
17
app/Classes/LDAP/Attribute/Password.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\LDAP\Attribute;
|
||||
|
||||
use App\Classes\LDAP\Attribute;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are passwords
|
||||
*/
|
||||
class Password extends Attribute
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
return str_repeat('*',10)
|
||||
.sprintf('<br><span class="btn btn-sm btn-outline-dark"><i class="fas fa-user-check"></i> %s</span>',__('Check Password'));
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@ namespace App\Classes\LDAP\Attribute\Schema;
|
||||
use App\Classes\LDAP\Attribute\Schema;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are binary
|
||||
* Represents a Mechanisms Attribute
|
||||
*/
|
||||
final class Mechanisms extends Schema
|
||||
{
|
||||
|
@@ -5,7 +5,7 @@ namespace App\Classes\LDAP\Attribute\Schema;
|
||||
use App\Classes\LDAP\Attribute\Schema;
|
||||
|
||||
/**
|
||||
* Represents an attribute whose values are binary
|
||||
* Represents an OID Attribute
|
||||
*/
|
||||
final class OID extends Schema
|
||||
{
|
||||
|
Reference in New Issue
Block a user