|
From: <gem...@li...> - 2012-09-21 16:42:28
|
Revision: 952
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=952&view=rev
Author: matijsdejong
Date: 2012-09-21 16:42:22 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
Fix for pulse bugs #556 and #551: user cannot be changed when in an inactive group
Modified Paths:
--------------
trunk/library/classes/Gems/Default/StaffAction.php
trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php
trunk/library/classes/Gems/User/User.php
Modified: trunk/library/classes/Gems/Default/StaffAction.php
===================================================================
--- trunk/library/classes/Gems/Default/StaffAction.php 2012-09-21 08:20:22 UTC (rev 951)
+++ trunk/library/classes/Gems/Default/StaffAction.php 2012-09-21 16:42:22 UTC (rev 952)
@@ -392,7 +392,7 @@
}
}
- return parent::getAfterSaveRoute($data, $isNew);
+ return parent::getAfterSaveRoute($data);
}
protected function getAutoSearchElements(MUtil_Model_ModelAbstract $model, array $data)
Modified: trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php
===================================================================
--- trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php 2012-09-21 08:20:22 UTC (rev 951)
+++ trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php 2012-09-21 16:42:22 UTC (rev 952)
@@ -102,6 +102,7 @@
// MUtil_Echo::track($name, $model->get($name, 'thClass'), $model->get($name, 'label'));
}
}
+ // MUtil_Echo::track($names);
return $names;
}
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-09-21 08:20:22 UTC (rev 951)
+++ trunk/library/classes/Gems/User/User.php 2012-09-21 16:42:22 UTC (rev 952)
@@ -990,10 +990,25 @@
*/
public function hasAllowedRole()
{
- if ($allowedGroups = $this->util->getDbLookup()->getAllowedStaffGroups()) {
- return isset($allowedGroups[$this->getGroup()]) ? 1 : 0;
+ if (! $this->isStaff()) {
+ // Always allow editing of non-staff user
+ // for the time being
+ return true;
+ }
+
+ $dbLookup = $this->util->getDbLookup();
+ $groups = $dbLookup->getActiveStaffGroups();
+ $group = $this->getGroup();
+
+ if (! isset($groups[$group])) {
+ // Allow editing when the group does not exist or is no longer active.
+ return true;
+ }
+
+ if ($allowedGroups = $dbLookup->getAllowedStaffGroups()) {
+ return (boolean) isset($allowedGroups[$this->getGroup()]);
} else {
- return 0;
+ return false;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|