summaryrefslogtreecommitdiff
path: root/doc/plugins/contrib/googlemaps
diff options
context:
space:
mode:
Diffstat (limited to 'doc/plugins/contrib/googlemaps')
0 files changed, 0 insertions, 0 deletions
##########################################
  • # Next bunch of lines are to check to see if they have the cpan module installed.
  • my $cpan=0;
  • eval {
  • use CPAN;
  • };
  • if (!$@){
  • $cpan = 1;
  • }
  • $| = 1;
  • #not sure how safe this is. If the browser sends a blank GATEWAY_INTERFACE
  • #will this script destroy part of the install?
  • #This script should probably be made inaccessible via HTTP until this feature is working
  • if (($ENV{GATEWAY_INTERFACE})||($ENV{HTTP_HOST})) {
  • print "Content-type: text/html\n\nThis does not work yet! use $0 from the command line";
  • exit;
  • }
  • # Make sure they have the required perl modules installed.
  • # bin/mozilla/admin.pl needs Digest::MD5 for session handling
  • # HTML:LinkExtor is used by the setup program.
  • my @req_modules=(qw(DBI DBD::Pg Digest::MD5 HTML::LinkExtor));
  • foreach my $module(@req_modules){
  • print "Checking for: $module ...\t";
  • my @results=&check_module($module);
  • print "$results[1]\n";
  • next if($results[0]); # Passed, no need to continue..
  • if ($cpan == 1){
  • # Can try to install the module..
  • print "\n\nWould you like to try and install this package ($module) through CPAN? (Y/N) [Y]:";
  • my $response=<STDIN>;
  • if(($response=~/y/i) or ($response eq "\n")){
  • my $inst_obj = CPAN::Shell->install($module);
  • @results=&check_module($module);
  • if(!$results[0]){
  • print "\n\nCould not install $module using CPAN.\n";
  • die "Please try to install this module manually\n";
  • }
  • } else {
  • die "Please install the $module perl module and retry the setup.\n";
  • }
  • } else {
  • # Can't try to install the module..
  • die "Please install the $module perl module and retry the setup.\n";
  • }
  • }
  • use HTML::LinkExtor;
  • my $lynx = `lynx -version`; # if LWP is not installed use lynx
  • my $gzip = `gzip -V 2>&1`; # gz decompression utility
  • my $tar = `tar --version 2>&1`; # tar archiver
  • my $latex = `latex -version`;
  • my $versionurl ='http://prdownloads.sourceforge.net/ledger-smb';
  • my %source = (
  • 1 => { url => "http://voxel.dl.sourceforge.net/sourceforge/ledger-smb", site => "New York, U.S.A", locale => 'us' },
  • 2 => { url => "http://easynews.dl.sourceforge.net/sourceforge/ledger-smb", site => "Arizona, U.S.A", locale => 'us' },
  • 3 => { url => "http://ufpr.dl.sourceforge.net/sourceforge/ledger-smb", site =>"Brazil", locale => 'br' },
  • 4 => { url => "http://surfnet.dl.sourceforge.net/sourceforge/ledger-smb", site => "The Netherlands", locale => 'nl' },
  • 5 => { url => "http://http://kent.dl.sourceforge.net/sourceforge/ledger-smb", site => "U.K", locale => 'uk' },
  • 6 => { url => "http://ovh.dl.sourceforge.net/sourceforge/ledger-smb", site => "France", locale => 'fr' },
  • 7 => { url => "http://mesh.dl.sourceforge.net/sourceforge/ledger-smb", site => "Germany", locale => 'de' },
  • 8 => { url => "http://citkit.dl.sourceforge.net/sourceforge/ledger-smb", site => "Russia", locale => 'ru' },
  • 9 => { url => "http://optusnet.dl.sourceforge.net/sourceforge/ledger-smb", site => "Sydney, Australia", locale => 'au' },
  • 10 => { url => "http://nchc.dl.sourceforge.net/sourceforge/ledger-smb", site => "Taiwan", locale => 'tw' },
  • 11 => { url => "http://jaist.dl.sourceforge.net/sourceforge/ledger-smb", site => "Japan", locale => 'jp' },
  • 12 => { url => "http://heanet.dl.sourceforge.net/sourceforge/ledger-smb", site => "Ireland", locale => 'ie' }
  • );
  • my $userspath = "users"; # default for new installation
  • eval { require "ledger-smb.conf"; };
  • my $filename = shift;
  • chomp $filename;
  • my $newinstall = 1;
  • # is LWP installed
  • eval { require LWP::Simple; };
  • $lwp = !($@);
  • unless ($lwp || $lynx || $filename) {
  • die "You must have either lynx or LWP installed or specify a filename.
  • perl $0 <filename>\n";
  • }
  • if ($filename) {
  • # extract version
  • die "Not a Ledger-SMB archive\n" if ($filename !~ /^ledger-smb/);
  • $version = $filename;
  • $version =~ s/ledger-smb-(\d+\.\d+\.\d+).*$/$1/;
  • }
  • if (-f "VERSION") {
  • # get installed version from VERSION file
  • open(FH, '<', "VERSION");
  • @a = <FH>;
  • close(FH);
  • $version = $a[0];
  • chomp $version;
  • $newinstall = !$version;
  • if (! -f "ledger-smb.conf") {
  • $newinstall = 1;
  • }
  • }
  • # Try to determine web user and group..
  • $webowner = "nobody";
  • $webgroup = "nogroup";
  • # Check for apache2.conf
  • if ($httpd = `find /etc /usr/local/etc -type f -name 'apache2.conf'`) {
  • chomp $httpd;
  • $webowner = `grep "^User " $httpd`;
  • $webgroup = `grep "^Group " $httpd`;
  • chomp $webowner;
  • chomp $webgroup;
  • (undef, $webowner) = split / /, $webowner;
  • (undef, $webgroup) = split / /, $webgroup;
  • } elsif ($httpd = `find /etc /usr/local/etc -type f -name 'httpd.conf'`) {
  • # Else check for httpd.conf
  • chomp $httpd;
  • $webowner = `grep "^User " $httpd`;
  • $webgroup = `grep "^Group " $httpd`;
  • chomp $webowner;
  • chomp $webgroup;
  • (undef, $webowner) = split / /, $webowner;
  • (undef, $webgroup) = split / /, $webgroup;
  • }
  • if ($confd = `find /etc /usr/local/etc -type d -name 'apache*/conf.d'`) {
  • chomp $confd;
  • }
  • # If we are doing a new install.. check the postgresql installation..
  • if ($newinstall == 1){
  • # Check the postgresql version before we even check for a connection if local
  • system("tput clear"); # Clear the screen..
  • our ($pghost, $pgport, $pguser, $pgpassword);
  • print "\n\nIs PostgreSQL installed [L]ocally,\n or will you be connecting to a [R]emote server? (L/R) [L]:";
  • my $localremote=<STDIN>;
  • if(($localremote=~/L/i) or ($localremote eq "\n")){
  • $pghost = 'localhost';
  • # If local, check the local postgresql version..
  • my $pgversion = `psql --version`;
  • ($pgversionnum) = $pgversion =~ m/(\d\.\d\.\d)/;
  • unless ($pgversionnum gt '8.0.0'){
  • # Die, cannot continue..
  • print "LedgerSMB requires postgres version 8.0 or higher. You have version $pgversionnum installed\n";
  • die;
  • }
  • }
  • if (!&check_pgconnect){
  • print "\n\n\nInstallation was not successful\n Exiting....\n";
  • exit;
  • }
  • }
  • system("tput clear");
  • if ($filename) {
  • $install = "\ninstall $version from (f)ile\n";
  • }
  • # check for latest version
  • &get_latest_version;
  • chomp $latest_version;
  • if (!$newinstall) {
  • $install .= "\n(r)einstall $version\n";
  • }
  • if ($version && $latest_version) {
  • if ($version ne $latest_version) {
  • $install .= "\n(u)pgrade to $latest_version\n";
  • }
  • }
  • $install .= "\n(i)nstall $latest_version (from Internet)\n" if $latest_version;
  • $install .= "\n(d)ownload $latest_version (no installation)" unless $filename;
  • print qq|
  • LedgerSMB Accounting and ERP Installation
  • $install
  • Enter: |;
  • $a = <STDIN>;
  • chomp $a;
  • exit unless $a;
  • $a = lc $a;
  • if ($a !~ /d/) {