开发者

Manage groups in different page with sfDoctrineGuardPlugin

开发者 https://www.devze.com 2023-02-22 11:30 出处:网络
i\'m using sfDoctrineGuardPlugin, but i would like a little change, i have 2 groups(admins,users) and i want to manage them separately, what i mean is a page that only shows me the \"admins\" group an

i'm using sfDoctrineGuardPlugin, but i would like a little change, i have 2 groups(admins,users) and i want to manage them separately, what i mean is a page that only shows me the "admins" group and another one the "users" group, i want this because users in "users" group will have some additional info and behavior, i already create a "sfGuardUser" empty module in my backend app, so i can overwrite and add everything i want, i create de actions.class.php

class sfGuardUserActions extends autoSfGuardUserActions
{
    public function executeAdmins(sfWebRequest $request)
    {
        // sorting
        if ($request->getParameter('sort') && $this->isValidSortColumn($request->getParameter('sort')))
        {
            $this->setSort(array($request->getParameter('sort'), $request->getParameter('sort_type')));
        }

        // pager
        if ($request->getParameter('page'))
        {
            $this->setPage($request->getParameter('page'));
        }

        $this->pager = $this->getPager();
        $this->sort = $this->getSort();
    }
}

i copied exactly the "executeIndex" function from "autoSfGuardUserAct开发者_StackOverflowions" class in cache, and now i can go to guard/admin and it acts like the default one, but now, how can i show only de users from "admins" group?


You have to modify buildQuery() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消