*** empty log message ***

This commit is contained in:
duergner 2004-10-30 16:46:06 +00:00
parent 6f6f9607e8
commit 6c97d892b3
18 changed files with 890 additions and 470 deletions

View File

@ -23,6 +23,16 @@ $Id$
LDAP Account Manager help topics. LDAP Account Manager help topics.
*/ */
/**
* LDAP Account Manager help entries.
*
* @author Michael Dürgner
* @version 0.5
* @package Help
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
setlanguage(); setlanguage();
$helpArray = array ( $helpArray = array (

View File

@ -498,12 +498,12 @@ class baseModule {
* *
* @return array The desired help entry. * @return array The desired help entry.
*/ */
function get_help($id,$scope) { function get_help($id) {
if(isset($this->meta['help'][$id])) { if(isset($this->meta['help'][$id])) {
return $this->meta['help'][$id]; return $this->meta['help'][$id];
} }
elseif(isset($this->meta['help'][$scope][$id])) { elseif(isset($this->meta['help'][$this->scope][$id])) {
return $this->meta['help'][$scope][$id]; return $this->meta['help'][$this->scope][$id];
} }
else { else {
return false; return false;

View File

@ -1,241 +1,298 @@
<?php <?php
/******************************************************************************* /**
* Software: FPDF * * You may use, modify and redistribute this software as you wish.
* Version: 1.52 * * Software: FPDF
* Date: 2003-12-30 * *
* Author: Olivier PLATHEY * * @author Olivier Plathey
* License: Freeware * * @version 1.52
* * * @package PDF
* You may use, modify and redistribute this software as you wish. * * @copyright Copyright (C) 2003-2004
*******************************************************************************/ * @license Freeware
*/
if(!class_exists('FPDF')) if(!class_exists('FPDF'))
{ {
define('FPDF_VERSION','1.52'); /**
*
*/
define('FPDF_VERSION','1.52');
class FPDF /**
{ *
//Private properties *
var $page; //current page number * @author Olivier Plathey
var $n; //current object number * @version 1.52
var $offsets; //array of object offsets * @package PDF
var $buffer; //buffer holding in-memory PDF * @copyright Copyright (C) 2003-2004
var $pages; //array containing pages * @license Freeware
var $state; //current document state */
var $compress; //compression flag class FPDF {
var $DefOrientation; //default orientation //Private properties
var $CurOrientation; //current orientation var $page; //current page number
var $OrientationChanges; //array indicating orientation changes var $n; //current object number
var $k; //scale factor (number of points in user unit) var $offsets; //array of object offsets
var $fwPt,$fhPt; //dimensions of page format in points var $buffer; //buffer holding in-memory PDF
var $fw,$fh; //dimensions of page format in user unit var $pages; //array containing pages
var $wPt,$hPt; //current dimensions of page in points var $state; //current document state
var $w,$h; //current dimensions of page in user unit var $compress; //compression flag
var $lMargin; //left margin var $DefOrientation; //default orientation
var $tMargin; //top margin var $CurOrientation; //current orientation
var $rMargin; //right margin var $OrientationChanges; //array indicating orientation changes
var $bMargin; //page break margin var $k; //scale factor (number of points in user unit)
var $cMargin; //cell margin var $fwPt,$fhPt; //dimensions of page format in points
var $x,$y; //current position in user unit for cell positioning var $fw,$fh; //dimensions of page format in user unit
var $lasth; //height of last cell printed var $wPt,$hPt; //current dimensions of page in points
var $LineWidth; //line width in user unit var $w,$h; //current dimensions of page in user unit
var $CoreFonts; //array of standard font names var $lMargin; //left margin
var $fonts; //array of used fonts var $tMargin; //top margin
var $FontFiles; //array of font files var $rMargin; //right margin
var $diffs; //array of encoding differences var $bMargin; //page break margin
var $images; //array of used images var $cMargin; //cell margin
var $PageLinks; //array of links in pages var $x,$y; //current position in user unit for cell positioning
var $links; //array of internal links var $lasth; //height of last cell printed
var $FontFamily; //current font family var $LineWidth; //line width in user unit
var $FontStyle; //current font style var $CoreFonts; //array of standard font names
var $underline; //underlining flag var $fonts; //array of used fonts
var $CurrentFont; //current font info var $FontFiles; //array of font files
var $FontSizePt; //current font size in points var $diffs; //array of encoding differences
var $FontSize; //current font size in user unit var $images; //array of used images
var $DrawColor; //commands for drawing color var $PageLinks; //array of links in pages
var $FillColor; //commands for filling color var $links; //array of internal links
var $TextColor; //commands for text color var $FontFamily; //current font family
var $ColorFlag; //indicates whether fill and text colors are different var $FontStyle; //current font style
var $ws; //word spacing var $underline; //underlining flag
var $AutoPageBreak; //automatic page breaking var $CurrentFont; //current font info
var $PageBreakTrigger; //threshold used to trigger page breaks var $FontSizePt; //current font size in points
var $InFooter; //flag set when processing footer var $FontSize; //current font size in user unit
var $ZoomMode; //zoom display mode var $DrawColor; //commands for drawing color
var $LayoutMode; //layout display mode var $FillColor; //commands for filling color
var $title; //title var $TextColor; //commands for text color
var $subject; //subject var $ColorFlag; //indicates whether fill and text colors are different
var $author; //author var $ws; //word spacing
var $keywords; //keywords var $AutoPageBreak; //automatic page breaking
var $creator; //creator var $PageBreakTrigger; //threshold used to trigger page breaks
var $AliasNbPages; //alias for total number of pages var $InFooter; //flag set when processing footer
var $ZoomMode; //zoom display mode
var $LayoutMode; //layout display mode
var $title; //title
var $subject; //subject
var $author; //author
var $keywords; //keywords
var $creator; //creator
var $AliasNbPages; //alias for total number of pages
/******************************************************************************* /*******************************************************************************
* * * *
* Public methods * * Public methods *
* * * *
*******************************************************************************/ *******************************************************************************/
function FPDF($orientation='P',$unit='mm',$format='A4') /**
{ *
//Some checks *
$this->_dochecks(); * @param string
//Initialization of properties * @param string
$this->page=0; * @param string
$this->n=2; */
$this->buffer=''; function FPDF($orientation='P',$unit='mm',$format='A4') {
$this->pages=array(); //Some checks
$this->OrientationChanges=array(); $this->_dochecks();
$this->state=0; //Initialization of properties
$this->fonts=array(); $this->page=0;
$this->FontFiles=array(); $this->n=2;
$this->diffs=array(); $this->buffer='';
$this->images=array(); $this->pages=array();
$this->links=array(); $this->OrientationChanges=array();
$this->InFooter=false; $this->state=0;
$this->lasth=0; $this->fonts=array();
$this->FontFamily=''; $this->FontFiles=array();
$this->FontStyle=''; $this->diffs=array();
$this->FontSizePt=12; $this->images=array();
$this->underline=false; $this->links=array();
$this->DrawColor='0 G'; $this->InFooter=false;
$this->FillColor='0 g'; $this->lasth=0;
$this->TextColor='0 g'; $this->FontFamily='';
$this->ColorFlag=false; $this->FontStyle='';
$this->ws=0; $this->FontSizePt=12;
//Standard fonts $this->underline=false;
$this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique', $this->DrawColor='0 G';
'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique', $this->FillColor='0 g';
'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic', $this->TextColor='0 g';
'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats'); $this->ColorFlag=false;
//Scale factor $this->ws=0;
if($unit=='pt') //Standard fonts
$this->k=1; $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
elseif($unit=='mm') 'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
$this->k=72/25.4; 'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
elseif($unit=='cm') 'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
$this->k=72/2.54; //Scale factor
elseif($unit=='in') if($unit=='pt')
$this->k=72; $this->k=1;
else elseif($unit=='mm')
$this->Error('Incorrect unit: '.$unit); $this->k=72/25.4;
//Page format elseif($unit=='cm')
if(is_string($format)) $this->k=72/2.54;
{ elseif($unit=='in')
$format=strtolower($format); $this->k=72;
if($format=='a3')
$format=array(841.89,1190.55);
elseif($format=='a4')
$format=array(595.28,841.89);
elseif($format=='a5')
$format=array(420.94,595.28);
elseif($format=='letter')
$format=array(612,792);
elseif($format=='legal')
$format=array(612,1008);
else else
$this->Error('Unknown page format: '.$format); $this->Error('Incorrect unit: '.$unit);
$this->fwPt=$format[0]; //Page format
$this->fhPt=$format[1]; if(is_string($format))
{
$format=strtolower($format);
if($format=='a3')
$format=array(841.89,1190.55);
elseif($format=='a4')
$format=array(595.28,841.89);
elseif($format=='a5')
$format=array(420.94,595.28);
elseif($format=='letter')
$format=array(612,792);
elseif($format=='legal')
$format=array(612,1008);
else
$this->Error('Unknown page format: '.$format);
$this->fwPt=$format[0];
$this->fhPt=$format[1];
}
else
{
$this->fwPt=$format[0]*$this->k;
$this->fhPt=$format[1]*$this->k;
}
$this->fw=$this->fwPt/$this->k;
$this->fh=$this->fhPt/$this->k;
//Page orientation
$orientation=strtolower($orientation);
if($orientation=='p' or $orientation=='portrait')
{
$this->DefOrientation='P';
$this->wPt=$this->fwPt;
$this->hPt=$this->fhPt;
}
elseif($orientation=='l' or $orientation=='landscape')
{
$this->DefOrientation='L';
$this->wPt=$this->fhPt;
$this->hPt=$this->fwPt;
}
else
$this->Error('Incorrect orientation: '.$orientation);
$this->CurOrientation=$this->DefOrientation;
$this->w=$this->wPt/$this->k;
$this->h=$this->hPt/$this->k;
//Page margins (1 cm)
$margin=28.35/$this->k;
$this->SetMargins($margin,$margin);
//Interior cell margin (1 mm)
$this->cMargin=$margin/10;
//Line width (0.2 mm)
$this->LineWidth=.567/$this->k;
//Automatic page break
$this->SetAutoPageBreak(true,2*$margin);
//Full width display mode
$this->SetDisplayMode('fullwidth');
//Compression
$this->SetCompression(true);
} }
else
/**
*
*
* @param int
* @param int
* @param int
*/
function SetMargins($left,$top,$right=-1)
{ {
$this->fwPt=$format[0]*$this->k; //Set left, top and right margins
$this->fhPt=$format[1]*$this->k; $this->lMargin=$left;
$this->tMargin=$top;
if($right==-1)
$right=$left;
$this->rMargin=$right;
} }
$this->fw=$this->fwPt/$this->k;
$this->fh=$this->fhPt/$this->k; /**
//Page orientation *
$orientation=strtolower($orientation); *
if($orientation=='p' or $orientation=='portrait') * @param int
*/
function SetLeftMargin($margin)
{ {
$this->DefOrientation='P'; //Set left margin
$this->wPt=$this->fwPt; $this->lMargin=$margin;
$this->hPt=$this->fhPt; if($this->page>0 and $this->x<$margin)
$this->x=$margin;
} }
elseif($orientation=='l' or $orientation=='landscape')
/**
*
*
* @param int
*/
function SetTopMargin($margin)
{ {
$this->DefOrientation='L'; //Set top margin
$this->wPt=$this->fhPt; $this->tMargin=$margin;
$this->hPt=$this->fwPt; }
/**
*
*
* @param int
*/
function SetRightMargin($margin)
{
//Set right margin
$this->rMargin=$margin;
}
/**
*
*
* @param boolean
* @param int
*/
function SetAutoPageBreak($auto,$margin=0)
{
//Set auto page break mode and triggering margin
$this->AutoPageBreak=$auto;
$this->bMargin=$margin;
$this->PageBreakTrigger=$this->h-$margin;
}
/**
*
*
* @param string
* @param string
*/
function SetDisplayMode($zoom,$layout='continuous')
{
//Set display mode in viewer
if($zoom=='fullpage' or $zoom=='fullwidth' or $zoom=='real' or $zoom=='default' or !is_string($zoom))
$this->ZoomMode=$zoom;
else
$this->Error('Incorrect zoom display mode: '.$zoom);
if($layout=='single' or $layout=='continuous' or $layout=='two' or $layout=='default')
$this->LayoutMode=$layout;
else
$this->Error('Incorrect layout display mode: '.$layout);
}
/**
*
*
* @param string
*/
function SetCompression($compress)
{
//Set page compression
if(function_exists('gzcompress'))
$this->compress=$compress;
else
$this->compress=false;
} }
else
$this->Error('Incorrect orientation: '.$orientation);
$this->CurOrientation=$this->DefOrientation;
$this->w=$this->wPt/$this->k;
$this->h=$this->hPt/$this->k;
//Page margins (1 cm)
$margin=28.35/$this->k;
$this->SetMargins($margin,$margin);
//Interior cell margin (1 mm)
$this->cMargin=$margin/10;
//Line width (0.2 mm)
$this->LineWidth=.567/$this->k;
//Automatic page break
$this->SetAutoPageBreak(true,2*$margin);
//Full width display mode
$this->SetDisplayMode('fullwidth');
//Compression
$this->SetCompression(true);
}
function SetMargins($left,$top,$right=-1)
{
//Set left, top and right margins
$this->lMargin=$left;
$this->tMargin=$top;
if($right==-1)
$right=$left;
$this->rMargin=$right;
}
function SetLeftMargin($margin)
{
//Set left margin
$this->lMargin=$margin;
if($this->page>0 and $this->x<$margin)
$this->x=$margin;
}
function SetTopMargin($margin)
{
//Set top margin
$this->tMargin=$margin;
}
function SetRightMargin($margin)
{
//Set right margin
$this->rMargin=$margin;
}
function SetAutoPageBreak($auto,$margin=0)
{
//Set auto page break mode and triggering margin
$this->AutoPageBreak=$auto;
$this->bMargin=$margin;
$this->PageBreakTrigger=$this->h-$margin;
}
function SetDisplayMode($zoom,$layout='continuous')
{
//Set display mode in viewer
if($zoom=='fullpage' or $zoom=='fullwidth' or $zoom=='real' or $zoom=='default' or !is_string($zoom))
$this->ZoomMode=$zoom;
else
$this->Error('Incorrect zoom display mode: '.$zoom);
if($layout=='single' or $layout=='continuous' or $layout=='two' or $layout=='default')
$this->LayoutMode=$layout;
else
$this->Error('Incorrect layout display mode: '.$layout);
}
function SetCompression($compress)
{
//Set page compression
if(function_exists('gzcompress'))
$this->compress=$compress;
else
$this->compress=false;
}
function SetTitle($title) function SetTitle($title)
{ {

View File

@ -352,7 +352,7 @@ function checkConfigOptions($scopes, $options) {
*/ */
function getHelp($module,$helpID,$scope='') { function getHelp($module,$helpID,$scope='') {
$moduleObject = new $module((($scope != '') ? $scope : 'none')); $moduleObject = new $module((($scope != '') ? $scope : 'none'));
return $moduleObject->get_help($helpID,$scope); return $moduleObject->get_help($helpID);
} }
/** /**
@ -877,7 +877,7 @@ class accountContainer {
echo "<td"; echo "<td";
if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"'; if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"';
echo ">\n"; echo ">\n";
echo "<a href=../help.php?module=$module&item=". $input[$i][$j]['value'] . "&scope=" . $this->type . " target=\"help\" tabindex=$z>" . _('Help') . "</a></td>\n"; echo "<a href=../help.php?module=$module&HelpNumber=". $input[$i][$j]['value'] . "&scope=" . $this->type . " target=\"help\" tabindex=$z>" . _('Help') . "</a></td>\n";
$z++; $z++;
break; break;
case 'message': case 'message':

View File

@ -36,9 +36,18 @@ class account extends baseModule {
// module dependencies // module dependencies
$return['dependencies'] = array('depends' => array(), 'conflicts' => array('inetOrgPerson')); $return['dependencies'] = array('depends' => array(), 'conflicts' => array('inetOrgPerson'));
// available PDF fields // available PDF fields
$return['PDF_fields'] = array('description'); $return['PDF_fields'] = array(
'description'
);
// help Entries // help Entries
$return['help'] = array ( 'description' => array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used."))); $return['help'] = array (
'host' => array(
'description' => array (
"Headline" => _("Gecos"),
"Text" => _("Host description. If left empty host name will be used.")
)
)
);
return $return; return $return;
} }

View File

@ -193,33 +193,80 @@ class inetOrgPerson extends baseModule {
); );
// TODO unix workstations for upload // TODO unix workstations for upload
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'description', $return['PDF_fields'] = array(
'host', 'description',
'title', 'host',
'givenName', 'title',
'sn', 'givenName',
'employeeType', 'sn',
'street', 'employeeType',
'postalCode', 'street',
'postalAddress', 'postalCode',
'telephoneNumber', 'postalAddress',
'mobileTelephoneNumber', 'telephoneNumber',
'facimilieTelefonNumber', 'mobileTelephoneNumber',
'mail'); 'facimilieTelefonNumber',
'mail'
);
// help Entries // help Entries
$return['help'] = array ( $return['help'] = array (
'description' => array("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used.")), 'user' => array (
'title' => array("ext" => "FALSE", "Headline" => _("Title"), "Text" => _("Title of user, Mr., Ms., ...")), 'description' => array (
'givenName' => array("ext" => "FALSE", "Headline" => _("First name"), "Text" => _("First name of user. Only letters, - and spaces are allowed.")), "Headline" => _("Gecos"),
'sn' => array("ext" => "FALSE", "Headline" => _("Last name"), "Text" => _("Last name of user. Only letters, - and spaces are allowed.")), "Text" => _("User description. If left empty sur- and give name will be used.")
'employeeType' => array("ext" => "FALSE", "Headline" => _("Employee type"), "Text" => _("Employee type: worker, student, nurse, ...")), ),
'street' => array("ext" => "FALSE", "Headline" => _("Street"), "Text" => _("Street")), 'title' => array (
'postalCode' => array("ext" => "FALSE", "Headline" => _("Postal code"), "Text" => _("Postal code")), "Headline" => _("Title"),
'postalAddress' => array("ext" => "FALSE", "Headline" => _("Postal address"), "Text" => _("Postal address, city")), "Text" => _("Title of user, Mr., Ms., ...")
'telephoneNumber' => array("ext" => "FALSE", "Headline" => _("Telephone number"), "Text" => _("Telephone number")), ),
'mobileTelephoneNumber' => array("ext" => "FALSE", "Headline" => _("Mobile number"), "Text" => _("Mobile number")), 'givenName' => array (
'facsimileTelephoneNumber' => array("ext" => "FALSE", "Headline" => _("Fax number"), "Text" => _("Fax number")), "Headline" => _("Given name"),
'mail' => array("ext" => "FALSE", "Headline" => _("eMail address"), "Text" => _("eMail address"))); "Text" => _("Given name of user. Only letters, - and spaces are allowed.")
),
'sn' => array (
"Headline" => _("Surname"),
"Text" => _("Surname of user. Only letters, - and spaces are allowed.")
),
'employeeType' => array (
"Headline" => _("Employee type"),
"Text" => _("Employee type: worker, student, nurse, ...")
),
'street' => array (
"Headline" => _("Street"),
"Text" => _("Street")
),
'postalCode' => array (
"Headline" => _("Postal code"),
"Text" => _("Postal code")
),
'postalAddress' => array (
"Headline" => _("Postal address"),
"Text" => _("Postal address, city")
),
'telephoneNumber' => array (
"Headline" => _("Telephone number"),
"Text" => _("Telephone number")
),
'mobileTelephoneNumber' => array (
"Headline" => _("Mobile number"),
"Text" => _("Mobile number")
),
'facsimileTelephoneNumber' => array (
"Headline" => _("Fax number"),
"Text" => _("Fax number")
),
'mail' => array (
"Headline" => _("eMail address"),
"Text" => _("eMail address")
)
),
'host' => array(
'description' => array (
"Headline" => _("Gecos"),
"Text" => _("Host description. If left empty host name will be used.")
)
)
);
return $return; return $return;
} }

View File

@ -268,70 +268,73 @@ class posixAccount extends baseModule {
'additionalGroups', 'additionalGroups',
'homeDirectory', 'homeDirectory',
'userPassword', 'userPassword',
'loginShell'); 'loginShell'
);
// help Entries // help Entries
$return['help'] = array( $return['help'] = array(
"minMaxUser" => array( 'minMaxUser' => array(
"ext" => "FALSE", 'Headline' => _('UID number'),
"Headline" => _("UID number"), 'Text' => _('These are the minimum and maximum numbers to use for user IDs when creating new user accounts. The range should be different from that of machines. New user accounts will always get the highest number in use plus one.')
"Text" => _("These are the minimum and maximum numbers to use for user IDs when creating new user accounts. The range should be different from that of machines. New user accounts will always get the highest number in use plus one.")), ),
"minMaxHost" => array( 'minMaxHost' => array(
"ext" => "FALSE", 'Headline' => _('UID number'),
"Headline" => _("UID number"), 'Text' => _('These are the minimum and maximum numbers to use for machine IDs when creating new accounts for Samba hosts. The range should be different from that of users. New host accounts will always get the highest number in use plus one.')
"Text" => _("These are the minimum and maximum numbers to use for machine IDs when creating new accounts for Samba hosts. The range should be different from that of users. New host accounts will always get the highest number in use plus one.")), ),
'pwdHash' => array( 'pwdHash' => array(
"ext" => "FALSE", "Headline" => _("Password hash type"),
"Headline" => _("Password hash type"), "Text" => _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of passwords. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.")
"Text" => _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of passwords. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.")), ),
'uidNumber' => array( 'uidNumber' => array(
"ext" => "FALSE", "Headline" => _("UID number"),
"Headline" => _("UID number"), "Text" => _("If empty UID number will be generated automaticly.")
"Text" => _("If empty UID number will be generated automaticly.")), ),
'user' => array( 'user' => array(
'uid' => array( 'uid' => array(
"ext" => "FALSE", "Headline" => _("Username"),
"Headline" => _("Username"), "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")
"Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")), ),
'gecos' => array( 'gecos' => array(
"ext" => "FALSE", "Headline" => _("Gecos"),
"Headline" => _("Gecos"), "Text" => _("User description. If left empty sur- and give name will be used.")
"Text" => _("User description. If left empty sur- and give name will be used.")), ),
'gidNumber' => array( 'gidNumber' => array(
"ext" => "FALSE", "Headline" => _("Primary group"),
"Headline" => _("Primary group"), "Text" => _("The Primary Group the user should be member of.")
"Text" => _("The Primary Group the user should be member of.")), ),
'homeDirectory' => array( 'homeDirectory' => array(
"ext" => "FALSE", "Headline" => _("Home directory"),
"Headline" => _("Home directory"), "Text" => _("$user and $group are replaced with username or primary groupname.")
"Text" => _("$user and $group are replaced with username or primary groupname.")), ),
/*'userPassword' =>*/ /*'userPassword' =>*/
'userPassword_no' => array( 'userPassword_no' => array(
"ext" => "FALSE", "Headline" => _("Use no password"),
"Headline" => _("Use no password"), "Text" => _("If checked no password will be used.")
"Text" => _("If checked no password will be used.")), ),
/*'userPassword_lock' =>*/ /*'userPassword_lock' =>*/
'loginShell' => array( 'loginShell' => array(
"ext" => "FALSE", "Headline" => _("Login shell"),
"Headline" => _("Login shell"), "Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells")
"Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells")), ),
'addgroup' => array( 'addgroup' => array(
"ext" => "FALSE", "Headline" => _("Additional groups"),
"Headline" => _("Additional groups"), "Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")
"Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty."))), )
'host' => array( ),
'uid' => array( 'host' => array(
"ext" => "FALSE", 'uid' => array(
"Headline" => _("Host name"), "Headline" => _("Host name"),
"Text" => _("Host name of the host which should be created. Valid characters are: a-z,0-9, .-_$. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. Hostnames are always ending with $. If last character is not $ it will be added. If hostname is already used hostname will be expanded with a number. The next free number will be used.")), "Text" => _("Host name of the host which should be created. Valid characters are: a-z,0-9, .-_$. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. Hostnames are always ending with $. If last character is not $ it will be added. If hostname is already used hostname will be expanded with a number. The next free number will be used.")
'gecos' => array( ),
"ext" => "FALSE", 'gecos' => array(
"Headline" => _("Gecos"), "Headline" => _("Gecos"),
"Text" => _("Host description. If left empty host name will be used.")), "Text" => _("Host description. If left empty host name will be used.")
'gidNumber' => array( ),
"ext" => "FALSE", 'gidNumber' => array(
"Headline" => _("Primary group"), "Headline" => _("Primary group"),
"Text" => _("The Primary group the host should be member of.")) "Text" => _("The Primary group the host should be member of.")
)); )
)
);
return $return; return $return;
} }
@ -1012,9 +1015,7 @@ class posixAccount extends baseModule {
} }
} }
return $return; return $return;
} n /**
/**
* In this function the LDAP account is built up. * In this function the LDAP account is built up.
* *
* @param array $rawAccounts list of hash arrays (name => value) from user input * @param array $rawAccounts list of hash arrays (name => value) from user input

View File

@ -276,10 +276,12 @@ class posixGroup extends baseModule {
'cmp_name2' => 'posixGroup_minGID', 'cmp_name2' => 'posixGroup_minGID',
'error_message' => $this->messages['gidNumber'][7]); 'error_message' => $this->messages['gidNumber'][7]);
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'cn', $return['PDF_fields'] = array(
'gidNumber', 'cn',
'memberUid', 'gidNumber',
'description'); 'memberUid',
'description'
);
// upload fields // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(
array( array(
@ -317,43 +319,43 @@ class posixGroup extends baseModule {
); );
// help Entries // help Entries
$return['help'] = array( $return['help'] = array(
'cn' => array( 'cn' => array(
"ext" => "FALSE", "Headline" => _("Groupname"),
"Headline" => _("Groupname"), "Text" => _("Group name of the group which should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because groupadd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If groupname is already used groupname will be expanded with a number. The next free number will be used.")
"Text" => _("Group name of the group which should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because groupadd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If groupname is already used groupname will be expanded with a number. The next free number will be used.")), ),
'gidNumber' => array( 'gidNumber' => array(
"ext" => "FALSE", "Headline" => _("GID number"),
"Headline" => _("GID number"), "Text" => _("If empty GID number will be generated automaticly depending on your configuration settings.")
"Text" => _("If empty GID number will be generated automaticly depending on your configuration settings.")), ),
'description' => array( 'description' => array(
"ext" => "FALSE", "Headline" => _("Description"),
"Headline" => _("Description"), "Text" => _("Group description. If left empty group name will be used.")
"Text" => _("Group description. If left empty group name will be used.")), ),
'members' => array( 'members' => array(
"ext" => "FALSE", "Headline" => _("Group members"),
"Headline" => _("Group members"), "Text" => _("Users also being member of the current group."). ' '. _("Can be left empty.")
"Text" => _("Users also being member of the current group."). ' '. _("Can be left empty.")), ),
'upload_members' => array( 'upload_members' => array(
"ext" => "FALSE", "Headline" => _("Group members"),
"Headline" => _("Group members"), "Text" => _("Users also being member of the current group. Users are separated by semicolons.")
"Text" => _("Users also being member of the current group. Users are separated by semicolons.")), ),
'password' => array( 'password' => array(
"ext" => "FALSE", "Headline" => _("Group password"),
"Headline" => _("Group password"), "Text" => _("Sets the group password.")
"Text" => _("Sets the group password.")), ),
'userPassword_no' => array( 'userPassword_no' => array(
"ext" => "FALSE", "Headline" => _("Use no password"),
"Headline" => _("Use no password"), "Text" => _("If checked no password will be used.")
"Text" => _("If checked no password will be used.")), ),
/*'userPassword_lock' => */ /*'userPassword_lock' => */
'minMaxGID' => array( 'minMaxGID' => array(
"ext" => "FALSE", "Headline" => _("GID number"),
"Headline" => _("GID number"), "Text" => _("These are the minimum and maximum numbers to use for group IDs when creating new group accounts. New group accounts will always get the highest number in use plus one.")
"Text" => _("These are the minimum and maximum numbers to use for group IDs when creating new group accounts. New group accounts will always get the highest number in use plus one.")), ),
'pwdHash' => array( 'pwdHash' => array(
"ext" => "FALSE", "Headline" => _("Password hash type"),
"Headline" => _("Password hash type"), "Text" => _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of passwords. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.")
"Text" => _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of passwords. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.")) )
); );
return $return; return $return;

