Changeset 143 for trunk


Ignore:
Timestamp:
02/27/2006 12:50:42 AM (6 years ago)
Author:
cirrus
Message:

Change: $root_path variable was changed to a constant due to possible security issues.

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/config-sample/config.php

    r141 r143  
    2525 
    2626        'templates' => array( 
    27                 'path' => $root_path.'templates/', 
    28                 'compiled_path' => $root_path.'templates/_compiled/', 
     27                'path' => ROOT_PATH.'templates/', 
     28                'compiled_path' => ROOT_PATH.'templates/_compiled/', 
    2929                'default' => 'basic' 
    3030                ), 
     
    4646                'ns_zone' => 'ns.yourdomain', 
    4747                'reverse_zone' => 'in-addr.arpa', 
    48                 'forward_zone_schema' => $root_path.'tools/dnszones-poller/yourdomain.schema', 
    49                 'reverse_zone_schema' => $root_path.'tools/dnszones-poller/10.in-addr.arpa.schema' 
     48                'forward_zone_schema' => ROOT_PATH.'tools/dnszones-poller/yourdomain.schema', 
     49                'reverse_zone_schema' => ROOT_PATH.'tools/dnszones-poller/10.in-addr.arpa.schema' 
    5050                ), 
    5151         
    5252        'folders' => array( 
    53                 'photos' => $root_path.'files/photos/' 
     53                'photos' => ROOT_PATH.'files/photos/' 
    5454                ), 
    5555         
     
    6262         
    6363        'srtm' => array( 
    64                 'path' => $root_path.'files/srtm/' 
     64                'path' => ROOT_PATH.'files/srtm/' 
    6565                ), 
    6666                 
  • trunk/debug/mysql.php

    r100 r143  
    2222ob_start(); 
    2323 
    24 $root_path = "../"; 
     24define("ROOT_PATH","../"); 
    2525 
    26 include_once($root_path."globals/common.php"); 
     26include_once(ROOT_PATH."globals/common.php"); 
    2727if ($vars['debug']['enabled'] == FALSE) die("WiND: Debug mode is not enabled. Check the config file.") ; 
    2828 
     
    6363} 
    6464 
    65 include_once($root_path."includes/main.php"); 
     65include_once(ROOT_PATH."includes/main.php"); 
    6666 
    6767echo '<table border="1">'; 
  • trunk/globals/classes/message.php

    r71 r143  
    5252         
    5353        function output() { 
    54                 global $vars, $design, $root_path, $smarty, $lang; 
     54                global $vars, $design, $smarty, $lang; 
    5555                 
    5656                if (isset($this->forward)) { 
  • trunk/globals/common.php

    r141 r143  
    2020 */ 
    2121 
    22 if (!file_exists($root_path."config/config.php")) { 
     22if (!file_exists(ROOT_PATH."config/config.php")) { 
    2323        die("WiND error: Please make config/config.php file ..."); 
    2424} 
    25 include_once($root_path."globals/vars.php"); 
    26 include_once($root_path."config/config.php"); 
     25include_once(ROOT_PATH."globals/vars.php"); 
     26include_once(ROOT_PATH."config/config.php"); 
    2727$vars = array_merge($vars, $config); 
    2828include_once($vars['templates']['path'].$vars['templates']['default'].'/config.php'); 
    2929$vars = array_merge($vars, $template_config); 
    30 include_once($root_path."globals/functions.php"); 
     30include_once(ROOT_PATH."globals/functions.php"); 
    3131 
    3232$php_start = getmicrotime(); 
    3333 
    34 include_once($root_path."globals/classes/mysql.php"); 
    35 include_once($root_path."globals/classes/construct.php"); 
    36 include_once($root_path."globals/classes/form.php"); 
    37 include_once($root_path."globals/classes/table.php"); 
     34include_once(ROOT_PATH."globals/classes/mysql.php"); 
     35include_once(ROOT_PATH."globals/classes/construct.php"); 
     36include_once(ROOT_PATH."globals/classes/form.php"); 
     37include_once(ROOT_PATH."globals/classes/table.php"); 
    3838 
    3939if (!file_exists($vars['smarty']['class'])) { 
     
    6969        $tl = $vars['language']['default']; 
    7070} 
    71 include_once($root_path."globals/language/".$tl.".php"); 
    72 if (file_exists($root_path."config/language/".$tl."_overwrite.php")) { 
    73         include_once($root_path."config/language/".$tl."_overwrite.php"); 
     71include_once(ROOT_PATH."globals/language/".$tl.".php"); 
     72if (file_exists(ROOT_PATH."config/language/".$tl."_overwrite.php")) { 
     73        include_once(ROOT_PATH."config/language/".$tl."_overwrite.php"); 
    7474        $lang = array_multimerge($lang, $lang_overwrite); 
    7575} 
  • trunk/globals/functions.php

    r138 r143  
    4747 
    4848function get($key) { 
    49         global $page_admin, $main, $root_path; 
     49        global $page_admin, $main; 
    5050        if ($_SERVER['REQUEST_METHOD'] == 'GET') { 
    5151                $ret = $_GET[$key]; 
     
    5656        switch ($key) { 
    5757                case 'page': 
    58                         $valid_array = getdirlist($root_path."includes/pages/"); 
     58                        $valid_array = getdirlist(ROOT_PATH."includes/pages/"); 
    5959                        array_unshift($valid_array, 'startup'); 
    6060                        break; 
    6161                case 'subpage': 
    62                         $valid_array = getdirlist($root_path."includes/pages/".get('page').'/', FALSE, TRUE); 
     62                        $valid_array = getdirlist(ROOT_PATH."includes/pages/".get('page').'/', FALSE, TRUE); 
    6363                        for ($key=0;$key<count($valid_array);$key++) { 
    6464                                $valid_array[$key] = basename($valid_array[$key], '.php'); 
     
    7373                        break; 
    7474                case 'lang': 
    75                         $valid_array = getdirlist($root_path."globals/language/", FALSE, TRUE); 
     75                        $valid_array = getdirlist(ROOT_PATH."globals/language/", FALSE, TRUE); 
    7676                        for ($key=0;$key<count($valid_array);$key++) { 
    7777                                $valid_array[$key] = basename($valid_array[$key], '.php'); 
  • trunk/includes/html.php

    r115 r143  
    2020 */ 
    2121 
    22 include_once($root_path."includes/head.php"); 
    23 include_once($root_path."includes/body.php"); 
     22include_once(ROOT_PATH."includes/head.php"); 
     23include_once(ROOT_PATH."includes/body.php"); 
    2424 
    2525class html { 
  • trunk/includes/main.php

    r100 r143  
    2020 */ 
    2121 
    22 include_once($root_path."includes/html.php"); 
    23 include_once($root_path."globals/classes/userdata.php"); 
    24 include_once($root_path."globals/classes/message.php"); 
    25 include_once($root_path."includes/main_header.php"); 
    26 include_once($root_path."includes/main_center.php"); 
    27 include_once($root_path."includes/main_footer.php"); 
    28 include_once($root_path."includes/main_menu.php"); 
     22include_once(ROOT_PATH."includes/html.php"); 
     23include_once(ROOT_PATH."globals/classes/userdata.php"); 
     24include_once(ROOT_PATH."globals/classes/message.php"); 
     25include_once(ROOT_PATH."includes/main_header.php"); 
     26include_once(ROOT_PATH."includes/main_center.php"); 
     27include_once(ROOT_PATH."includes/main_footer.php"); 
     28include_once(ROOT_PATH."includes/main_menu.php"); 
    2929 
    3030class main { 
     
    4949         
    5050        function output() { 
    51                 global $root_path, $lang; 
     51                global $lang; 
    5252                 
    5353                $this->html->head->add_title($lang['site_title']); 
  • trunk/includes/main_center.php

    r140 r143  
    2020 */ 
    2121 
    22 include_once($root_path."includes/pages/".get('page')."/".get('page').".php"); 
     22include_once(ROOT_PATH."includes/pages/".get('page')."/".get('page').".php"); 
    2323 
    2424class center { 
  • trunk/includes/main_footer.php

    r101 r143  
    3434                $this->tpl['mysql_time'] = $db->total_time; 
    3535                if ($main->userdata->privileges['admin'] === TRUE && $vars['debug']['enabled'] == TRUE) { 
    36                         $this->tpl['debug_mysql'] = $root_path."debug/mysql.php?".get_qs(); 
     36                        $this->tpl['debug_mysql'] = ROOT_PATH."debug/mysql.php?".get_qs(); 
    3737                } 
    3838                return template($this->tpl, __FILE__); 
  • trunk/includes/main_header.php

    r136 r143  
    2929         
    3030        function output() { 
    31                 global $root_path; 
    3231                if ($this->hide) return; 
    33                 if (file_exists($root_path.'config/mylogo.png')) { 
     32                if (file_exists(ROOT_PATH.'config/mylogo.png')) { 
    3433                        $this->tpl['mylogo'] = TRUE; 
    35                         $this->tpl['mylogo_dir'] = $root_path.'config/'; 
     34                        $this->tpl['mylogo_dir'] = ROOT_PATH.'config/'; 
    3635                } 
    3736                return template($this->tpl, __FILE__); 
  • trunk/includes/pages/admin/admin.php

    r1 r143  
    2020 */ 
    2121 
    22 if (get('subpage') != '') include_once($root_path."includes/pages/admin/admin_".get('subpage').".php"); 
     22if (get('subpage') != '') include_once(ROOT_PATH."includes/pages/admin/admin_".get('subpage').".php"); 
    2323 
    2424class admin { 
  • trunk/includes/pages/gearth/gearth.php

    r141 r143  
    2222 
    2323if (get('subpage') != '') { 
    24         include_once($root_path."includes/pages/gearth/gearth_".get('subpage').".php"); 
     24        include_once(ROOT_PATH."includes/pages/gearth/gearth_".get('subpage').".php"); 
    2525} else { 
    26         include_once($root_path."includes/pages/gearth/gearth_main.php"); 
     26        include_once(ROOT_PATH."includes/pages/gearth/gearth_main.php"); 
    2727} 
    2828 
  • trunk/includes/pages/gmap/gmap.php

    r42 r143  
    2121 
    2222if (get('subpage') != '') { 
    23         include_once($root_path."includes/pages/gmap/gmap_".get('subpage').".php"); 
     23        include_once(ROOT_PATH."includes/pages/gmap/gmap_".get('subpage').".php"); 
    2424} else { 
    25         include_once($root_path."includes/pages/gmap/gmap_fullmap.php"); 
     25        include_once(ROOT_PATH."includes/pages/gmap/gmap_fullmap.php"); 
    2626} 
    2727 
  • trunk/includes/pages/hostmaster/hostmaster.php

    r1 r143  
    2020 */ 
    2121 
    22 if (get('subpage') != '') include_once($root_path."includes/pages/hostmaster/hostmaster_".get('subpage').".php"); 
     22if (get('subpage') != '') include_once(ROOT_PATH."includes/pages/hostmaster/hostmaster_".get('subpage').".php"); 
    2323 
    2424class hostmaster { 
  • trunk/includes/pages/mynodes/mynodes.php

    r141 r143  
    2020 */ 
    2121 
    22 if (get('subpage') != '') include_once($root_path."includes/pages/mynodes/mynodes_".get('subpage').".php"); 
     22if (get('subpage') != '') include_once(ROOT_PATH."includes/pages/mynodes/mynodes_".get('subpage').".php"); 
    2323 
    2424class mynodes { 
     
    493493         
    494494        function output_onpost_table_photosview() { 
    495                 global $root_path, $vars, $db, $main; 
     495                global $vars, $db, $main; 
    496496                foreach( (array) $_POST['id'] as $key => $value) { 
    497497                        $db->del("photos", "id = '".$value."'"); 
    498498                        $uploaddir = $vars['folders']['photos']; 
    499499                        $filename = 'photo-'.$value.".*"; 
    500                         delfile($root_path.$uploaddir.$filename); 
     500                        delfile(ROOT_PATH.$uploaddir.$filename); 
    501501                        $filename = 'photo-'.$value."-*.*"; 
    502                         delfile($root_path.$uploaddir.$filename); 
     502                        delfile(ROOT_PATH.$uploaddir.$filename); 
    503503                } 
    504504                foreach( (array) array('N','NE','E','SE','S','SW','W','NW', 'PANORAMIC') as $value) { 
     
    510510                                $filename = 'photo-'.$ins_id.'.jpg'; 
    511511                                $filename_s = 'photo-'.$ins_id.'-s.jpg'; 
    512                                 if (@move_uploaded_file($_FILES[$value]['tmp_name'], $root_path.$uploaddir.$filename) === FALSE) { 
     512                                if (@move_uploaded_file($_FILES[$value]['tmp_name'], ROOT_PATH.$uploaddir.$filename) === FALSE) { 
    513513                                        $db->del("photos", "id = '".$ins_id."'"); 
    514514                                        $main->message->set_fromlang("error", "upload_file_failed"); 
     
    516516                                } 
    517517                                if ($value == 'PANORAMIC') { 
    518                                         $image_s = resizeJPG($root_path.$uploaddir.$filename, 600, 200); 
     518                                        $image_s = resizeJPG(ROOT_PATH.$uploaddir.$filename, 600, 200); 
    519519                                } else { 
    520                                         $image_s = resizeJPG($root_path.$uploaddir.$filename, 200, 200); 
     520                                        $image_s = resizeJPG(ROOT_PATH.$uploaddir.$filename, 200, 200); 
    521521                                } 
    522                                 imagejpeg($image_s, $root_path.$uploaddir.$filename_s); 
     522                                imagejpeg($image_s, ROOT_PATH.$uploaddir.$filename_s); 
    523523                        } elseif ($_POST['info-'.$value] != '') { 
    524524                                $db->set("photos", array('info' => $_POST['info-'.$value]), "node_id = ".intval(get('node'))." AND view_point = '".$value."'"); 
  • trunk/includes/pages/nodes/nodes.php

    r1 r143  
    2121 
    2222if (get('subpage') != '') { 
    23         include_once($root_path."includes/pages/nodes/nodes_".get('subpage').".php"); 
     23        include_once(ROOT_PATH."includes/pages/nodes/nodes_".get('subpage').".php"); 
    2424} else { 
    2525        if (get('node') != '') { 
    26                 include_once($root_path."includes/pages/nodes/nodes_view.php"); 
     26                include_once(ROOT_PATH."includes/pages/nodes/nodes_view.php"); 
    2727        } else { 
    28                 include_once($root_path."includes/pages/nodes/nodes_search.php"); 
     28                include_once(ROOT_PATH."includes/pages/nodes/nodes_search.php"); 
    2929        } 
    3030} 
  • trunk/includes/pages/nodes/nodes_plot.php

    r130 r143  
    2020 */ 
    2121 
    22 include_once($root_path.'globals/classes/geocalc.php'); 
     22include_once(ROOT_PATH.'globals/classes/geocalc.php'); 
    2323$geocalc = new geocalc(); 
    2424 
    25 include_once($root_path.'globals/classes/srtm.php'); 
     25include_once(ROOT_PATH.'globals/classes/srtm.php'); 
    2626$srtm = new srtm($vars['srtm']['path']); 
    2727 
    28 include_once($root_path.'globals/classes/geoimage.php'); 
     28include_once(ROOT_PATH.'globals/classes/geoimage.php'); 
    2929$geoimage = new geoimage(); 
    3030 
  • trunk/includes/pages/nodes/nodes_plot_link.php

    r129 r143  
    2020 */ 
    2121  
    22 include_once($root_path.'globals/classes/geocalc.php'); 
     22include_once(ROOT_PATH.'globals/classes/geocalc.php'); 
    2323$geocalc = new geocalc(); 
    2424 
    25 include_once($root_path.'globals/classes/srtm.php'); 
     25include_once(ROOT_PATH.'globals/classes/srtm.php'); 
    2626$srtm = new srtm($vars['srtm']['path']); 
    2727 
  • trunk/includes/pages/nodes/nodes_view.php

    r140 r143  
    2020 */ 
    2121 
    22 include_once($root_path.'globals/classes/geocalc.php'); 
     22include_once(ROOT_PATH.'globals/classes/geocalc.php'); 
    2323$geocalc = new geocalc(); 
    2424 
    25 include_once($root_path.'globals/classes/srtm.php'); 
     25include_once(ROOT_PATH.'globals/classes/srtm.php'); 
    2626$srtm = new srtm($vars['srtm']['path']); 
    2727 
  • trunk/includes/pages/pickup/pickup.php

    r1 r143  
    2020 */ 
    2121 
    22 if (get('subpage') != '') include_once($root_path."includes/pages/pickup/pickup_".get('subpage').".php"); 
     22if (get('subpage') != '') include_once(ROOT_PATH."includes/pages/pickup/pickup_".get('subpage').".php"); 
    2323 
    2424class pickup { 
  • trunk/includes/pages/ranges/ranges.php

    r1 r143  
    2020 */ 
    2121 
    22 if (get('subpage') != '') include_once($root_path."includes/pages/ranges/ranges_".get('subpage').".php"); 
     22if (get('subpage') != '') include_once(ROOT_PATH."includes/pages/ranges/ranges_".get('subpage').".php"); 
    2323 
    2424class ranges { 
  • trunk/includes/pages/startup/startup.php

    r136 r143  
    2929         
    3030        function output() { 
    31                 global $root_path; 
    32                 if (file_exists($root_path."config/startup.html")) $this->tpl['startup_html'] = file_get_contents($root_path."config/startup.html"); 
     31                if (file_exists(ROOT_PATH."config/startup.html")) $this->tpl['startup_html'] = file_get_contents(ROOT_PATH."config/startup.html"); 
    3332                return template($this->tpl, __FILE__); 
    3433        } 
  • trunk/includes/pages/users/users.php

    r87 r143  
    2020 */ 
    2121 
    22 if (get('action') == 'restore') include_once($root_path."includes/pages/users/users_restore.php"); 
     22if (get('action') == 'restore') include_once(ROOT_PATH."includes/pages/users/users_restore.php"); 
    2323 
    2424class users { 
  • trunk/index.php

    r1 r143  
    2222ob_start(); 
    2323 
    24 $root_path = "./"; 
     24define("ROOT_PATH","./"); 
    2525 
    26 include_once($root_path."globals/common.php"); 
     26include_once(ROOT_PATH."globals/common.php"); 
    2727 
    28 include_once($root_path."includes/main.php"); 
     28include_once(ROOT_PATH."includes/main.php"); 
    2929 
    3030$main = new main; 
Note: See TracChangeset for help on using the changeset viewer.