Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/user_groups/user_groups_eh.php
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
*/ | */ | ||||
function OnSetPrimary($event) | function OnSetPrimary($event) | ||||
{ | { | ||||
$ids = $this->StoreSelectedIDs($event); | $ids = $this->StoreSelectedIDs($event); | ||||
if ($ids) { | if ($ids) { | ||||
/** @var kDBItem $user */ | |||||
$user = $this->Application->recallObject('u'); | $user = $this->Application->recallObject('u'); | ||||
/* @var $user kDBItem */ | |||||
$user->SetDBField('PrimaryGroupId', array_shift($ids)); | $user->SetDBField('PrimaryGroupId', array_shift($ids)); | ||||
$user->Update(); | $user->Update(); | ||||
} | } | ||||
$this->clearSelectedIDs($event); | $this->clearSelectedIDs($event); | ||||
} | } | ||||
Show All 37 Lines | |||||
$exclude_users = $this->Conn->GetCol($sql); | $exclude_users = $this->Conn->GetCol($sql); | ||||
$event->setEventParam('ids', array_diff($ids, $exclude_users)); | $event->setEventParam('ids', array_diff($ids, $exclude_users)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |