Changeset 676

Show
Ignore:
Timestamp:
06/25/07 01:31:21 (18 months ago)
Author:
raphael
Message:

Fixed #430: Error in sql query of vhcs2ispcp.sql
Fixed #419: Error 500: segfault

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r674 r676  
    1515                * Fixed #425: WARNING: KEY or IV has invalid length 
    1616        - SETUP: 
    17                 * Fixed #428: ERROR: External command '/usr/bin/mysql --host=localhost --user=root --pass= < /tmp/db.sql 1>/tmp/db.sql.stdout 2>/tmp/db.sql.stderr' returned '1'  
     17                * Fixed #428: ERROR: External command '/usr/bin/mysql --host=localhost --user=root --pass= < /tmp/db.sql 1>/tmp/db.sql.stdout 2>/tmp/db.sql.stderr' returned '1' 
     18                * Fixed #430: Error in sql query of vhcs2ispcp.sql 
     19        - GUI: 
     20                * Fixed #419: Error 500: segfault 
    1821 
    19222007-06-21 Benedikt Heintel 
  • trunk/engine/setup/vhcs2ispcp.pl

    r670 r676  
    22 
    33# VHCS 2.4.7.1 to ispCP Omega migration script 
    4 # Copyright (c) 2007 by Raphael Geissert <atomo64@gmail.com> 
    5 # 
     4# Copyright (c) 2007 by Raphael Geissert <atomo64@gmail.com> (original author) 
     5# Copyright (c) 2007 by isp Control Panel 
     6# http://isp-control.net 
    67# 
    78# License: 
     
    106107    sys_command("$main::cfg{'CMD_FTPD'} restart"); 
    107108    sleep(2); 
    108     sys_command("$main::cfg{'CMD_AUTHD'} restart");     
     109    sys_command("$main::cfg{'CMD_AUTHD'} restart"); 
    109110     
    110111    return 0; 
     
    193194    return 0; 
    194195} 
    195  
    196 my $rs = undef; 
    197196 
    198197my $welcome_message = <<MSG; 
     
    229228require $main::cfg{'ROOT_DIR'} . '/ispcp-db-keys.pl'; 
    230229 
    231 # This time we connect to the database 
    232 get_conf(); 
     230# Let's connect to the database 
     231setup_main_vars(); 
    233232 
    234233print STDOUT "\nVHCS2's services will now be stopped:\n"; 
    235234 
    236 $rs = stop_services("/tmp/vhcs2-backup-all.lock"); 
     235stop_services("/tmp/vhcs2-backup-all.lock"); 
    237236 
    238237print STDOUT "\nVHCS2's database will now be converted:\n"; 
     
    245244$main::cfg_file = '/etc/ispcp/ispcp.conf'; 
    246245 
    247 # Load new config and connect to the database as the new user 
     246# Load new config 
    248247get_conf(); 
    249248 
     249require $main::cfg{'ROOT_DIR'} . '/ispcp-db-keys.pl'; 
     250 
     251# Now we connect 
     252setup_main_vars(); 
     253 
    250254install_language(); 
    251255 
    252256if($main::cfg{'DATABASE_NAME'} ne 'ispcp') { 
    253257 
    254     print STDOUT "\nIMPORTANT: you have installed ispCP in a non-default directory"; 
     258    print STDOUT "\nIMPORTANT: you have installed ispCP in a non-default database"; 
    255259    print STDOUT "\n\tThe migration script has converted your old VHCS database"; 
    256260    print STDOUT "\n\tin the new database called 'ispcp'; please rename this database"; 
    257     print STDOUT "\n\twith the one you choose at install time: $main::cfg{'DATABASE_NAME'}\n"; 
     261    print STDOUT "\n\twith the one you choose at ispCP install time: $main::cfg{'DATABASE_NAME'}\n"; 
    258262 
    259263} else { 
    260264 
    261     print STDOUT "\nispCP's requests manager will now be executed..."; 
     265    print STDOUT "\nRunning ispCP's requests manager..."; 
    262266 
    263267    sys_command("$main::db{'ROOT_DIR'}/engine/ispcp-rqst-mngr"); 
     
    267271} 
    268272 
    269 print STDOUT "\nispCP's services will now be started:\n"; 
     273print STDOUT "\nStarting ispCP's services:\n"; 
    270274 
    271275start_services(); 
  • trunk/engine/setup/vhcs2ispcp.sql

    r668 r676  
    1919ALTER TABLE `htaccess_groups` ADD `status` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ; 
    2020 
    21 ALTER TABLE `htaccess_users` ADD `status` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci iNULL ; 
     21ALTER TABLE `htaccess_users` ADD `status` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ; 
     22 
     23ALTER TABLE `login` ADD `ipaddr` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ; 
     24ALTER TABLE `login` ADD `user_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ; 
     25ALTER TABLE `login` ADD `login_count` TINYINT( 1 ) NULL; 
     26 
     27-- Drop existing languages (they are outdated anyways) 
    2228 
    2329DROP TABLE IF EXISTS `lang_English`; 
     
    3238DROP TABLE IF EXISTS `lang_Spanish`; 
    3339DROP TABLE IF EXISTS `lang_French`; 
    34  
    35 ALTER TABLE `login` ADD `ipaddr` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ; 
    36 ALTER TABLE `login` ADD `user_name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL ; 
    37 ALTER TABLE `login` ADD `login_count` TINYINT( 1 ) NULL; 
    3840 
    3941-- Add Primary and possibly an index to login table! 
  • trunk/gui/include/i18n.php

    r660 r676  
    3131 **/ 
    3232function tr($msgid, $as_is = false) { 
    33     global $sql, $default_lang, $cfg; 
    34     static $cache; 
     33    global $sql, $cfg; 
     34    static $cache = array(); 
    3535 
    3636    $lang = (isset($_SESSION['user_def_lang'])) ? $_SESSION['user_def_lang'] : $cfg['USER_INITIAL_LANG']; 
     
    4343 
    4444        if ($sql) { 
    45             if (!$as_is) { 
     45            if (!$as_is && 'encoding' != $msgid) { 
    4646                $encoding = tr('encoding'); 
    4747            } 
     
    6464 
    6565    // Replace values 
    66     if (func_num_args() > 2) { 
     66    if (func_num_args() > 1) { 
    6767        $argv = func_get_args(); 
    6868        unset($argv[0]); //msgid 
    69         unset($argv[1]); //as_is 
     69 
     70        if (is_bool($argv[1])) { 
     71            unset($argv[1]); //as_is 
     72        } 
    7073        $msgstr = vsprintf($msgstr, $argv); 
    7174    } 
  • trunk/gui/include/ispcp-config.php

    r664 r676  
    3737    function parseFile(){ 
    3838        /* open file ... parse it and put it in $cfg_values */ 
    39         @@$fd = fopen($this->config_file,'r'); 
     39        @$fd = fopen($this->config_file,'r'); 
    4040        if ($fd == FALSE) { 
    4141            /* ooops error */ 
  • trunk/gui/include/ispcp-lib.php

    r665 r676  
    1919 **/ 
    2020 
    21 define(INCLUDEPATH, realpath(dirname(__FILE__))); 
    22  
    23 session_name("ISPCP"); 
     21define('INCLUDEPATH', realpath(dirname(__FILE__))); 
     22 
     23session_name('ispCP'); 
    2424 
    2525if (!isset($_SESSION)) 
     
    6060$cfg['LOGIN_TEMPLATE_PATH'] = $cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME']; 
    6161 
    62 $cfg['ADMIN_TEMPLATE_PATH'] = "../".$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/admin'; 
    63  
    64 $cfg['RESELLER_TEMPLATE_PATH'] = "../".$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/reseller'; 
    65  
    66 $cfg['CLIENT_TEMPLATE_PATH'] = "../".$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/client'; 
    67  
    68 $cfg['IPS_LOGO_PATH'] = "../themes/user_logos"; 
    69  
    70 $cfg['PURCHASE_TEMPLATE_PATH'] = "../".$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/orderpanel'; 
     62$cfg['ADMIN_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/admin'; 
     63 
     64$cfg['RESELLER_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/reseller'; 
     65 
     66$cfg['CLIENT_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/client'; 
     67 
     68$cfg['IPS_LOGO_PATH'] = '../themes/user_logos'; 
     69 
     70$cfg['PURCHASE_TEMPLATE_PATH'] = '../'.$cfg['ROOT_TEMPLATE_PATH'].$cfg['USER_INITIAL_THEME'].'/orderpanel'; 
    7171 
    7272$cfg['DOMAIN_ROWS_PER_PAGE'] = 10; 
     
    164164 
    165165// The virtual host file from Apache which contains our virtual host entries 
    166 $cfg['SERVER_VHOST_FILE'] = "/etc/apache2/sites-available/ispcp.conf"; 
     166$cfg['SERVER_VHOST_FILE'] = '/etc/apache2/sites-available/ispcp.conf'; 
    167167 
    168168require_once(INCLUDEPATH.'/spGzip.php'); 
     
    222222if(!$res = exec_query($sql, $query, array())) { 
    223223        system_message(tr('Could not get config from database')); 
    224         die(); 
    225224} 
    226225else { 
  • trunk/gui/include/sql.php

    r662 r676  
    1818 * 
    1919 **/ 
    20 $include_path = realpath(dirname(__FILE__)); 
    2120 
    22 require ($include_path.'/adodb/adodb.inc.php'); 
     21require (INCLUDEPATH.'/adodb/adodb.inc.php'); 
    2322 
    24 //require ($include_path.'/adodb/tohtml.inc.php'); 
     23//require (INCLUDEPATH.'/adodb/tohtml.inc.php'); 
    2524 
    26 require ($include_path.'/adodb/adodb-pager.inc.php'); 
     25require (INCLUDEPATH.'/adodb/adodb-pager.inc.php'); 
    2726 
    2827$cfg['DB_TYPE'] = $cfg['DATABASE_TYPE']; 
     
    3534 
    3635$cfg['DB_NAME'] = $cfg['DATABASE_NAME']; 
    37  
    3836 
    3937if ($cfg['DB_TYPE'] === 'pgsql') {