[Cartoweb-users] admin zone - new plugin?

Oliver Christen oliver.christen at camptocamp.com
Tue Jul 3 08:17:14 EDT 2007


Hi

If you dont need to interact with cartographic data, it would be probably 
easier to not make a plugin but simply put a php file in the project's 
htdocs folder.

You can access the cartoclient object like this:


<?php
// set the project name
$_ENV['CW3_PROJECT'] = 'your_project_name';
// define the path to cartoweb
if (!defined('CARTOCLIENT_HOME'))
    define('CARTOCLIENT_HOME', realpath(dirname(__FILE__) . '/../../..') . 
'/');

if (!defined('CARTOCOMMON_HOME'))
    define('CARTOCOMMON_HOME', CARTOCLIENT_HOME);
// include the main cartoweb files
require_once(CARTOCOMMON_HOME . 'common/Common.php');
Common::preInitializeCartoweb(array('client' => true));

require_once(CARTOCLIENT_HOME . 'client/Cartoclient.php');
// create a new instance of the cartoclient
$cartoclient = new Cartoclient();
// check if user is allowed
if (!$cartoclient->clientAllowed()) {
    return;
}

// add all the rest of your code here
// you should be able to access all cartoweb plugin, session and so on

?>

regards
Oliver


> Hello list,
> I'd like to manage my cartoweb users.
> I have written small php script which can do it.
> But I need implement it into cartoweb.
> Can I take the phpsession, or I have to write new plugin?
> I'm beginner to object oriented php and I don't understand cartoweb code
> very much. I have read the doc about new plugin creation, but I still
> don't know how to do it :-(
> Is there any empty plugin to download?
> How can I start please?
>
> Thanks for any advice.
>
> wochter
> _______________________________________________
> 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