Fixing the acl widget is going to be hard. Here's a start.

This commit is contained in:
friendica
2012-12-06 19:18:38 -08:00
parent 435836b224
commit 8f864ebd19
2 changed files with 33 additions and 23 deletions

View File

@@ -26,8 +26,20 @@ function group_add($uid,$name) {
}
return true;
}
$r = q("INSERT INTO `group` ( `uid`, `name` )
VALUES( %d, '%s' ) ",
do {
$dups = false;
$hash = random_string() . $name;
$r = q("SELECT id FROM group WHERE hash = '%s' LIMIT 1", dbesc($hash));
if(count($r))
$dups = true;
} while($dups == true);
$r = q("INSERT INTO `group` ( hash, uid, name )
VALUES( '%s', %d, '%s' ) ",
dbesc($hash),
intval($uid),
dbesc($name)
);