Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+4 -4
View File
@@ -116,7 +116,7 @@ class _Key extends \IPS\Node\Model
public function form( &$form )
{
/* API Key */
$form->add( new \IPS\Helpers\Form\Custom( 'api_id', $this->id ?: md5( uniqid() ), TRUE, array(
$form->add( new \IPS\Helpers\Form\Custom( 'api_id', $this->id ?: md5( mt_rand() ), TRUE, array(
'getHtml' => function( $field )
{
return \IPS\Theme::i()->getTemplate('api')->apiKeyField( $field->name, $field->value );
@@ -161,13 +161,13 @@ class _Key extends \IPS\Node\Model
$form->add( new \IPS\Helpers\Form\Custom( 'api_permissions', $this->permissions ? json_decode( $this->permissions, TRUE ) : array(), FALSE, array(
'rowHtml' => function( $field )
{
$endpoints = \IPS\Api\Controller::getAllEndpoints();
$endpoints = \IPS\Api\Controller::getAllEndpoints('client');
foreach ( $endpoints as $key => $endpoint )
{
$pieces = explode('/', $key);
$endpointTree[ $pieces[0] ][ $pieces[1] ][ $key ] = $endpoint;
}
return \IPS\Theme::i()->getTemplate( 'api' )->permissionsField( $endpointTree, $field->name, $field->value );
}
) ) );
@@ -216,7 +216,7 @@ class _Key extends \IPS\Node\Model
$oldId = $this->id;
$this->id = md5( uniqid() );
$this->id = md5( mt_rand() );
$this->_new = TRUE;
$this->save();