summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f4e3050)
raw | patch | inline | side by side (parent: f4e3050)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Jan 2010 15:50:18 +0000 (15:50 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Jan 2010 15:50:18 +0000 (15:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15268 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc
index 48babc45568aeb9ab4971c1a7b57e1fb6b4ca8fd..7d12f4878cbea635510366f2966057b571777804 100644 (file)
private $acl= "";
private $modified= false;
- public function sortableListing($data= array(), $displayData= null, $modes= null, $reorderable= false)
+ public function sortableListing($data= array(), $displayData= null, $reorderable= false)
{
global $config;
// Save data to display
- $this->setListData($data, $displayData, $modes);
+ $this->setListData($data, $displayData);
// Generate instance wide unique ID
$tmp= gettimeofday();
}
- public function setListData($data, $displayData= null, $modes= null)
+ public function setListData($data, $displayData= null)
{
// Save data to display
$this->setData($data);
if (!$displayData) {
$displayData= array();
foreach ($data as $key => $value) {
- $displayData[$key]= array($value);
+ $displayData[$key]= array("data" => array($value));
}
}
- if (!$modes) {
- $modes= array();
- foreach ($data as $key => $value) {
- $modes[$key]= LIST_NORMAL;
- }
- }
-
$this->setDisplayData($displayData);
- $this->setModes($modes);
}
}
- private function setModes($modes)
- {
- $this->modes= array_values($modes);
- }
-
-
private function setDisplayData($data)
{
if (!is_array($data)) {
}
// Transfer information
- $this->displayData= array_values($data);
+ $this->displayData= array();
+ foreach ($data as $key => $value) {
+ $this->displayData[]= $value['data'];
+ }
$this->keys= array_keys($data);
// Create initial mapping
$editable= $this->editable?" onclick='$(\"edit_".$this->id."_$nr\").click()'":"";
$id= "";
- switch ($this->modes[$row]) {
- case LIST_DISABLED:
- $id= " sortableListItemDisabled";
- $editable= false;
- break;
- case LIST_MARKED:
- $id= " sortableListItemMarked";
- break;
+ if (isset($this->modes[$row])) {
+ switch ($this->modes[$row]) {
+ case LIST_DISABLED:
+ $id= " sortableListItemDisabled";
+ $editable= false;
+ break;
+ case LIST_MARKED:
+ $id= " sortableListItemMarked";
+ break;
+ }
}
$result.= " <tr class='sortableListItem".((($nr&1)||!$this->colorAlternate)?'':'Odd')."$id' id='item_".$this->id."_$nr'$reorderable>\n";
}
- public function addEntry($entry, $displayEntry= null, $key= null, $mode= null)
+ public function addEntry($entry, $displayEntry= null, $key= null)
{
// Only add if not already there
if (!$key) {
// Prefill with default value if not specified
if (!$displayEntry) {
- $displayEntry= array($entry);
+ $displayEntry= array('data' => array($entry));
}
// Append to data and mapping
$this->data[]= $entry;
$this->keys[]= count($this->mapping);
}
- $this->modes[]= $mode;
- $this->displayData[]= $displayEntry;
+ $this->displayData[]= $displayEntry['data'];
$this->mapping[]= count($this->mapping);
$this->modified= true;
+
+ // Sort data after we've added stuff
+ $this->sortData();
}
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index cf2d762d6b91cb20132f0c87a800aaf1515dd513..36dbd589a3fc2250de948ffaf371b1e0337c6b1a 100644 (file)
/* Call parent execute */
plugin::execute();
- /* Let the lists update themselves */
+ /* Set list ACL */
$this->gosaLoginRestrictionWidget->setAcl($this->getacl('gosaLoginRestriction', (!is_object($this->parent) && !session::is_set('edit'))));
- $this->gosaLoginRestrictionWidget->update();
/* Handle add/delete for restriction mode */
if (isset($_POST['add_res']) && isset($_POST['res'])) {
plugin::save_object ();
/* Sync lists */
+ $this->gosaLoginRestrictionWidget->update();
if ($this->gosaLoginRestrictionWidget->isModified()) {
$this->gosaLoginRestriction= $this->gosaLoginRestrictionWidget->getMaintainedData();
}
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index cbdf7366a01cb3914e0f2cfd8088bf0946357e93..a3dbf1f1d1b7e8bc0dfff1122392f40ab80af9d7 100644 (file)
plugin::execute();
$display= "";
- /* Let the lists update themselves */
+ /* Assign list acl */
$this->groupMembershipList->setAcl($this->getacl('memberUid', (!is_object($this->parent) && !session::is_set('edit'))));
- $this->groupMembershipList->update();
/* Log view */
if($this->is_account && !$this->view_logged){
$smarty->assign("shells", $this->loginShellList);
$smarty->assign("secondaryGroups", $this->secondaryGroups);
$smarty->assign("primaryGroup", $this->primaryGroup);
- if(!$this->multiple_support_active){
- if (!count($this->groupMembership)){
- $smarty->assign("groupMembership", array(" "));
- } else {
- $smarty->assign("groupMembership", $this->groupMembership);
- }
- }else{
- $smarty->assign("groupMembership", $this->groupMembership);
- $smarty->assign("groupMembership_some", $this->groupMembership_some);
- }
if (count($this->groupMembership) > 16){
$smarty->assign("groups", "too_many_for_nfs");
} else {
/* Save values to object */
plugin::save_object();
+ /* Maintain list */
+ $this->groupMembershipList->update();
/* Save force GID checkbox */
if($this->acl_is_writeable("gidNumber") || $this->acl_is_writeable("uidNumber")){
foreach ($this->groupMembership as $key => $value) {
if (!preg_match('/^([^[]+)\[(.*)\]$/', $value, $m)) {
- $tmp[$key]= array($value, "");
+ $tmp[$key]= array("data" => array($value, ""));
} else {
- $tmp[$key]= array(rtrim($m[1]), $m[2]);
+ $tmp[$key]= array("data" => array(rtrim($m[1]), $m[2]));
}
}