From c94e6a329275d7502e09a0eeebd73a8f2dc2e4c1 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 29 May 2015 08:56:58 +0200 Subject: [PATCH] Db/IniUserGroupBackend: Drop column parent_name, it's not a name anymore refs #8826 --- application/controllers/GroupController.php | 2 -- application/views/scripts/group/show.phtml | 11 ----------- .../Authentication/UserGroup/DbUserGroupBackend.php | 7 +++---- .../Authentication/UserGroup/IniUserGroupBackend.php | 5 ++--- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/application/controllers/GroupController.php b/application/controllers/GroupController.php index 360ff17dd..8a13bfd6f 100644 --- a/application/controllers/GroupController.php +++ b/application/controllers/GroupController.php @@ -75,7 +75,6 @@ class GroupController extends AuthBackendController $this->setupSortControl( array( 'group_name' => $this->translate('Group'), - 'parent_name' => $this->translate('Parent'), 'created_at' => $this->translate('Created at'), 'last_modified' => $this->translate('Last modified') ), @@ -94,7 +93,6 @@ class GroupController extends AuthBackendController $group = $backend->select(array( 'group_name', - 'parent_name', 'created_at', 'last_modified' ))->where('group_name', $groupName)->fetchRow(); diff --git a/application/views/scripts/group/show.phtml b/application/views/scripts/group/show.phtml index 75895b908..1fd3e48c6 100644 --- a/application/views/scripts/group/show.phtml +++ b/application/views/scripts/group/show.phtml @@ -29,17 +29,6 @@ if ($this->hasPermission('config/application/groups/edit') && $backend instanceo

escape($group->group_name); ?>

-

translate('Parent'); ?>: parent_name === null ? '-' : $this->qlink( - $group->parent_name, - 'group/show', - array( - 'backend' => $backend->getName(), - 'group' => $group->parent_name - ), - array( - 'title' => sprintf($this->translate('Show detailed information for group %s'), $group->parent_name) - ) - ); ?>

translate('Created at'); ?>: created_at === null ? '-' : $this->formatDateTime($group->created_at); ?>

translate('Last modified'); ?>: last_modified === null ? '-' : $this->formatDateTime($group->last_modified); ?>

diff --git a/library/Icinga/Authentication/UserGroup/DbUserGroupBackend.php b/library/Icinga/Authentication/UserGroup/DbUserGroupBackend.php index d3096dadd..2cf177e01 100644 --- a/library/Icinga/Authentication/UserGroup/DbUserGroupBackend.php +++ b/library/Icinga/Authentication/UserGroup/DbUserGroupBackend.php @@ -20,8 +20,7 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa 'group_id' => 'g.id', 'group' => 'g.name COLLATE utf8_general_ci', 'group_name' => 'g.name', - 'parent' => 'g.parent COLLATE utf8_general_ci', - 'parent_name' => 'g.parent', + 'parent' => 'g.parent', 'created_at' => 'UNIX_TIMESTAMP(g.ctime)', 'last_modified' => 'UNIX_TIMESTAMP(g.mtime)' ), @@ -53,7 +52,7 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa 'group' => array( 'group_id' => 'id', 'group_name' => 'name', - 'parent_name' => 'parent', + 'parent' => 'parent', 'created_at' => 'ctime', 'last_modified' => 'mtime' ), @@ -70,7 +69,7 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa * * @var array */ - protected $filterColumns = array('group', 'parent', 'user'); + protected $filterColumns = array('group', 'user'); /** * Initialize this database user group backend diff --git a/library/Icinga/Authentication/UserGroup/IniUserGroupBackend.php b/library/Icinga/Authentication/UserGroup/IniUserGroupBackend.php index a9d73038c..f17cbb6a8 100644 --- a/library/Icinga/Authentication/UserGroup/IniUserGroupBackend.php +++ b/library/Icinga/Authentication/UserGroup/IniUserGroupBackend.php @@ -21,7 +21,6 @@ class IniUserGroupBackend extends IniRepository implements UserGroupBackendInter 'group' => 'name', 'group_name' => 'name', 'parent' => 'parent', - 'parent_name' => 'parent', 'created_at' => 'ctime', 'last_modified' => 'mtime', 'users' @@ -33,7 +32,7 @@ class IniUserGroupBackend extends IniRepository implements UserGroupBackendInter * * @var array */ - protected $filterColumns = array('group', 'parent'); + protected $filterColumns = array('group'); /** * The value conversion rules to apply on a query @@ -96,7 +95,7 @@ class IniUserGroupBackend extends IniRepository implements UserGroupBackendInter $groups = array(); foreach ($result as $group) { - $groups[$group->group_name] = $group->parent_name; + $groups[$group->group_name] = $group->parent; } $username = strtolower($user->getUsername());