root/trunk/dntp/action.php

Revision 10, 2.3 KB (checked in by alexx, 7 years ago)

* remove last "domain dependency" (hard coded domain)
* replace hard coded IP or login (for debug/administration purpose) by configuration array $configadmin_login? and $configadmin_ip?
* replace hard coded email by $configemail?
* manage smarty var by $_SMARTY (that will be assigned on time at the end of script), dotnode-*.php from the root has been modified
* fixe gettext file to reflect change into terms that contain an hard coded email
* some minor change

Line 
1<?php
2/****************************************************** Open .node ***
3 * Description:   
4 * Status:        Stable.
5 * Author:        Alexandre Dath <alexandre@dotnode.com>
6 * $Id$
7 *
8 * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************** http://opensource.ikse.net/projects/dotnode ***/
24
25include('../includes/includes.inc.php');
26include('../includes/config/dntp.inc.php');
27
28session_start();
29
30$token = retreive_url_info($_SERVER["PHP_SELF"]);
31
32error_log($_SERVER['HTTP_HOST'].' | '.$_SERVER['PHP_SELF'].' | '.$_SESSION['my_login']);
33
34        $db =& DB::connect($dsn);
35        if (DB::isError($db))
36                error_log($_SERVER['HTTP_HOST'].' | '.__FILE__.' | Connexion SQL impossible : '.$db->getMessage());
37        $db->setFetchMode(DB_FETCHMODE_ASSOC);
38
39        for($idx=(count($token)-1); $idx>=0; $idx--)
40        {
41                $action = "";
42                for($level=1; $level<=$idx; $level++)
43                        $action .= $token[$level].'/';
44                $action = substr($action,0,-1).'.action.php';
45                error_log($_SERVER['HTTP_HOST'].' | Include action : '.ACTIONSPATH.'/'.$action);
46                if(file_exists(ACTIONSPATH.'/'.$action))
47                        break;
48        }
49
50        if(file_exists(ACTIONSPATH.'/'.$action) )
51                include(ACTIONSPATH.'/'.$action);
52        else
53        {
54                header("HTTP/1.1 403 Forbidden");
55                print $_SERVER["PHP_SELF"].": Action forbidden<br />\n";
56                if($_SERVER['REMOTE_ADDR'] == $config['admin_ip'])
57                        print ACTIONSPATH.'/'.$action;
58        }
59
60        $db->disconnect();
61?>
Note: See TracBrowser for help on using the browser.