*** 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 entries.
*
* @author Michael Dürgner
* @version 0.5
* @package Help
* @copyright Copyright (C) 2003-2004 Michael Dürgner
* @license GPL
*/
setlanguage();
$helpArray = array (

View File

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

View File

@ -1,241 +1,298 @@
<?php
/*******************************************************************************
* Software: FPDF *
* Version: 1.52 *
* Date: 2003-12-30 *
* Author: Olivier PLATHEY *
* License: Freeware *
* *
* You may use, modify and redistribute this software as you wish. *
*******************************************************************************/
/**
* You may use, modify and redistribute this software as you wish.
* Software: FPDF
*
* @author Olivier Plathey
* @version 1.52
* @package PDF
* @copyright Copyright (C) 2003-2004
* @license Freeware
*/
if(!class_exists('FPDF'))
{
define('FPDF_VERSION','1.52');
/**
*
*/
define('FPDF_VERSION','1.52');
class FPDF
{
//Private properties
var $page; //current page number
var $n; //current object number
var $offsets; //array of object offsets
var $buffer; //buffer holding in-memory PDF
var $pages; //array containing pages
var $state; //current document state
var $compress; //compression flag
var $DefOrientation; //default orientation
var $CurOrientation; //current orientation
var $OrientationChanges; //array indicating orientation changes
var $k; //scale factor (number of points in user unit)
var $fwPt,$fhPt; //dimensions of page format in points
var $fw,$fh; //dimensions of page format in user unit
var $wPt,$hPt; //current dimensions of page in points
var $w,$h; //current dimensions of page in user unit
var $lMargin; //left margin
var $tMargin; //top margin
var $rMargin; //right margin
var $bMargin; //page break margin
var $cMargin; //cell margin
var $x,$y; //current position in user unit for cell positioning
var $lasth; //height of last cell printed
var $LineWidth; //line width in user unit
var $CoreFonts; //array of standard font names
var $fonts; //array of used fonts
var $FontFiles; //array of font files
var $diffs; //array of encoding differences
var $images; //array of used images
var $PageLinks; //array of links in pages
var $links; //array of internal links
var $FontFamily; //current font family
var $FontStyle; //current font style
var $underline; //underlining flag
var $CurrentFont; //current font info
var $FontSizePt; //current font size in points
var $FontSize; //current font size in user unit
var $DrawColor; //commands for drawing color
var $FillColor; //commands for filling color
var $TextColor; //commands for text color
var $ColorFlag; //indicates whether fill and text colors are different
var $ws; //word spacing
var $AutoPageBreak; //automatic page breaking
var $PageBreakTrigger; //threshold used to trigger page breaks
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
/**
*
*
* @author Olivier Plathey
* @version 1.52
* @package PDF
* @copyright Copyright (C) 2003-2004
* @license Freeware
*/
class FPDF {
//Private properties
var $page; //current page number
var $n; //current object number
var $offsets; //array of object offsets
var $buffer; //buffer holding in-memory PDF
var $pages; //array containing pages
var $state; //current document state
var $compress; //compression flag
var $DefOrientation; //default orientation
var $CurOrientation; //current orientation
var $OrientationChanges; //array indicating orientation changes
var $k; //scale factor (number of points in user unit)
var $fwPt,$fhPt; //dimensions of page format in points
var $fw,$fh; //dimensions of page format in user unit
var $wPt,$hPt; //current dimensions of page in points
var $w,$h; //current dimensions of page in user unit
var $lMargin; //left margin
var $tMargin; //top margin
var $rMargin; //right margin
var $bMargin; //page break margin
var $cMargin; //cell margin
var $x,$y; //current position in user unit for cell positioning
var $lasth; //height of last cell printed
var $LineWidth; //line width in user unit
var $CoreFonts; //array of standard font names
var $fonts; //array of used fonts
var $FontFiles; //array of font files
var $diffs; //array of encoding differences
var $images; //array of used images
var $PageLinks; //array of links in pages
var $links; //array of internal links
var $FontFamily; //current font family
var $FontStyle; //current font style
var $underline; //underlining flag
var $CurrentFont; //current font info
var $FontSizePt; //current font size in points
var $FontSize; //current font size in user unit
var $DrawColor; //commands for drawing color
var $FillColor; //commands for filling color
var $TextColor; //commands for text color
var $ColorFlag; //indicates whether fill and text colors are different
var $ws; //word spacing
var $AutoPageBreak; //automatic page breaking
var $PageBreakTrigger; //threshold used to trigger page breaks
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 *
* *
*******************************************************************************/
function FPDF($orientation='P',$unit='mm',$format='A4')
{
//Some checks
$this->_dochecks();
//Initialization of properties
$this->page=0;
$this->n=2;
$this->buffer='';
$this->pages=array();
$this->OrientationChanges=array();
$this->state=0;
$this->fonts=array();
$this->FontFiles=array();
$this->diffs=array();
$this->images=array();
$this->links=array();
$this->InFooter=false;
$this->lasth=0;
$this->FontFamily='';
$this->FontStyle='';
$this->FontSizePt=12;
$this->underline=false;
$this->DrawColor='0 G';
$this->FillColor='0 g';
$this->TextColor='0 g';
$this->ColorFlag=false;
$this->ws=0;
//Standard fonts
$this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
//Scale factor
if($unit=='pt')
$this->k=1;
elseif($unit=='mm')
$this->k=72/25.4;
elseif($unit=='cm')
$this->k=72/2.54;
elseif($unit=='in')
$this->k=72;
else
$this->Error('Incorrect unit: '.$unit);
//Page format
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);
/**
*
*
* @param string
* @param string
* @param string
*/
function FPDF($orientation='P',$unit='mm',$format='A4') {
//Some checks
$this->_dochecks();
//Initialization of properties
$this->page=0;
$this->n=2;
$this->buffer='';
$this->pages=array();
$this->OrientationChanges=array();
$this->state=0;
$this->fonts=array();
$this->FontFiles=array();
$this->diffs=array();
$this->images=array();
$this->links=array();
$this->InFooter=false;
$this->lasth=0;
$this->FontFamily='';
$this->FontStyle='';
$this->FontSizePt=12;
$this->underline=false;
$this->DrawColor='0 G';
$this->FillColor='0 g';
$this->TextColor='0 g';
$this->ColorFlag=false;
$this->ws=0;
//Standard fonts
$this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
//Scale factor
if($unit=='pt')
$this->k=1;
elseif($unit=='mm')
$this->k=72/25.4;
elseif($unit=='cm')
$this->k=72/2.54;
elseif($unit=='in')
$this->k=72;
else
$this->Error('Unknown page format: '.$format);
$this->fwPt=$format[0];
$this->fhPt=$format[1];
$this->Error('Incorrect unit: '.$unit);
//Page format
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;
$this->fhPt=$format[1]*$this->k;
//Set left, top and right margins
$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';
$this->wPt=$this->fwPt;
$this->hPt=$this->fhPt;
//Set left margin
$this->lMargin=$margin;
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';
$this->wPt=$this->fhPt;
$this->hPt=$this->fwPt;
//Set top margin
$this->tMargin=$margin;
}
/**
*
*
* @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)
{

View File

@ -352,7 +352,7 @@ function checkConfigOptions($scopes, $options) {
*/
function getHelp($module,$helpID,$scope='') {
$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";
if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"';
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++;
break;
case 'message':

View File

@ -36,9 +36,18 @@ class account extends baseModule {
// module dependencies
$return['dependencies'] = array('depends' => array(), 'conflicts' => array('inetOrgPerson'));
// available PDF fields
$return['PDF_fields'] = array('description');
$return['PDF_fields'] = array(
'description'
);
// 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;
}

View File

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

View File

@ -268,70 +268,73 @@ class posixAccount extends baseModule {
'additionalGroups',
'homeDirectory',
'userPassword',
'loginShell');
'loginShell'
);
// help Entries
$return['help'] = array(
"minMaxUser" => array(
"ext" => "FALSE",
"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.")),
"minMaxHost" => array(
"ext" => "FALSE",
"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.")),
'pwdHash' => array(
"ext" => "FALSE",
"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.")),
'uidNumber' => array(
"ext" => "FALSE",
"Headline" => _("UID number"),
"Text" => _("If empty UID number will be generated automaticly.")),
'user' => array(
'uid' => array(
"ext" => "FALSE",
"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.")),
'gecos' => array(
"ext" => "FALSE",
"Headline" => _("Gecos"),
"Text" => _("User description. If left empty sur- and give name will be used.")),
'gidNumber' => array(
"ext" => "FALSE",
"Headline" => _("Primary group"),
"Text" => _("The Primary Group the user should be member of.")),
'homeDirectory' => array(
"ext" => "FALSE",
"Headline" => _("Home directory"),
"Text" => _("$user and $group are replaced with username or primary groupname.")),
/*'userPassword' =>*/
'userPassword_no' => array(
"ext" => "FALSE",
"Headline" => _("Use no password"),
"Text" => _("If checked no password will be used.")),
/*'userPassword_lock' =>*/
'loginShell' => array(
"ext" => "FALSE",
"Headline" => _("Login shell"),
"Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells")),
'addgroup' => array(
"ext" => "FALSE",
"Headline" => _("Additional groups"),
"Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty."))),
'host' => array(
'uid' => array(
"ext" => "FALSE",
"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.")),
'gecos' => array(
"ext" => "FALSE",
"Headline" => _("Gecos"),
"Text" => _("Host description. If left empty host name will be used.")),
'gidNumber' => array(
"ext" => "FALSE",
"Headline" => _("Primary group"),
"Text" => _("The Primary group the host should be member of."))
));
'minMaxUser' => array(
'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.')
),
'minMaxHost' => array(
'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.')
),
'pwdHash' => array(
"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.")
),
'uidNumber' => array(
"Headline" => _("UID number"),
"Text" => _("If empty UID number will be generated automaticly.")
),
'user' => array(
'uid' => array(
"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.")
),
'gecos' => array(
"Headline" => _("Gecos"),
"Text" => _("User description. If left empty sur- and give name will be used.")
),
'gidNumber' => array(
"Headline" => _("Primary group"),
"Text" => _("The Primary Group the user should be member of.")
),
'homeDirectory' => array(
"Headline" => _("Home directory"),
"Text" => _("$user and $group are replaced with username or primary groupname.")
),
/*'userPassword' =>*/
'userPassword_no' => array(
"Headline" => _("Use no password"),
"Text" => _("If checked no password will be used.")
),
/*'userPassword_lock' =>*/
'loginShell' => array(
"Headline" => _("Login shell"),
"Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells")
),
'addgroup' => array(
"Headline" => _("Additional groups"),
"Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")
)
),
'host' => array(
'uid' => array(
"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.")
),
'gecos' => array(
"Headline" => _("Gecos"),
"Text" => _("Host description. If left empty host name will be used.")
),
'gidNumber' => array(
"Headline" => _("Primary group"),
"Text" => _("The Primary group the host should be member of.")
)
)
);
return $return;
}
@ -1012,9 +1015,7 @@ class posixAccount extends baseModule {
}
}
return $return;
}
/**
n /**
* In this function the LDAP account is built up.
*
* @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',
'error_message' => $this->messages['gidNumber'][7]);
// available PDF fields
$return['PDF_fields'] = array( 'cn',
'gidNumber',
'memberUid',
'description');
$return['PDF_fields'] = array(
'cn',
'gidNumber',
'memberUid',
'description'
);
// upload fields
$return['upload_columns'] = array(
array(
@ -317,43 +319,43 @@ class posixGroup extends baseModule {
);
// help Entries
$return['help'] = array(
'cn' => array(
"ext" => "FALSE",
"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.")),
'gidNumber' => array(
"ext" => "FALSE",
"Headline" => _("GID number"),
"Text" => _("If empty GID number will be generated automaticly depending on your configuration settings.")),
'description' => array(
"ext" => "FALSE",
"Headline" => _("Description"),
"Text" => _("Group description. If left empty group name will be used.")),
'members' => array(
"ext" => "FALSE",
"Headline" => _("Group members"),
"Text" => _("Users also being member of the current group."). ' '. _("Can be left empty.")),
'upload_members' => array(
"ext" => "FALSE",
"Headline" => _("Group members"),
"Text" => _("Users also being member of the current group. Users are separated by semicolons.")),
'password' => array(
"ext" => "FALSE",
"Headline" => _("Group password"),
"Text" => _("Sets the group password.")),
'userPassword_no' => array(
"ext" => "FALSE",
"Headline" => _("Use no password"),
"Text" => _("If checked no password will be used.")),
/*'userPassword_lock' => */
'minMaxGID' => array(
"ext" => "FALSE",
"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.")),
'pwdHash' => array(
"ext" => "FALSE",
"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."))
'cn' => array(
"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.")
),
'gidNumber' => array(
"Headline" => _("GID number"),
"Text" => _("If empty GID number will be generated automaticly depending on your configuration settings.")
),
'description' => array(
"Headline" => _("Description"),
"Text" => _("Group description. If left empty group name will be used.")
),
'members' => array(
"Headline" => _("Group members"),
"Text" => _("Users also being member of the current group."). ' '. _("Can be left empty.")
),
'upload_members' => array(
"Headline" => _("Group members"),
"Text" => _("Users also being member of the current group. Users are separated by semicolons.")
),
'password' => array(
"Headline" => _("Group password"),
"Text" => _("Sets the group password.")
),
'userPassword_no' => array(
"Headline" => _("Use no password"),
"Text" => _("If checked no password will be used.")
),
/*'userPassword_lock' => */
'minMaxGID' => array(
"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.")
),
'pwdHash' => array(
"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.")
)
);
return $return;

