public function executeAddUser($request) { $this->checkGroup($request); $this->checkUser($request); $this->checkOwner(); if ($request->isMethod('post')) { if (!($userId = $request->getParameter('user_id'))) { $this->forward('error', 'invalid'); } //add user if not already group member $q = LsDoctrineQuery::create()->from('sfGuardUserGroup ug')->where('ug.group_id = ? AND ug.user_id = ?', array($this->group->id, $userId)); if (!$q->count()) { $ug = new sfGuardUserGroup(); $ug->group_id = $this->group->id; $ug->user_id = $userId; $ug->save(); } $this->clearCache($this->group); $this->redirect($this->group->getInternalUrl('members')); } if ($terms = $request->getParameter('q')) { $q = sfGuardUserTable::getPublicNameSearchQuery($terms); $this->result_pager = new LsDoctrinePager($q, $page = 1, $num = 20); } }