*** 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,20 +1,32 @@
<?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');
class FPDF
{
/**
*
*
* @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
@ -74,8 +86,14 @@ var $AliasNbPages; //alias for total number of pages
* Public methods *
* *
*******************************************************************************/
function FPDF($orientation='P',$unit='mm',$format='A4')
{
/**
*
*
* @param string
* @param string
* @param string
*/
function FPDF($orientation='P',$unit='mm',$format='A4') {
//Some checks
$this->_dochecks();
//Initialization of properties
@ -177,6 +195,13 @@ function FPDF($orientation='P',$unit='mm',$format='A4')
$this->SetCompression(true);
}
/**
*
*
* @param int
* @param int
* @param int
*/
function SetMargins($left,$top,$right=-1)
{
//Set left, top and right margins
@ -187,6 +212,11 @@ function SetMargins($left,$top,$right=-1)
$this->rMargin=$right;
}
/**
*
*
* @param int
*/
function SetLeftMargin($margin)
{
//Set left margin
@ -195,18 +225,34 @@ function SetLeftMargin($margin)
$this->x=$margin;
}
/**
*
*
* @param int
*/
function SetTopMargin($margin)
{
//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
@ -215,6 +261,12 @@ function SetAutoPageBreak($auto,$margin=0)
$this->PageBreakTrigger=$this->h-$margin;
}
/**
*
*
* @param string
* @param string
*/
function SetDisplayMode($zoom,$layout='continuous')
{
//Set display mode in viewer
@ -228,6 +280,11 @@ function SetDisplayMode($zoom,$layout='continuous')
$this->Error('Incorrect layout display mode: '.$layout);
}
/**
*
*
* @param string
*/
function SetCompression($compress)
{
//Set page compression

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,7 +193,8 @@ class inetOrgPerson extends baseModule {
);
// TODO unix workstations for upload
// available PDF fields
$return['PDF_fields'] = array( 'description',
$return['PDF_fields'] = array(
'description',
'host',
'title',
'givenName',
@ -205,21 +206,67 @@ class inetOrgPerson extends baseModule {
'telephoneNumber',
'mobileTelephoneNumber',
'facimilieTelefonNumber',
'mail');
'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.")),
'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(
"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.")),
"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.")),
"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.")),
"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.")),
"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.")),
"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.")),
"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.")),
"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")),
"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."))),
"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.")),
"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.")),
"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."))
));
"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',
$return['PDF_fields'] = array(
'cn',
'gidNumber',
'memberUid',
'description');
'description'
);
// upload fields
$return['upload_columns'] = array(
array(
@ -318,42 +320,42 @@ 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.")),
"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.")),
"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.")),
"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.")),
"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.")),
"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.")),
"Text" => _("Sets the group password.")
),
'userPassword_no' => array(
"ext" => "FALSE",
"Headline" => _("Use no password"),
"Text" => _("If checked no password will be used.")),
"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.")),
"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."))
"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.")),
"Text" => _("Mountpoint of device with enabled quotas.")
),
"UsedBlocks" => array(
"ext" => "FALSE",
"Headline" => _("Used blocks"),
"Text" => _("Used blocks. 1000 blocks are usually 1MB")),
"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>'),
"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>'),
"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>'),
"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)").'.'),
"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>'),
"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>'),
"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>'),
"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,7 +147,8 @@ 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',
$return['PDF_fields'] = array(
'displayName',
'uid',
'smbHome',
'homeDrive',
@ -155,7 +156,8 @@ class sambaAccount extends baseModule {
'profilePath',
'userWorkstations',
'domain',
'description');
'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',
$return['PDF_fields'] = array(
'gidNumber',
'sambaSID',
'displayName',
'sambaGroupType',
'description');
'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,7 +86,8 @@ class sambaSamAccount extends baseModule {
'regex' => 'unixhost',
'error_message' => $this->messages['workstations'][0]);
// available PDF fields
$return['PDF_fields'] = array( 'displayName',
$return['PDF_fields'] = array(
'displayName',
'uid',
'sambaHomePath',
'sambaHomeDrive',
@ -95,7 +96,8 @@ class sambaSamAccount extends baseModule {
'sambaUserWorkstations',
'sambaDomainName',
'description',
'sambaPrimaryGroupSID');
'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',
$return['PDF_fields'] = array(
'shadowLastChange',
'shadowWarning',
'shadowInactive',
'shadowExpire',
'shadowFlag',
'description');
'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();