From 7d9a33408e677a646b2b4ebd44a1088f1b0acb75 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 28 Dec 2007 02:29:37 +0000 Subject: [PATCH] Validate permissions on application. :) --- includes/SpecialUserrights.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index a2d78c7096..634fb3f2e6 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -101,13 +101,17 @@ class UserrightsForm extends HTMLForm { if(isset($removegroup)) { $newGroups = array_diff($newGroups, $removegroup); foreach( $removegroup as $group ) { - $user->removeGroup( $group ); + if( $this->canRemove( $group ) ) { + $user->removeGroup( $group ); + } } } if(isset($addgroup)) { $newGroups = array_merge($newGroups, $addgroup); foreach( $addgroup as $group ) { - $user->addGroup( $group ); + if( $this->canAdd( $group ) ) { + $user->addGroup( $group ); + } } } $newGroups = array_unique( $newGroups ); -- 2.20.1