2008-04-06 19:45:09 +00:00
< ? /*
LibreSSL - CAcert web application
Copyright ( C ) 2004 - 2008 CAcert Inc .
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; version 2 of the License .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
*/
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] != " ja_JP " )
{
define ( 'FPDF_FONTPATH' , '/usr/share/fpdf/font/' );
require_once ( '/usr/share/ufpdf/fpdf.php' );
class PDF2 extends FPDF { }
} else {
require ( '/usr/share/fpdf/japanese.php' );
class PDF2 extends PDF_Japanese { }
}
2005-06-12 03:51:48 +00:00
2005-07-01 13:12:14 +00:00
class PDF extends PDF2
2005-06-12 03:51:48 +00:00
{
function MultiCellBlt ( $w , $h , $blt , $txt , $border = 0 , $align = 'J' , $fill = 0 )
{
$blt_width = $this -> GetStringWidth ( $blt ) + $this -> cMargin * 2 ;
$bak_x = $this -> x ;
$this -> Cell ( $blt_width , $h , $blt , 0 , '' , $fill );
$this -> MultiCell ( $w - $blt_width , $h , $txt , $border , $align , $fill );
$this -> x = $bak_x ;
}
function Header ()
{
2008-09-03 18:44:03 +00:00
$this -> Image ( $_REQUEST [ 'bw' ] ? 'images/CAcert-logo-mono-1000.png' : 'images/CAcert-logo-colour-1000.png' , 8 , 8 , 100 );
2005-06-12 03:51:48 +00:00
$this -> SetFont ( 'Arial' , 'B' , 14 );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 14 );
2005-06-12 03:51:48 +00:00
$this -> Cell ( 100 );
2005-07-01 13:12:14 +00:00
$this -> Cell ( 40 , 20 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Trusted Third Party " )));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 6 );
$this -> Cell ( 100 );
2005-07-01 13:12:14 +00:00
$this -> Cell ( 40 , 20 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Identity Verification Form " )));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 10 );
}
function Footer ()
{
$this -> SetY ( - 10 );
$this -> SetFont ( 'Arial' , 'I' , 8 );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'I' , 8 );
2007-12-26 22:27:11 +00:00
$this -> Cell ( 0 , 0 , 'CAcert Inc. - P.O. Box 4107 - Denistone East NSW 2112 - Australia - http://www.CAcert.org' , 0 , 0 , 'C' );
2005-06-12 03:51:48 +00:00
$this -> SetY ( - 7 );
$this -> SetFont ( 'Arial' , '' , 6 );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , '' , 6 );
$this -> Cell ( 0 , 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " CAcert's Root Certificate fingerprints " )) . " : A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B " . _ ( " and " ) . " 135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33 " , 0 , 0 , 'C' );
2005-06-12 03:51:48 +00:00
}
function Body ( $name = " " , $dob = " " , $email = " " , $date = " " )
{
if ( $date == " now " )
$date = date ( " Y-m-d " );
// Show text blurb at top of page
$this -> SetY ( 40 );
$this -> SetFont ( 'Arial' , '' , 10 );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , '' , 10 );
$this -> Write ( 4 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " The CAcert Trusted Third Party (TTP) Programme is designed to assure Internet user identities through personal verification of government issued identity documents. " )));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 7 );
2008-01-12 20:45:00 +00:00
$this -> Write ( 4 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " The Applicant asks you to certify to CAcert that you have met with the Applicant and verified the Full Name, Date of Birth, and ID Numbers of the Applicant against two separate original government issued photo-identity documents. Once the photocopies of the photo IDs have been verified by the TTP they must be signed by the TTP with the statement 'I certify that this copy is a true copy of the original document'. The verified and signed photocopies of IDs are then to be included with the completed TTP forms and returned to CAcert Inc. " )));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 7 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 4 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Please complete and sign this form, and sign the photocopies of the IDs, to acknowledge that " ) . " : " ));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 7 );
2005-07-01 13:12:14 +00:00
$this -> MultiCellBlt ( $this -> w - 25 , 5 , " 1 " , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " You have viewed two of the Applicant's photo identity documents and you are convinced of their authenticity, and are convinced that the photos indeed depict the Applicant (allowed documents are government-issued documents with photos such as driver's license, passport, or others that are normally accepted as legal identification in your country; expired documents are allowed). " )));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 2 );
2005-07-01 13:12:14 +00:00
$this -> MultiCellBlt ( $this -> w - 25 , 5 , " 2 " , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " You have verified that the Full Name, Date of Birth, and ID Numbers on the identity documents matches those filled in the Applicant section below and in the photocopies provided. " )));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 4 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 4 , sprintf ( recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " If you have ANY doubts or concerns about the identity of the Applicant then please DO NOT COMPLETE AND SIGN this form. For more information about the Web of Trust, including detailed guides for Trusted Third Parties, please see: %s " )), " http://www.CAcert.org " ));
2005-06-12 03:51:48 +00:00
$this -> Ln ( 8 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 4 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " PLEASE NOTE: You must get 2 fully completed TTP forms before sending anything to CAcert. Failure to do so will only cause your application to be delayed until all forms have been received by CAcert! " )));
2005-06-12 03:51:48 +00:00
// TTP Section
$top = 160 ;
$this -> Rect ( 11 , $top , $this -> w - 25 , 45 , " D " );
$this -> Line ( 11 , $top + 6 , $this -> w - 14 , $top + 6 );
$this -> Line ( 11 , $top + 12 , 120 , $top + 12 );
$this -> Line ( 11 , $top + 18 , 120 , $top + 18 );
$this -> Line ( 11 , $top + 24 , 120 , $top + 24 );
$this -> Line ( 11 , $top + 30 , 120 , $top + 30 );
$this -> Line ( 11 , $top + 36 , $this -> w - 14 , $top + 36 );
$this -> Line ( 120 , $top + 6 , 120 , $top + 36 );
$this -> SetXY ( 11 , $top + 3 );
$this -> SetFont ( " Arial " , " BUI " , " 12 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'BUI' , 12 );
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Person Verifying Applicant's Identity " )));
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 9 );
$this -> SetFont ( " Arial " , " B " , " 8 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 8 );
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Names " ) . " : " ));
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 120 , $top + 9 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Office Street Address " ) . " : " ));
2005-06-12 03:51:48 +00:00
$this -> SetFont ( " Arial " , " B " , " 6 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 6 );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 14 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Profession (Please circle one) " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 16 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Justice of the Peace, Public Notary, Lawyer, Accountant, or Bank Manager " )));
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 20 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Bar Association, CPA Number or Bank Name and Branch, JP/Notary Number " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 22 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], " ( " . _ ( " as applicable " ) . " ): " ));
2005-06-12 03:51:48 +00:00
$this -> SetFont ( " Arial " , " B " , " 8 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 8 );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 27 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Office Phone " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 33 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Email (if applicable) " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 39 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Signature " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 120 , $top + 39 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Date " )) . " : " );
2005-06-12 03:51:48 +00:00
if ( $date )
$this -> Write ( 0 , $date );
// TTP Section
$top += 50 ;
$this -> Rect ( 11 , $top , $this -> w - 25 , 45 , " D " );
$this -> Line ( 11 , $top + 6 , $this -> w - 14 , $top + 6 );
$this -> Line ( 11 , $top + 12 , $this -> w - 14 , $top + 12 );
$this -> Line ( 11 , $top + 18 , $this -> w - 14 , $top + 18 );
$this -> Line ( 11 , $top + 24 , $this -> w - 14 , $top + 24 );
$this -> Line ( 11 , $top + 30 , $this -> w - 14 , $top + 30 );
$this -> Line ( 11 , $top + 36 , $this -> w - 14 , $top + 36 );
$this -> Line ( 120 , $top + 6 , 120 , $top + 36 );
$this -> SetXY ( 11 , $top + 3 );
$this -> SetFont ( " Arial " , " BUI " , " 12 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'BUI' , 12 );
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Applicant Information " )));
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 9 );
$this -> SetFont ( " Arial " , " B " , " 8 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 8 );
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Full Name (as shown on ID) " ) . " : " ));
2005-06-12 03:51:48 +00:00
if ( $name )
{
$this -> SetXY ( 120 , $top + 9 );
$this -> Write ( 0 , $name );
}
$this -> SetXY ( 11 , $top + 15 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Main email (so we can find you) " )) . " : " );
2005-06-12 03:51:48 +00:00
if ( $email )
{
$this -> SetXY ( 120 , $top + 15 );
$this -> Write ( 0 , $email );
}
$this -> SetXY ( 11 , $top + 21 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Date of Birth " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetFont ( " Arial " , " B " , " 6 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 6 );
$this -> Write ( 0 , " ( " . recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " YYYY-MM-DD " )) . " ) " );
2005-06-12 03:51:48 +00:00
$this -> SetFont ( " Arial " , " B " , " 8 " );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$this -> SetFont ( 'SJIS' , 'B' , 8 );
2005-06-12 03:51:48 +00:00
if ( $dob )
{
$this -> SetXY ( 120 , $top + 21 );
$this -> Write ( 0 , $dob );
}
$this -> SetXY ( 11 , $top + 27 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " F irst ID Number (driver's license, passport etc) " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 33 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Second ID Number (driver's license, passport etc) " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 11 , $top + 39 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Signature " )) . " : " );
2005-06-12 03:51:48 +00:00
$this -> SetXY ( 120 , $top + 39 );
2005-07-01 13:12:14 +00:00
$this -> Write ( 0 , recode ( $_SESSION [ '_config' ][ 'recode' ], _ ( " Date " )) . " : " );
2005-06-12 03:51:48 +00:00
if ( $date )
$this -> Write ( 0 , $date );
}
}
$format = $_GET [ 'format' ];
if ( $format != " letter " )
$format = " A4 " ;
$pdf = new PDF ( 'P' , 'mm' , $format );
2005-07-01 13:12:14 +00:00
if ( $_SESSION [ '_config' ][ 'language' ] == " ja_JP " )
$pdf -> AddSJISFont ();
$pdf -> Open ();
2005-06-12 03:51:48 +00:00
$pdf -> AddPage ();
$pdf -> Body ( $_GET [ 'name' ], $_GET [ 'dob' ], $_GET [ 'email' ], $_GET [ 'date' ]);
2005-11-08 10:06:04 +00:00
header ( " Expires: " . gmdate ( " D, j M Y G:i:s \ G \ M \T " , time () + 10800 ));
2005-12-04 21:04:05 +00:00
header ( " Content-Disposition: attachment; filename=ttp.pdf " );
2005-11-08 10:06:04 +00:00
header ( " Cache-Control: public, max-age=10800 " );
header ( " Pragma: cache " );
2005-06-12 03:51:48 +00:00
$pdf -> output ();
exit ;
?>