--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2004 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 *
+ ***************************************************************************/
+
+// {{{ config HOOK
+// {{{ class ManageursConfig
+
+class ManageursConfig
+{
+ var $authorized_ips = '129.104.30.32 129.104.30.33';
+ var $manageurs_cipher_key = '';
+ var $manageurs_pass = '';
+}
+
+// }}}
+
+function manageurs_config()
+{
+ global $globals;
+ $globals->manageurs = new ManageursConfig;
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
require_once('xorg.inc.php');
require_once('webservices/manageurs.server.inc.php');
+$ips = array_flip(split(' ',$globals->manageurs->authorized_ips));
-if(isset($GLOBALS['manageurs_authorized_ips'][$_SERVER['REMOTE_ADDR']])){
+if($ips && isset($ips[$_SERVER['REMOTE_ADDR']])){
$server = xmlrpc_server_create();
function manageurs_encrypt_init($id_assoce){
- global $tripledes;
+ global $tripledes, $globals;
if(!$tripledes){
- if(empty($GLOBALS['manageurs_cipher_key'])){
+ if(empty($globals->manageurs->manageurs_cipher_key)){
return 1;
}
$tripledes = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($tripledes), MCRYPT_RAND);
- mcrypt_generic_init($tripledes, $GLOBALS['manageurs_cipher_key'].$id_assoce, $iv);
+ mcrypt_generic_init($tripledes, $globals->manageurs->manageurs_cipher_key.$id_assoce, $iv);
return 0;
}
}
if($tripledes){
mcrypt_generic_deinit($tripledes);
mcrypt_module_close($tripledes);
+ $tripledes = '';
}
}
global $error_mat, $error_key, $globals;
//verif du mdp
- if(!isset($params[0]) || ($params[0] != $GLOBALS['manageurs_pass'])){return false;}
+ if(!isset($params[0]) || ($params[0] != $globals->manageurs->manageurs_pass)){return false;}
//si on a adresse == -1 => on ne recupère aucune adresse
if(isset($params[2]) && ($params[2] == -1)) unset($params[2]);