mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-24 02:44:51 +03:00
Добавил getItemByIdentifier в ClientModel
This commit is contained in:
parent
dc4b1734ab
commit
58a6631164
@ -9,6 +9,8 @@ use Joomla\CMS\MVC\Model\AdminModel;
|
|||||||
|
|
||||||
class ClientModel extends AdminModel
|
class ClientModel extends AdminModel
|
||||||
{
|
{
|
||||||
|
use GetItemByIdentifierTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type alias for this content type.
|
* The type alias for this content type.
|
||||||
*
|
*
|
||||||
@ -17,15 +19,6 @@ class ClientModel extends AdminModel
|
|||||||
*/
|
*/
|
||||||
public $typeAlias = 'com_oauthserver.client';
|
public $typeAlias = 'com_oauthserver.client';
|
||||||
|
|
||||||
/**
|
|
||||||
* Client item.
|
|
||||||
*
|
|
||||||
* @var array|null
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
protected ?array $_item = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @param bool $loadData
|
* @param bool $loadData
|
||||||
@ -87,10 +80,10 @@ class ClientModel extends AdminModel
|
|||||||
|
|
||||||
if ($task === 'save2reset' || empty($table->id)) {
|
if ($task === 'save2reset' || empty($table->id)) {
|
||||||
$table->identifier = $this->generateNewIdentifier();
|
$table->identifier = $this->generateNewIdentifier();
|
||||||
$table->secret = $table->public ? '' : $this->generateNewSecret();
|
$table->secret = !!$table->public ? '' : $this->generateNewSecret();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($table->public) {
|
if (!!$table->public) {
|
||||||
$table->secret = '';
|
$table->secret = '';
|
||||||
} else {
|
} else {
|
||||||
if (empty($table->secret)) {
|
if (empty($table->secret)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user