View File

@ -55,51 +55,47 @@ class quota extends baseModule {
$return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array()); $return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array());
} }
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'quotas'); $return['PDF_fields'] = array(
'quotas'
);
// help entries // help entries
$return['help'] = array( $return['help'] = array(
"Mountpoint" => array( "Mountpoint" => array(
"ext" => "FALSE", "Headline" => _("Mountpoint"),
"Headline" => _("Mountpoint"), "Text" => _("Mountpoint of device with enabled quotas.")
"Text" => _("Mountpoint of device with enabled quotas.")), ),
"UsedBlocks" => array( "UsedBlocks" => array(
"ext" => "FALSE", "Headline" => _("Used blocks"),
"Headline" => _("Used blocks"), "Text" => _("Used blocks. 1000 blocks are usually 1MB")
"Text" => _("Used blocks. 1000 blocks are usually 1MB")), ),
"SoftBlockLimit" => array( "SoftBlockLimit" => array(
"ext" => "FALSE", "Headline" => _("Soft block limit"),
"Headline" => _("Soft block limit"), "Text" => _("Soft block limit."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.4">'.'Quota How-To</a>'
"Text" => _("Soft block limit."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.4">'. ),
'Quota How-To</a>'), "HardBlockLimit" => array(
"HardBlockLimit" => array( "Headline" => _("Hard block limit"),
"ext" => "FALSE", "Text" => _("Hard block limit").'.', "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.5">'.'Quota How-To</a>'
"Headline" => _("Hard block limit"), ),
"Text" => _("Hard block limit").'.', "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.5">'. "GraceBlockPeriod" => array(
'Quota How-To</a>'), "Headline" => _("Grace block period"),
"GraceBlockPeriod" => array( "Text" => _("Grace block period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.6">'.'Quota How-To</a>'
"ext" => "FALSE", ),
"Headline" => _("Grace block period"), "UsedInodes" => array(
"Text" => _("Grace block period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.6">'. "Headline" => _("Used inodes"),
'Quota How-To</a>'), "Text" => _("Used inodes (files)").'.'
"UsedInodes" => array( ),
"ext" => "FALSE", "SoftInodeLimit" => array(
"Headline" => _("Used inodes"), "Headline" => _("Soft inode limit"),
"Text" => _("Used inodes (files)").'.'), "Text" => _("Soft inode (files) limit."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.4">'.'Quota How-To</a>'
"SoftInodeLimit" => array( ),
"ext" => "FALSE", "HardInodeLimit" => array(
"Headline" => _("Soft inode limit"), "Headline" => _("Hard inode limit"),
"Text" => _("Soft inode (files) limit."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.4">'. "Text" => _("Hard inode (files) limit").'.', "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.5">'.'Quota How-To</a>'
'Quota How-To</a>'), ),
"HardInodeLimit" => array( "GraceInodePeriod" => array(
"ext" => "FALSE", "Headline" => _("Grace inode period"),
"Headline" => _("Hard inode limit"), "Text" => _("Grace inode (files) period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.6">'.'Quota How-To</a>'
"Text" => _("Hard inode (files) limit").'.', "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.5">'. )
'Quota How-To</a>'),
"GraceInodePeriod" => array(
"ext" => "FALSE",
"Headline" => _("Grace inode period"),
"Text" => _("Grace inode (files) period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.6">'.
'Quota How-To</a>'),
); );
return $return; return $return;
} }

View File

@ -147,15 +147,17 @@ class sambaAccount extends baseModule {
$return['profile_checks']['sambaAccount_domain'] = array('type' => 'ext_preg', 'regex' => 'domainname', $return['profile_checks']['sambaAccount_domain'] = array('type' => 'ext_preg', 'regex' => 'domainname',
'error_message' => $this->messages['domain'][0]); 'error_message' => $this->messages['domain'][0]);
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'displayName', $return['PDF_fields'] = array(
'uid', 'displayName',
'smbHome', 'uid',
'homeDrive', 'smbHome',
'scriptPath', 'homeDrive',
'profilePath', 'scriptPath',
'userWorkstations', 'profilePath',
'domain', 'userWorkstations',
'description'); 'domain',
'description'
);
return $return; return $return;
} }

View File

@ -219,11 +219,13 @@ class sambaGroupMapping extends baseModule {
// module dependencies // module dependencies
$return['dependencies'] = array('depends' => array('posixGroup'), 'conflicts' => array()); $return['dependencies'] = array('depends' => array('posixGroup'), 'conflicts' => array());
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'gidNumber', $return['PDF_fields'] = array(
'sambaSID', 'gidNumber',
'displayName', 'sambaSID',
'sambaGroupType', 'displayName',
'description'); 'sambaGroupType',
'description'
);
// upload fields // upload fields
// search existing Samba 3 domains // search existing Samba 3 domains
if ($_SESSION['loggedIn']) $domains = search_domains($_SESSION['config']->get_domainSuffix()); if ($_SESSION['loggedIn']) $domains = search_domains($_SESSION['config']->get_domainSuffix());
@ -262,25 +264,26 @@ class sambaGroupMapping extends baseModule {
// help Entries // help Entries
$return['help'] = array( $return['help'] = array(
'displayName' => array( 'displayName' => array(
"ext" => "FALSE",
"Headline" => _("Display name"), "Headline" => _("Display name"),
"Text" => _("This is the group name which will be shown in Windows.")), "Text" => _("This is the group name which will be shown in Windows.")
),
'sambaSID' => array( 'sambaSID' => array(
"ext" => "FALSE",
"Headline" => _("Windows groupname"), "Headline" => _("Windows groupname"),
"Text" => _("If you want to use a well known RID you can selcet a well known group.")), "Text" => _("If you want to use a well known RID you can selcet a well known group.")
),
'rid' => array( 'rid' => array(
"ext" => "FALSE",
"Headline" => _("Samba RID number"), "Headline" => _("Samba RID number"),
"Text" => _("This is the relative ID (similar to UID on Unix) for Windows accounts. If you leave this empty LAM will calculate the RID from the UID. This can be either a number or the name of a special group:") . ' ' . implode(", ", array_keys($this->rids))), "Text" => _("This is the relative ID (similar to UID on Unix) for Windows accounts. If you leave this empty LAM will calculate the RID from the UID. This can be either a number or the name of a special group:") . ' ' . implode(", ", array_keys($this->rids))
),
'sambaDomainName' => array( 'sambaDomainName' => array(
"ext" => "FALSE",
"Headline" => _("Domain"), "Headline" => _("Domain"),
"Text" => _("Windows-Domain name of group."). ' '. _("Can be left empty.")), "Text" => _("Windows-Domain name of group."). ' '. _("Can be left empty.")
),
'type' => array( 'type' => array(
"ext" => "FALSE",
"Headline" => _("Samba group type"), "Headline" => _("Samba group type"),
"Text" => _("Windows group type."))); "Text" => _("Windows group type.")
)
);
return $return; return $return;
} }

View File

@ -86,16 +86,18 @@ class sambaSamAccount extends baseModule {
'regex' => 'unixhost', 'regex' => 'unixhost',
'error_message' => $this->messages['workstations'][0]); 'error_message' => $this->messages['workstations'][0]);
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'displayName', $return['PDF_fields'] = array(
'uid', 'displayName',
'sambaHomePath', 'uid',
'sambaHomeDrive', 'sambaHomePath',
'sambaLogonScript', 'sambaHomeDrive',
'sambaProfilePath', 'sambaLogonScript',
'sambaUserWorkstations', 'sambaProfilePath',
'sambaDomainName', 'sambaUserWorkstations',
'description', 'sambaDomainName',
'sambaPrimaryGroupSID'); 'description',
'sambaPrimaryGroupSID'
);
return $return; return $return;
} }

