]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
chpasswd.cgi: Make swroot refs the same as for other cgi files
authorAdolf Belka <adolf.belka@ipfire.org>
Tue, 6 May 2025 14:10:11 +0000 (16:10 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 May 2025 09:01:30 +0000 (09:01 +0000)
- This uses the swroot definition from general-functions.pl and makes the definition
   the same as used in the majority of other IPFire cgi files.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/chpasswd.cgi

index bda69319367483782dc188cb9d8ba6c8c6ddd38a..6e9dd9e1c7ac66c5a33b5da245fce7b8619a9054 100644 (file)
@@ -21,7 +21,7 @@
 
 use CGI qw(param);
 
-$swroot = "/var/ipfire";
+require '/var/ipfire/general-functions.pl';
 
 my %cgiparams;
 my %mainsettings;
@@ -30,8 +30,8 @@ my %proxysettings;
 $proxysettings{'NCSA_MIN_PASS_LEN'} = 6;
 
 ### Initialize environment
-&readhash("${swroot}/main/settings", \%mainsettings);
-&readhash("${swroot}/proxy/advanced/settings", \%proxysettings);
+&readhash("${General::swroot}/main/settings", \%mainsettings);
+&readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
 $language = $mainsettings{'LANGUAGE'};
 
 ### Initialize language
@@ -40,12 +40,12 @@ if ($language =~ /^(\w+)$/) {$language = $1;}
  # Uncomment this to force a certain language:
  # $language='en';
  #
-require "${swroot}/langs/en.pl";
-require "${swroot}/langs/${language}.pl";
+require "${General::swroot}/langs/en.pl";
+require "${General::swroot}/langs/${language}.pl";
 
-my $userdb = "$swroot/proxy/advanced/ncsa/passwd";
+my $userdb = "$General::swroot/proxy/advanced/ncsa/passwd";
 
-&readhash("$swroot/ethernet/settings", \%netsettings);
+&readhash("$General::swroot/ethernet/settings", \%netsettings);
 
 my $success = 0;