⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search_user.cgi

📁 Unix下基于Web的管理工具
💻 CGI
字号:
#!/usr/local/bin/perl# search_user.cgi# Search the password file, and display a list of resultsrequire './user-lib.pl';&ReadParse();@ulist = &list_users();$m = $in{'match'};$w = $in{'what'};for($i=0; $i<@ulist; $i++) {	$u = $ulist[$i];	$f = $u->{$in{'field'}};	if ($m == 0 && $f eq $w ||	    $m == 1 && $f =~ /$w/i ||	    $m == 2 && $f ne $w ||	    $m == 3 && $f !~ /$w/i) {		push(@match, $u);		}	}if (@match == 1) {	&redirect("edit_user.cgi?num=".$match[0]->{'num'});	}else {	&header($text{'search_title'}, "");	print "<hr>\n";	if (@match == 0) {		print "<p><b>No matching users found</b>. <p>\n";		}	else {		print "<table border width=100%>\n";		print "<tr $tb> <td><b>$text{'user'}</b></td>\n";		print "<td><b>$text{'uid'}</b></td>\n";		print "<td><b>$text{'real'}</b></td>\n";		print "<td><b>$text{'home'}</b></td> </tr>\n";		foreach $m (@match) {			print "<tr $cb>\n";			print "<td><a href=\"edit_user.cgi?num=$m->{'num'}\">",			      "$m->{'user'}</a></td>\n";			print "<td>$m->{'uid'}</td>\n";			print "<td>$m->{'real'}&nbsp;</td>\n";			print "<td>$m->{'home'}</td>\n";			print "</tr>\n";			}		print "</table><p>\n";		}	print "<hr>\n";	&footer("", $text{'index_return'});	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -