X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FGroup.php;h=50a3affa19bcbca02e0047c76dbfdd2c3a7af307;hb=5ee2db8a164ae27e2a5821ff4036f3d686b0c40e;hp=9e472a7ade5f378a34f189dfff997cfb23f72437;hpb=6b44fbbda03af125035c185c964f10ce78f97610;p=friendica.git diff --git a/src/Model/Group.php b/src/Model/Group.php index 9e472a7ade..50a3affa19 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -4,8 +4,8 @@ */ namespace Friendica\Model; -use Friendica\Core\L10n; use Friendica\BaseObject; +use Friendica\Core\L10n; use Friendica\Database\DBM; use dba; @@ -40,7 +40,7 @@ class Group extends BaseObject // was restricted to this group may now be seen by the new group members. $group = dba::selectFirst('group', ['deleted'], ['id' => $gid]); if (DBM::is_result($group) && $group['deleted']) { - dba::update('group', ['deleted' => 0], ['gid' => $gid]); + dba::update('group', ['deleted' => 0], ['id' => $gid]); notice(L10n::t('A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL); } return true; @@ -54,6 +54,19 @@ class Group extends BaseObject return $return; } + /** + * Update group information. + * + * @param int $id Group ID + * @param string $name Group name + * + * @return bool Was the update successful? + */ + public static function update($id, $name) + { + return dba::update('group', ['name' => $name], ['id' => $id]); + } + /** * @brief Get a list of group ids a contact belongs to * @@ -138,7 +151,7 @@ class Group extends BaseObject return false; } - $group = dba::selectFirst('group', ['uid'], ['gid' => $gid]); + $group = dba::selectFirst('group', ['uid'], ['id' => $gid]); if (!DBM::is_result($group)) { return false; } @@ -289,8 +302,7 @@ class Group extends BaseObject } if ($check_dead && !$use_gcontact) { - require_once 'include/acl_selectors.php'; - $return = prune_deadguys($return); + Contact::pruneUnavailable($return); } return $return; }