Private
Server IP : 195.201.23.43  /  Your IP : 18.118.207.114
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/usermin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/usermin/thirdparty.pl
# thirdparty.pl
# Checks for modules available in an old install of webmin that are
# not included in this new install, and offers to copy them across.
# Also re-creates clones of existing modules in the new install

($newdir, $olddir, $copythird) = @ARGV;

# find missing modules
opendir(DIR, $olddir);
while($m = readdir(DIR)) {
	next if ($m =~ /^\./);
	if (-r "$olddir/$m/module.info" && !-r "$newdir/$m/module.info") {
		if (-l "$olddir/$m") {
			# Found a clone - recreate it
			$clone = readlink("$olddir/$m");
			symlink($clone, "$newdir/$m");
			}
		else {
			# Found a candidate for copying
			local %minfo;
			&read_file("$olddir/$m/module.info", \%minfo);
			push(@missing, $m);
			push(@missdesc, $minfo{'desc'});
			}
		}
	elsif (-r "$olddir/$m/theme.info" && !-r "$newdir/$m/theme.info") {
		# Found a theme for copying
		local %tinfo;
		&read_file("$olddir/$m/theme.info", \%tinfo);
		push(@missing, $m);
		push(@missdesc, $tinfo{'desc'});
		}
	}
closedir(DIR);

if (@missing) {
	# Tell the user, and ask whether to copy
	if (!$copythird) {
		print "The following third party modules were found in your old Webmin\n";
		print "installation in $olddir :\n";
		for($i=0; $i<@missing; $i++) {
			printf "  %-12.12s %s\n", $missing[$i], $missdesc[$i];
			}
		print "Copy to new Webmin installation (y/n): ";
		chop($resp = <STDIN>);
		$copythird = $resp =~ /^y/i;
		}
	if ($copythird) {
		foreach $m (@missing) {
			system("cp -rp $olddir/$m $newdir");
			}
		}
	}

# read_file(file, array)
# Fill an associative array with name=value pairs from a file
sub read_file
{
local($arr);
$arr = $_[1];
open(ARFILE, "<".$_[0]) || return 0;
while(<ARFILE>) {
        chop;
        if (!/^#/ && /^([^=]+)=(.*)$/) { $$arr{$1} = $2; }
        }
close(ARFILE);
return 1;
}
 
Private