HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/local/usermin-1.823/gnupg/import.cgi
#!/usr/bin/perl
# import.cgi
# Import somebody's public key

require './gnupg-lib.pl';
&ReadParseMime();
&error_setup($text{'import_err'});

if ($in{'mode'} == 0) {
	# From uploaded file, saved to temp
	$in{'upload'} || &error($text{'import_ekey'});
	$temp = &transname();
	open(TEMP, ">$temp");
	print TEMP $in{'upload'};
	close(TEMP);
	$out = `$gpgpath --import $temp 2>&1`;
	unlink($temp);
	}
elsif ($in{'mode'} == 1) {
	# From local file
	$in{'file'} = "$remote_user_info[7]/$in{'file'}"
		if ($in{'file'} !~ /^\//);
	-r $in{'file'} || &error($text{'import_efile'});
	$out = `$gpgpath --import '$in{'file'}' 2>&1`;
	}
elsif ($in{'mode'} == 2) {
	# From pasted text
	$in{'text'} || &error($text{'import_etext'});
	$in{'text'} =~ s/\r//g;
	$temp = &transname();
	open(TEMP, ">$temp");
	print TEMP $in{'text'};
	close(TEMP);
	$out = `$gpgpath --import $temp 2>&1`;
	unlink($temp);
	}
if ($?) {
	&error(&text('import_egpg', "<tt>$out</tt>"));
	}
&redirect("list_keys.cgi");