?? search
字號:
## OpenCA - CA Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group#### File Name: search## Brief: Search Items## Description: Search Items ad list results found## Parameters: dataType, viewFrom, rowsmy $cmdName = "search";if ( $cmd !~ /$cmdName/i ) { configError( "Wrong Command Usage ($cmd over importReqs)!" ); exit 1;}## Reserved variablesmy ( $page, $certData, $sheet );## We need some parameters to generate the list because of## we do not want to generate a list of ALL issued certificates## so get the numer of results we should give away, then the## starting serial number.my $from = $query->param( 'viewFrom' );my $matched = $query->param( 'rows' );my $dataType = $query->param( 'dataType' );my $parName = $query->param( 'name' );my $parVal = $query->param( 'value' );## Get required parameters ( return only the value string )my $sheet = getRequired( 'baseSearchlist' );my $maxItems = getRequired( 'MaxReturnedItems' );my $uptime = $tools->getDate();my $f1 = "<FONT COLOR=\"#EF7000\">";my $f2 = "<FONT SIZE=+0 COLOR=\"#CCCCDD\">";my $f3 = "<FONT COLOR=\"#FFFFFF\">";my $ef = "</FONT>";my $title = "${f1}S${ef}earch ${f1}R${ef}esults${ef}${f3}.${ef}<BR>";if( $dataType =~ /CERTIFICATE/ ) { $title .= "${f2}Certificates Search${ef}";} elsif ( $dataType =~ /REQUEST/ ) { $title .= "${f2}Requests Search${ef}";} else { $title .= "${f2}Unknown Search${ef}";} my @cols;## Get the base Page ( got in $page variable )if( not $page = $query->getFile( "$sheet" ) ) { configError ( "File not Found : $sheet" );};if( $dataType =~ /CERTIFICATE/ ) { push( @cols, "Serial", "Common Name", "Email" );} elsif ( $dataType =~ /REQUEST/ ) { push( @cols, "Serial", "Common Name", "Email" );} else { configError( "Datatype $dataType not supported!" ); exit 0;}my @itemsList = $db->searchItems( DATATYPE=>$dataType, $parName=>$parVal );if ( not $matched ) { $matched = $#itemsList; };$table = $query->buildRefs( ELEMENTS=>$matched, MAXITEMS=>$maxItems );$table .= $query->startTable( COLS=>[ @cols ], WIDTH=>"100%", TITLE_BGCOLOR=>"#DDCCFF" );## Process all Filesforeach $item ( @itemsList ) { my ( $lnk, $cmd, $key, $type, $mySer, $myCN, $myEmail, $serCol ); $key = $item->getParsed()->{DBKEY}; $type = $item->{DATATYPE}; $mySer = ( $item->getParsed()->{SERIAL} or "<CENTER>n/a</CENTER>"); $myCN = ( $item->getParsed()->{CN} or "<CENTER>n/a</CENTER>" ); $myEmail = ( $item->getParsed()->{EMAIL} or "<CENTER>n/a</CENTER>" ); if( $type =~ /CERTIFICATE/ ) { $cmd = "viewCert"; } elsif ( $type =~ /REQUEST/ ) { $cmd = "viewReq"; } else { $cmd = ""; } $lnk = new CGI({ cmd=>"$cmd", dataType=>$type, key=>$key }); $serCol = $lnk->a( {-href=>$lnk->self_url()}, "$mySer" ); $table .= $query->addTableLine( DATA =>[ $serCol, $myCN, $myEmail ]);}## Close the Table$table .= $query->endTable();$table .= getCopyRight();## Substitute the Variables in the $page$page = $query->subVar( $page, '@UPTIME@', $uptime );$page = $query->subVar( $page, '@TABLE@', $table );$page = $query->subVar( $page, '@TITLE@', $title );print "$page";1;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -