mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
DbUserGroupBackend: Properly utilize the insert and update capability
refs #8826
This commit is contained in:
parent
ca166b0175
commit
b3957c556b
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Authentication\UserGroup;
|
namespace Icinga\Authentication\UserGroup;
|
||||||
|
|
||||||
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Repository\DbRepository;
|
use Icinga\Repository\DbRepository;
|
||||||
use Icinga\User;
|
use Icinga\User;
|
||||||
|
|
||||||
@ -24,6 +25,18 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The statement columns being provided
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $statementColumns = array(
|
||||||
|
'group' => array(
|
||||||
|
'created_at' => 'ctime',
|
||||||
|
'last_modified' => 'mtime'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The columns which are not permitted to be queried
|
* The columns which are not permitted to be queried
|
||||||
*
|
*
|
||||||
@ -55,6 +68,31 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Insert a table row with the given data
|
||||||
|
*
|
||||||
|
* @param string $table
|
||||||
|
* @param array $bind
|
||||||
|
*/
|
||||||
|
public function insert($table, array $bind)
|
||||||
|
{
|
||||||
|
$bind['created_at'] = date('Y-m-d H:i:s');
|
||||||
|
parent::insert($table, $bind);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update table rows with the given data, optionally limited by using a filter
|
||||||
|
*
|
||||||
|
* @param string $table
|
||||||
|
* @param array $bind
|
||||||
|
* @param Filter $filter
|
||||||
|
*/
|
||||||
|
public function update($table, array $bind, Filter $filter = null)
|
||||||
|
{
|
||||||
|
$bind['last_modified'] = date('Y-m-d H:i:s');
|
||||||
|
parent::update($table, $bind, $filter);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the groups the given user is a member of
|
* Return the groups the given user is a member of
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user