📄 listcerts
字号:
## OpenCA - CA Command## (c) 1998-2001 by Massimiliano Pala and OpenCA Group#### File Name: certsList## Brief: build Certificates' listing## Description: Build Certificates' listing given the dataType## Parameters: dataType, viewFrom, rowsif ( $cmd !~ /listCerts/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' );## Get required parameters ( return only the value string )my $sheet = getRequired( 'basecertslist' );my $maxItems = getRequired( 'MaxReturnedItems' );my $uptime = $tools->getDate();my @cols;## Get the base Page ( got in $page variable )if( not $page = $query->getFile( "$sheet" ) ) { configError ( "File not Found : $sheet" );};## Set the column titlespush( @cols, "Mark" );push( @cols, "Serial" );push( @cols, "Common Name" );push( @cols, "Email" );if ( not $matched ) { $matched = $db->elements( DATATYPE=>$dataType );};my @certsList = $db->listItems( DATATYPE=>$dataType, FROM=>$from, TO=>$to, ITEMS=>$maxItems );my $refs = $query->buildRefs( ELEMENTS=>$matched, MAXITEMS=>$maxItems );$table = $refs;$table .= $query->startTable( COLS=>[ @cols ], WIDTH=>"100%", TITLE_BGCOLOR=>"#DDCCFF" );## Process all Filesforeach $cert ( @certsList ) { my ( $format, $key, $type, $ser_col, $check ); my @vals; $key = $cert->getParsed()->{DBKEY}; $type = $dataType; $check = $query->newInput( -intype=>checkbox, -name=>"$key", -value=>'1', -label=>"" ); $ser_col = "<a href=\"$self?cmd=viewCert&dataType=$type" . "&key=$key\">". $cert->getParsed()->{SERIAL} . "</a>"; push( @vals, "<CENTER>$check</CENTER>" ); push( @vals, $ser_col ); push( @vals, ( $cert->getParsed()->{CN} || "<CENTER>---</CENTER>") ); push( @vals, ( $cert->getParsed()->{EMAIL} || "<CENTER>---</CENTER>") ); $table .= $query->addTableLine( DATA =>[ @vals ]);}## Close the Table$table .= $query->endTable();## Substitute the Variables in the $page$page = $query->subVar( $page, '$uptime', $uptime );$page = $query->subVar( $page, '$table', $table );$page = $query->subVar( $page, '@COPY@', getCopyRight() );$page = $query->subVar( $page, '@DATATYPE@', $dataType);print "$page";1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -