File: chkuser

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 (40 lines) | stat: -rwxr-xr-x 781 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
#!/usr/bin/perl
use Slash;
use Slash::Utility;
use Slash::DB;


die "usage chkuser [ nickname | email ] \n" unless @ARGV;

my %opts;
$opts{'u'} ||= 'banjo';

createEnvironment($opts{'u'});

my $slashdb = getCurrentDB();
my $constants = getCurrentStatic();

my $args = join " ", @ARGV;
$args =~ s/'/''/g;
$args = "'$args'";

my $U= $slashdb->sqlSelectHashref("*","users","nickname=".$args)
   || $slashdb->sqlSelectHashref("*","users","realemail=".$args)
   || $slashdb->sqlSelectHashref("*","users","uid=".$args);

if($U) {
	$$U{bio}=$$U{sig}=undef;
	foreach ( sort keys %$U ) {
		if($$U{$_}) {
			print substr($_,0,15)."\t";
			$$U{$_}=~s/\n//g;
			print "\t" if length $_ < 8;
			print "'".substr($$U{$_},0,255)."'\n";
		}
	}
} else {
	print "@ARGV Not found";
}
print "\n\n";