View File

@ -55,51 +55,47 @@ class quota extends baseModule {
$return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array());
}
// available PDF fields
$return['PDF_fields'] = array( 'quotas');
$return['PDF_fields'] = array(
'quotas'
);
// help entries
$return['help'] = array(
"Mountpoint" => array(
"ext" => "FALSE",
"Headline" => _("Mountpoint"),
"Text" => _("Mountpoint of device with enabled quotas.")),
"UsedBlocks" => array(
"ext" => "FALSE",
"Headline" => _("Used blocks"),
"Text" => _("Used blocks. 1000 blocks are usually 1MB")),
"SoftBlockLimit" => array(
"ext" => "FALSE",
"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>'),
"HardBlockLimit" => array(
"ext" => "FALSE",
"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">'.
'Quota How-To</a>'),
"GraceBlockPeriod" => array(
"ext" => "FALSE",
"Headline" => _("Grace block period"),
"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>'),
"UsedInodes" => array(
"ext" => "FALSE",
"Headline" => _("Used inodes"),
"Text" => _("Used inodes (files)").'.'),
"SoftInodeLimit" => array(
"ext" => "FALSE",
"Headline" => _("Soft 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">'.
'Quota How-To</a>'),
"HardInodeLimit" => array(
"ext" => "FALSE",
"Headline" => _("Hard inode limit"),
"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>'),
"Mountpoint" => array(
"Headline" => _("Mountpoint"),
"Text" => _("Mountpoint of device with enabled quotas.")
),
"UsedBlocks" => array(
"Headline" => _("Used blocks"),
"Text" => _("Used blocks. 1000 blocks are usually 1MB")
),
"SoftBlockLimit" => array(
"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>'
),
"HardBlockLimit" => array(
"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">'.'Quota How-To</a>'
),
"GraceBlockPeriod" => array(
"Headline" => _("Grace block period"),
"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>'
),
"UsedInodes" => array(
"Headline" => _("Used inodes"),
"Text" => _("Used inodes (files)").'.'
),
"SoftInodeLimit" => array(
"Headline" => _("Soft 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">'.'Quota How-To</a>'
),
"HardInodeLimit" => array(
"Headline" => _("Hard inode limit"),
"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(
"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;
}

View File

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

View File

@ -219,11 +219,13 @@ class sambaGroupMapping extends baseModule {
// module dependencies
$return['dependencies'] = array('depends' => array('posixGroup'), 'conflicts' => array());
// available PDF fields
$return['PDF_fields'] = array( 'gidNumber',
'sambaSID',
'displayName',
'sambaGroupType',
'description');
$return['PDF_fields'] = array(
'gidNumber',
'sambaSID',
'displayName',
'sambaGroupType',
'description'
);
// upload fields
// search existing Samba 3 domains
if ($_SESSION['loggedIn']) $domains = search_domains($_SESSION['config']->get_domainSuffix());
@ -262,25 +264,26 @@ class sambaGroupMapping extends baseModule {
// help Entries
$return['help'] = array(
'displayName' => array(
"ext" => "FALSE",
"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(
"ext" => "FALSE",
"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(
"ext" => "FALSE",
"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(
"ext" => "FALSE",
"Headline" => _("Domain"),
"Text" => _("Windows-Domain name of group."). ' '. _("Can be left empty.")),
"Text" => _("Windows-Domain name of group."). ' '. _("Can be left empty.")
),
'type' => array(
"ext" => "FALSE",
"Headline" => _("Samba group type"),
"Text" => _("Windows group type.")));
"Text" => _("Windows group type.")
)
);
return $return;
}

View File

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

View File

@ -120,18 +120,37 @@ class shadowAccount extends baseModule {
'regex' => 'digit',
'error_message' => $this->messages['shadowWarning'][0]);
// available PDF fields
$return['PDF_fields'] = array( 'shadowLastChange',
'shadowWarning',
'shadowInactive',
'shadowExpire',
'shadowFlag',
'description');
$return['PDF_fields'] = array(
'shadowLastChange',
'shadowWarning',
'shadowInactive',
'shadowExpire',
'shadowFlag',
'description'
);
// 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.")),
'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.")),
'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.")),
'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.")),
'shadowExpire' => array ("ext" => "FALSE", "Headline" => _("Expire date"), "Text" => _("Account expire date. Format: DD-MM-YYYY")));
$return['help'] = array (
'shadowWarning' => array (
"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.")
),
'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;
}

View File

@ -18,19 +18,54 @@ $Id$
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
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('LAMPDF_LINEWIDTH',190);
/**
*
*/
include_once("fpdf.php");
/**
*
*/
include_once('xml_parser.inc');
$key = false;
$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') {
$return = array();
$dirHandle = opendir($_SESSION['lampath'] . '/config/pdf/' . $scope . '/');
@ -43,6 +78,18 @@ function getAvailablePDFStructures($scope='user') {
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") {
global $key;
@ -173,6 +220,14 @@ function createModulePDF($accounts,$pdf_structure="default.xml") {
return $filename;
}
/**
*
*
* @param string
* @param string
*
* @return array
*/
function getStructure($scope,$pdf_structure) {
$parser = new xmlParser();
$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);
}
/**
*
*
* @param string
*
* @return string
*/
function getSectionHeadline($line) {
$headline_pattern = '/<block>.*<value>(.*)<\/value><\/block>/';
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) {
global $key, $line_width;
@ -266,6 +336,14 @@ function processLine($line,$first_td = true) {
}
}
/**
*
*
* @param string
* @param string
*
* @return array
*/
function processFormatTags($line,$style) {
// PCRE matching a <i> tag
$i_pattern = '/(.*)<i>(.+)<\/i>(.*)/';
@ -291,6 +369,14 @@ function processFormatTags($line,$style) {
return array($style,$line);
}
/**
*
*
* @param string
* @param array
*
* @return array
*/
function processAttributes($attrs,$return = array()) {
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 {
/**
*
*/
var $page_definitions;
/**
*
*
* @param string
* @param array
*/
function lamPDF($account_type = "User",$page_definitions = array()) {
// Call constructor of superclass
$this->FPDF('P','mm','A4');
@ -362,12 +463,13 @@ class lamPDF extends FPDF {
$this->setSubject($subject);
$this->setAuthor("LDAP Account Manager Devel-Team -Michael Duergner-");
$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->setAutoPageBreak(true,$this->page_definitions['margin-bottom']);
}
// Print page header
/**
*
*/
function header() {
if($this->page_definitions['filename'] != 'none') {
$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);
}
// Print page footer
/**
*
*/
function footer() {
$this->SetLineWidth(0.8);
$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
along with this program; if not, write to the Free Software
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("ldap.inc");
/**
*
*
* @param string
*
* @return array
*/
function getPDFStructureDefinitions($scope = "user") {
$return = array();
$path = $_SESSION['lampath'] . 'config/pdf/' . $scope;
@ -39,6 +62,14 @@ function getPDFStructureDefinitions($scope = "user") {
return $return;
}
/**
*
*
* @param string
* @param string
*
* @return array
*/
function loadPDFStructureDefinitions($scope='user', $definition='default.xml') {
$parser = new xmlParser();
$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);
}
/**
*
*
* @param string
* @param string
*/
function savePDFStructureDefinitions($scope,$definition) {
$handle = fopen($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition,'w');
$pdf_attributes = '';
@ -101,11 +138,24 @@ function savePDFStructureDefinitions($scope,$definition) {
fclose($handle);
}
/**
*
*
* @param string
* @param string
*
* @return boolean
*/
function deletePDFStructureDefinition($scope,$definition) {
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
return unlink($file);
}
/**
*
*
* @return array
*/
function getAvailableLogos() {
$return = array();
$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
along with this program; if not, write to the Free Software
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()) {
/* Setting CSS-StyleSheet class depending on the $MessageTyp and rewriting $MessageTyp with a readable string. */
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) {
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) {
$pattern = "/\{bold\}([^{]*)\{endbold\}/"; // Regular expression matching {bold}[Text]{endbold}
$replace = "<b class=\"status\">\\1</b>"; // Replace pattern
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) {
$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
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) {
$pattern = "/\{link=([^}]*)\}([^{]*)\{endlink\}/"; // Regular expression matching {link=[Link-Target]}[Text]{endlink}
$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
along with this program; if not, write to the Free Software
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 {
/**
*
*/
var $xmlParser;
/**
*
*/
function xmlParser() {
$this->xmlParser = xml_parser_create();
xml_set_object($this->xmlParser,&$this);
@ -34,6 +54,13 @@ class xmlParser {
xml_parser_set_option($this->xmlParser, XML_OPTION_SKIP_WHITE, 1);
}
/**
*
*
* @param string
*
* @return array
*/
function parse($filename) {
if(file_exists($filename)) {
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 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/config.inc");
session_save_path("../sess"); // Set session save path
@session_start(); // Start LDAP Account Manager session
/**
*
*/
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
setlanguage();
/* Print HTML head */
/**
* Print HTML header of the help page.
*/
function echoHTMLHead()
{
echo $_SESSION['header'];
@ -46,7 +73,9 @@ echo $_SESSION['header'];
<?php
}
/* Print HTML foot */
/**
* Print HTML footer of the help page.
*/
function echoHTMLFoot()
{
?>
@ -55,7 +84,12 @@ function echoHTMLFoot()
<?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) {
/* Load external help page */
if($helpEntry["ext"] == "TRUE")
@ -84,7 +118,7 @@ function displayHelp($helpEntry,$helpVariables) {
}
/* If no help number was submitted print error message */
if(!isset($_GET['item']))
if(!isset($_GET['HelpNumber']))
{
$errorMessage = _("Sorry no help number submitted.");
echoHTMLHead();
@ -97,11 +131,15 @@ $helpEntry = array();
if(isset($_GET['module'])) {
include_once("../lib/modules.inc");
$helpEntry = getHelp($_GET['module'],$_GET['item'],$_GET['scope']);
//$helpEntry = $_SESSION['account']->getHelp($_GET['module'],$_GET['item']);
if(isset($_GET['scope'])) {
$helpEntry = getHelp($_GET['module'],$_GET['HelpNumber'],$_GET['scope']);
}
else {
$helpEntry = getHelp($_GET['module'],$_GET['HelpNumber']);
}
if(!$helpEntry) {
$variables = array();
array_push($variables,$_GET['item']);
array_push($variables,$_GET['HelpNumber']);
array_push($variables,$_GET['module']);
$errorMessage = _("Sorry this help id ({bold}%s{endbold}) is not available for this module ({bold}%s{endbold}).");
echoHTMLHead();