Ticket #2053: back_timezone.patch
| File back_timezone.patch, 19.9 KB (added by nuxwin, 22 months ago) |
|---|
-
engine/setup/ispcp-setup
107 107 $rs = ask_vhost(); 108 108 } while ($rs == 1); 109 109 110 #111 110 # SQL Questions 112 # 111 ############### 113 112 114 113 $rs = ask_db_host(); 115 114 return $rs if ($rs != 0); … … 124 123 $rs = ask_db_password(); 125 124 } while ($rs == 1); 126 125 127 # 128 # ispCP ftp SQL user questions; 129 # 126 # ispCP ftp SQL user questions 127 ############################## 130 128 131 129 do { 132 130 $rs = ask_db_ftp_user(); … … 136 134 $rs = ask_db_ftp_password(); 137 135 } while ($rs == 1); 138 136 139 #140 137 # PMA user for SQL 141 # 138 ################## 142 139 143 140 do { 144 141 $rs = ask_db_pma_user(); … … 148 145 $rs = ask_db_pma_password(); 149 146 } while ($rs == 1); 150 147 151 #152 148 # Admin questions 153 # 149 ################# 154 150 155 151 $rs = ask_admin(); 156 152 return $rs if ($rs != 0); … … 163 159 $rs = ask_admin_email(); 164 160 } while ($rs == 1); 165 161 166 #167 162 # Configuration questions 168 # 163 ######################### 169 164 170 165 do { 171 166 $rs = ask_second_dns(); … … 175 170 $rs = ask_mysql_prefix(); 176 171 } while ($rs == 1); 177 172 178 #179 173 # FastCGI-Version questions 180 # 174 ########################### 181 175 182 176 do { 183 177 $rs = ask_fastcgi(); 184 178 } while ($rs == 1); 185 186 # 179 180 # PHP Timzeone question 181 ####################### 182 183 do { 184 $rs = ask_timezone(); 185 } while ($rs == 1); 186 187 187 # AWStats questions 188 # 188 ################### 189 189 190 190 do { 191 191 $rs = ask_awstats_on(); … … 741 741 742 742 $rs = set_conf_val('PHP_FASTCGI', $main::ua{'php_fastcgi'}); 743 743 return $rs if ($rs != 0); 744 744 745 $rs = set_conf_val('PHP_TIMEZONE', $main::ua{'php_timezone'}); 746 return $rs if ($rs != 0); 747 745 748 $rs = set_conf_val('SECONDARY_DNS', $main::ua{'secondary_dns'}); 746 749 return $rs if ($rs != 0); 747 750 … … 791 794 $main::db_pwd 792 795 ); 793 796 794 # TODO Add ask touser confirmation797 # TODO Add ask for user confirmation 795 798 $sql = "DROP DATABASE IF EXISTS $store_db_name;"; 796 799 797 800 ($rs, $rdata) = doSQL($sql); -
configs/openbsd/ispcp.conf
190 190 191 191 PHP_VERSION = 5 192 192 193 PHP_TIMEZONE = UTC193 PHP_TIMEZONE = 194 194 195 195 # 196 196 # ProFTPd data -
configs/redhat/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
engine/setup/ispcp-update
545 545 546 546 push_el(\@main::el, 'check_ispcp_cfg_file()', 'Starting...'); 547 547 548 # Ref to an array of settings names that have aunallowed empty value548 # Reference to an array of settings that have unallowed empty value 549 549 my $settings = shift; 550 550 551 my ($rs, $msg, $rdata, $warn_msg) = (undef, undef, undef, undef);551 my ($rs, $msg, $rdata, $warn_msg); 552 552 553 # Map each setting to appropriate dialog subroutine and mainua key name 554 # TODO: Add a trigger to check database connection if related setting values 555 # are changed && add a subroutine for the 'BASE_SERVER_VHOST' to prevent 556 # errors if a dns file doesn't exist for him 553 # Map each setting to the appropriate dialog subroutine and the corresponding 554 # main::ua key name 555 # 556 # TODO: 557 # - Add a trigger to check database connection if related settings are 558 # changed 559 # - Add a subroutine for the 'BASE_SERVER_VHOST' to prevent errors if the 560 # DNS file doesn't exist 557 561 my $recovery_dispatcher = { 558 562 DEFAULT_ADMIN_ADDRESS => [\&ask_admin_email, 'admin_email'], 559 563 SERVER_HOSTNAME => [\&ask_hostname, 'hostname'], … … 562 566 DATABASE_HOST => [\&ask_db_host, 'db_host'], 563 567 DATABASE_NAME => [\&ask_db_name, 'db_name'], 564 568 DATABASE_USER => [\&ask_db_user, 'db_user'], 565 PHP_FASTCGI => [\&ask_fastcgi, 'php_fastcgi'] 569 PHP_FASTCGI => [\&ask_fastcgi, 'php_fastcgi'], 570 PHP_TIMEZONE => [\&ask_timezone, 'php_timezone'] 566 571 }; 567 572 568 # If several parameters are set to an empty value, we ensure569 # that the user has installed ispCP by asking th equestion570 if (scalar(@$settings) >= 2) {573 # If several parameters are set to an empty value, we should ensure 574 # that the user has installed ispCP by asking this question 575 if (scalar(@$settings) >= 2) { 571 576 572 577 print colored(['bold yellow'], "\n\n\tWARNING:"). 573 578 " Your ispCP configuration file has several settings set\n" . 574 "\tto an empty value !\n";579 "\tto an empty value!\n"; 575 580 576 581 do { 577 582 print STDOUT "\n\tAre you sure you have installed ispCP ? [Y/n]: "; … … 579 584 } while($rdata !~ /^(|y|n)$/i); 580 585 581 586 $msg = colored(['bold blue'], "\n\tNOTICE:") . 582 " The program will end now!\n" .583 "\tPlease, run '$main::cfg{'ROOT_DIR'}/engine/setup/ispcp-setup' instead !\n";587 " The program ends now!\n" . 588 "\tPlease, run '$main::cfg{'ROOT_DIR'}/engine/setup/ispcp-setup' instead!\n"; 584 589 585 590 ($rdata !~ /^n$/i) or exit_msg(1, $msg); 586 591 } 587 592 588 593 print STDOUT colored(['bold yellow'], "\n\n\tWARNING:") . 589 " Your ispCP configuration file is not valid!\n" .590 "\tThe program will switch to recoverymode now...\n";594 " Your ispCP configuration file has missing parameters!\n" . 595 "\tThe update script will switch to recovery/upgrade mode now...\n"; 591 596 592 597 do { 593 598 print STDOUT "\n\tDo you want to continue [Y/n]: "; 594 599 chomp($rdata = readline \*STDIN); 595 600 } while($rdata !~ /^(|y|n)$/i); 596 601 597 # Exit with a notice message if the user choose 598 # to abort the recovery process 602 # Exit with a notice if the user chooses to abort the recovery/update process 599 603 ($rdata !~ /^n$/i) or exit_msg(1, 600 604 colored(['bold blue'], "\n\tNOTICE:") . 601 " The recovery process was aborted by user...\n"605 " The recovery/upgrade process was aborted by user...\n" 602 606 ); 603 607 604 # For each setting, call s the dialog subroutine if it isavailable,605 # OTHERWISE saves the value salready changed and stops the program608 # For each setting, call the subroutine dialouge if available, 609 # OTHERWISE saves the value already changed and stops the program 606 610 # with an specific message. 607 611 foreach(@$settings) { 608 612 … … 643 647 } 644 648 } 645 649 646 # Store new configuration settings values and reload it650 # Store new configuration settings values and reload the ispcp.conf 647 651 $rs = store_conf(); 648 652 return $rs if($rs != 0); 649 653 … … 654 658 } 655 659 656 660 print STDOUT colored(['bold blue'], "\n\tNOTICE:") . 657 " The recovery process was end successfully!\n" .658 "\tThe update process will continue normal ly now...\n\n";661 " The recovery/upgrade process ended successfully!\n" . 662 "\tThe update process will continue normal...\n\n"; 659 663 660 664 push_el(\@main::el, 'check_ispcp_cfg_file()', 'Ending...'); 661 665 -
configs/freebsd/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667 -
configs/fedora/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667 -
configs/opensuse/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
configs/ubuntu/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
configs/fedora/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
configs/centos/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
configs/freebsd/ispcp.conf
190 190 191 191 PHP_VERSION = 5 192 192 193 PHP_TIMEZONE = UTC193 PHP_TIMEZONE = 194 194 195 195 # 196 196 # ProFTPd data -
configs/centos/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667 -
configs/gentoo/fcgi/parts/php5/php.ini
663 663 664 664 [Date] 665 665 ; Defines the default timezone used by the date functions 666 ;date.timezone = 666 date.timezone = {PHP_TIMEZONE} 667 667 668 668 ;date.default_latitude = 31.7667 669 669 ;date.default_longitude = 35.2333 -
configs/ubuntu/fcgi/parts/php5/php.ini
663 663 664 664 [Date] 665 665 ; Defines the default timezone used by the date functions 666 ;date.timezone = 666 date.timezone = {PHP_TIMEZONE} 667 667 668 668 ;date.default_latitude = 31.7667 669 669 ;date.default_longitude = 35.2333 -
engine/setup/ispcp-setup-methods.pl
689 689 } 690 690 691 691 sub ask_fastcgi { 692 693 692 push_el(\@main::el, 'ask_fastcgi()', 'Starting...'); 694 693 695 694 my $rdata = undef; 696 697 695 my $qmsg = "\n\tFastCGI Version: [f]cgid or fast[c]gi. [fcgid]: "; 698 696 699 697 print STDOUT $qmsg; 700 701 698 chomp($rdata = readline \*STDIN); 702 699 703 700 if (!defined($rdata) || $rdata eq '') { 704 705 701 $main::ua{'php_fastcgi'} = 'fcgid'; 706 707 702 } else { 708 709 703 if ($rdata eq 'fcgid' || $rdata eq 'f') { 710 711 704 $main::ua{'php_fastcgi'} = 'fcgid'; 712 713 705 } elsif ($rdata eq 'fastcgi' || $rdata eq 'c') { 714 715 706 $main::ua{'php_fastcgi'} = 'fastcgi'; 716 717 707 } else { 718 719 708 print STDOUT colored(['bold red'], "\n\tERROR:") . 720 709 " Only '[f]cgid' or 'fast[c]gi' are allowed!"; 721 722 710 return 1; 723 711 } 724 712 } … … 728 716 0; 729 717 } 730 718 731 sub ask_awstats_on { 719 sub ask_timezone { 720 push_el(\@main::el, 'ask_timezone()', 'Starting...'); 732 721 722 my $rdata; 723 my $qmsg = "\n\tServer's Timezone [Europe/London]: "; 724 725 print STDOUT $qmsg; 726 chomp($rdata = readline \*STDIN); 727 728 if (!defined($rdata) || $rdata eq '') { 729 $main::ua{'php_timezone'} = 'Europe/London'; 730 } else { 731 if ($rdata =~ m/^UTC|([Africa|America|Antarctica|Arctic|Asia|Atlantic|Australia|Europe|Indian|Pacific]\/[A-Z][a-z]+)$/i) { 732 $main::ua{'php_timezone'} = $rdata; 733 } else { 734 print STDOUT colored(['bold red'], "\n\tERROR:") . 735 $rdata . " is not a valid Timezone! " . 736 "The city must start with a capital letter, e.g. Europe/London"; 737 return 1; 738 } 739 } 740 741 push_el(\@main::el, 'ask_timezone()', 'Ending...'); 742 743 0; 744 } 745 746 sub ask_awstats_on { 733 747 push_el(\@main::el, 'ask_awstats_on()', 'Starting...'); 734 748 735 749 my $rdata = undef; 736 750 my $qmsg = "\n\tActivate AWStats. [no]: "; 737 751 738 752 print STDOUT $qmsg; 739 740 753 chomp($rdata = readline \*STDIN); 741 754 742 755 if (!defined($rdata) || $rdata eq '') { 743 744 756 $main::ua{'awstats_on'} = 'no'; 745 746 757 } else { 747 748 758 if ($rdata eq 'yes' || $rdata eq 'y') { 749 750 759 $main::ua{'awstats_on'} = 'yes'; 751 752 760 } elsif ($rdata eq 'no' || $rdata eq 'n') { 753 754 761 $main::ua{'awstats_on'} = 'no'; 755 756 762 } else { 757 758 763 print STDOUT colored(['bold red'], "\n\tERROR:") . 759 764 " Only '(y)es' and '(n)o' are allowed!"; 760 765 return 1; … … 767 772 } 768 773 769 774 sub ask_awstats_dyn { 770 771 775 push_el(\@main::el, 'ask_awstats_dyn()', 'Starting...'); 772 776 773 777 my $rdata = undef; 774 778 my $qmsg = "\n\tAWStats Mode:\n\tPossible values [d]ynamic and [s]tatic. [dynamic]: "; 775 779 776 780 print STDOUT $qmsg; 777 778 781 chomp($rdata = readline \*STDIN); 779 782 780 783 if (!defined($rdata) || $rdata eq '') { 781 782 784 $main::ua{'awstats_dyn'} = '0'; 783 784 785 } else { 785 786 786 if ($rdata eq 'dynamic' || $rdata eq 'd') { 787 788 787 $main::ua{'awstats_dyn'} = '0'; 789 790 788 } elsif ($rdata eq 'static' || $rdata eq 's') { 791 792 789 $main::ua{'awstats_dyn'} = '1'; 793 794 790 } else { 795 796 791 print STDOUT colored(['bold red'], "\n\tERROR:") . 797 792 " Only '[d]ynamic' or '[s]tatic' are allowed!"; 798 799 793 return 1; 800 794 } 801 795 } … … 816 810 # IspCP crontab setup / update 817 811 # Built, store and install the ispCP crontab file 818 812 sub setup_crontab { 819 820 813 push_el(\@main::el, 'setup_crontab()', 'Starting...'); 821 814 822 my ($rs, $rdata, $cmd) = (undef, undef, undef); 823 824 my $cfg_tpl = undef; 815 my ($rs, $rdata, $cmd, $cfg_tpl); 825 816 my $cfg = \$cfg_tpl; 826 817 827 818 my ($awstats, $rkhunter, $chkrootkit) = ('', undef, undef); … … 834 825 835 826 # Determines the path of production directory 836 827 if ($main::cfg{'ROOT_GROUP'} eq 'wheel') { 837 838 828 $prod_dir = '/usr/local/etc/ispcp/cron.d'; 839 840 829 } else { 841 842 830 $prod_dir = '/etc/cron.d' 843 831 } 844 832 … … 1415 1403 # Enable awstats vhost - Begin 1416 1404 1417 1405 if(-e '/usr/sbin/a2ensite') { 1418 1419 1406 sys_command("/usr/sbin/a2ensite 01_awstats.conf $main::rlogfile"); 1420 1407 } 1421 1408 … … 1423 1410 1424 1411 # Update Apache logrotate file - Begin 1425 1412 1426 # FIXME: check for openSUSE and other dists... 1427 # Todo create dedicated directory for backup logrotate configuration file 1413 # if the distribution provides an apache or apache2 logrotation file, 1414 # update it with the awstats information. If not, use the ispcp file. 1415 # logrotation should be never executed twice. Therefore it is sane to 1416 # define it two times in different scopes. 1428 1417 foreach(qw/apache apache2/) { 1429 1418 1430 1419 next if(! -e "$bk_dir/$_.system"); -
configs/opensuse/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667 -
configs/redhat/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667 -
configs/openbsd/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667 -
configs/gentoo/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
CHANGELOG
1 1 ispCP ω 1.0.8 ChangeLog 2 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 3 4 2010-08-11 Benedikt Heintel 5 - ENGINE: 6 * Fixed #2053: Make ispCP ω PHP 5.3 compatible (part II) 7 - Added Timezone Variable 8 4 9 2010-08-11 Laurent Declercq 5 10 - ENGINE: (ispcp-alssub-mngr) 6 11 * Removed useless sleep statement -
engine/ispcp-dmn-mngr
1546 1546 my $www_dir = $main::cfg{'APACHE_WWW_DIR'}; 1547 1547 my $pear_dir = $main::cfg{'PEAR_DIR'}; 1548 1548 my $starter_dir = $main::cfg{'PHP_STARTER_DIR'}; 1549 my $timezone = $main::cfg{'PHP_TIMEZONE'}; 1549 1550 my $conf_dir = $main::cfg{'CONF_DIR'}; 1550 1551 my $httpd_uid = $main::cfg{'APACHE_USER'}; 1551 1552 my $httpd_gid = $main::cfg{'APACHE_GROUP'}; … … 1789 1790 my %tag_hash = ( 1790 1791 '{PEAR_DIR}' => $pear_dir, 1791 1792 '{WWW_DIR}' => $www_dir, 1792 '{DMN_NAME}' => $dmn_name 1793 '{DMN_NAME}' => $dmn_name, 1794 '{PHP_TIMEZONE}' => $timezone 1793 1795 ); 1794 1796 1795 1797 ($rs, $cfg) = prep_tpl(\%tag_hash, $ini_tpl); … … 1859 1861 my $www_dir = $main::cfg{'APACHE_WWW_DIR'}; 1860 1862 my $pear_dir = $main::cfg{'PEAR_DIR'}; 1861 1863 my $starter_dir = $main::cfg{'PHP_STARTER_DIR'}; 1864 my $timezone = $main::cfg{'PHP_TIMEZONE'}; 1862 1865 my $conf_dir = $main::cfg{'CONF_DIR'}; 1863 1866 my $httpd_uid = $main::cfg{'APACHE_USER'}; 1864 1867 my $httpd_gid = $main::cfg{'APACHE_GROUP'}; … … 2031 2034 2032 2035 # php.ini for the domain 2033 2036 2034 if (! -e "$starter_dir/$dmn_name/php5/php.ini") { 2035 my $ini_tpl = undef; 2036 my $ini_cfg_dir = "$main::cfg{'CONF_DIR'}/fcgi/parts/php5"; 2037 # backup current file if one exist 2038 if (-e "$starter_dir/$dmn_name/php5/php.ini") { 2039 $rs = sys_command_rs( 2040 "$main::cfg{'CMD_CP'} -p $starter_dir/$dmn_name/php5/php.ini " . 2041 "$conf_dir/fcgi/backup/${dmn_name}.php.ini." . time 2042 ); 2043 return $rs if ($rs != 0); 2037 2044 2038 ($rs, $ini_tpl) = get_tpl($ini_cfg_dir, 'php.ini'); 2039 return $rs if ($rs != 0); 2045 } 2046 2047 ($rs, my $ini_tpl) = get_file("$conf_dir/fcgi/parts/php5/php.ini"); 2048 return $rs if ($rs != 0); 2040 2049 2041 my %tag_hash = ( 2050 ($rs, $cfg) = prep_tpl( 2051 { 2042 2052 '{PEAR_DIR}' => $pear_dir, 2043 2053 '{WWW_DIR}' => $www_dir, 2044 '{DMN_NAME}' => $dmn_name 2045 ); 2046 2047 ($rs, $cfg) = prep_tpl(\%tag_hash, $ini_tpl); 2048 return $rs if ($rs != 0); 2054 '{DMN_NAME}' => $dmn_name, 2055 '{PHP_TIMEZONE}' => $timezone 2056 }, 2057 $ini_tpl 2058 ); 2059 return $rs if ($rs != 0); 2049 2060 2050 ($rs, $rdata) = store_file( 2051 "$starter_dir/$dmn_name/php5/php.ini", $cfg, $sys_user, $sys_group, 2052 0440 2053 ); 2054 return $rs if ($rs != 0); 2055 } 2061 ($rs, $rdata) = store_file( 2062 "$starter_dir/$dmn_name/php5/php.ini", $cfg, $sys_user, $sys_group, 2063 0440 2064 ); 2065 return $rs if ($rs != 0); 2056 2066 2057 2067 # php5-fcgi-starter for the domain 2058 2068 -
configs/debian/ispcp.conf
184 184 185 185 PHP_VERSION = 5 186 186 187 PHP_TIMEZONE = UTC187 PHP_TIMEZONE = 188 188 189 189 # 190 190 # ProFTPd data -
configs/debian/fcgi/parts/php5/php.ini
995 995 [Date] 996 996 ; Defines the default timezone used by the date functions 997 997 ; http://php.net/date.timezone 998 ;date.timezone = 998 date.timezone = {PHP_TIMEZONE} 999 999 1000 1000 ; http://php.net/date.default-latitude 1001 1001 ;date.default_latitude = 31.7667
