File: pubkey.pl

package info (click to toggle)
slash 2.2.6-8etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 3,672 kB
  • ctags: 1,915
  • sloc: perl: 23,113; sql: 1,878; sh: 433; makefile: 233
file content (46 lines) | stat: -rwxr-xr-x 1,075 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
# Copyright 1997-2001 by Open Source Development Network. See README
# and COPYING for more information, or see http://slashcode.com/.
# $Id: pubkey.pl,v 1.1.2.2 2001/08/31 14:26:06 jamie Exp $

use strict;
use Slash 2.001;	# require Slash 2.1
use Slash::Display;
use Slash::Utility;
use Slash::XML;
use vars qw($VERSION);

($VERSION) = ' $Revision: 1.1.2.2 $ ' =~ /\$Revision:\s+([^\s]+)/;

sub main {
	my $slashdb   = getCurrentDB();
	my $user      = getCurrentUser();
	my $r = Apache->request;
	$r->header_out('Cache-Control', 'private');
	$r->content_type('text/plain');
	$r->status(200);
	$r->send_http_header;
	$r->rflush;
	my $nick = getCurrentForm('nick');
	unless ($nick) {
			$r->print(getData('no_nick'));
			return 1;
	}
	my $uid = $slashdb->getUserUID($nick);
	my $content = $slashdb->getUser($uid, 'pubkey');

	if($content) {
		$content = strip_nohtml($content);
		$r->print($content);
	} else {
		$r->print(getData('no_key'));
	}

	return 1;
}


createEnvironment();
main();
1;