improved group handling

This commit is contained in:
SJ
2012-06-27 11:17:23 +02:00
parent a631595e5f
commit ee910e7735
14 changed files with 221 additions and 16 deletions

View File

@ -380,6 +380,7 @@ class ModelUserUser extends Model {
private function update_group_settings($uid = -1, $group = '') {
$__g = array();
if($uid <= 0 || $group == '') { return 0; }
@ -398,7 +399,10 @@ class ModelUserUser extends Model {
foreach($group as $g) {
$g = rtrim($g);
$query = $this->db->query("INSERT INTO `" . TABLE_GROUP_USER . "` (id, uid) VALUES(?,?)", array($groups[$g], (int)$uid));
if(!isset($__g[$groups[$g]])) {
$query = $this->db->query("INSERT INTO `" . TABLE_GROUP_USER . "` (id, uid) VALUES(?,?)", array($groups[$g], (int)$uid));
$__g[$groups[$g]] = 1;
}
}
return 1;