Changeset 236


Ignore:
Timestamp:
06/15/2011 04:34:23 AM (11 months ago)
Author:
sque
Message:

A complete autonomous installation module for WiND.

Location:
trunk
Files:
5 edited

Legend:

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

    r179 r236  
    88                'password' => "yourpassword", 
    99                'database' => "yourdatabase", 
    10                 'version' => yourversion                //Ex. 4.0, 4.1, 5 
     10                'version' => 5.0                //Ex. 4.0, 4.1, 5 
    1111                ), 
    1212                 
     
    9494                'api' => '2.128e', 
    9595                'keys' => array( // Domains must be as in $_SERVER['SERVER_NAME'] variable 
    96                         'server.example.org/path' => 'example_key' 
     96                        // 'server.example.org/path' => 'example_key' 
    9797                        ), 
    9898                'bounds' => array( 
    99                         'min_latitude' => MINLAT_GPS_COORDINATE, 
    100                         'min_longitude' => MINLON_GPS_COORDINATE, 
    101                         'max_latitude' => MAXLAT_GPS_COORDINATE, 
    102                         'max_longitude' => MAXLON_GPS_COORDINATE 
     99                        'min_latitude' => 35, // MINLAT_GPS_COORDINATE, 
     100                        'min_longitude' => 17, // MINLON_GPS_COORDINATE, 
     101                        'max_latitude' => 42, // MAXLAT_GPS_COORDINATE, 
     102                        'max_longitude' => 27 // MAXLON_GPS_COORDINATE 
    103103                        ) 
    104104                ), 
     
    107107                'enabled' => FALSE 
    108108                ) 
    109                  
    110109); 
    111  
    112 ?> 
  • trunk/globals/classes/srtm.php

    r175 r236  
    2020 */ 
    2121 
     22/** 
     23 * Class to handle SRTM Data 
     24 */ 
    2225class srtm { 
    2326         
    2427        var $data_path; 
    2528         
    26         function srtm($data_path='') { 
     29        function __construct($data_path='') { 
    2730                $this->data_path = $data_path; 
     31        } 
     32         
     33        public static function get_filename($lat, $lon) { 
     34                if ($lat < 0) { 
     35                        $lat_dir = 'S'; 
     36                        $lat_adj = 1; 
     37                } else { 
     38                        $lat_dir = 'N'; 
     39                        $lat_adj = 0; 
     40                } 
     41                if ($lon < 0) { 
     42                        $lon_dir = 'W'; 
     43                        $lon_adj = 1; 
     44                } else { 
     45                        $lon_dir = 'E'; 
     46                        $lon_adj = 0; 
     47                } 
     48                 
     49                return $lat_dir . sprintf("%02.0f", (integer)($lat+$lat_adj)).$lon_dir.sprintf("%03.0f", (integer)($lon+$lon_adj)).'.hgt'; 
    2850        } 
    2951         
  • trunk/globals/common.php

    r145 r236  
    1919 * 
    2020 */ 
    21  
     21if (file_exists(ROOT_PATH."/install")) { 
     22        die("WiND error: Please delete \"install/\" folder if you have completed installation ..."); 
     23} 
    2224if (!file_exists(ROOT_PATH."config/config.php")) { 
    2325        die("WiND error: Please make config/config.php file ..."); 
  • trunk/index.php

    r143 r236  
    3333 
    3434ob_end_flush(); 
    35  
    36 ?> 
  • trunk/install/schema.sql

    r164 r236  
    11 
    2 CREATE TABLE `areas` ( 
     2CREATE TABLE IF NOT EXISTS `areas` ( 
    33  `id` int(10) unsigned NOT NULL auto_increment, 
    44  `region_id` int(10) unsigned NOT NULL default '0', 
     
    1414) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    1515 
    16 CREATE TABLE `dns_nameservers` ( 
     16CREATE TABLE IF NOT EXISTS `dns_nameservers` ( 
    1717  `id` int(10) unsigned NOT NULL auto_increment, 
    1818  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    3131) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    3232 
    33 CREATE TABLE `dns_zones` ( 
     33CREATE TABLE IF NOT EXISTS `dns_zones` ( 
    3434  `id` int(10) unsigned NOT NULL auto_increment, 
    3535  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    4949) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    5050 
    51 CREATE TABLE `dns_zones_nameservers` ( 
     51CREATE TABLE IF NOT EXISTS `dns_zones_nameservers` ( 
    5252  `id` int(10) unsigned NOT NULL auto_increment, 
    5353  `zone_id` int(10) unsigned NOT NULL default '0', 
     
    5858) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    5959 
    60 CREATE TABLE `ip_addresses` ( 
     60CREATE TABLE IF NOT EXISTS `ip_addresses` ( 
    6161  `id` int(10) unsigned NOT NULL auto_increment, 
    6262  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    7575) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    7676 
    77 CREATE TABLE `ip_ranges` ( 
     77CREATE TABLE IF NOT EXISTS `ip_ranges` ( 
    7878  `id` int(10) unsigned NOT NULL auto_increment, 
    7979  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    9393) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    9494 
    95 CREATE TABLE `links` ( 
     95CREATE TABLE IF NOT EXISTS `links` ( 
    9696  `id` int(10) unsigned NOT NULL auto_increment, 
    9797  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    114114) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    115115 
    116 CREATE TABLE `nodes` ( 
     116CREATE TABLE IF NOT EXISTS `nodes` ( 
    117117  `id` int(10) unsigned NOT NULL auto_increment, 
    118118  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    133133) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; 
    134134 
    135 CREATE TABLE `nodes_services` ( 
     135CREATE TABLE IF NOT EXISTS `nodes_services` ( 
    136136  `id` int(10) unsigned NOT NULL auto_increment, 
    137137  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    150150) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    151151 
    152 CREATE TABLE `photos` ( 
     152CREATE TABLE IF NOT EXISTS `photos` ( 
    153153  `id` int(10) unsigned NOT NULL auto_increment, 
    154154  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    164164) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    165165 
    166 CREATE TABLE `regions` ( 
     166CREATE TABLE IF NOT EXISTS `regions` ( 
    167167  `id` int(10) unsigned NOT NULL auto_increment, 
    168168  `name` varchar(40) NOT NULL default '', 
     
    176176) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    177177 
    178 CREATE TABLE `rights` ( 
     178CREATE TABLE IF NOT EXISTS `rights` ( 
    179179  `id` int(10) unsigned NOT NULL auto_increment, 
    180180  `user_id` int(10) unsigned NOT NULL default '0', 
     
    185185) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    186186 
    187 CREATE TABLE `services` ( 
     187CREATE TABLE IF NOT EXISTS `services` ( 
    188188  `id` int(10) unsigned NOT NULL auto_increment, 
    189189  `title` varchar(255) NOT NULL default '', 
     
    194194) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    195195 
    196 CREATE TABLE `subnets` ( 
     196CREATE TABLE IF NOT EXISTS `subnets` ( 
    197197  `id` int(10) unsigned NOT NULL auto_increment, 
    198198  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    207207) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    208208 
    209 CREATE TABLE `users` ( 
     209CREATE TABLE IF NOT EXISTS `users` ( 
    210210  `id` int(10) unsigned NOT NULL auto_increment, 
    211211  `date_in` datetime NOT NULL default '0000-00-00 00:00:00', 
     
    232232) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
    233233 
    234 CREATE TABLE `users_nodes` ( 
     234CREATE TABLE IF NOT EXISTS `users_nodes` ( 
    235235  `id` int(10) unsigned NOT NULL auto_increment, 
    236236  `user_id` int(10) unsigned NOT NULL default '0', 
Note: See TracChangeset for help on using the changeset viewer.