36 lines
769 B
PHP
Raw Normal View History

2023-03-02 18:21:53 +11:00
<?php
namespace App\Classes\LDAP\Attribute;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Arr;
2023-03-02 18:21:53 +11:00
use App\Classes\LDAP\Attribute;
use App\Traits\MD5Updates;
2023-03-02 18:21:53 +11:00
/**
* Represents an attribute whose values are passwords
*/
final class Password extends Attribute
2023-03-02 18:21:53 +11:00
{
use MD5Updates;
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View
2023-03-02 18:21:53 +11:00
{
return view('components.attribute.password')
->with('o',$this)
->with('edit',$edit)
->with('old',$old)
->with('new',$new);
2023-03-02 18:21:53 +11:00
}
public function render_item_old(int $key): ?string
{
return Arr::get($this->oldValues,$key) ? str_repeat('x',8) : NULL;
}
public function render_item_new(int $key): ?string
{
return Arr::get($this->values,$key) ? str_repeat('x',8) : NULL;
}
2023-03-02 18:21:53 +11:00
}