Ignore:
Timestamp:
08/11/10 11:24:56 (22 months ago)
Author:
benedikt
Message:
  • [ENGINE] Fixed #2053: Make ispCP ω PHP 5.3 compatible (part II): Added Timezone Variable
  • [GUI] Default/Disabled? Page CSS embedded in CDATA tags
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/engine/setup/ispcp-setup-methods.pl

    r3166 r3186  
    690690 
    691691sub ask_fastcgi { 
    692  
    693692        push_el(\@main::el, 'ask_fastcgi()', 'Starting...'); 
    694693 
    695694        my $rdata = undef; 
    696  
    697695        my $qmsg = "\n\tFastCGI Version: [f]cgid or fast[c]gi. [fcgid]: "; 
    698696 
    699697        print STDOUT $qmsg; 
    700  
    701698        chomp($rdata = readline \*STDIN); 
    702699 
    703700        if (!defined($rdata) || $rdata eq '') { 
    704  
    705701                $main::ua{'php_fastcgi'} = 'fcgid'; 
    706  
    707702        } else { 
    708  
    709703                if ($rdata eq 'fcgid' || $rdata eq 'f') { 
    710  
    711704                        $main::ua{'php_fastcgi'} = 'fcgid'; 
    712  
    713705                } elsif ($rdata eq 'fastcgi' || $rdata eq 'c') { 
    714  
    715706                        $main::ua{'php_fastcgi'} = 'fastcgi'; 
    716  
    717707                } else { 
    718  
    719708                        print STDOUT colored(['bold red'], "\n\tERROR:") . 
    720709                                 " Only '[f]cgid' or 'fast[c]gi' are allowed!"; 
    721  
    722710                        return 1; 
    723711                } 
     
    729717} 
    730718 
     719sub ask_timezone { 
     720        push_el(\@main::el, 'ask_timezone()', 'Starting...'); 
     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 
    731746sub ask_awstats_on { 
    732  
    733747        push_el(\@main::el, 'ask_awstats_on()', 'Starting...'); 
    734748 
     
    737751 
    738752        print STDOUT $qmsg; 
    739  
    740753        chomp($rdata = readline \*STDIN); 
    741754 
    742755        if (!defined($rdata) || $rdata eq '') { 
    743  
    744756                $main::ua{'awstats_on'} = 'no'; 
    745  
    746757        } else { 
    747  
    748758                if ($rdata eq 'yes' || $rdata eq 'y') { 
    749  
    750759                        $main::ua{'awstats_on'} = 'yes'; 
    751  
    752760                } elsif ($rdata eq 'no' || $rdata eq 'n') { 
    753  
    754761                        $main::ua{'awstats_on'} = 'no'; 
    755  
    756762                } else { 
    757  
    758763                        print STDOUT colored(['bold red'], "\n\tERROR:") . 
    759764                                " Only '(y)es' and '(n)o' are allowed!"; 
     
    768773 
    769774sub ask_awstats_dyn { 
    770  
    771775        push_el(\@main::el, 'ask_awstats_dyn()', 'Starting...'); 
    772776 
     
    775779 
    776780        print STDOUT $qmsg; 
    777  
    778781        chomp($rdata = readline \*STDIN); 
    779782 
    780783        if (!defined($rdata) || $rdata eq '') { 
    781  
    782784                $main::ua{'awstats_dyn'} = '0'; 
    783  
    784785        } else { 
    785  
    786786                if ($rdata eq 'dynamic' || $rdata eq 'd') { 
    787  
    788787                        $main::ua{'awstats_dyn'} = '0'; 
    789  
    790788                } elsif ($rdata eq 'static' || $rdata eq 's') { 
    791  
    792789                        $main::ua{'awstats_dyn'} = '1'; 
    793  
    794790                } else { 
    795  
    796791                        print STDOUT colored(['bold red'], "\n\tERROR:") . 
    797792                                 " Only '[d]ynamic' or '[s]tatic' are allowed!"; 
    798  
    799793                        return 1; 
    800794                } 
     
    817811# Built, store and install the ispCP crontab file 
    818812sub setup_crontab { 
    819  
    820813        push_el(\@main::el, 'setup_crontab()', 'Starting...'); 
    821814 
    822         my ($rs, $rdata, $cmd) = (undef, undef, undef); 
    823  
    824         my $cfg_tpl = undef; 
     815        my ($rs, $rdata, $cmd, $cfg_tpl); 
    825816        my $cfg = \$cfg_tpl; 
    826817 
     
    835826        # Determines the path of production directory 
    836827        if ($main::cfg{'ROOT_GROUP'} eq 'wheel') { 
    837  
    838828                $prod_dir = '/usr/local/etc/ispcp/cron.d'; 
    839  
    840829        } else { 
    841  
    842830                $prod_dir = '/etc/cron.d' 
    843831        } 
     
    14161404 
    14171405                if(-e '/usr/sbin/a2ensite') { 
    1418  
    14191406                        sys_command("/usr/sbin/a2ensite 01_awstats.conf $main::rlogfile"); 
    14201407                } 
     
    14241411                # Update Apache logrotate file - Begin 
    14251412 
    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. 
    14281417                foreach(qw/apache apache2/) { 
    14291418 
     
    23122301                '{OTHER_ROOTKIT_LOG}' => ($main::cfg{'OTHER_ROOTKIT_LOG'} ne '') 
    23132302                        ? ":$main::cfg{'OTHER_ROOTKIT_LOG'}" : '', 
    2314                 '{PHP_STARTER_DIR}' => $main::cfg{'PHP_STARTER_DIR'} 
     2303                '{PHP_STARTER_DIR}' => $main::cfg{'PHP_STARTER_DIR'}, 
     2304                '{PHP_TIMEZONE}' => $main::cfg{'PHP_TIMEZONE'} 
    23152305        ); 
    23162306 
Note: See TracChangeset for help on using the changeset viewer.