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
[email protected]
http://lists.maptools.org/mailman/listinfo/cartoweb-users


_______________________________________________
Cartoweb-users mailing list
[email protected]
http://lists.maptools.org/mailman/listinfo/cartoweb-users

Reply via email to