[Cartoweb-users] CartoWeb and projections & dynamicfiltering

oliver oliver.christen at camptocamp.com
Thu Mar 2 09:27:46 EST 2006


Hi Raihan,

there is no default smarty variable that is set if user is logged.
you will need to create a simple plugin, see below:

create a plugin which will implement GuiProvider

class ClientSomeNameForThisPlugin extends ClientPlugin implements
GuiProvider {
     /**
     * @see GuiProvider::renderForm()
     */
    public function renderForm(Smarty $template) {

        $allowedRoles = $this->getArrayFromIni('general.allowedRoles',
true);
        $allowed = SecurityManager::getInstance()->hasRole($allowedRoles);

        $template->assign('isLogged', $allowed);
    }

    /* the two function below must be present, even if left empty */
    handleHttpGetRequest();
    handleHttpPostRequest();
}

set the security role in client.ini (if not already done)

securityAllowedRoles = loggedIn

and in the template, simply enclose your image with the smarty tags like
that:

{if $isLogged}<your image here>{/if}

Regards,
Oliver


> Hi
> I added  a clickable image in the toolbar. I like to hide that icon
> when user is not logged on.
>
> I can do it for layers, but i don't know is there any feature of cartoweb 
> to do this.
>
> Need help.
>
> Best regards,
> Raihan
>
>
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> 



More information about the Cartoweb-users mailing list