/[BackupPC]/trunk/lib/BackupPC/CGI/Lib.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/BackupPC/CGI/Lib.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 315 by dpavlin, Fri Oct 28 12:41:47 2005 UTC revision 316 by dpavlin, Mon Jan 30 13:37:17 2006 UTC
# Line 29  Line 29 
29  #  #
30  #========================================================================  #========================================================================
31  #  #
32  # Version 2.1.0, released 20 Jun 2004.  # Version 2.1.2, released 5 Sep 2005.
33  #  #
34  # See http://backuppc.sourceforge.net.  # See http://backuppc.sourceforge.net.
35  #  #
# Line 102  sub NewRequest Line 102  sub NewRequest
102          $Lang   = $bpc->Lang();          $Lang   = $bpc->Lang();
103          $ConfigMTime = $bpc->ConfigMTime();          $ConfigMTime = $bpc->ConfigMTime();
104      } elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {      } elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
105          $bpc->ServerMesg("log Re-read config file because mtime changed");          $bpc->ConfigRead();
106          $bpc->ServerMesg("server reload");          %Conf   = $bpc->Conf();
107            $Lang   = $bpc->Lang();
108            $ConfigMTime = $bpc->ConfigMTime();
109      }      }
110    
111      #      #
# Line 154  EOF Line 156  EOF
156                 {map {$_, 1} split(",", $Hosts->{$host}{moreUsers}) }                 {map {$_, 1} split(",", $Hosts->{$host}{moreUsers}) }
157          }          }
158      }      }
159    
160        #
161        # Untaint the host name
162        #
163        if ( $In{host} =~ /^([\w.\s-]+)$/ ) {
164            $In{host} = $1;
165        } else {
166            delete($In{host});
167        }
168  }  }
169    
170  sub timeStamp2  sub timeStamp2
# Line 278  sub GetStatusInfo Line 289  sub GetStatusInfo
289  {  {
290      my($status) = @_;      my($status) = @_;
291      ServerConnect();      ServerConnect();
292        %Status = ()     if ( $status =~ /\bhosts\b/ );
293        %StatusHost = () if ( $status =~ /\bhost\(/ );
294      my $reply = $bpc->ServerMesg("status $status");      my $reply = $bpc->ServerMesg("status $status");
295      $reply = $1 if ( $reply =~ /(.*)/s );      $reply = $1 if ( $reply =~ /(.*)/s );
296      eval($reply);      eval($reply);
# Line 455  EOF Line 468  EOF
468                      $Lang->{Last_bad_XferLOG_errors_only},                      $Lang->{Last_bad_XferLOG_errors_only},
469                      " class=\"navbar\"");                      " class=\"navbar\"");
470          }          }
471          if ( -f "$TopDir/pc/$host/config.pl" ) {          if ( -f "$TopDir/pc/$host/config.pl"
472                        || ($host ne "config" && -f "$TopDir/conf/$host.pl") ) {
473              NavLink("?action=view&type=config&host=${EscURI($host)}",              NavLink("?action=view&type=config&host=${EscURI($host)}",
474                      $Lang->{Config_file}, " class=\"navbar\"");                      $Lang->{Config_file}, " class=\"navbar\"");
475          }          }
# Line 505  EOF Line 519  EOF
519      NavSectionTitle($Lang->{NavSectionTitle_});      NavSectionTitle($Lang->{NavSectionTitle_});
520      foreach my $l ( @adminLinks ) {      foreach my $l ( @adminLinks ) {
521          if ( $PrivAdmin || !$l->{priv} ) {          if ( $PrivAdmin || !$l->{priv} ) {
522              my $txt = defined($l->{lname}) ? $Lang->{$l->{lname}} : $l->{name};              my $txt = $l->{lname} ne "" ? $Lang->{$l->{lname}} : $l->{name};
523              NavLink($l->{link}, $txt);              NavLink($l->{link}, $txt);
524          }          }
525      }      }

Legend:
Removed from v.315  
changed lines
  Added in v.316

  ViewVC Help
Powered by ViewVC 1.1.26