[3/5] chpasswd.cgi: Make swroot refs the same as for other cgi files

Message ID 20250506141013.15292-3-adolf.belka@ipfire.org
State Staged
Commit 4c39e38f90fea60ef62e07267fd84f1b89de0297
Headers
Series [1/5] chpasswd.cgi: Fixes bug12755 - proxy auth password problem longer than 8 chars |

Commit Message

Adolf Belka May 6, 2025, 2:10 p.m. UTC
  - 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>
---
 html/cgi-bin/chpasswd.cgi | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
  

Patch

diff --git a/html/cgi-bin/chpasswd.cgi b/html/cgi-bin/chpasswd.cgi
index bda693193..6e9dd9e1c 100644
--- a/html/cgi-bin/chpasswd.cgi
+++ b/html/cgi-bin/chpasswd.cgi
@@ -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;