View File

@ -120,18 +120,37 @@ class shadowAccount extends baseModule {
'regex' => 'digit', 'regex' => 'digit',
'error_message' => $this->messages['shadowWarning'][0]); 'error_message' => $this->messages['shadowWarning'][0]);
// available PDF fields // available PDF fields
$return['PDF_fields'] = array( 'shadowLastChange', $return['PDF_fields'] = array(
'shadowWarning', 'shadowLastChange',
'shadowInactive', 'shadowWarning',
'shadowExpire', 'shadowInactive',
'shadowFlag', 'shadowExpire',
'description'); 'shadowFlag',
'description'
);
// help Entries // help Entries
$return['help'] = array ( 'shadowWarning' => array ("ext" => "FALSE", "Headline" => _("Password warn"), "Text" => _("Days before password is to expire that user is warned of pending password expiration. If set value must be 0<."). ' '. _("Can be left empty.")), $return['help'] = array (
'shadowInactive' => array ("ext" => "FALSE", "Headline" => _("Password expire"), "Text" => _("Number of days a user can login even his password has expired. -1=always."). ' '. _("Can be left empty.")), 'shadowWarning' => array (
'shadowMin' => array ("ext" => "FALSE", "Headline" => _("Minimum password age"), "Text" => _("Number of days a user has to wait until he\'s allowed to change his password again. If set value must be 0<."). ' '. _("Can be left empty.")), "Headline" => _("Password warn"),
'shadowMax' => array ("ext" => "FALSE", "Headline" => _("Maximum password age"), "Text" => _("Number of days after a user has to change his password again. If set value must be 0<."). ' '. _("Can be left empty.")), "Text" => _("Days before password is to expire that user is warned of pending password expiration. If set value must be 0<."). ' '. _("Can be left empty.")
'shadowExpire' => array ("ext" => "FALSE", "Headline" => _("Expire date"), "Text" => _("Account expire date. Format: DD-MM-YYYY"))); ),
'shadowInactive' => array (
"Headline" => _("Password expire"),
"Text" => _("Number of days a user can login even his password has expired. -1=always."). ' '. _("Can be left empty.")
),
'shadowMin' => array (
"Headline" => _("Minimum password age"),
"Text" => _("Number of days a user has to wait until he\'s allowed to change his password again. If set value must be 0<."). ' '. _("Can be left empty.")
),
'shadowMax' => array (
"Headline" => _("Maximum password age"),
"Text" => _("Number of days after a user has to change his password again. If set value must be 0<."). ' '. _("Can be left empty.")
),
'shadowExpire' => array (
"Headline" => _("Expire date"),
"Text" => _("Account expire date. Format: DD-MM-YYYY")
)
);
return $return; return $return;
} }

