Options +FollowSymLinks
RewriteEngine on
-RewriteBase /~x2000habouzit
+RewriteBase /~x2001corpet
# Rewrite URLs of the form 'index.php?q=x':
RewriteCond %{REQUEST_FILENAME} !-f
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-
-require_once('xnet.inc.php');
-
-$querystring = "";
-foreach ($_GET as $v => $a)
- if ($v != 'initfile')
- $querystring .= '&'.urlencode($v).'='.urlencode($a);
-$initfile = urlencode('geolocInit.php?'.$querystring);
-
-if (urlencode(Env::v('initfile')) != $initfile)
-{
- header("Location: dynamap.php?initfile=$initfile{$querystring}");
- die();
-}
-
-header("Content-type: application/x-shockwave-flash");
-
-if ($globals->geoloc->use_map)
- readfile($globals->geoloc->dynamap_path);
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-
-if ($globals->asso('pub') == 'public') {
- new_group_page('geoloc/index.tpl');
-} else {
- new_groupadmin_page('geoloc/index.tpl');
-}
-
-$page->assign('no_annu', true);
-$page->assign('dynamap_vars', 'none');
-$page->run();
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-require_once('xnet.inc.php');
-
-header("Content-type: text/xml");
-new_nonhtml_page('geoloc/geolocInit.tpl');
-
-$page->assign('background', '#F4FAD4');
-$page->run();
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-require 'xnet.inc.php';
-
-
-header("Content-type: text/xml");
-
-new_nonhtml_page('geoloc/getCityInfos.tpl');
-
-require_once('geoloc.inc.php');
-require_once('search.inc.php');
-
-$_REQUEST['asso_id'] = $globals->asso('id');
-$_REQUEST['only_current'] = 1;
-$assoField = new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid');
-$cityIdField = new RefSField('cityid',array('av.cityid'),'adresses','av',getadr_join('av'));
-
-$fields = new SFieldGroup(true, array($assoField, $cityIdField));
-$where = $fields->get_where_statement();
-if ($where) $where = "WHERE ".$where;
-
-$users = XDB::iterator("
- SELECT u.user_id AS id, u.prenom, u.nom, u.promo
- FROM adresses AS a
-INNER JOIN auth_user_md5 AS u ON(u.user_id = a.uid)
-INNER JOIN auth_user_quick AS q ON(q.user_id = a.uid)
- ".$fields->get_select_statement()."
- ".$where."
- GROUP BY u.user_id LIMIT 11",
- $id);
-
-if ($globals->asso('pub') == 'public' || S::has_perms())
- $page->assign('users', $users);
-
-$page->run();
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-require 'xnet.inc.php';
-
-new_nonhtml_page('geoloc/getData.tpl');
-$nodata = ($globals->asso('pub') != 'public') && !S::has_perms();
-
-header("Content-type: text/xml");
-
-require_once('geoloc.inc.php');
-require_once('search.inc.php');
-
-$querystring = "";
-foreach ($_GET as $v => $a)
- if ($v != 'mapid')
- $querystring .= urlencode($v).'='.urlencode($a).'&';
-$page->assign('searchvars', $querystring);
-if (Env::has('mapid'))
- $mapid = Env::i('mapid', -2);
-else
- $mapid = false;
-
-$_REQUEST['asso_id'] = $globals->asso('id');
-$_REQUEST['only_current'] = 1;
-$assoField = new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid');
-
-if (!$nodata) {
- list($countries, $cities) = geoloc_getData_subcountries($mapid, array($assoField), 10);
- $page->assign('countries', $countries);
- $page->assign('cities', $cities);
-}
-
-$page->run();
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-
-require_once('xnet.inc.php');
-
-new_nonhtml_page('');
-
-header("Content-type: application/x-shockwave-flash");
-
-if ($globals->geoloc->use_map) {
- readfile($globals->geoloc->icon_path);
-}
-
-?>
require_once dirname(__FILE__).'/../classes/Xnet.php';
require_once dirname(__FILE__).'/../classes/PLModule.php';
-$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents');
+$GLOBALS['IS_XNET_SITE'] = true;
+$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'geoloc');
$platal->run();
?>
XDB::execute('INSERT INTO geoloc_maps VALUES '.substr($s, 1));
return true;
}
+// }}}
// {{{ get_address_text($adr)
/** make the text of an address that can be read by a mailman
if (may_update() || $globals->asso('pub') == 'public') {
$sub['annuaire du groupe'] = "$dim/annuaire";
if ($globals->xnet->geoloc)
- $sub['carte'] = "$dim/geoloc.php";
+ $sub['carte'] = "$dim/geoloc";
}
if ($globals->asso('mail_domain')) {
$sub['listes de diffusion'] = "$dim/lists";
'geoloc/init' => $this->make_hook('init', AUTH_COOKIE),
'geoloc/city' => $this->make_hook('city', AUTH_COOKIE),
'geoloc/country' => $this->make_hook('country', AUTH_COOKIE),
+ '%grp/geoloc' => $this->make_hook('default',AUTH_COOKIE),
+ '%grp/geoloc/icon.swf' => $this->make_hook('icon', AUTH_COOKIE),
+ '%grp/geoloc/dynamap.swf'=> $this->make_hook('dynamap',AUTH_COOKIE),
+ '%grp/geoloc/init' => $this->make_hook('init', AUTH_COOKIE),
+ '%grp/geoloc/city' => $this->make_hook('city', AUTH_COOKIE),
+ '%grp/geoloc/country' => $this->make_hook('country',AUTH_COOKIE),
);
}
{
global $globals;
- require_once 'search.inc.php';
+ if (!is_file(dirname(__FILE__).'/geoloc/dynamap.swf') ||
+ !is_file(dirname(__FILE__).'/geoloc/icon.swf'))
+ $page->assign('request_geodesix', 1);
- $page->changeTpl('geoloc/index.tpl');
+ if (!empty($GLOBALS['IS_XNET_SITE'])) {
+ $page->useMenu();
+ $page->setType($globals->asso('cat'));
+ $page->assign('no_annu', 1);
+ }
+ require_once 'search.inc.php';
+ $page->changeTpl('geoloc/index.tpl');
$fields = new SFieldGroup(true, advancedSearchFromInput());
$search = $fields->get_url();
if (!Env::has('only_current'))
$search = preg_replace('/(^|&)mapid=([0-9]+)(&|$)/','\1\3', $search);
if ($search)
$search = '?'.$search;
- $initfile = urlencode('geoloc/init'.$search);
- $page->assign('flashvars','initfile='.$initfile);
+ $page->assign('search',$search);
$page->assign('protocole', substr($globals->baseurl,0,strpos($globals->baseurl,':')));
header("Content-type: application/x-shockwave-flash");
header("Pragma:");
- if ($globals->geoloc->use_map) {
- readfile($globals->geoloc->icon_path);
- exit;
- }
+ readfile(dirname(__FILE__).'/geoloc/icon.swf');
+ exit;
return PL_NOT_FOUND;
}
header("Content-type: application/x-shockwave-flash");
- if ($globals->geoloc->use_map) {
- header("Pragma:");
- readfile($globals->geoloc->dynamap_path);
- exit;
- }
+ header("Pragma:");
+ readfile(dirname(__FILE__).'/geoloc/dynamap.swf');
+ exit;
return PL_NOT_FOUND;
}
header('Content-type: text/xml');
header('Pragma:');
+ if(!empty($GLOBALS['IS_XNET_SITE']))
+ $page->assign('background', 0xF2E9D0);
$page->assign('querystring', $this->_make_qs());
}
require_once('geoloc.inc.php');
require_once('search.inc.php');
- $usual_fields = advancedSearchFromInput();
- $fields = new SFieldGroup(true, $usual_fields);
+ if (empty($GLOBALS['IS_XNET_SITE'])) {
+ $usual_fields = advancedSearchFromInput();
+ $fields = new SFieldGroup(true, $usual_fields);
+ } else {
+ $_REQUEST['asso_id'] = $globals->asso('id');
+ $_REQUEST['only_current'] = 'on';
+ $fields = new SFieldGroup(true, array(
+ new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid'),
+ new RefSField('cityid',array('av.cityid'),'adresses','av',getadr_join('av'))));
+ }
$where = $fields->get_where_statement();
if ($where) $where = "WHERE ".$where;
$page->assign('searchvars', $querystring);
$mapid = Env::has('mapid') ? Env::i('mapid', -2) : false;
+ if (empty($GLOBALS['IS_XNET_SITE'])) {
+ $fields = advancedSearchFromInput();
+ } else {
+ $_REQUEST['asso_id'] = $globals->asso('id');
+ $_REQUEST['only_current'] = 'on';
+ $fields = array(new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid'));
+ }
- list($countries, $cities) = geoloc_getData_subcountries($mapid, advancedSearchFromInput(), 10);
+ list($countries, $cities) = geoloc_getData_subcountries($mapid, $fields, 10);
$page->assign('countries', $countries);
$page->assign('cities', $cities);
textYouHaveSelected="Tu as sélectionné "\r
{if $background}\r
background="{$background}"\r
+zoomBarBackgroundColor="{$background}"\r
{/if} \r
textCopyright="Les règles de l'annuaire s'appliquent aussi à cette application"\r
-iconSwf="geoloc/icon.swf"\r
-scriptInfosArea="geoloc/country?{$querystring}"/>\r
+iconSwf="{$platal->ns}geoloc/icon.swf"\r
+scriptInfosArea="{$platal->ns}geoloc/country?{$querystring}"/>\r
{if $country.nbPop > 0 or $country.id eq 0}\r
<map x="{$country.x}" y="{$country.y}" height="{$country.height}" width="{$country.width}" ratio="{$country.rat}"/>\r
<icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name|utf8_encode}" green="{if $country.nbPop}{$country.yellow/$country.nbPop}{else}0{/if}" blue="0" alpha="0.7"/>\r
- <moreinfos url="geoloc/country?{$searchvars}mapid={$country.id}"/>\r
+ <moreinfos url="{$platal->ns}geoloc/country?{$searchvars}mapid={$country.id}"/>\r
{/if}\r
</country>\r
{/foreach}\r
{foreach from=$cities item="city"}\r
<city id="{$city.id}" name="{$city.name}">\r
<icon x="{$city.x}" y="{$city.y}" nb="{$city.pop}" size="{$city.size}" name="{$city.name}" green="{if $city.pop}{$city.yellow/$city.pop}{else}0{/if}" blue="0"/>\r
- <moreinfos url="geoloc/city?{$searchvars}cityid={$city.id}"/>\r
+ <moreinfos url="{$platal->ns}geoloc/city?{$searchvars}cityid={$city.id}"/>\r
</city>\r
{/foreach}\r
</cities>\r
{literal}
function ficheXorg(id)
{
- window.open('profile/'+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600');
+ window.open('{/literal}{if $no_annu}https://www.polytechnique.org/{/if}{literal}profile/'+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600');
}
{/literal}
{if !$no_annu}
Aujourd'hui {$localises} de nos camarades sont localisés grâce à leurs adresses personnelles.
</p>
{/if}
-{if $globals->geoloc->use_map}
+{if !$request_geodesix}
<p class="center">
<embed
- src="geoloc/dynamap.swf"
+ src="{$platal->ns}geoloc/dynamap.swf"
quality="high"
bgcolor="#ffffff"
width="600"
name="dynamap"
id="dynamap"
align="middle"
- flashvars="{$flashvars}"
+ flashvars="initfile={$platal->ns}geoloc%2Finit{$search}"
type="application/x-shockwave-flash"
menu="false"
wmode="opaque"