parent::prepare($args);
- $cur = common_current_user();
- if (!$cur) {
- // TRANS: Client exception in autocomplete plugin.
- throw new ClientException(_m('Access forbidden.'), true);
- }
-
$this->groups=array();
$this->profiles=array();
$term = $this->arg('term');
$profile->whereAdd('nickname like \'' . trim($profile->escape($term), '\'') . '%\'');
$profile->whereAdd(sprintf('id in (SELECT id FROM user) OR '
. 'id in (SELECT subscribed from subscription'
- . ' where subscriber = %d)', $cur->id));
+ . ' where subscriber = %d)', $this->scoped->id));
if ($profile->find()) {
while($profile->fetch()) {
$this->profiles[]=clone($profile);
$group->limit($limit);
$group->whereAdd('nickname like \'' . trim($group->escape($term), '\'') . '%\'');
//Can't post to groups we're not subscribed to...:
- $group->whereAdd('id in (SELECT group_id from group_member'
- . ' where profile_id = ' . $cur->id . ')');
+ $group->whereAdd(sprintf('id in (SELECT group_id FROM group_member'
+ . ' WHERE profile_id = %d)', $this->scoped->id));
if($group->find()){
while($group->fetch()) {
$this->groups[]=clone($group);