File manager - Edit - /usr/local/cpanel/hooks/passwd/change_password.example
Back
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - hooks/passwd/change_password.example Copyright 2022 cPanel, L.L.C. # All rights reserved. # copyright@cpanel.net http://cpanel.net use XML::Simple; use Data::Dumper; $XML::Simple::PREFERRED_PARSER = "XML::SAX::PurePerl"; # uid of the user who did the action my $uid = $ARGV[0]; # treat any of the xml data inside the CPDATA tag as trusted # # NEVER treat any of the xml data inside the cpanelevent as trusted # as a malicous user could inject bogus data. # It's probably never going to be an issue as most people do not want to break # their own account. my $xmldoc; while (<STDIN>) { $xmldoc .= $_; } chomp($xmldoc); if ( substr( $xmldoc, 0, 1 ) ne '<' || substr( $xmldoc, -1, 1 ) ne '>' ) { die 'XML not well formed'; } # prevent XMLin from opening a file my $dref = XMLin($xmldoc); my $user = ( getpwuid($uid) )[0]; my $event = $$dref{'cpanelevent'}; my $oldpass = $$dref{'cpanelevent'}{'params'}{'oldpass'} || $$dref{'cpanelevent'}{'params'}{'param0'}; my $newpass = $$dref{'cpanelevent'}{'params'}{'newpass'} || $$dref{'cpanelevent'}{'params'}{'param1'}; my $errors = $$dref{'cpanelevent'}{'errors'}; my $pwchangestatus = $$dref{'cpanelevent'}{'result'}{'status'}; # # Careful, writing to STDOUT will be displayed in the web browser. Make sure you strip out <>s to prevent # css problems. # if ( $pwchangestatus eq "1" ) { print "Your password was changed\n"; print "OLDPASS: $oldpass\n"; print "NEWPASS: $newpass\n"; print "ERRORS: $errors\n"; } else { print "Your password was not changed\n"; }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings