2003-08-20 16:09:41 +00:00
|
|
|
|
<?php
|
2003-05-31 10:52:15 +00:00
|
|
|
|
/*
|
|
|
|
|
$Id$
|
|
|
|
|
|
|
|
|
|
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
|
2003-08-26 18:58:40 +00:00
|
|
|
|
Copyright (C) 2003 Michael D<EFBFBD>rgner
|
2003-05-31 10:52:15 +00:00
|
|
|
|
|
|
|
|
|
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; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
|
|
|
|
|
2003-08-20 16:09:41 +00:00
|
|
|
|
LDAP Account Manager lamPDF class and some pdf functions
|
2003-05-31 10:52:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
define('FPDF_FONTPATH', 'font/');
|
2003-08-20 16:09:41 +00:00
|
|
|
|
include_once("fpdf.php");
|
2003-05-31 10:52:15 +00:00
|
|
|
|
|
2003-08-20 16:09:41 +00:00
|
|
|
|
function createUserPDF($accounts) {
|
2003-09-28 16:38:54 +00:00
|
|
|
|
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Check if all submitted accounts are user accounts
|
|
|
|
|
for($i=0;$i<count($accounts);$i++) {
|
|
|
|
|
$account = $accounts[$i];
|
2003-09-28 16:38:54 +00:00
|
|
|
|
// if($account->type <> "user") {
|
|
|
|
|
// return 2; // 2 means non user account submitted for createUserPDF()
|
|
|
|
|
// }
|
2003-08-21 15:27:42 +00:00
|
|
|
|
}
|
2003-09-28 16:38:54 +00:00
|
|
|
|
|
|
|
|
|
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Start PDF file
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile = new lamPDF();
|
|
|
|
|
$pdfFile->Open();
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Write some information into the PDF file
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("arial","",12);
|
|
|
|
|
$pdfFile->setTitle("LDAP Account Manager");
|
|
|
|
|
$pdfFile->setSubject(_("User information page"));
|
|
|
|
|
$pdfFile->setAuthor("LDAP Account Manager Devel-Team -Michael D<>rgner-");
|
|
|
|
|
$pdfFile->setCreator("LDAP Account Manager (pdf.inc)");
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Loop for every sumbitted account and print its values on a extra page
|
2003-08-20 16:09:41 +00:00
|
|
|
|
for($i=0;$i<count($accounts);$i++) {
|
|
|
|
|
$account = $accounts[$i];
|
2003-08-20 19:50:40 +00:00
|
|
|
|
$iv = base64_decode($_COOKIE['IV']);
|
|
|
|
|
$key = base64_decode($_COOKIE['Key']);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->addPage();
|
2003-09-10 17:49:46 +00:00
|
|
|
|
// Print Personal settings
|
|
|
|
|
$pdfFile->Write(5,"- " . _("Personal User Infos") . ":");
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Ln(6);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Title") . ":",0,0,"R",0);
|
2003-09-10 19:10:13 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_title,0,1,"L",0);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Surname") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->general_surname,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Given name") . ":",0,0,"R",0);
|
2003-09-10 19:14:32 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 19:10:13 +00:00
|
|
|
|
$pdfFile->Cell(50,5,$account->general_givenname,0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Street") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_street,0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 19:18:44 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Postal code") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_postalCode,0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Postal address") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_postalAddress,0,1,"L",0);
|
2003-09-10 19:10:13 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("E-Mail") . ":",0,0,"R",0);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_mail,0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Phone") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_telephoneNumber,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Cellular phone") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_mobileTelephoneNumber,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Facsimile") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->personal_facsimileTelephoneNumber,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
// Print Unix settings
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Ln(9);
|
|
|
|
|
$pdfFile->setFont("arial","B",12);
|
|
|
|
|
$pdfFile->Write(5,"- " . _("Unix User Settings") . ":");
|
|
|
|
|
$pdfFile->Ln(6);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Username") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->general_username,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
if($account->unix_password_no == "1") {
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Unix password") . ":",0,0,"R",0);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Unix password disabled!"),0,1,"L",0);
|
|
|
|
|
}
|
2003-08-26 20:03:25 +00:00
|
|
|
|
elseif($account->unix_password == "") {
|
|
|
|
|
}
|
2003-08-21 15:27:42 +00:00
|
|
|
|
else {
|
|
|
|
|
$account->unix_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->unix_password), MCRYPT_MODE_ECB, $iv);
|
|
|
|
|
$account->unix_password = str_replace(chr(00), '', $account->unix_password);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Unix password") . ":",0,0,"R",0);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->unix_password,0,1,"L",0);
|
|
|
|
|
}
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Group(s)") . ":",0,0,"R",0);
|
|
|
|
|
$text = $account->general_group;
|
|
|
|
|
$groups = $account->general_groupadd;
|
|
|
|
|
for($j=0;$j<count($groups);$j++) {
|
|
|
|
|
$text .= ", " . $groups[$j];
|
|
|
|
|
}
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$text,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Home Directory") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->general_homedir,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Login Shell") . ":",0,0,"R",0);
|
|
|
|
|
$text = "";
|
|
|
|
|
$shells = $account->general_shell;
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->general_shell,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Password expire") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-08-29 11:21:02 +00:00
|
|
|
|
$pdfFile->Cell(50,5,date('j. F Y' ,$account->unix_pwdexpire),0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Login at host(s)") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->unix_host,0,1,"L",0);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
// Print Samba settings
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Ln(9);
|
|
|
|
|
$pdfFile->setFont("arial","B",12);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Write(5,"- " . _("Windows User Settings") . ":");
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Ln(6);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 19:18:44 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Username") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->general_username,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
if($account->smb_password_no == "1") {
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Windows password") . ":",0,0,"R",0);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Window password disabled!"),0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
}
|
2003-08-21 15:27:42 +00:00
|
|
|
|
elseif($account->smb_useunixpwd == "1") {
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Windows password") . ":",0,0,"R",0);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Windows password set to unix password."),0,1,"L",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
}
|
2003-08-26 20:03:25 +00:00
|
|
|
|
elseif($account->smb_password == "") {
|
|
|
|
|
}
|
2003-08-21 15:27:42 +00:00
|
|
|
|
else {
|
2003-08-20 19:50:40 +00:00
|
|
|
|
$account->smb_password = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, base64_decode($account->smb_password), MCRYPT_MODE_ECB, $iv);
|
|
|
|
|
$account->smb_password = str_replace(chr(00), '', $account->smb_password);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Windows password") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_password,0,1,"L",0);
|
|
|
|
|
}
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Home drive") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_homedrive,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Script path") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_scriptPath,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Profile path") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_profilePath,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("Login at workstation(s)") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_smbuserworkstations,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 19:18:44 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Windows home directory") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_home,0,1,"L",0);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$pdfFile->Cell(50,5,_("Windows Domain") . ":",0,0,"R",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
if($_SESSION['config']->get_samba3() == "yes") {
|
|
|
|
|
$account->smb_domain = $account->smb_domain->name;
|
|
|
|
|
}
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Cell(50,5,$account->smb_domain,0,1,"L",0);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
// Print Quota settings
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Ln(9);
|
|
|
|
|
$pdfFile->setFont("arial","B",12);
|
|
|
|
|
$pdfFile->Write(5,"- " . _("Quota Settings") . ":");
|
|
|
|
|
$pdfFile->Ln(6);
|
|
|
|
|
$pdfFile->setFont("times","",10);
|
|
|
|
|
$pdfFile->Cell(50,5,_("User quota(s)") . ":",0,0,"R",0);
|
|
|
|
|
$pdfFile->setFont("times","B",10);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
$quotas = $account->quota;
|
2003-08-26 20:48:20 +00:00
|
|
|
|
if(count($quotas)>0) {
|
2003-09-10 19:10:13 +00:00
|
|
|
|
$pdfFile->Cell(30,5,_("Mountpoint"),0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,_("Soft block"),0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,_("Soft inode"),0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,_("Hard block"),0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,_("Hard inode"),0,1,"L",0);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
for($j=0;$j<count($quotas);$j++) {
|
|
|
|
|
$pdfFile->Cell(50,5,"",0,0,"R",0);
|
2003-09-10 19:10:13 +00:00
|
|
|
|
$pdfFile->Cell(30,5,$quotas[$j][0],0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,$quotas[$j][2],0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,$quotas[$j][3],0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,$quotas[$j][6],0,0,"L",0);
|
|
|
|
|
$pdfFile->Cell(30,5,$quotas[$j][7],0,1,"L",0);
|
2003-08-21 15:27:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$pdfFile->Cell(50,5,_("No user quotas defined or no quota support by filesystem."),0,1,"L",0);
|
|
|
|
|
}
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Ln(9);
|
|
|
|
|
$pdfFile->setFont("arial","B",12);
|
2003-05-31 10:52:15 +00:00
|
|
|
|
}
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Close document and send it to the browser
|
2003-09-28 16:38:54 +00:00
|
|
|
|
// $pdfFile->Close();
|
|
|
|
|
// $pdfFile->Output();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete old PDF older than 3 min
|
|
|
|
|
$relpath = $_SESSION['lampath'].'tmp/';
|
|
|
|
|
|
|
|
|
|
$t=time();
|
|
|
|
|
$h=opendir("$relpath");
|
|
|
|
|
while ($file=readdir($h)) {
|
|
|
|
|
if (substr($file, -4)=='.pdf') {
|
|
|
|
|
$path = $relpath.$file;
|
|
|
|
|
if ($t-filemtime($path)>180)
|
|
|
|
|
@unlink($path);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
closedir($h);
|
|
|
|
|
|
|
|
|
|
// Close PDF
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$pdfFile->Close();
|
2003-09-28 16:38:54 +00:00
|
|
|
|
// use timestamp as filename so it should be unique.
|
|
|
|
|
$time = time();
|
|
|
|
|
$filename = $relpath. $time .'.pdf';
|
|
|
|
|
$fileurl = $_SESSION['lamurl'].'templates/getpdf.php?&f='.$_SESSION['lampath'] .'tmp/'. $time .'.pdf';
|
|
|
|
|
// Save PDF
|
|
|
|
|
$pdfFile->Output($filename);
|
|
|
|
|
|
|
|
|
|
// Create redirector page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $_SESSION['header'];
|
|
|
|
|
echo "<html><head><title>";
|
|
|
|
|
echo _("PDF File");
|
|
|
|
|
echo "</title>\n".
|
|
|
|
|
"<link rel=\"stylesheet\" type=\"text/css\" href=\"".$_SESSION['lamurl']."style/layout.css\">\n".
|
|
|
|
|
"<meta http-equiv=\"pragma\" content=\"no-cache\">\n".
|
|
|
|
|
"<meta http-equiv=\"cache-control\" content=\"no-cache\">\n".
|
|
|
|
|
"<meta http-equiv=\"refresh\" content=\"2; URL=$fileurl\">\n".
|
|
|
|
|
"</head><body>\n".
|
|
|
|
|
"<a href=\"$fileurl\">";
|
|
|
|
|
echo _('Please press here if meta-refresh didn\'t work.');
|
|
|
|
|
echo "</a></body></html>";
|
|
|
|
|
|
2003-08-21 15:27:42 +00:00
|
|
|
|
return 0; // 0 means everything successful; page(s) printed
|
2003-08-20 16:09:41 +00:00
|
|
|
|
}
|
2003-05-31 10:52:15 +00:00
|
|
|
|
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// lamPDF class || For defining own a Header and Footer
|
2003-08-20 16:09:41 +00:00
|
|
|
|
class lamPDF extends FPDF {
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Print page header
|
2003-08-20 16:09:41 +00:00
|
|
|
|
function header() {
|
2003-08-26 20:48:20 +00:00
|
|
|
|
$imageFile = substr(__FILE__,0,strlen(__FILE__)- 11) . "graphics/printLogo.jpg";
|
2003-08-26 20:29:47 +00:00
|
|
|
|
$this->Image($imageFile,10,10,50,20,"JPG");
|
2003-08-20 16:09:41 +00:00
|
|
|
|
$this->SetFont("arial","B",22);
|
|
|
|
|
$this->Cell(170,5,"LDAP Account Manager",0,1,"R",0);
|
|
|
|
|
$this->Ln(3);
|
|
|
|
|
$this->SetFont("times","",14);
|
|
|
|
|
$this->Cell(170,5,"-" . _("User information page") . "-",0,0,"R",0);
|
|
|
|
|
$this->SetLineWidth(0.8);
|
|
|
|
|
$this->Line(10,40,200,40);
|
|
|
|
|
$this->Line(10,42,200,42);
|
|
|
|
|
$this->SetY(60);
|
|
|
|
|
}
|
2003-05-31 10:52:15 +00:00
|
|
|
|
|
2003-08-21 15:27:42 +00:00
|
|
|
|
// Print page footer
|
2003-08-20 16:09:41 +00:00
|
|
|
|
function footer() {
|
|
|
|
|
$this->SetLineWidth(0.8);
|
|
|
|
|
$this->Line(10,280,200,280);
|
|
|
|
|
$this->Line(10,282,200,282);
|
|
|
|
|
$this->SetY(285);
|
2003-09-10 17:49:46 +00:00
|
|
|
|
$this->Cell(0,5,_("This document was automatically created by LDAP Account Manager"),0,0,"C",0);
|
2003-08-20 16:09:41 +00:00
|
|
|
|
}
|
|
|
|
|
}
|