[Chameleon] Show layer based on a list of layers by users

Julien-Samuel Lacroix jlacroix at mapgears.com
Wed Apr 23 10:00:09 EDT 2008


Hi,

You can use the Authenticator code in Chameleon to do the login.

http://lists.maptools.org/pipermail/chameleon/2007-November/005105.html

Once the user is authentified, you can set layer ON and OFF in your 
index.phtml between the CWCInitialize() and the CWCExecute() function.

$oApp->CWCInitialize( $szTemplate, $szMapFile  );

// Do a query to your PostgreSQL table here
// The user name is in $_SESSION['user']
// pg_connect(...);
//$szLayerName = ...

$oMap = $oApp->moMapSession->oMap;
$oLayer = $oMap->getLayerByName($szLayerName);
$oLayer->set("status", MS_OFF);

$oApp->CWCExecute();


Alexys Herleym Rodriguez Avellaneda wrote:
> Hi,
> 
> I have some tables in my postgresql database. This tables has gis web 
> users and list of layers, ej:
> 
> user             mapserver_layer
> peter           cities
> peter           countries
> luis              cities
> jhon            lakes
> paul            ....
> paul           ....
> 
> 
> I would like to show in the interface only the layers by user. If peter 
> was login, then i need to show in the chameleon interface cities and 
> countries only.
> 
> Someone have tips for to do that layer filter by user?
> 
> Thanks
> 
> Alexys
> 
> ------------------------------------------------------------------------
> 
> Yahoo! Solidario. 
> <http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52433/*http://green.yahoo.com/es/dia-de-la-tierra/>
> Intercambia los objetos que ya no necesitas y ayuda a mantener un 
> entorno más ecológico.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/


More information about the Chameleon mailing list