View File

@ -18,19 +18,54 @@ $Id$
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LDAP Account Manager lamPDF class and some pdf functions
*/ */
/**
* LDAP Account Manager PDF printing library. It consists of lamPDF class,
* the createModulePDF() and getAvailablePDFStructure() functions that may
* be called by other pages and furthermore some helper functions.
*
* @author Michael Dürgner
* @version 0.5
* @package PDF
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
/**
*
*/
define('FPDF_FONTPATH','font/'); define('FPDF_FONTPATH','font/');
/**
*
*/
define('LAMPDF_LINEWIDTH',190); define('LAMPDF_LINEWIDTH',190);
/**
*
*/
include_once("fpdf.php"); include_once("fpdf.php");
/**
*
*/
include_once('xml_parser.inc'); include_once('xml_parser.inc');
$key = false; $key = false;
$line_width = LAMPDF_LINEWIDTH; $line_width = LAMPDF_LINEWIDTH;
/**
* This function will return all available PDF structure definitions for the submitted
* account scope.
*
* @param string The account scope the PDF structure definitions should be
* returned.
*
* @return array All available PDF structure definitions for the submitted account
* scope. Each entry is a string being the filename that may be passed to the
* createModulePDF() function as second argument.
*/
function getAvailablePDFStructures($scope='user') { function getAvailablePDFStructures($scope='user') {
$return = array(); $return = array();
$dirHandle = opendir($_SESSION['lampath'] . '/config/pdf/' . $scope . '/'); $dirHandle = opendir($_SESSION['lampath'] . '/config/pdf/' . $scope . '/');
@ -43,6 +78,18 @@ function getAvailablePDFStructures($scope='user') {
return $return; return $return;
} }
/**
* This function creates the PDF output of one or more accounts. At the moment
* this function can create a PDF page for user, group and host accounts. But
* this is not limited by the function itself but by the account types that are
* allowed in LAM and the exsisting PDF structure definitions.
*
* @param array A numbered array containing all accounts the PDF page should
* be created for. The entries of the array must be AccountContainer objects.
* @param string The filename of the structure definition that should be used
* to create the PDF page. If not submitted the 'default.xml' structure definition
* for the appropriate account type.
*/
function createModulePDF($accounts,$pdf_structure="default.xml") { function createModulePDF($accounts,$pdf_structure="default.xml") {
global $key; global $key;
@ -173,6 +220,14 @@ function createModulePDF($accounts,$pdf_structure="default.xml") {
return $filename; return $filename;
} }
/**
*
*
* @param string
* @param string
*
* @return array
*/
function getStructure($scope,$pdf_structure) { function getStructure($scope,$pdf_structure) {
$parser = new xmlParser(); $parser = new xmlParser();
$xml = $parser->parse($_SESSION['lampath'] . '/config/pdf/' . $scope . '/' . $pdf_structure); $xml = $parser->parse($_SESSION['lampath'] . '/config/pdf/' . $scope . '/' . $pdf_structure);
@ -193,6 +248,13 @@ function getStructure($scope,$pdf_structure) {
return array('structure' => $structure, 'page_definitions' => $complete_page_definitions); return array('structure' => $structure, 'page_definitions' => $complete_page_definitions);
} }
/**
*
*
* @param string
*
* @return string
*/
function getSectionHeadline($line) { function getSectionHeadline($line) {
$headline_pattern = '/<block>.*<value>(.*)<\/value><\/block>/'; $headline_pattern = '/<block>.*<value>(.*)<\/value><\/block>/';
if(preg_match($headline_pattern,$line,$matches)) { if(preg_match($headline_pattern,$line,$matches)) {
@ -204,6 +266,14 @@ function getSectionHeadline($line) {
} }
} }
/**
*
*
* @param string
* @param boolean
*
* @return array
*/
function processLine($line,$first_td = true) { function processLine($line,$first_td = true) {
global $key, $line_width; global $key, $line_width;
@ -266,6 +336,14 @@ function processLine($line,$first_td = true) {
} }
} }
/**
*
*
* @param string
* @param string
*
* @return array
*/
function processFormatTags($line,$style) { function processFormatTags($line,$style) {
// PCRE matching a <i> tag // PCRE matching a <i> tag
$i_pattern = '/(.*)<i>(.+)<\/i>(.*)/'; $i_pattern = '/(.*)<i>(.+)<\/i>(.*)/';
@ -291,6 +369,14 @@ function processFormatTags($line,$style) {
return array($style,$line); return array($style,$line);
} }
/**
*
*
* @param string
* @param array
*
* @return array
*/
function processAttributes($attrs,$return = array()) { function processAttributes($attrs,$return = array()) {
global $line_width; global $line_width;
@ -327,11 +413,26 @@ function processAttributes($attrs,$return = array()) {
} }
// lamPDF class || For defining own a Header and Footer /**
*
*
* @author Michael Dürgner
* @version 0.5
* @package PDF
*/
class lamPDF extends FPDF { class lamPDF extends FPDF {
/**
*
*/
var $page_definitions; var $page_definitions;
/**
*
*
* @param string
* @param array
*/
function lamPDF($account_type = "User",$page_definitions = array()) { function lamPDF($account_type = "User",$page_definitions = array()) {
// Call constructor of superclass // Call constructor of superclass
$this->FPDF('P','mm','A4'); $this->FPDF('P','mm','A4');
@ -362,12 +463,13 @@ class lamPDF extends FPDF {
$this->setSubject($subject); $this->setSubject($subject);
$this->setAuthor("LDAP Account Manager Devel-Team -Michael Duergner-"); $this->setAuthor("LDAP Account Manager Devel-Team -Michael Duergner-");
$this->setCreator("LDAP Account Manager (pdf.inc)"); $this->setCreator("LDAP Account Manager (pdf.inc)");
//$this->setMargins(10.0,10.0,10.0);
$this->setMargins($this->page_definitions['margin-left'],$this->page_definitions['margin-top'],$this->page_definitions['margin-right']); $this->setMargins($this->page_definitions['margin-left'],$this->page_definitions['margin-top'],$this->page_definitions['margin-right']);
$this->setAutoPageBreak(true,$this->page_definitions['margin-bottom']); $this->setAutoPageBreak(true,$this->page_definitions['margin-bottom']);
} }
// Print page header /**
*
*/
function header() { function header() {
if($this->page_definitions['filename'] != 'none') { if($this->page_definitions['filename'] != 'none') {
$imageFile = substr(__FILE__,0,strlen(__FILE__)- 11) . "config/pdf/logos/" . $this->page_definitions['filename']; $imageFile = substr(__FILE__,0,strlen(__FILE__)- 11) . "config/pdf/logos/" . $this->page_definitions['filename'];
@ -398,7 +500,9 @@ class lamPDF extends FPDF {
$this->SetY(50); $this->SetY(50);
} }
// Print page footer /**
*
*/
function footer() { function footer() {
$this->SetLineWidth(0.8); $this->SetLineWidth(0.8);
$this->Line(10,280,200,280); $this->Line(10,280,200,280);

View File

@ -18,12 +18,35 @@ $Id$
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/**
*
*
* @author Michael Dürgner
* @version 0.5
* @package PDF
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
/**
*
*/
include_once("config.inc"); include_once("config.inc");
/**
*
*/
include_once("ldap.inc"); include_once("ldap.inc");
/**
*
*
* @param string
*
* @return array
*/
function getPDFStructureDefinitions($scope = "user") { function getPDFStructureDefinitions($scope = "user") {
$return = array(); $return = array();
$path = $_SESSION['lampath'] . 'config/pdf/' . $scope; $path = $_SESSION['lampath'] . 'config/pdf/' . $scope;
@ -39,6 +62,14 @@ function getPDFStructureDefinitions($scope = "user") {
return $return; return $return;
} }
/**
*
*
* @param string
* @param string
*
* @return array
*/
function loadPDFStructureDefinitions($scope='user', $definition='default.xml') { function loadPDFStructureDefinitions($scope='user', $definition='default.xml') {
$parser = new xmlParser(); $parser = new xmlParser();
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition; $file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
@ -61,6 +92,12 @@ function loadPDFStructureDefinitions($scope='user', $definition='default.xml') {
return array('structure' => $structure, 'page_definitions' => $page_definitions); return array('structure' => $structure, 'page_definitions' => $page_definitions);
} }
/**
*
*
* @param string
* @param string
*/
function savePDFStructureDefinitions($scope,$definition) { function savePDFStructureDefinitions($scope,$definition) {
$handle = fopen($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition,'w'); $handle = fopen($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition,'w');
$pdf_attributes = ''; $pdf_attributes = '';
@ -101,11 +138,24 @@ function savePDFStructureDefinitions($scope,$definition) {
fclose($handle); fclose($handle);
} }
/**
*
*
* @param string
* @param string
*
* @return boolean
*/
function deletePDFStructureDefinition($scope,$definition) { function deletePDFStructureDefinition($scope,$definition) {
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition; $file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
return unlink($file); return unlink($file);
} }
/**
*
*
* @return array
*/
function getAvailableLogos() { function getAvailableLogos() {
$return = array(); $return = array();
$dirPath = $_SESSION['lampath'] . '/config/pdf/logos/'; $dirPath = $_SESSION['lampath'] . '/config/pdf/logos/';

View File

@ -18,11 +18,31 @@ $Id$
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LDAP Account Manager status messages.
*/ */
/**
* LDAP Account Manager status messages.
*
* @author Michael Dürgner
* @version 0.5
* @package lib
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
/**
* This function prints a short status message. It can be used to print INFO,
* WARN and ERROR messages at the moment.
*
* @param string The type of the message to be printed. It must be one of
* the following types: 'INFO', 'WARN' or 'ERROR'. Every other type will lead
* to an error message indicating an invalid message type.
* @param string The headline of the status message.
* @param string The text of the status message. It may be formatted with
* the syntax specified by the other functions in this file.
* @param array The variables that are used to replace the spacers in the
* submitted text. This parameter is optional.
*/
function StatusMessage($MessageTyp,$MessageHeadline,$MessageText,$MessageVariables = array()) { function StatusMessage($MessageTyp,$MessageHeadline,$MessageText,$MessageVariables = array()) {
/* Setting CSS-StyleSheet class depending on the $MessageTyp and rewriting $MessageTyp with a readable string. */ /* Setting CSS-StyleSheet class depending on the $MessageTyp and rewriting $MessageTyp with a readable string. */
if($MessageTyp == "INFO") { if($MessageTyp == "INFO") {
@ -64,26 +84,59 @@ function StatusMessage($MessageTyp,$MessageHeadline,$MessageText,$MessageVariabl
} }
} }
/* Use the three replace functions on the submitted Text. */ /**
* Use the three replace functions on the submitted Text.
*
* @access private
*
* @param string The text that is used to search for replaceable strings.
*
* @return string The processed text.
*/
function parseMessageString($MessageString) { function parseMessageString($MessageString) {
return linkText(colorText(boldText($MessageString))); return linkText(colorText(boldText($MessageString)));
} }
/* Replace {bold} and {endbold} with <b> and </b> HTML-Tags. */ /**
* Replace {bold} and {endbold} with <b> and </b> HTML-Tags.
*
* @access private
*
* @param string The text that is used to search for {bold} and {endbold} tags.
*
* @return string The submitted text with {bold} and {endbold} replaced with
* the appropriate HTML tages <b> and </b>
*/
function boldText($text) { function boldText($text) {
$pattern = "/\{bold\}([^{]*)\{endbold\}/"; // Regular expression matching {bold}[Text]{endbold} $pattern = "/\{bold\}([^{]*)\{endbold\}/"; // Regular expression matching {bold}[Text]{endbold}
$replace = "<b class=\"status\">\\1</b>"; // Replace pattern $replace = "<b class=\"status\">\\1</b>"; // Replace pattern
return preg_replace($pattern,$replace,$text); return preg_replace($pattern,$replace,$text);
} }
/* Replace {color=#[HEX-Value]} or {color=[HEX-Value]} and {endcolor} with <font color="#[HEX-Value]"> and </font> HTML-Tags. */ /**
* Replace {color=#[HEX-Value]} or {color=[HEX-Value]} and {endcolor} with <font color="#[HEX-Value]"> and </font> HTML-Tags.
*
* @access private
*
* @param string
*
* @return string
*/
function colorText($text) { function colorText($text) {
$pattern = "/\{color=#?([0-9,a-f,A-F]{6})\}([^{]*)\{endcolor\}/"; // Regular expression matching {color=#[HEX-Value]}[Text]{endcolor} or {color=[HEX-Value]}[Text]{endcolor} $pattern = "/\{color=#?([0-9,a-f,A-F]{6})\}([^{]*)\{endcolor\}/"; // Regular expression matching {color=#[HEX-Value]}[Text]{endcolor} or {color=[HEX-Value]}[Text]{endcolor}
$replace = "<font color=\"#\\1\">\\2</font>"; // Replace pattern $replace = "<font color=\"#\\1\">\\2</font>"; // Replace pattern
return preg_replace($pattern,$replace,$text); return preg_replace($pattern,$replace,$text);
} }
/* Replace {link=[Link-Target]} and {endlink} with <a href="[Link-Target]" target="_blank"> and </a> HTML-Tags. */ /**
* Replace {link=[Link-Target]} and {endlink} with <a href="[Link-Target]" target="_blank"> and </a> HTML-Tags.
*
* @access private
*
* @param string
*
* @return string
*/
function linkText($text) { function linkText($text) {
$pattern = "/\{link=([^}]*)\}([^{]*)\{endlink\}/"; // Regular expression matching {link=[Link-Target]}[Text]{endlink} $pattern = "/\{link=([^}]*)\}([^{]*)\{endlink\}/"; // Regular expression matching {link=[Link-Target]}[Text]{endlink}
$replace = "<a href=\"\\1\" target=\"_blank\">\\2</a>"; //Replace pattern $replace = "<a href=\"\\1\" target=\"_blank\">\\2</a>"; //Replace pattern

View File

@ -18,15 +18,35 @@ $Id$
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LDAP Account Manager xmlPasrser class
*/ */
/**
* LDAP Account Manager xmlParser class
*
* @author Michael Dürgner
* @version 0.5
* @package PDF
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
/**
*
*
* @author Michael Dürgner
* @version 0.5
* @package PDF
*/
class xmlParser { class xmlParser {
/**
*
*/
var $xmlParser; var $xmlParser;
/**
*
*/
function xmlParser() { function xmlParser() {
$this->xmlParser = xml_parser_create(); $this->xmlParser = xml_parser_create();
xml_set_object($this->xmlParser,&$this); xml_set_object($this->xmlParser,&$this);
@ -34,6 +54,13 @@ class xmlParser {
xml_parser_set_option($this->xmlParser, XML_OPTION_SKIP_WHITE, 1); xml_parser_set_option($this->xmlParser, XML_OPTION_SKIP_WHITE, 1);
} }
/**
*
*
* @param string
*
* @return array
*/
function parse($filename) { function parse($filename) {
if(file_exists($filename)) { if(file_exists($filename)) {
xml_parse_into_struct($this->xmlParser,implode("\n",file($filename)),$xmlStructure,$xmlIndex); xml_parse_into_struct($this->xmlParser,implode("\n",file($filename)),$xmlStructure,$xmlIndex);

View File

@ -22,19 +22,46 @@ $Id$
LDAP Account Manager display help pages. LDAP Account Manager display help pages.
*/ */
/**
* LDAP Account Manager help page.
*
* @author Michael Dürgner
* @version 0.5
* @package Help
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
/**
*
*/
include_once("../lib/ldap.inc"); include_once("../lib/ldap.inc");
/**
*
*/
include_once("../lib/config.inc"); include_once("../lib/config.inc");
session_save_path("../sess"); // Set session save path session_save_path("../sess"); // Set session save path
@session_start(); // Start LDAP Account Manager session @session_start(); // Start LDAP Account Manager session
/**
*
*/
include_once("../lib/status.inc"); // Include lib/status.php which provides statusMessage() include_once("../lib/status.inc"); // Include lib/status.php which provides statusMessage()
/**
*
*/
include_once("../help/help.inc"); // Include help/help.inc which provides $helpArray where the help pages are stored include_once("../help/help.inc"); // Include help/help.inc which provides $helpArray where the help pages are stored
setlanguage(); setlanguage();
/* Print HTML head */ /**
* Print HTML header of the help page.
*/
function echoHTMLHead() function echoHTMLHead()
{ {
echo $_SESSION['header']; echo $_SESSION['header'];
@ -46,7 +73,9 @@ echo $_SESSION['header'];
<?php <?php
} }
/* Print HTML foot */ /**
* Print HTML footer of the help page.
*/
function echoHTMLFoot() function echoHTMLFoot()
{ {
?> ?>
@ -55,7 +84,12 @@ function echoHTMLFoot()
<?php <?php
} }
/* Print help site */ /**
* Print help site for a specific help number.
*
* @param array The help entry that is to be displayed.
* @param array The help variables that are used to replace the spacer in the help text.
*/
function displayHelp($helpEntry,$helpVariables) { function displayHelp($helpEntry,$helpVariables) {
/* Load external help page */ /* Load external help page */
if($helpEntry["ext"] == "TRUE") if($helpEntry["ext"] == "TRUE")
@ -84,7 +118,7 @@ function displayHelp($helpEntry,$helpVariables) {
} }
/* If no help number was submitted print error message */ /* If no help number was submitted print error message */
if(!isset($_GET['item'])) if(!isset($_GET['HelpNumber']))
{ {
$errorMessage = _("Sorry no help number submitted."); $errorMessage = _("Sorry no help number submitted.");
echoHTMLHead(); echoHTMLHead();
@ -97,11 +131,15 @@ $helpEntry = array();
if(isset($_GET['module'])) { if(isset($_GET['module'])) {
include_once("../lib/modules.inc"); include_once("../lib/modules.inc");
$helpEntry = getHelp($_GET['module'],$_GET['item'],$_GET['scope']); if(isset($_GET['scope'])) {
//$helpEntry = $_SESSION['account']->getHelp($_GET['module'],$_GET['item']); $helpEntry = getHelp($_GET['module'],$_GET['HelpNumber'],$_GET['scope']);
}
else {
$helpEntry = getHelp($_GET['module'],$_GET['HelpNumber']);
}
if(!$helpEntry) { if(!$helpEntry) {
$variables = array(); $variables = array();
array_push($variables,$_GET['item']); array_push($variables,$_GET['HelpNumber']);
array_push($variables,$_GET['module']); array_push($variables,$_GET['module']);
$errorMessage = _("Sorry this help id ({bold}%s{endbold}) is not available for this module ({bold}%s{endbold})."); $errorMessage = _("Sorry this help id ({bold}%s{endbold}) is not available for this module ({bold}%s{endbold}).");
echoHTMLHead(); echoHTMLHead();