2023-02-19 09:25:32 +00:00
|
|
|
<?php
|
|
|
|
|
2023-03-01 22:54:30 +00:00
|
|
|
namespace App\Classes\LDAP\Attribute\Schema;
|
2023-02-19 09:25:32 +00:00
|
|
|
|
2023-04-02 12:07:15 +00:00
|
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
|
2023-03-01 22:54:30 +00:00
|
|
|
use App\Classes\LDAP\Attribute\Schema;
|
2023-02-19 09:25:32 +00:00
|
|
|
|
|
|
|
/**
|
2023-03-02 07:21:53 +00:00
|
|
|
* Represents an OID Attribute
|
2023-02-19 09:25:32 +00:00
|
|
|
*/
|
2023-03-01 22:54:30 +00:00
|
|
|
final class OID extends Schema
|
2023-02-19 09:25:32 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Given an LDAP OID number, returns a verbose description of the OID.
|
|
|
|
* This function parses ldap_supported_oids.txt and looks up the specified
|
|
|
|
* OID, and returns the verbose message defined in that file.
|
|
|
|
*
|
|
|
|
* <code>
|
|
|
|
* "1.3.6.1.4.1.4203.1.5.1" => array:3 [
|
|
|
|
* [title] => All Operational Attribute
|
|
|
|
* [ref] => RFC 3673
|
|
|
|
* [desc] => An LDAP extension which clients may use to request the return of all operational attributes.
|
|
|
|
* ]
|
|
|
|
* </code>
|
|
|
|
*
|
2023-03-01 22:54:30 +00:00
|
|
|
* @param string $string The OID number (ie, "1.3.6.1.4.1.4203.1.5.1") of the OID of interest.
|
2023-02-19 09:25:32 +00:00
|
|
|
* @param string $key The title|ref|desc to return
|
|
|
|
* @return string|null
|
|
|
|
* @testedby TranslateOidTest::testRootDSE()
|
|
|
|
*/
|
2023-04-02 12:07:15 +00:00
|
|
|
public static function get(string $string,string $key): ?string
|
2023-02-19 09:25:32 +00:00
|
|
|
{
|
2023-03-01 22:54:30 +00:00
|
|
|
return parent::_get(config_path('ldap_supported_oids.txt'),$string,$key);
|
2023-02-19 09:25:32 +00:00
|
|
|
}
|
2023-04-02 12:07:15 +00:00
|
|
|
|
2024-01-19 23:36:30 +00:00
|
|
|
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
|
2023-04-02 12:07:15 +00:00
|
|
|
{
|
|
|
|
// @note Schema attributes cannot be edited
|
|
|
|
return view('components.attribute.schema.oid')
|
|
|
|
->with('o',$this);
|
|
|
|
}
|
2023-02-19 09:25:32 +00:00
|
|
|
}
|