commit
7c94b6e13f
|
@ -1,5 +1,6 @@
|
||||||
March 2017
|
March 2017
|
||||||
- 2-factor authentication for admin login and self service with privacyIDEA
|
- 2-factor authentication for admin login and self service with privacyIDEA
|
||||||
|
- Updated Debian dependencies
|
||||||
|
|
||||||
|
|
||||||
18.12.2016 5.6
|
18.12.2016 5.6
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +50,14 @@ This is a list of API changes for all LAM releases.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<h2>5.6 -> 5.7</h2>
|
||||||
|
<ul>
|
||||||
|
<li>module interface: get_pdfEntries() must return an array key =>
|
||||||
|
PDFEntry (no action required if you did not build the XML yourself)<span style="color: rgb(34, 31, 30); font-family: Sans,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: rgb(214, 210, 208); display: inline ! important; float: none;"></span></li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
<h2>5.5 -> 5.6</h2>
|
<h2>5.5 -> 5.6</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Functions in lib/types.inc got namespace LAM/TYPES (e.g. getTypeAlias()).</li>
|
Functions in lib/types.inc got namespace LAM/TYPES (e.g. getTypeAlias()).</li>
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFLabelValue;
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2016 Roland Gruber
|
Copyright (C) 2003 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -33,6 +35,9 @@ $Id$
|
||||||
* @see baseModule
|
* @see baseModule
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** PDF functions */
|
||||||
|
include_once('pdf.inc');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parent class of all account modules.
|
* Parent class of all account modules.
|
||||||
* It implements the complete module interface and uses meta-data
|
* It implements the complete module interface and uses meta-data
|
||||||
|
@ -808,7 +813,7 @@ abstract class baseModule {
|
||||||
* Returns the PDF entries for this module.
|
* Returns the PDF entries for this module.
|
||||||
*
|
*
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
* @param array $pdfKeys list of PDF keys that are included in document
|
||||||
* @return array list of possible PDF entries
|
* @return PDFEntry[] list of key => PDFEntry
|
||||||
*/
|
*/
|
||||||
public function get_pdfEntries($pdfKeys) {
|
public function get_pdfEntries($pdfKeys) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -831,14 +836,9 @@ abstract class baseModule {
|
||||||
if (isset($this->attributes[$attrName]) && (sizeof($this->attributes[$attrName]) > 0)) {
|
if (isset($this->attributes[$attrName]) && (sizeof($this->attributes[$attrName]) > 0)) {
|
||||||
natcasesort($this->attributes[$attrName]);
|
natcasesort($this->attributes[$attrName]);
|
||||||
$value = implode($delimiter, $this->attributes[$attrName]);
|
$value = implode($delimiter, $this->attributes[$attrName]);
|
||||||
// TODO workarounds for PDF parser, remove when migrated to other PDF library
|
|
||||||
$value = str_replace("\r\n", " ", $value);
|
|
||||||
$value = str_replace("\n", " ", $value);
|
|
||||||
$value = str_replace("\r", " ", $value);
|
|
||||||
// TODO workaround for UFPDF, remove when migrated to other PDF library
|
|
||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
}
|
}
|
||||||
$result[get_class($this) . '_' . $name] = array('<block><key>' . $label . '</key><value>' . $value . '</value></block>');
|
$result[get_class($this) . '_' . $name][] = new PDFLabelValue($label, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -855,7 +855,7 @@ abstract class baseModule {
|
||||||
natcasesort($value);
|
natcasesort($value);
|
||||||
$value = implode($delimiter, $value);
|
$value = implode($delimiter, $value);
|
||||||
}
|
}
|
||||||
$result[get_class($this) . '_' . $name] = array('<block><key>' . $label . '</key><value>' . $value . '</value></block>');
|
$result[get_class($this) . '_' . $name][] = new PDFLabelValue($label, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -869,19 +869,7 @@ abstract class baseModule {
|
||||||
if (empty($table->rows)) {
|
if (empty($table->rows)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!empty($table->label)) {
|
$result[get_class($this) . '_' . $name][] = $table;
|
||||||
$result[get_class($this) . '_' . $name][] = '<block><tr><td><b>' . $table->label . ':</b></td></tr></block>';
|
|
||||||
}
|
|
||||||
foreach ($table->rows as $row) {
|
|
||||||
$xml = '<block><tr>';
|
|
||||||
foreach ($row->cells as $cell) {
|
|
||||||
$width = empty($cell->width) ? '' : ' width="' . $cell->width . '"';
|
|
||||||
$content = ($cell->bold) ? '<b>' . $cell->content . '</b>' : $cell->content;
|
|
||||||
$xml .= '<td align="' . $cell->align . '"' . $width . '>' . $content . '</td>';
|
|
||||||
}
|
|
||||||
$xml .= '</tr></block>';
|
|
||||||
$result[get_class($this) . '_' . $name][] = $xml;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1963,80 +1951,4 @@ abstract class baseModule {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a table for PDF export.
|
|
||||||
*
|
|
||||||
* @package PDF
|
|
||||||
* @author Roland Gruber
|
|
||||||
*/
|
|
||||||
class PDFTable {
|
|
||||||
|
|
||||||
/** optional label of table */
|
|
||||||
public $label = null;
|
|
||||||
/** list of PDFTableRow elements */
|
|
||||||
public $rows = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param String $label label
|
|
||||||
*/
|
|
||||||
public function __construct($label = null) {
|
|
||||||
$this->label = $label;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a table row for PDF export.
|
|
||||||
*
|
|
||||||
* @package PDF
|
|
||||||
* @author Roland Gruber
|
|
||||||
*/
|
|
||||||
class PDFTableRow {
|
|
||||||
|
|
||||||
/** list of PDFTableCell */
|
|
||||||
public $cells = array();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a table cell for PDF export.
|
|
||||||
*
|
|
||||||
* @package PDF
|
|
||||||
* @author Roland Gruber
|
|
||||||
*/
|
|
||||||
class PDFTableCell {
|
|
||||||
|
|
||||||
const ALIGN_LEFT = 'L';
|
|
||||||
const ALIGN_RIGHT = 'R';
|
|
||||||
const ALIGN_CENTER = 'C';
|
|
||||||
|
|
||||||
/** content text of cell */
|
|
||||||
public $content = '';
|
|
||||||
/** text alignment */
|
|
||||||
public $align = self::ALIGN_LEFT;
|
|
||||||
/** cell width (e.g. "20%") */
|
|
||||||
public $width = null;
|
|
||||||
/** bold text */
|
|
||||||
public $bold = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @param String $content cell content
|
|
||||||
* @param String $width width (e.g. "20%")
|
|
||||||
* @param String $align cell alignment (default: left)
|
|
||||||
* @param boolean $bold print in bold
|
|
||||||
*/
|
|
||||||
public function __construct($content, $width = null, $align = null, $bold = false) {
|
|
||||||
$this->content = empty($content) ? ' ' : $content;
|
|
||||||
$this->align = ($align == null) ? self::ALIGN_LEFT : $align;
|
|
||||||
$this->width = $width;
|
|
||||||
$this->bold = $bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -5,7 +5,7 @@ use LAM\TYPES\ConfiguredType;
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2016 Roland Gruber
|
Copyright (C) 2003 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -609,7 +609,7 @@ class lamList {
|
||||||
if ($option == 'DN') {
|
if ($option == 'DN') {
|
||||||
$_SESSION["accountPDF"] = new accountContainer($this->type, "accountPDF");
|
$_SESSION["accountPDF"] = new accountContainer($this->type, "accountPDF");
|
||||||
$_SESSION["accountPDF"]->load_account(base64_decode($_POST['clickedAccount']));
|
$_SESSION["accountPDF"]->load_account(base64_decode($_POST['clickedAccount']));
|
||||||
$filename = createModulePDF(array($_SESSION["accountPDF"]),$pdfStruct);
|
$filename = \LAM\PDF\createModulePDF(array($_SESSION["accountPDF"]),$pdfStruct);
|
||||||
unset($_SESSION["accountPDF"]);
|
unset($_SESSION["accountPDF"]);
|
||||||
}
|
}
|
||||||
// create for all selected accounts
|
// create for all selected accounts
|
||||||
|
@ -624,7 +624,7 @@ class lamList {
|
||||||
$list[$i] = $_SESSION["accountPDF-$i"];
|
$list[$i] = $_SESSION["accountPDF-$i"];
|
||||||
}
|
}
|
||||||
if (sizeof($list) > 0) {
|
if (sizeof($list) > 0) {
|
||||||
$filename = createModulePDF($list,$pdfStruct);
|
$filename = \LAM\PDF\createModulePDF($list,$pdfStruct);
|
||||||
for ($i = 0; $i < sizeof($accounts); $i++) {
|
for ($i = 0; $i < sizeof($accounts); $i++) {
|
||||||
unset($_SESSION["accountPDF-$i"]);
|
unset($_SESSION["accountPDF-$i"]);
|
||||||
}
|
}
|
||||||
|
@ -640,7 +640,7 @@ class lamList {
|
||||||
$list[$i] = $_SESSION["accountPDF-$i"];
|
$list[$i] = $_SESSION["accountPDF-$i"];
|
||||||
}
|
}
|
||||||
if (sizeof($list) > 0) {
|
if (sizeof($list) > 0) {
|
||||||
$filename = createModulePDF($list,$pdfStruct);
|
$filename = \LAM\PDF\createModulePDF($list,$pdfStruct);
|
||||||
for ($i = 0; $i < $entriesCount; $i++) {
|
for ($i = 0; $i < $entriesCount; $i++) {
|
||||||
// clean session
|
// clean session
|
||||||
unset($_SESSION["accountPDF-$i"]);
|
unset($_SESSION["accountPDF-$i"]);
|
||||||
|
@ -648,7 +648,7 @@ class lamList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($option == 'SESSION') {
|
elseif ($option == 'SESSION') {
|
||||||
$filename = createModulePDF(array($_SESSION[$_POST['PDFSessionID']]),$pdfStruct);
|
$filename = \LAM\PDF\createModulePDF(array($_SESSION[$_POST['PDFSessionID']]),$pdfStruct);
|
||||||
unset($_SESSION[$_POST['PDFSessionID']]);
|
unset($_SESSION[$_POST['PDFSessionID']]);
|
||||||
}
|
}
|
||||||
if ($filename != '') {
|
if ($filename != '') {
|
||||||
|
|
|
@ -2006,7 +2006,7 @@ class accountContainer {
|
||||||
* Returns a list of possible PDF entries for this account.
|
* Returns a list of possible PDF entries for this account.
|
||||||
*
|
*
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
* @param array $pdfKeys list of PDF keys that are included in document
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
* @return PDFEntry[] list of key => PDFEntry
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -2018,7 +2018,7 @@ class accountContainer {
|
||||||
if (isset($this->finalDN)) {
|
if (isset($this->finalDN)) {
|
||||||
$dn = $this->finalDN;
|
$dn = $this->finalDN;
|
||||||
}
|
}
|
||||||
$return = array_merge($return,array('main_dn' => array('<block><key>' . _('DN') . '</key><value>' . $dn . '</value></block>')));
|
$return = array_merge($return,array('main_dn' => array(new \LAM\PDF\PDFLabelValue(_('DN'), $dn))));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,11 +220,9 @@ class account extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the PDF entries for this module.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
*/
|
||||||
* @return array list of possible PDF entries
|
|
||||||
*/
|
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
$this->addSimplePDFField($return, 'description', _('Description'));
|
$this->addSimplePDFField($return, 'description', _('Description'));
|
||||||
|
|
|
@ -54,7 +54,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -67,7 +67,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
* @return array array with meta data
|
* @return array array with meta data
|
||||||
*/
|
*/
|
||||||
function get_metaData() {
|
function get_metaData() {
|
||||||
$return = array();
|
$return = array();
|
||||||
$return["is_base"] = false;
|
$return["is_base"] = false;
|
||||||
// alias name
|
// alias name
|
||||||
$return["alias"] = _("Asterisk");
|
$return["alias"] = _("Asterisk");
|
||||||
|
@ -134,7 +134,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
'AstAccountCallGroup' => array(
|
'AstAccountCallGroup' => array(
|
||||||
"Headline" => _("Call groups"), 'attr' => 'AstAccountCallGroup',
|
"Headline" => _("Call groups"), 'attr' => 'AstAccountCallGroup',
|
||||||
"Text" => _("The user's call groups.")
|
"Text" => _("The user's call groups.")
|
||||||
),
|
),
|
||||||
'AstAccountDTMFMode' => array(
|
'AstAccountDTMFMode' => array(
|
||||||
"Headline" => _("DTMF mode"), 'attr' => 'AstAccountDTMFMode',
|
"Headline" => _("DTMF mode"), 'attr' => 'AstAccountDTMFMode',
|
||||||
"Text" => _("DTMF mode for SIP client configuration.")
|
"Text" => _("DTMF mode for SIP client configuration.")
|
||||||
|
@ -244,7 +244,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
"Text" => _("The selected options will not be managed inside LAM. You can use this to reduce the number of displayed input fields.")
|
"Text" => _("The selected options will not be managed inside LAM. You can use this to reduce the number of displayed input fields.")
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// self service options
|
// self service options
|
||||||
$selfServiceContainer = new htmlTable();
|
$selfServiceContainer = new htmlTable();
|
||||||
$selfServiceContainer->addElement(new htmlTableExtendedInputField(_('Asterisk realm'), 'asteriskAccount_AsteriskRealm', null));
|
$selfServiceContainer->addElement(new htmlTableExtendedInputField(_('Asterisk realm'), 'asteriskAccount_AsteriskRealm', null));
|
||||||
$selfServiceContainer->addElement(new htmlHelpLink('AsteriskRealm', get_class($this)));
|
$selfServiceContainer->addElement(new htmlHelpLink('AsteriskRealm', get_class($this)));
|
||||||
|
@ -415,7 +415,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
'help' => 'AstAccountDeny',
|
'help' => 'AstAccountDeny',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPermit')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountPermit')) {
|
||||||
$return['upload_columns'][] = array(
|
$return['upload_columns'][] = array(
|
||||||
'name' => 'asteriskAccount_AstAccountPermit',
|
'name' => 'asteriskAccount_AstAccountPermit',
|
||||||
|
@ -487,7 +487,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
'help' => 'AstAccountMusicOnHold',
|
'help' => 'AstAccountMusicOnHold',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountExpirationTimestamp')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountExpirationTimestamp')) {
|
||||||
$return['upload_columns'][] = array(
|
$return['upload_columns'][] = array(
|
||||||
'name' => 'asteriskAccount_AstAccountExpirationTimestamp',
|
'name' => 'asteriskAccount_AstAccountExpirationTimestamp',
|
||||||
|
@ -523,7 +523,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
'help' => 'AstAccountIPAddress',
|
'help' => 'AstAccountIPAddress',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDefaultUser')) {
|
if (!$this->isBooleanConfigOptionSet('asteriskAccount_hideAstAccountDefaultUser')) {
|
||||||
$return['upload_columns'][] = array(
|
$return['upload_columns'][] = array(
|
||||||
'name' => 'asteriskAccount_AstAccountDefaultUser',
|
'name' => 'asteriskAccount_AstAccountDefaultUser',
|
||||||
|
@ -579,7 +579,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_attributes() {
|
function display_html_attributes() {
|
||||||
|
@ -975,10 +975,8 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -1056,7 +1054,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
$pwdString = asteriskAccount::buildPasswordString($attributes, $this->moduleSettings, $rawAccounts[$i][$ids['asteriskAccount_AstAccountRealmedPassword']]);
|
$pwdString = asteriskAccount::buildPasswordString($attributes, $this->moduleSettings, $rawAccounts[$i][$ids['asteriskAccount_AstAccountRealmedPassword']]);
|
||||||
$partialAccounts[$i]['AstAccountRealmedPassword'] = $pwdString;
|
$partialAccounts[$i]['AstAccountRealmedPassword'] = $pwdString;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountUserAgent', 'AstAccountUserAgent');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountUserAgent', 'AstAccountUserAgent');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountAMAFlags', 'AstAccountAMAFlags');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountAMAFlags', 'AstAccountAMAFlags');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountCallGroup', 'AstAccountCallGroup');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountCallGroup', 'AstAccountCallGroup');
|
||||||
|
@ -1075,10 +1073,10 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountDeny', 'AstAccountDeny');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountDeny', 'AstAccountDeny');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountPermit', 'AstAccountPermit');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountPermit', 'AstAccountPermit');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountPickupGroup', 'AstAccountPickupGroup');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountPickupGroup', 'AstAccountPickupGroup');
|
||||||
|
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountPort', 'AstAccountPort',
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountPort', 'AstAccountPort',
|
||||||
'digit', $this->messages['AstAccountPort'][1], $messages);
|
'digit', $this->messages['AstAccountPort'][1], $messages);
|
||||||
|
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountQualify', 'AstAccountQualify');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountQualify', 'AstAccountQualify');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRestrictCID', 'AstAccountRestrictCID');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRestrictCID', 'AstAccountRestrictCID');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRTPTimeout', 'AstAccountRTPTimeout');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRTPTimeout', 'AstAccountRTPTimeout');
|
||||||
|
@ -1090,13 +1088,13 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRegistrationContext', 'AstAccountRegistrationContext');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRegistrationContext', 'AstAccountRegistrationContext');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRegistrationExten', 'AstAccountRegistrationExten');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRegistrationExten', 'AstAccountRegistrationExten');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountCanCallForward', 'AstAccountCanCallForward');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountCanCallForward', 'AstAccountCanCallForward');
|
||||||
|
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountIPAddress', 'AstAccountIPAddress',
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountIPAddress', 'AstAccountIPAddress',
|
||||||
'ip', $this->messages['AstAccountIPAddress'][1], $messages);
|
'ip', $this->messages['AstAccountIPAddress'][1], $messages);
|
||||||
|
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountDefaultUser', 'AstAccountDefaultUser',
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountDefaultUser', 'AstAccountDefaultUser',
|
||||||
'username', $this->messages['AstAccountDefaultUser'][1], $messages);
|
'username', $this->messages['AstAccountDefaultUser'][1], $messages);
|
||||||
|
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRegistrationServer', 'AstAccountRegistrationServer');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountRegistrationServer', 'AstAccountRegistrationServer');
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountLastQualifyMilliseconds', 'AstAccountLastQualifyMilliseconds');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'asteriskAccount_AstAccountLastQualifyMilliseconds', 'AstAccountLastQualifyMilliseconds');
|
||||||
}
|
}
|
||||||
|
@ -1120,13 +1118,13 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies if this module supports to force that a user must change his password on next login.
|
* Specifies if this module supports to force that a user must change his password on next login.
|
||||||
*
|
*
|
||||||
* @return boolean force password change supported
|
* @return boolean force password change supported
|
||||||
*/
|
*/
|
||||||
public function supportsForcePasswordChange() {
|
public function supportsForcePasswordChange() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is called whenever the password should be changed. Account modules
|
* This function is called whenever the password should be changed. Account modules
|
||||||
* must change their password attributes only if the modules list contains their module name.
|
* must change their password attributes only if the modules list contains their module name.
|
||||||
|
@ -1145,7 +1143,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
$this->attributes['AstAccountRealmedPassword'][0] = asteriskAccount::buildPasswordString($this->attributes, $this->moduleSettings, $password);
|
$this->attributes['AstAccountRealmedPassword'][0] = asteriskAccount::buildPasswordString($this->attributes, $this->moduleSettings, $password);
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the password string for the password attribute.
|
* Builds the password string for the password attribute.
|
||||||
*
|
*
|
||||||
|
@ -1162,7 +1160,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
return asteriskAccount::hashPassword($attributes['AstAccountCallerID'][0] . ":" . $astRealm . ":" . $password);
|
return asteriskAccount::hashPassword($attributes['AstAccountCallerID'][0] . ":" . $astRealm . ":" . $password);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hashes a password value to Asterisk format.
|
* Hashes a password value to Asterisk format.
|
||||||
*
|
*
|
||||||
|
@ -1181,7 +1179,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
* <br>del: array of attributes to remove
|
* <br>del: array of attributes to remove
|
||||||
* <br>mod: array of attributes to modify
|
* <br>mod: array of attributes to modify
|
||||||
* <br>info: array of values with informational value (e.g. to be used later by pre/postModify actions)
|
* <br>info: array of values with informational value (e.g. to be used later by pre/postModify actions)
|
||||||
*
|
*
|
||||||
* Calling this method does not require the existence of an enclosing {@link accountContainer}.
|
* Calling this method does not require the existence of an enclosing {@link accountContainer}.
|
||||||
*
|
*
|
||||||
* @param string $fields input fields
|
* @param string $fields input fields
|
||||||
|
@ -1216,7 +1214,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of configuration options.
|
* Returns a list of configuration options.
|
||||||
*
|
*
|
||||||
* Calling this method does not require the existence of an enclosing {@link accountContainer}.<br>
|
* Calling this method does not require the existence of an enclosing {@link accountContainer}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* The field names are used as keywords to load and save settings.
|
* The field names are used as keywords to load and save settings.
|
||||||
|
@ -1225,7 +1223,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
* @param array $scopes account types (user, group, host)
|
* @param array $scopes account types (user, group, host)
|
||||||
* @param array $allScopes list of all active account modules and their scopes (module => array(scopes))
|
* @param array $allScopes list of all active account modules and their scopes (module => array(scopes))
|
||||||
* @return mixed htmlElement or array of htmlElement
|
* @return mixed htmlElement or array of htmlElement
|
||||||
*
|
*
|
||||||
* @see htmlElement
|
* @see htmlElement
|
||||||
*/
|
*/
|
||||||
public function get_configOptions($scopes, $allScopes) {
|
public function get_configOptions($scopes, $allScopes) {
|
||||||
|
@ -1303,7 +1301,7 @@ class asteriskAccount extends baseModule implements passwordService {
|
||||||
$return[] = $configContainer;
|
$return[] = $configContainer;
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
|
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
|
||||||
Copyright (C) 2009 - 2012 Pavel Pozdniak
|
Copyright (C) 2009 - 2012 Pavel Pozdniak
|
||||||
2009 - 2015 Roland Gruber
|
2009 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -795,10 +797,8 @@ class asteriskExtension extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$a = $this->attributes;
|
$a = $this->attributes;
|
||||||
|
|
|
@ -362,10 +362,8 @@ class asteriskVoicemail extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -221,10 +221,8 @@ class authorizedServiceObject extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -38,14 +38,14 @@ $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ddns extends baseModule {
|
class ddns extends baseModule {
|
||||||
|
|
||||||
/** standard DDNS settings */
|
/** standard DDNS settings */
|
||||||
public $ddns = array();
|
public $ddns = array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -141,7 +141,7 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function fills the message array.
|
* This function fills the message array.
|
||||||
*/
|
*/
|
||||||
|
@ -153,7 +153,7 @@ class ddns extends baseModule {
|
||||||
$this->messages['zone'][0] = array('ERROR', 'Please enter a zone name.');
|
$this->messages['zone'][0] = array('ERROR', 'Please enter a zone name.');
|
||||||
$this->messages['zone_reverse'][0] = array('ERROR', 'Please enter the reverse zone.');
|
$this->messages['zone_reverse'][0] = array('ERROR', 'Please enter the reverse zone.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions returns true if all needed settings are done.
|
* This functions returns true if all needed settings are done.
|
||||||
*
|
*
|
||||||
|
@ -175,16 +175,16 @@ class ddns extends baseModule {
|
||||||
// Account settings
|
// Account settings
|
||||||
$ip = $this->getDNSServer();
|
$ip = $this->getDNSServer();
|
||||||
if (!empty($ip) && !check_ip($ip)) return false;
|
if (!empty($ip) && !check_ip($ip)) return false;
|
||||||
|
|
||||||
$zones = $this->getZoneNames();
|
$zones = $this->getZoneNames();
|
||||||
if (sizeof($zones) < 2) {
|
if (sizeof($zones) < 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of modifications which have to be made to the LDAP account.
|
* Returns a list of modifications which have to be made to the LDAP account.
|
||||||
*
|
*
|
||||||
|
@ -200,7 +200,7 @@ class ddns extends baseModule {
|
||||||
public function save_attributes() {
|
public function save_attributes() {
|
||||||
// done by dhcp_server object
|
// done by dhcp_server object
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function check if ddns is enable.
|
* This function check if ddns is enable.
|
||||||
*/
|
*/
|
||||||
|
@ -210,7 +210,7 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
$ldap = $_SESSION['ldap']->server();
|
$ldap = $_SESSION['ldap']->server();
|
||||||
$dn = $_SESSION['config']->get_suffix('dhcp');
|
$dn = $_SESSION['config']->get_suffix('dhcp');
|
||||||
|
|
||||||
$search = @ldap_read($ldap,$dn,"dhcpStatements=ddns-update-style interim", array('dn'), 0, 0, 0, LDAP_DEREF_NEVER);
|
$search = @ldap_read($ldap,$dn,"dhcpStatements=ddns-update-style interim", array('dn'), 0, 0, 0, LDAP_DEREF_NEVER);
|
||||||
if ($search) {
|
if ($search) {
|
||||||
$info = @ldap_get_entries($ldap,$search);
|
$info = @ldap_get_entries($ldap,$search);
|
||||||
|
@ -226,7 +226,7 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes user input of the primary module page.
|
* Processes user input of the primary module page.
|
||||||
* It checks if all input values are correct and updates the associated LDAP attributes.
|
* It checks if all input values are correct and updates the associated LDAP attributes.
|
||||||
|
@ -235,7 +235,7 @@ class ddns extends baseModule {
|
||||||
*/
|
*/
|
||||||
public function process_attributes() {
|
public function process_attributes() {
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
// Main Settings and Account have to different processes.
|
// Main Settings and Account have to different processes.
|
||||||
if ($this->getAccountContainer()->dn_orig==$_SESSION['config']->get_suffix('dhcp')) {
|
if ($this->getAccountContainer()->dn_orig==$_SESSION['config']->get_suffix('dhcp')) {
|
||||||
// main settings:
|
// main settings:
|
||||||
|
@ -246,7 +246,7 @@ class ddns extends baseModule {
|
||||||
if (!$this->check_if_ddns_is_enable()) {
|
if (!$this->check_if_ddns_is_enable()) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$errors = $this->process_attributes_account();
|
$errors = $this->process_attributes_account();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,41 +261,41 @@ class ddns extends baseModule {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
// Is DDNS active?
|
// Is DDNS active?
|
||||||
$active = $_POST['active'];
|
$active = $_POST['active'];
|
||||||
|
|
||||||
// Insert fixed IPs into DNS?
|
// Insert fixed IPs into DNS?
|
||||||
$insert_fixed = $_POST['insert_fixed'];
|
$insert_fixed = $_POST['insert_fixed'];
|
||||||
|
|
||||||
// Client can contribute which is registered into DNS
|
// Client can contribute which is registered into DNS
|
||||||
$client_insert = $_POST['client_insert'];
|
$client_insert = $_POST['client_insert'];
|
||||||
|
|
||||||
// The path to the key:
|
// The path to the key:
|
||||||
$key_path = trim($_POST['key_path']);
|
$key_path = trim($_POST['key_path']);
|
||||||
|
|
||||||
$this->setDynDNSActivated(($active == 'on'));
|
$this->setDynDNSActivated(($active == 'on'));
|
||||||
|
|
||||||
$this->setFixIPs(($insert_fixed == 'on'));
|
$this->setFixIPs(($insert_fixed == 'on'));
|
||||||
|
|
||||||
$this->setIgnoreClientUpdates(($client_insert == 'on'));
|
$this->setIgnoreClientUpdates(($client_insert == 'on'));
|
||||||
|
|
||||||
$this->setUpdateKey($key_path);
|
$this->setUpdateKey($key_path);
|
||||||
if (!empty($key_path)) {
|
if (!empty($key_path)) {
|
||||||
if (str_replace("\"","",$_POST['key_path']) != $key_path) {
|
if (str_replace("\"","",$_POST['key_path']) != $key_path) {
|
||||||
$errors[] = $this->messages['key_path'][1];
|
$errors[] = $this->messages['key_path'][1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process for account
|
* Process for account
|
||||||
*/
|
*/
|
||||||
public function process_attributes_account() {
|
public function process_attributes_account() {
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
$ip = trim($_POST['ip']);
|
$ip = trim($_POST['ip']);
|
||||||
$zone = trim($_POST['zone']);
|
$zone = trim($_POST['zone']);
|
||||||
$zone_reverse = trim($_POST['zone_reverse']);
|
$zone_reverse = trim($_POST['zone_reverse']);
|
||||||
|
@ -306,7 +306,7 @@ class ddns extends baseModule {
|
||||||
$errors[] = $this->messages['ip'][0];
|
$errors[] = $this->messages['ip'][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 0; $i < sizeof($this->attributes['dhcpStatements']); $i++) {
|
for ($i = 0; $i < sizeof($this->attributes['dhcpStatements']); $i++) {
|
||||||
if (substr($this->attributes['dhcpStatements'][$i], 0, 5) == 'zone ') {
|
if (substr($this->attributes['dhcpStatements'][$i], 0, 5) == 'zone ') {
|
||||||
unset($this->attributes['dhcpStatements'][$i]);
|
unset($this->attributes['dhcpStatements'][$i]);
|
||||||
|
@ -314,7 +314,7 @@ class ddns extends baseModule {
|
||||||
$i--;
|
$i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zone inserted?
|
// Zone inserted?
|
||||||
if (!empty($zone)) {
|
if (!empty($zone)) {
|
||||||
if (!empty($ip)) {
|
if (!empty($ip)) {
|
||||||
|
@ -329,7 +329,7 @@ class ddns extends baseModule {
|
||||||
$errors[] = $this->messages['zone'][0];
|
$errors[] = $this->messages['zone'][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zone reverse inserted?
|
// Zone reverse inserted?
|
||||||
if (!empty($zone_reverse)) {
|
if (!empty($zone_reverse)) {
|
||||||
if (!empty($ip)) {
|
if (!empty($ip)) {
|
||||||
|
@ -346,10 +346,10 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
public function display_html_attributes() {
|
public function display_html_attributes() {
|
||||||
|
@ -372,7 +372,7 @@ class ddns extends baseModule {
|
||||||
$return->addElement($keyInput);
|
$return->addElement($keyInput);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Account edit
|
// Account edit
|
||||||
if (!$this->check_if_ddns_is_enable()) {
|
if (!$this->check_if_ddns_is_enable()) {
|
||||||
$return->addElement(new htmlOutputText(_("DDNS ist not activated. You can activate it in the DHCP settings (DDNS).")));
|
$return->addElement(new htmlOutputText(_("DDNS ist not activated. You can activate it in the DHCP settings (DDNS).")));
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ class ddns extends baseModule {
|
||||||
// DNS server
|
// DNS server
|
||||||
$serverInput = new htmlTableExtendedInputField(_('IP address of the DNS server'), 'ip', $this->getDNSServer(), 'dns');
|
$serverInput = new htmlTableExtendedInputField(_('IP address of the DNS server'), 'ip', $this->getDNSServer(), 'dns');
|
||||||
$return->addElement($serverInput, true);
|
$return->addElement($serverInput, true);
|
||||||
|
|
||||||
$zones = $this->getZoneNames();
|
$zones = $this->getZoneNames();
|
||||||
$zone = '';
|
$zone = '';
|
||||||
$revzone = '';
|
$revzone = '';
|
||||||
|
@ -398,15 +398,13 @@ class ddns extends baseModule {
|
||||||
$return->addElement($revZoneInput);
|
$return->addElement($revZoneInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
public function get_pdfEntries($pdfKeys) {
|
public function get_pdfEntries($pdfKeys) {
|
||||||
// attributes are taken from DHCP server object
|
// attributes are taken from DHCP server object
|
||||||
|
@ -427,7 +425,7 @@ class ddns extends baseModule {
|
||||||
$this->addPDFKeyValue($result, 'reverseZone', _('Reverse zone name'), $revzone);
|
$this->addPDFKeyValue($result, 'reverseZone', _('Reverse zone name'), $revzone);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IP of the DNS server.
|
* Returns the IP of the DNS server.
|
||||||
*
|
*
|
||||||
|
@ -450,7 +448,7 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the zone names.
|
* Returns the zone names.
|
||||||
*
|
*
|
||||||
|
@ -478,10 +476,10 @@ class ddns extends baseModule {
|
||||||
$return[1] = $revZone;
|
$return[1] = $revZone;
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if DDNS is activated.
|
* Returns if DDNS is activated.
|
||||||
*
|
*
|
||||||
* @return boolean activated
|
* @return boolean activated
|
||||||
*/
|
*/
|
||||||
private function isDynDNSActivated() {
|
private function isDynDNSActivated() {
|
||||||
|
@ -496,10 +494,10 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if DDNS is activated.
|
* Sets if DDNS is activated.
|
||||||
*
|
*
|
||||||
* @param boolean $activated activated
|
* @param boolean $activated activated
|
||||||
*/
|
*/
|
||||||
private function setDynDNSActivated($activated) {
|
private function setDynDNSActivated($activated) {
|
||||||
|
@ -518,10 +516,10 @@ class ddns extends baseModule {
|
||||||
$this->attributes['dhcpStatements'][] = 'ddns-update-style none';
|
$this->attributes['dhcpStatements'][] = 'ddns-update-style none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if fixed IPs are added to DDNS.
|
* Returns if fixed IPs are added to DDNS.
|
||||||
*
|
*
|
||||||
* @return boolean add fixed IPs
|
* @return boolean add fixed IPs
|
||||||
*/
|
*/
|
||||||
private function addFixIPs() {
|
private function addFixIPs() {
|
||||||
|
@ -536,10 +534,10 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if client updates are ignored.
|
* Sets if client updates are ignored.
|
||||||
*
|
*
|
||||||
* @param boolean $add add fixed IPs
|
* @param boolean $add add fixed IPs
|
||||||
*/
|
*/
|
||||||
private function setFixIPs($add) {
|
private function setFixIPs($add) {
|
||||||
|
@ -555,10 +553,10 @@ class ddns extends baseModule {
|
||||||
$this->attributes['dhcpStatements'][] = 'update-static-leases true';
|
$this->attributes['dhcpStatements'][] = 'update-static-leases true';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if client updates are ignored.
|
* Returns if client updates are ignored.
|
||||||
*
|
*
|
||||||
* @return boolean ignore client updates
|
* @return boolean ignore client updates
|
||||||
*/
|
*/
|
||||||
private function isIgnoreClientUpdates() {
|
private function isIgnoreClientUpdates() {
|
||||||
|
@ -573,10 +571,10 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if client updates are ignored.
|
* Sets if client updates are ignored.
|
||||||
*
|
*
|
||||||
* @param boolean $ignore ignore client updates
|
* @param boolean $ignore ignore client updates
|
||||||
*/
|
*/
|
||||||
private function setIgnoreClientUpdates($ignore) {
|
private function setIgnoreClientUpdates($ignore) {
|
||||||
|
@ -595,10 +593,10 @@ class ddns extends baseModule {
|
||||||
$this->attributes['dhcpStatements'][] = 'ignore client-updates';
|
$this->attributes['dhcpStatements'][] = 'ignore client-updates';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the key for DNS updates.
|
* Returns the key for DNS updates.
|
||||||
*
|
*
|
||||||
* @return String key
|
* @return String key
|
||||||
*/
|
*/
|
||||||
private function getUpdateKey() {
|
private function getUpdateKey() {
|
||||||
|
@ -613,10 +611,10 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the key for DNS updates.
|
* Sets the key for DNS updates.
|
||||||
*
|
*
|
||||||
* @param String $key key
|
* @param String $key key
|
||||||
*/
|
*/
|
||||||
private function setUpdateKey($key) {
|
private function setUpdateKey($key) {
|
||||||
|
@ -636,7 +634,7 @@ class ddns extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function loads the LDAP attributes when an account should be loaded.
|
* This function loads the LDAP attributes when an account should be loaded.
|
||||||
*
|
*
|
||||||
* Calling this method requires the existence of an enclosing {@link accountContainer}.<br>
|
* Calling this method requires the existence of an enclosing {@link accountContainer}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* By default this method loads the object classes and accounts which are specified in {@link getManagedObjectClasses()}
|
* By default this method loads the object classes and accounts which are specified in {@link getManagedObjectClasses()}
|
||||||
|
@ -647,7 +645,7 @@ class ddns extends baseModule {
|
||||||
public function load_attributes($attributes) {
|
public function load_attributes($attributes) {
|
||||||
// load nothing, attributes are saved in "dhcp_settings" module
|
// load nothing, attributes are saved in "dhcp_settings" module
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this function the LDAP account is built up.
|
* In this function the LDAP account is built up.
|
||||||
*
|
*
|
||||||
|
@ -676,7 +674,7 @@ class ddns extends baseModule {
|
||||||
}
|
}
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -39,10 +39,10 @@ $Id$
|
||||||
* @return boolean true or false
|
* @return boolean true or false
|
||||||
**/
|
**/
|
||||||
if (!function_exists('check_ip')) {
|
if (!function_exists('check_ip')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given IP is valid.
|
* Checks if the given IP is valid.
|
||||||
*
|
*
|
||||||
* @param String $ip IP address
|
* @param String $ip IP address
|
||||||
* @param boolean $subnet IP must be a subnet
|
* @param boolean $subnet IP must be a subnet
|
||||||
*/
|
*/
|
||||||
|
@ -89,7 +89,7 @@ class dhcp_settings extends baseModule {
|
||||||
private $allowDenyOptions;
|
private $allowDenyOptions;
|
||||||
/** LDAP attributes */
|
/** LDAP attributes */
|
||||||
public $attributes;
|
public $attributes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new dhcp_settings object.
|
* Creates a new dhcp_settings object.
|
||||||
*
|
*
|
||||||
|
@ -114,7 +114,7 @@ class dhcp_settings extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -315,7 +315,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
);
|
);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function fills the message array.
|
* This function fills the message array.
|
||||||
*/
|
*/
|
||||||
|
@ -343,7 +343,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$this->messages['domainname'][2] = array('ERROR', _('The domain name includes invalid characters. Valid characters are A-Z, a-z, 0-9, ".", "_","-".'));
|
$this->messages['domainname'][2] = array('ERROR', _('The domain name includes invalid characters. Valid characters are A-Z, a-z, 0-9, ".", "_","-".'));
|
||||||
$this->messages['domainname'][5] = array('ERROR', _('Account %s:') . ' dhcp_settings_domainName', _('The domain name includes invalid characters. Valid characters are A-Z, a-z, 0-9, ".", "_","-".'));
|
$this->messages['domainname'][5] = array('ERROR', _('Account %s:') . ' dhcp_settings_domainName', _('The domain name includes invalid characters. Valid characters are A-Z, a-z, 0-9, ".", "_","-".'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of modifications which have to be made to the LDAP account.
|
* Returns a list of modifications which have to be made to the LDAP account.
|
||||||
*
|
*
|
||||||
|
@ -366,7 +366,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$return = parent::save_attributes();
|
$return = parent::save_attributes();
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes user input of the primary module page.
|
* Processes user input of the primary module page.
|
||||||
* It checks if all input values are correct and updates the associated LDAP attributes.
|
* It checks if all input values are correct and updates the associated LDAP attributes.
|
||||||
|
@ -406,7 +406,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
$this->setUnknownClients($_POST['unknownClients']);
|
$this->setUnknownClients($_POST['unknownClients']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check domainname:
|
// Check domainname:
|
||||||
if (!empty($_POST['domainname'])) $_POST['domainname'] = trim($_POST['domainname']);
|
if (!empty($_POST['domainname'])) $_POST['domainname'] = trim($_POST['domainname']);
|
||||||
if (!empty($_POST['domainname'])) {
|
if (!empty($_POST['domainname'])) {
|
||||||
|
@ -441,7 +441,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->setDHCPOption('domain-name-servers', $_POST['dns']);
|
$this->setDHCPOption('domain-name-servers', $_POST['dns']);
|
||||||
|
|
||||||
// Lease Time
|
// Lease Time
|
||||||
if (!empty($_POST['lease_time'])) {
|
if (!empty($_POST['lease_time'])) {
|
||||||
$_POST['lease_time'] = trim($_POST['lease_time']);
|
$_POST['lease_time'] = trim($_POST['lease_time']);
|
||||||
|
@ -450,7 +450,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
if (!is_numeric($_POST['lease_time']) && !empty($_POST['lease_time'])) {
|
if (!is_numeric($_POST['lease_time']) && !empty($_POST['lease_time'])) {
|
||||||
$errors[] = $this->messages['lease_time'][0];
|
$errors[] = $this->messages['lease_time'][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Max lease Time
|
// Max lease Time
|
||||||
if (!empty($_POST['max_lease_time'])) {
|
if (!empty($_POST['max_lease_time'])) {
|
||||||
$_POST['max_lease_time'] = trim($_POST['max_lease_time']);
|
$_POST['max_lease_time'] = trim($_POST['max_lease_time']);
|
||||||
|
@ -459,7 +459,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
if (!is_numeric($_POST['max_lease_time']) && !empty($_POST['max_lease_time'])) {
|
if (!is_numeric($_POST['max_lease_time']) && !empty($_POST['max_lease_time'])) {
|
||||||
$errors[] = $this->messages['max_lease_time'][0];
|
$errors[] = $this->messages['max_lease_time'][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default Gateway
|
// Default Gateway
|
||||||
if (!empty($_POST['routers'])) {
|
if (!empty($_POST['routers'])) {
|
||||||
$_POST['routers'] = trim($_POST['routers']);
|
$_POST['routers'] = trim($_POST['routers']);
|
||||||
|
@ -468,7 +468,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->setDHCPOption('routers', $_POST['routers']);
|
$this->setDHCPOption('routers', $_POST['routers']);
|
||||||
|
|
||||||
// Netbios
|
// Netbios
|
||||||
if (!empty($_POST['netbios'])) $_POST['netbios'] = trim($_POST['netbios']);
|
if (!empty($_POST['netbios'])) $_POST['netbios'] = trim($_POST['netbios']);
|
||||||
$netbiosServers = explode(', ', $_POST['netbios']);
|
$netbiosServers = explode(', ', $_POST['netbios']);
|
||||||
|
@ -483,9 +483,9 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$errors[] = $this->messages['netbios'][0];
|
$errors[] = $this->messages['netbios'][0];
|
||||||
}
|
}
|
||||||
$this->setDHCPOption('netbios-name-servers', $_POST['netbios']);
|
$this->setDHCPOption('netbios-name-servers', $_POST['netbios']);
|
||||||
|
|
||||||
$this->setDHCPOption('netbios-node-type', $_POST['netbios_node_type']);
|
$this->setDHCPOption('netbios-node-type', $_POST['netbios_node_type']);
|
||||||
|
|
||||||
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
|
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
|
||||||
// Check subnet
|
// Check subnet
|
||||||
$_POST['subnet'] = trim($_POST['subnet']);
|
$_POST['subnet'] = trim($_POST['subnet']);
|
||||||
|
@ -500,10 +500,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->attributes['dhcpComments'][0] = $_POST['description'];
|
$this->attributes['dhcpComments'][0] = $_POST['description'];
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the subnet mask is valid.
|
* Checks if the subnet mask is valid.
|
||||||
*
|
*
|
||||||
|
@ -523,7 +523,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
return preg_match('/^1*0*$/', $bits);
|
return preg_match('/^1*0*$/', $bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the net mask from the subnet.
|
* Calculates the net mask from the subnet.
|
||||||
*
|
*
|
||||||
|
@ -539,10 +539,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
return $num;
|
return $num;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
public function display_html_attributes() {
|
public function display_html_attributes() {
|
||||||
|
@ -593,7 +593,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$nodeSelect = new htmlTableExtendedSelect('netbios_node_type', $nodeOptions, array($nodeType), _('Netbios node type'), 'netbios_type');
|
$nodeSelect = new htmlTableExtendedSelect('netbios_node_type', $nodeOptions, array($nodeType), _('Netbios node type'), 'netbios_type');
|
||||||
$nodeSelect->setHasDescriptiveElements(true);
|
$nodeSelect->setHasDescriptiveElements(true);
|
||||||
$return->addElement($nodeSelect, true);
|
$return->addElement($nodeSelect, true);
|
||||||
|
|
||||||
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
|
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
|
||||||
// unknown clients
|
// unknown clients
|
||||||
$unknownClients = $this->getUnknownClients();
|
$unknownClients = $this->getUnknownClients();
|
||||||
|
@ -622,7 +622,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$return->addElement(new htmlTableExtendedInputField(_('Description'), 'description', $description, 'description'), true);
|
$return->addElement(new htmlTableExtendedInputField(_('Description'), 'description', $description, 'description'), true);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the values of an account profile into internal variables.
|
* Loads the values of an account profile into internal variables.
|
||||||
*
|
*
|
||||||
|
@ -632,16 +632,16 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
// profile mappings in meta data
|
// profile mappings in meta data
|
||||||
parent::load_profile($profile);
|
parent::load_profile($profile);
|
||||||
$this->attributes['cn'][0] = $profile['cn'][0];
|
$this->attributes['cn'][0] = $profile['cn'][0];
|
||||||
|
|
||||||
$this->setDefaultLeaseTime($profile['lease_time'][0]);
|
$this->setDefaultLeaseTime($profile['lease_time'][0]);
|
||||||
$this->setMaxLeaseTime($profile['max_lease_time'][0]);
|
$this->setMaxLeaseTime($profile['max_lease_time'][0]);
|
||||||
|
|
||||||
$this->setDHCPOption('domain-name', $profile['domainname'][0]);
|
$this->setDHCPOption('domain-name', $profile['domainname'][0]);
|
||||||
$this->setDHCPOption('domain-name-servers', $profile['dns'][0]);
|
$this->setDHCPOption('domain-name-servers', $profile['dns'][0]);
|
||||||
$this->setDHCPOption('routers', $profile['routers'][0]);
|
$this->setDHCPOption('routers', $profile['routers'][0]);
|
||||||
$this->setDHCPOption('netbios-name-servers', $profile['netbios'][0]);
|
$this->setDHCPOption('netbios-name-servers', $profile['netbios'][0]);
|
||||||
$this->setDHCPOption('netbios-node-type', $profile['netbios_node_type'][0]);
|
$this->setDHCPOption('netbios-node-type', $profile['netbios_node_type'][0]);
|
||||||
|
|
||||||
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
|
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
|
||||||
$this->setDHCPOption('subnet-mask', $profile['subnet'][0]);
|
$this->setDHCPOption('subnet-mask', $profile['subnet'][0]);
|
||||||
|
|
||||||
|
@ -655,12 +655,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$this->attributes['dhcpNetMask'][0] = $num;
|
$this->attributes['dhcpNetMask'][0] = $num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$nodeType = $this->getDHCPOption('netbios-node-type');
|
$nodeType = $this->getDHCPOption('netbios-node-type');
|
||||||
|
@ -688,10 +686,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$this->addSimplePDFField($return, 'netMask', _('Net mask'), 'dhcpNetMask');
|
$this->addSimplePDFField($return, 'netMask', _('Net mask'), 'dhcpNetMask');
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a DHCP option.
|
* Returns a DHCP option.
|
||||||
*
|
*
|
||||||
* @param String $name option name
|
* @param String $name option name
|
||||||
* @return String value
|
* @return String value
|
||||||
*/
|
*/
|
||||||
|
@ -709,10 +707,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a DHCP option.
|
* Sets a DHCP option.
|
||||||
*
|
*
|
||||||
* @param String $name option name
|
* @param String $name option name
|
||||||
* @param String $value option value
|
* @param String $value option value
|
||||||
*/
|
*/
|
||||||
|
@ -733,7 +731,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default lease time.
|
* Returns the default lease time.
|
||||||
*
|
*
|
||||||
* @return String time
|
* @return String time
|
||||||
*/
|
*/
|
||||||
private function getDefaultLeaseTime() {
|
private function getDefaultLeaseTime() {
|
||||||
|
@ -748,10 +746,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the default lease time.
|
* Sets the default lease time.
|
||||||
*
|
*
|
||||||
* @param String $time time
|
* @param String $time time
|
||||||
*/
|
*/
|
||||||
private function setDefaultLeaseTime($time) {
|
private function setDefaultLeaseTime($time) {
|
||||||
|
@ -771,7 +769,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the unknown clients option.
|
* Returns the unknown clients option.
|
||||||
*
|
*
|
||||||
* @return String unknown clients value
|
* @return String unknown clients value
|
||||||
*/
|
*/
|
||||||
private function getUnknownClients() {
|
private function getUnknownClients() {
|
||||||
|
@ -787,10 +785,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the unknown clients option.
|
* Sets the unknown clients option.
|
||||||
*
|
*
|
||||||
* @param String $option allow/deny
|
* @param String $option allow/deny
|
||||||
*/
|
*/
|
||||||
private function setUnknownClients($option) {
|
private function setUnknownClients($option) {
|
||||||
|
@ -811,7 +809,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the maximum lease time.
|
* Returns the maximum lease time.
|
||||||
*
|
*
|
||||||
* @return String time
|
* @return String time
|
||||||
*/
|
*/
|
||||||
private function getMaxLeaseTime() {
|
private function getMaxLeaseTime() {
|
||||||
|
@ -826,10 +824,10 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the maximum lease time.
|
* Sets the maximum lease time.
|
||||||
*
|
*
|
||||||
* @param String $time time
|
* @param String $time time
|
||||||
*/
|
*/
|
||||||
private function setMaxLeaseTime($time) {
|
private function setMaxLeaseTime($time) {
|
||||||
|
@ -846,7 +844,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$this->attributes['dhcpStatements'][] = 'max-lease-time ' . $time;
|
$this->attributes['dhcpStatements'][] = 'max-lease-time ' . $time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this function the LDAP account is built up.
|
* In this function the LDAP account is built up.
|
||||||
*
|
*
|
||||||
|
|
|
@ -548,10 +548,8 @@ class eduPerson extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2008 Thomas Manninger
|
Copyright (C) 2008 Thomas Manninger
|
||||||
2008 - 2015 Roland Gruber
|
2008 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -728,10 +731,8 @@ class fixed_ip extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -685,10 +685,8 @@ class freeRadius extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -195,10 +195,8 @@ class hostObject extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -155,10 +155,8 @@ class ieee802device extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -344,10 +344,8 @@ class inetLocalMailRecipient extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1970,10 +1970,8 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -390,10 +390,8 @@ class kolabGroup extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -510,10 +510,8 @@ class kolabSharedFolder extends baseModule { // TODO folder type
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2004 - 2015 Roland Gruber
|
Copyright (C) 2004 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -696,10 +699,8 @@ class kolabUser extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2005 - 2015 Roland Gruber
|
Copyright (C) 2005 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -279,10 +282,8 @@ class ldapPublicKey extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -465,10 +465,8 @@ class nisMailAlias extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -521,10 +521,8 @@ class nisMailAliasUser extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2016 Roland Gruber
|
Copyright (C) 2016 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -249,10 +252,8 @@ class nisNetGroupHost extends nisNetGroupUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2015 - 2016 Roland Gruber
|
Copyright (C) 2015 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -467,10 +470,8 @@ class nisNetGroupUser extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2009 - 2015 Roland Gruber
|
Copyright (C) 2009 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -569,10 +572,8 @@ class nisnetgroup extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1826,10 +1826,8 @@ class posixAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$uidLabel = _('User name');
|
$uidLabel = _('User name');
|
||||||
|
|
|
@ -613,10 +613,8 @@ class posixGroup extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is not yet part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is not yet part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2012 - 2016 Roland Gruber
|
Copyright (C) 2012 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -395,10 +398,8 @@ class puppetClient extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -33,13 +33,13 @@ $Id$
|
||||||
* @package modules
|
* @package modules
|
||||||
*/
|
*/
|
||||||
class pykotaBillingCode extends baseModule {
|
class pykotaBillingCode extends baseModule {
|
||||||
|
|
||||||
/** cache for existing codes (array(dn1 => pykotaBillingCode1, dn2 => pykotaBillingCode2)) */
|
/** cache for existing codes (array(dn1 => pykotaBillingCode1, dn2 => pykotaBillingCode2)) */
|
||||||
private $codeCache = null;
|
private $codeCache = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -50,7 +50,7 @@ class pykotaBillingCode extends baseModule {
|
||||||
* Returns meta data that is interpreted by parent class
|
* Returns meta data that is interpreted by parent class
|
||||||
*
|
*
|
||||||
* @return array array with meta data
|
* @return array array with meta data
|
||||||
*
|
*
|
||||||
* @see baseModule::get_metaData()
|
* @see baseModule::get_metaData()
|
||||||
*/
|
*/
|
||||||
function get_metaData() {
|
function get_metaData() {
|
||||||
|
@ -132,7 +132,7 @@ class pykotaBillingCode extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_attributes() {
|
function display_html_attributes() {
|
||||||
|
@ -206,7 +206,7 @@ class pykotaBillingCode extends baseModule {
|
||||||
}
|
}
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this function the LDAP account is built up.
|
* In this function the LDAP account is built up.
|
||||||
*
|
*
|
||||||
|
@ -251,12 +251,10 @@ class pykotaBillingCode extends baseModule {
|
||||||
}
|
}
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -267,10 +265,10 @@ class pykotaBillingCode extends baseModule {
|
||||||
$this->addSimplePDFField($return, 'pykotaPageCounter', _('Page count'));
|
$this->addSimplePDFField($return, 'pykotaPageCounter', _('Page count'));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the given billing code already exists.
|
* Returns if the given billing code already exists.
|
||||||
*
|
*
|
||||||
* @param String $code pykotaBillingCode attribute value
|
* @param String $code pykotaBillingCode attribute value
|
||||||
* @return boolean pykotaBillingCode exists
|
* @return boolean pykotaBillingCode exists
|
||||||
*/
|
*/
|
||||||
|
@ -301,7 +299,7 @@ class pykotaBillingCode extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,18 +33,18 @@ $Id$
|
||||||
* @package modules
|
* @package modules
|
||||||
*/
|
*/
|
||||||
class pykotaGroup extends baseModule {
|
class pykotaGroup extends baseModule {
|
||||||
|
|
||||||
/** cache for cn attribute */
|
/** cache for cn attribute */
|
||||||
private $cnCache = null;
|
private $cnCache = null;
|
||||||
/** cache for pykotaGroupName attribute */
|
/** cache for pykotaGroupName attribute */
|
||||||
private $pykotaGroupNameCache = null;
|
private $pykotaGroupNameCache = null;
|
||||||
/** list of limit options label => value */
|
/** list of limit options label => value */
|
||||||
private $limitOptions;
|
private $limitOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if this module also manages the structural object class pykotaObject.
|
* Returns if this module also manages the structural object class pykotaObject.
|
||||||
* This is overridden by a submodule that must provide the structural object class.
|
* This is overridden by a submodule that must provide the structural object class.
|
||||||
*
|
*
|
||||||
* @return boolean structural usage
|
* @return boolean structural usage
|
||||||
*/
|
*/
|
||||||
public function isStructural() {
|
public function isStructural() {
|
||||||
|
@ -71,7 +71,7 @@ class pykotaGroup extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -82,7 +82,7 @@ class pykotaGroup extends baseModule {
|
||||||
* Returns meta data that is interpreted by parent class
|
* Returns meta data that is interpreted by parent class
|
||||||
*
|
*
|
||||||
* @return array array with meta data
|
* @return array array with meta data
|
||||||
*
|
*
|
||||||
* @see baseModule::get_metaData()
|
* @see baseModule::get_metaData()
|
||||||
*/
|
*/
|
||||||
function get_metaData() {
|
function get_metaData() {
|
||||||
|
@ -207,7 +207,7 @@ class pykotaGroup extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_attributes() {
|
function display_html_attributes() {
|
||||||
|
@ -352,7 +352,7 @@ class pykotaGroup extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used to check if all settings for this module have been made.
|
* This function is used to check if all settings for this module have been made.
|
||||||
*
|
*
|
||||||
* Calling this method requires the existence of an enclosing {@link accountContainer}.<br>
|
* Calling this method requires the existence of an enclosing {@link accountContainer}.<br>
|
||||||
* <br>
|
* <br>
|
||||||
* This function tells LAM if it can create/modify the LDAP account. If your module needs any
|
* This function tells LAM if it can create/modify the LDAP account. If your module needs any
|
||||||
|
@ -386,7 +386,7 @@ class pykotaGroup extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In this function the LDAP account is built up.
|
* In this function the LDAP account is built up.
|
||||||
*
|
*
|
||||||
|
@ -457,12 +457,10 @@ class pykotaGroup extends baseModule {
|
||||||
}
|
}
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -477,10 +475,10 @@ class pykotaGroup extends baseModule {
|
||||||
$this->addPDFKeyValue($return, 'pykotaLimitBy', _('Limit type'), $limitByValue);
|
$this->addPDFKeyValue($return, 'pykotaLimitBy', _('Limit type'), $limitByValue);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the cn attribute should be managed.
|
* Returns if the cn attribute should be managed.
|
||||||
*
|
*
|
||||||
* @return boolean manage cn attribute
|
* @return boolean manage cn attribute
|
||||||
*/
|
*/
|
||||||
private function manageCn() {
|
private function manageCn() {
|
||||||
|
@ -500,7 +498,7 @@ class pykotaGroup extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the description attribute should be managed.
|
* Returns if the description attribute should be managed.
|
||||||
*
|
*
|
||||||
* @return boolean manage description attribute
|
* @return boolean manage description attribute
|
||||||
*/
|
*/
|
||||||
private function manageDescription() {
|
private function manageDescription() {
|
||||||
|
@ -517,10 +515,10 @@ class pykotaGroup extends baseModule {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the given cn already exists.
|
* Returns if the given cn already exists.
|
||||||
*
|
*
|
||||||
* @param String $cn cn attribute value
|
* @param String $cn cn attribute value
|
||||||
* @return boolean cn exists
|
* @return boolean cn exists
|
||||||
*/
|
*/
|
||||||
|
@ -533,7 +531,7 @@ class pykotaGroup extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the given pykotaGroupName already exists.
|
* Returns if the given pykotaGroupName already exists.
|
||||||
*
|
*
|
||||||
* @param String $pykotaGroupName pykotaGroupName attribute value
|
* @param String $pykotaGroupName pykotaGroupName attribute value
|
||||||
* @return boolean pykotaGroupName exists
|
* @return boolean pykotaGroupName exists
|
||||||
*/
|
*/
|
||||||
|
@ -543,7 +541,7 @@ class pykotaGroup extends baseModule {
|
||||||
}
|
}
|
||||||
return in_array($pykotaGroupName, $this->pykotaGroupNameCache);
|
return in_array($pykotaGroupName, $this->pykotaGroupNameCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the list of group names into the cache.
|
* Loads the list of group names into the cache.
|
||||||
*/
|
*/
|
||||||
|
@ -560,10 +558,10 @@ class pykotaGroup extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current group name (cn) of this account.
|
* Returns the current group name (cn) of this account.
|
||||||
*
|
*
|
||||||
* @return String group name
|
* @return String group name
|
||||||
*/
|
*/
|
||||||
private function getCurrentGroupName() {
|
private function getCurrentGroupName() {
|
||||||
|
|
|
@ -33,14 +33,14 @@ $Id$
|
||||||
* @package modules
|
* @package modules
|
||||||
*/
|
*/
|
||||||
class pykotaPrinter extends baseModule {
|
class pykotaPrinter extends baseModule {
|
||||||
|
|
||||||
/** cache for existing printers (array(dn => array(cn => ..., description => ...))) */
|
/** cache for existing printers (array(dn => array(cn => ..., description => ...))) */
|
||||||
private $printerCache = null;
|
private $printerCache = null;
|
||||||
/** printer group cache */
|
/** printer group cache */
|
||||||
private $groupCache = null;
|
private $groupCache = null;
|
||||||
/** list of pass through options: label => value */
|
/** list of pass through options: label => value */
|
||||||
private $passThroughOptions;
|
private $passThroughOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new pykotaPrinter object.
|
* Creates a new pykotaPrinter object.
|
||||||
*
|
*
|
||||||
|
@ -57,7 +57,7 @@ class pykotaPrinter extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -68,7 +68,7 @@ class pykotaPrinter extends baseModule {
|
||||||
* Returns meta data that is interpreted by parent class
|
* Returns meta data that is interpreted by parent class
|
||||||
*
|
*
|
||||||
* @return array array with meta data
|
* @return array array with meta data
|
||||||
*
|
*
|
||||||
* @see baseModule::get_metaData()
|
* @see baseModule::get_metaData()
|
||||||
*/
|
*/
|
||||||
function get_metaData() {
|
function get_metaData() {
|
||||||
|
@ -222,7 +222,7 @@ class pykotaPrinter extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_attributes() {
|
function display_html_attributes() {
|
||||||
|
@ -376,10 +376,10 @@ class pykotaPrinter extends baseModule {
|
||||||
}
|
}
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function will create the meta HTML code to show a page to add members.
|
* This function will create the meta HTML code to show a page to add members.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_members() {
|
function display_html_members() {
|
||||||
|
@ -432,7 +432,7 @@ class pykotaPrinter extends baseModule {
|
||||||
$return->addElement($buttonTable);
|
$return->addElement($buttonTable);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes user input of the members page.
|
* Processes user input of the members page.
|
||||||
* It checks if all input values are correct and updates the associated LDAP attributes.
|
* It checks if all input values are correct and updates the associated LDAP attributes.
|
||||||
|
@ -574,12 +574,10 @@ class pykotaPrinter extends baseModule {
|
||||||
}
|
}
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -625,10 +623,10 @@ class pykotaPrinter extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the given cn already exists.
|
* Returns if the given cn already exists.
|
||||||
*
|
*
|
||||||
* @param String $cn cn attribute value
|
* @param String $cn cn attribute value
|
||||||
* @return boolean cn exists
|
* @return boolean cn exists
|
||||||
*/
|
*/
|
||||||
|
@ -662,10 +660,10 @@ class pykotaPrinter extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the printer group memberships.
|
* Returns the printer group memberships.
|
||||||
*
|
*
|
||||||
* @return array DNs of parent groups
|
* @return array DNs of parent groups
|
||||||
*/
|
*/
|
||||||
private function getPrinterGroups() {
|
private function getPrinterGroups() {
|
||||||
|
@ -679,7 +677,7 @@ class pykotaPrinter extends baseModule {
|
||||||
}
|
}
|
||||||
return $this->groupCache;
|
return $this->groupCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2013 - 2015 Roland Gruber
|
Copyright (C) 2013 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -881,10 +884,8 @@ class pykotaUser extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2006 Tilo Lutz
|
Copyright (C) 2003 - 2006 Tilo Lutz
|
||||||
2007 - 2015 Roland Gruber
|
2007 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -608,10 +611,8 @@ class quota extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$this->initQuotas();
|
$this->initQuotas();
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2008 Thomas Manninger
|
Copyright (C) 2008 Thomas Manninger
|
||||||
2008 - 2015 Roland Gruber
|
2008 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -761,10 +764,8 @@ class range extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -36,7 +36,7 @@ class sambaDomain extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -47,7 +47,7 @@ class sambaDomain extends baseModule {
|
||||||
* Returns meta data that is interpreted by parent class
|
* Returns meta data that is interpreted by parent class
|
||||||
*
|
*
|
||||||
* @return array array with meta data
|
* @return array array with meta data
|
||||||
*
|
*
|
||||||
* @see baseModule::get_metaData()
|
* @see baseModule::get_metaData()
|
||||||
*/
|
*/
|
||||||
function get_metaData() {
|
function get_metaData() {
|
||||||
|
@ -227,7 +227,7 @@ class sambaDomain extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_attributes() {
|
function display_html_attributes() {
|
||||||
|
@ -590,10 +590,8 @@ class sambaDomain extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -610,7 +608,7 @@ class sambaDomain extends baseModule {
|
||||||
$this->addSimplePDFField($return, 'maxPwdAge', _('Maximum password age'), 'sambaMaxPwdAge');
|
$this->addSimplePDFField($return, 'maxPwdAge', _('Maximum password age'), 'sambaMaxPwdAge');
|
||||||
$this->addSimplePDFField($return, 'lockoutDuration', _('Lockout duration'), 'sambaLockoutDuration');
|
$this->addSimplePDFField($return, 'lockoutDuration', _('Lockout duration'), 'sambaLockoutDuration');
|
||||||
$this->addSimplePDFField($return, 'lockoutObservationWindow', _('Reset time after lockout'), 'sambaLockoutObservationWindow');
|
$this->addSimplePDFField($return, 'lockoutObservationWindow', _('Reset time after lockout'), 'sambaLockoutObservationWindow');
|
||||||
|
|
||||||
if (isset($this->attributes['sambaLogonToChgPwd'])) {
|
if (isset($this->attributes['sambaLogonToChgPwd'])) {
|
||||||
$logonToChgPwd = _('Off');
|
$logonToChgPwd = _('Off');
|
||||||
if ($this->attributes['sambaPwdHistoryLength'][0] == 2) $logonToChgPwd = _('On');
|
if ($this->attributes['sambaPwdHistoryLength'][0] == 2) $logonToChgPwd = _('On');
|
||||||
|
|
|
@ -529,10 +529,8 @@ class sambaGroupMapping extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1904,10 +1904,8 @@ class sambaSamAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -547,10 +547,8 @@ class shadowAccount extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
function get_pdfEntries($pdfKeys) {
|
function get_pdfEntries($pdfKeys) {
|
||||||
$timeZone = getTimeZone();
|
$timeZone = getTimeZone();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2011 - 2015 Roland Gruber
|
Copyright (C) 2011 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -373,10 +376,8 @@ class systemQuotas extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
public function get_pdfEntries($pdfKeys) {
|
public function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \LAM\PDF\PDFTable;
|
||||||
|
use \LAM\PDF\PDFTableCell;
|
||||||
|
use \LAM\PDF\PDFTableRow;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2013 - 2016 Roland Gruber
|
Copyright (C) 2013 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -901,10 +904,8 @@ class windowsGroup extends baseModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
public function get_pdfEntries($pdfKeys) {
|
public function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -33,10 +33,10 @@ $Id$
|
||||||
* @package modules
|
* @package modules
|
||||||
*/
|
*/
|
||||||
class windowsHost extends baseModule {
|
class windowsHost extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this module can manage accounts of the current type, otherwise false.
|
* Returns true if this module can manage accounts of the current type, otherwise false.
|
||||||
*
|
*
|
||||||
* @return boolean true if module fits
|
* @return boolean true if module fits
|
||||||
*/
|
*/
|
||||||
public function can_manage() {
|
public function can_manage() {
|
||||||
|
@ -47,7 +47,7 @@ class windowsHost extends baseModule {
|
||||||
* Returns meta data that is interpreted by parent class
|
* Returns meta data that is interpreted by parent class
|
||||||
*
|
*
|
||||||
* @return array array with meta data
|
* @return array array with meta data
|
||||||
*
|
*
|
||||||
* @see baseModule::get_metaData()
|
* @see baseModule::get_metaData()
|
||||||
*/
|
*/
|
||||||
public function get_metaData() {
|
public function get_metaData() {
|
||||||
|
@ -134,7 +134,7 @@ class windowsHost extends baseModule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML meta data for the main account page.
|
* Returns the HTML meta data for the main account page.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
public function display_html_attributes() {
|
public function display_html_attributes() {
|
||||||
|
@ -188,10 +188,10 @@ class windowsHost extends baseModule {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function will create the meta HTML code to show a page to change the member attribute.
|
* This function will create the meta HTML code to show a page to change the member attribute.
|
||||||
*
|
*
|
||||||
* @return htmlElement HTML meta data
|
* @return htmlElement HTML meta data
|
||||||
*/
|
*/
|
||||||
function display_html_managedBy() {
|
function display_html_managedBy() {
|
||||||
|
@ -227,7 +227,7 @@ class windowsHost extends baseModule {
|
||||||
$return->addElement($buttonTable);
|
$return->addElement($buttonTable);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes user input of the members page.
|
* Processes user input of the members page.
|
||||||
* It checks if all input values are correct and updates the associated LDAP attributes.
|
* It checks if all input values are correct and updates the associated LDAP attributes.
|
||||||
|
@ -279,12 +279,10 @@ class windowsHost extends baseModule {
|
||||||
}
|
}
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
public function get_pdfEntries($pdfKeys) {
|
public function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
|
@ -2415,10 +2415,8 @@ class windowsUser extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of possible PDF entries for this account.
|
* {@inheritDoc}
|
||||||
*
|
* @see baseModule::get_pdfEntries()
|
||||||
* @param array $pdfKeys list of PDF keys that are included in document
|
|
||||||
* @return list of PDF entries (array(<PDF key> => <PDF lines>))
|
|
||||||
*/
|
*/
|
||||||
public function get_pdfEntries($pdfKeys) {
|
public function get_pdfEntries($pdfKeys) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
|
388
lam/lib/pdf.inc
388
lam/lib/pdf.inc
|
@ -1,10 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace LAM\PDF;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2004 Michael Duergner
|
Copyright (C) 2003 - 2004 Michael Duergner
|
||||||
2003 - 2015 Roland Gruber
|
2003 - 2017 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -31,8 +32,16 @@ $Id$
|
||||||
* @package PDF
|
* @package PDF
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** PDF line width */
|
/** line width */
|
||||||
define('LAMPDF_LINEWIDTH',190);
|
define('LAMPDF_LINEWIDTH', 190);
|
||||||
|
/** line height */
|
||||||
|
define('LAMPDF_LINEHEIGHT', 5);
|
||||||
|
/** width of a label */
|
||||||
|
define('LAMPDF_LABELWIDTH', 50);
|
||||||
|
/** font size */
|
||||||
|
define('LAMPDF_FONT_SIZE', 7);
|
||||||
|
/** font size for bigger text */
|
||||||
|
define('LAMPDF_FONT_SIZE_BIG', 10);
|
||||||
|
|
||||||
/** XML functions */
|
/** XML functions */
|
||||||
include_once('xml_parser.inc');
|
include_once('xml_parser.inc');
|
||||||
|
@ -40,9 +49,6 @@ include_once('xml_parser.inc');
|
||||||
/** access to PDF configuration files */
|
/** access to PDF configuration files */
|
||||||
include_once('pdfstruct.inc');
|
include_once('pdfstruct.inc');
|
||||||
|
|
||||||
$key = false;
|
|
||||||
$line_width = LAMPDF_LINEWIDTH;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates the PDF output of one or more accounts.
|
* This function creates the PDF output of one or more accounts.
|
||||||
*
|
*
|
||||||
|
@ -63,8 +69,6 @@ function createModulePDF($accounts, $pdf_structure="default", $returnAsString =
|
||||||
/** LAM PDF generator class */
|
/** LAM PDF generator class */
|
||||||
include_once("lamPDF.inc");
|
include_once("lamPDF.inc");
|
||||||
|
|
||||||
global $key;
|
|
||||||
|
|
||||||
$account_type = $accounts[0]->get_type();
|
$account_type = $accounts[0]->get_type();
|
||||||
// Get PDF structure from xml file
|
// Get PDF structure from xml file
|
||||||
$load = \LAM\PDF\loadPDFStructure($account_type->getId(), $pdf_structure);
|
$load = \LAM\PDF\loadPDFStructure($account_type->getId(), $pdf_structure);
|
||||||
|
@ -91,7 +95,7 @@ function createModulePDF($accounts, $pdf_structure="default", $returnAsString =
|
||||||
$fontName = "BitstreamVeraSans-Roman";
|
$fontName = "BitstreamVeraSans-Roman";
|
||||||
|
|
||||||
// Create a new PDF file acording to the account type
|
// Create a new PDF file acording to the account type
|
||||||
$pdf = new lamPDF($load['page_definitions'],$fontName);
|
$pdf = new \lamPDF($load['page_definitions'],$fontName);
|
||||||
|
|
||||||
// Loop over each account and add a new page in the PDF file for it
|
// Loop over each account and add a new page in the PDF file for it
|
||||||
foreach($accounts as $account) {
|
foreach($accounts as $account) {
|
||||||
|
@ -113,23 +117,24 @@ function createModulePDF($accounts, $pdf_structure="default", $returnAsString =
|
||||||
else {
|
else {
|
||||||
$section_headline = $name;
|
$section_headline = $name;
|
||||||
}
|
}
|
||||||
$pdf->setFont($fontName,"B",10);
|
$pdf->setFont($fontName, "B", LAMPDF_FONT_SIZE_BIG);
|
||||||
$pdf->Write(0,$section_headline . ":");
|
$pdf->Write(0,$section_headline . ":");
|
||||||
$pdf->Ln(6);
|
$pdf->Ln(LAMPDF_LINEHEIGHT);
|
||||||
}
|
}
|
||||||
// We have a section to end
|
// We have a section to end
|
||||||
elseif($entry['tag'] == "SECTION" && $entry['type'] == "close") {
|
elseif($entry['tag'] == "SECTION" && $entry['type'] == "close") {
|
||||||
$pdf->Ln(9);
|
$pdf->Ln(LAMPDF_LINEHEIGHT * 2);
|
||||||
}
|
}
|
||||||
// We have to include a static text.
|
// We have to include a static text.
|
||||||
elseif($entry['tag'] == "TEXT") {
|
elseif($entry['tag'] == "TEXT") {
|
||||||
// Load PDF text from structure array
|
$pdf->setFont($fontName, "", LAMPDF_FONT_SIZE);
|
||||||
$info_string = $entry['value'];
|
$info_string = str_replace("\r", "", $entry['value']);
|
||||||
// Set font for text
|
$info_string = explode("\n", $info_string);
|
||||||
$pdf->setFont($fontName,"",10);
|
foreach ($info_string as $text) {
|
||||||
$pdf->MultiCell(0,5,$info_string,0,"L",0);
|
$pdf->MultiCell(0, LAMPDF_LINEHEIGHT, trim($text), 0, "L", 0);
|
||||||
// Print linebreak afterwards
|
$pdf->Ln(0);
|
||||||
$pdf->Ln(6);
|
}
|
||||||
|
$pdf->Ln(LAMPDF_LINEHEIGHT * 2);
|
||||||
}
|
}
|
||||||
// We have to include an entry from the account
|
// We have to include an entry from the account
|
||||||
elseif($entry['tag'] == "ENTRY") {
|
elseif($entry['tag'] == "ENTRY") {
|
||||||
|
@ -138,22 +143,21 @@ function createModulePDF($accounts, $pdf_structure="default", $returnAsString =
|
||||||
// skip non-existent entries
|
// skip non-existent entries
|
||||||
if (isset($entries[$name])) {
|
if (isset($entries[$name])) {
|
||||||
// Get current entry
|
// Get current entry
|
||||||
$value_entry = $entries[$name];
|
$valueEntries = $entries[$name];
|
||||||
|
|
||||||
// Print entry only when module sumitted values for it
|
// Print entry only when module sumitted values for it
|
||||||
if(is_array($value_entry)) {
|
if(is_array($valueEntries)) {
|
||||||
// Loop over all rows of this entry (most of the time this will be just one)
|
// Loop over all rows of this entry (most of the time this will be just one)
|
||||||
foreach($value_entry as $line) {
|
foreach($valueEntries as $valueEntry) {
|
||||||
// Substitue XML syntax with valid FPDF methods
|
if ($valueEntry instanceof PDFLabelValue) {
|
||||||
$methods = processLine($line,true,$fontName);
|
printLabelValue($pdf, $valueEntry, $fontName);
|
||||||
// Call every method
|
}
|
||||||
foreach($methods as $method) {
|
else if ($valueEntry instanceof PDFTable) {
|
||||||
call_user_func_array(array(&$pdf,$method[0]),$method[1]);
|
printTable($pdf, $valueEntry, $fontName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$key = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,170 +181,208 @@ function createModulePDF($accounts, $pdf_structure="default", $returnAsString =
|
||||||
/**
|
/**
|
||||||
* Creates a section headline.
|
* Creates a section headline.
|
||||||
*
|
*
|
||||||
* @param string $line section name
|
* @param PDFEntry $entry content entry
|
||||||
*
|
*
|
||||||
* @return string XML code for headline
|
* @return string headline
|
||||||
*/
|
*/
|
||||||
function getSectionHeadline($line) {
|
function getSectionHeadline($entry) {
|
||||||
$headline_pattern = '/<block>.*<value>(.*)<\/value><\/block>/';
|
return $entry->getHeadline();
|
||||||
if(preg_match($headline_pattern,$line,$matches)) {
|
|
||||||
$valueStyle = processFormatTags($matches[1],'');
|
|
||||||
return $valueStyle[1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the XML code for an PDF entry.
|
* Prints a PDFLabelValue entry.
|
||||||
*
|
*
|
||||||
* @param string $line XML code of PDF entry
|
* @param lamPDF $pdf PDF
|
||||||
* @param boolean $first_td True if this is the first column
|
* @param PDFLabelValue $valueEntry entry
|
||||||
* @param String $fontName font name
|
* @param string $fontName font name
|
||||||
*
|
|
||||||
* @return array XML codes
|
|
||||||
*/
|
*/
|
||||||
function processLine($line, $first_td = true, $fontName) {
|
function printLabelValue(&$pdf, $valueEntry, $fontName) {
|
||||||
global $key, $line_width;
|
$pdf->SetFont($fontName, 'B', LAMPDF_FONT_SIZE);
|
||||||
|
$pdf->Cell(LAMPDF_LABELWIDTH, LAMPDF_LINEHEIGHT, $valueEntry->getLabel() . ':', 0, 0, 'R', 0);
|
||||||
// PCRE matching <block> tag
|
$pdf->SetFont($fontName, '', LAMPDF_FONT_SIZE);
|
||||||
$block_pattern = '/<block><\/block>/';
|
$pdf->MultiCell(0, LAMPDF_LINEHEIGHT, $valueEntry->getValue(), 0, 'L', 0);
|
||||||
// PCRE matching a <key> tag
|
$pdf->Ln(0);
|
||||||
$key_pattern = '/(<block>)<key>(.+)<\/key>(.*<\/block>)/';
|
|
||||||
// PCRE matching a <value> tag
|
|
||||||
// !!FIXME!! value must contain at least one character
|
|
||||||
$value_pattern = '/(<block>.*)<value>(.*)<\/value>(<\/block>)/';
|
|
||||||
// PCRE matching a <td> tag
|
|
||||||
$td_pattern = '/(<block>.*?)<td(.*?)>(.+?)<\/td>(.*<\/block>)/';
|
|
||||||
// PCRE matching <tr> tag
|
|
||||||
$tr_pattern = '/<tr><\/tr>/';
|
|
||||||
// PCRE matching a <p> tag
|
|
||||||
$p_pattern = '/(<block>.*)<p>(.+)<\/p>(.*<\/block>)/';
|
|
||||||
// PCRE matching a <br> tag
|
|
||||||
$br_pattern = '/<br \/>/';
|
|
||||||
|
|
||||||
$return = array();
|
|
||||||
if(preg_match($key_pattern,$line,$matches)) {
|
|
||||||
$key = true;
|
|
||||||
$line_width = $line_width - 50;
|
|
||||||
$format = processFormatTags($matches[2],'B');
|
|
||||||
$return[] = array('setFont',array($fontName,$format[0],7));
|
|
||||||
$return[] = array('Cell',array(50,5,$format[1] . ':',0,0,'R',0));
|
|
||||||
$return[] = array('setFont',array($fontName,'',7));
|
|
||||||
return array_merge($return,processLine($matches[1] . $matches[3],false,$fontName));
|
|
||||||
}
|
|
||||||
elseif(preg_match($value_pattern,$line,$matches)) {
|
|
||||||
$format = processFormatTags($matches[2],'');
|
|
||||||
$return[] = array('setFont',array($fontName,$format[0],7));
|
|
||||||
$return[] = array('MultiCell',array(0,5,$format[1],0,'L',0));
|
|
||||||
$return[] = array('setFont',array($fontName,'',7));
|
|
||||||
return array_merge($return,processLine($matches[1] . $matches[3],true,$fontName));
|
|
||||||
}
|
|
||||||
elseif(preg_match($p_pattern,$line,$matches)) {
|
|
||||||
$format = processFormatTags($matches[2],'');
|
|
||||||
$return[] = array('setFont',array($fontName,$format[0],7));
|
|
||||||
$return[] = array('Write',array(5,$format[1]));
|
|
||||||
$return[] = array('setFont',array($fontName,'',7));
|
|
||||||
return array_merge($return,processLine($matches[1] . $matches[3],true,$fontName));
|
|
||||||
}
|
|
||||||
elseif(preg_match($td_pattern,$line,$matches)) {
|
|
||||||
if($first_td && $key) {
|
|
||||||
$first_td = !$first_td;
|
|
||||||
$return[] = array('Cell',array(50,5,'',0,0,'L',0));
|
|
||||||
}
|
|
||||||
$format = processFormatTags($matches[3],'');
|
|
||||||
$attrs = processAttributes($matches[2],array('width' => $line_width,'height' => 5,'align' => 'L'));
|
|
||||||
$return[] = array('setFont',array($fontName,$format[0],7));
|
|
||||||
$return[] = array('Cell',array($attrs['width'],$attrs['height'],$format[1],0,0,$attrs['align'],0));
|
|
||||||
$return[] = array('setFont',array($fontName,'',7));
|
|
||||||
return array_merge($return,processLine($matches[1] . $matches[4],$first_td,$fontName));
|
|
||||||
}
|
|
||||||
elseif(preg_match($br_pattern,$line,$matches)) {
|
|
||||||
return array(array('Ln',array(5)));
|
|
||||||
}
|
|
||||||
elseif(preg_match($block_pattern,$line,$matches)) {
|
|
||||||
$line_width = LAMPDF_LINEWIDTH;
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
elseif(preg_match($tr_pattern,$line,$matches)) {
|
|
||||||
$line_width = LAMPDF_LINEWIDTH;
|
|
||||||
return array(array('Ln',array(5)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formats the XML code.
|
* Prints a PDFTable entry.
|
||||||
*
|
*
|
||||||
* @param string $line XML code of PDF entry
|
* @param lamPDF $pdf PDF
|
||||||
* @param string $style style commands
|
* @param PDFTable $table entry
|
||||||
*
|
* @param string $fontName font name
|
||||||
* @return array XML code
|
|
||||||
*/
|
*/
|
||||||
function processFormatTags($line,$style) {
|
function printTable(&$pdf, $table, $fontName) {
|
||||||
// PCRE matching a <i> tag
|
if (!empty($table->getHeadline())) {
|
||||||
$i_pattern = '/(.*)<i>(.+)<\/i>(.*)/';
|
$pdf->SetFont($fontName, 'B', LAMPDF_FONT_SIZE);
|
||||||
// PCRE matching a <b> tag
|
$pdf->Cell(LAMPDF_LABELWIDTH, LAMPDF_LINEHEIGHT, $table->getHeadline() . ':', 0 , 0, 'L', 0);
|
||||||
$b_pattern = '/(.*)<b>(.+)<\/b>(.*)/';
|
$pdf->Ln(LAMPDF_LINEHEIGHT);
|
||||||
// PCRE matching a <u> tag
|
|
||||||
$u_pattern = '/(.*)<u>(.+)<\/u>(.*)/';
|
|
||||||
// Replacement pattern when one of the above pattern matched
|
|
||||||
$replace = "\$1\$2\$3";
|
|
||||||
|
|
||||||
if(preg_match($i_pattern,$line,$matches)) {
|
|
||||||
$style .= "I";
|
|
||||||
$line = preg_replace($i_pattern,$replace,$line);
|
|
||||||
}
|
}
|
||||||
if(preg_match($b_pattern,$line,$matches)) {
|
foreach ($table->rows as $row) {
|
||||||
$style .= "B";
|
foreach ($row->cells as $cell) {
|
||||||
$line = preg_replace($b_pattern,$replace,$line);
|
$width = $cell->width;
|
||||||
|
if (!empty($width) && (strpos($width, '%') !== false)) {
|
||||||
|
$width = ceil(LAMPDF_LINEWIDTH * substr($width, 0, -1) / 100);
|
||||||
|
}
|
||||||
|
if ($cell->bold) {
|
||||||
|
$pdf->SetFont($fontName, 'B', LAMPDF_FONT_SIZE);
|
||||||
|
}
|
||||||
|
$pdf->Cell($width, LAMPDF_LINEHEIGHT, $cell->content, 0, 0, $cell->align, 0);
|
||||||
|
if ($cell->bold) {
|
||||||
|
$pdf->SetFont($fontName, '', LAMPDF_FONT_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$pdf->Ln(LAMPDF_LINEHEIGHT);
|
||||||
}
|
}
|
||||||
if(preg_match($u_pattern,$line,$matches)) {
|
$pdf->Ln(LAMPDF_LINEHEIGHT);
|
||||||
$style .= "U";
|
|
||||||
$line = preg_replace($u_pattern,$replace,$line);
|
|
||||||
}
|
|
||||||
return array($style,$line);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes width, height and alignment attributes.
|
* Common interface for all PDF entries.
|
||||||
*
|
*
|
||||||
* @param string $attrs attributes
|
* @package PDF
|
||||||
* @param array $return XML code
|
* @author Roland Gruber
|
||||||
*
|
|
||||||
* @return array XML code
|
|
||||||
*/
|
*/
|
||||||
function processAttributes($attrs,$return = array()) {
|
interface PDFEntry {
|
||||||
global $line_width;
|
|
||||||
|
|
||||||
// PCRE matching width attribute
|
/**
|
||||||
$width_pattern = '/(.*)width\=\"(\\d+)(\%?)\"(.*)/';
|
* Returns the head line of the entry.
|
||||||
// PCRE matching height attribute
|
*
|
||||||
$height_pattern = '/(.*)height\=\"(\\d+)\"(.*)/';
|
* @return string label
|
||||||
// PCRE matching align attribute
|
*/
|
||||||
$align_pattern = '/(.*)align\=\"(L|R|C)\"(.*)/';
|
public function getHeadline();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a table for PDF export.
|
||||||
|
*
|
||||||
|
* @package PDF
|
||||||
|
* @author Roland Gruber
|
||||||
|
*/
|
||||||
|
class PDFTable implements PDFEntry {
|
||||||
|
|
||||||
|
/** optional label of table */
|
||||||
|
private $label = '';
|
||||||
|
/** list of PDFTableRow elements */
|
||||||
|
public $rows = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param String $label label
|
||||||
|
*/
|
||||||
|
public function __construct($label = null) {
|
||||||
|
$this->label = $label;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* @see PDFEntry::getHeadline()
|
||||||
|
*/
|
||||||
|
public function getHeadline() {
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a table row for PDF export.
|
||||||
|
*
|
||||||
|
* @package PDF
|
||||||
|
* @author Roland Gruber
|
||||||
|
*/
|
||||||
|
class PDFTableRow {
|
||||||
|
|
||||||
|
/** list of PDFTableCell */
|
||||||
|
public $cells = array();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a table cell for PDF export.
|
||||||
|
*
|
||||||
|
* @package PDF
|
||||||
|
* @author Roland Gruber
|
||||||
|
*/
|
||||||
|
class PDFTableCell {
|
||||||
|
|
||||||
|
const ALIGN_LEFT = 'L';
|
||||||
|
const ALIGN_RIGHT = 'R';
|
||||||
|
const ALIGN_CENTER = 'C';
|
||||||
|
|
||||||
|
/** content text of cell */
|
||||||
|
public $content = '';
|
||||||
|
/** text alignment */
|
||||||
|
public $align = self::ALIGN_LEFT;
|
||||||
|
/** cell width (e.g. "20%") */
|
||||||
|
public $width = null;
|
||||||
|
/** bold text */
|
||||||
|
public $bold = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param String $content cell content
|
||||||
|
* @param String $width width (e.g. "20%")
|
||||||
|
* @param String $align cell alignment (default: left)
|
||||||
|
* @param boolean $bold print in bold
|
||||||
|
*/
|
||||||
|
public function __construct($content, $width = null, $align = null, $bold = false) {
|
||||||
|
$this->content = empty($content) ? ' ' : $content;
|
||||||
|
$this->align = ($align == null) ? self::ALIGN_LEFT : $align;
|
||||||
|
$this->width = $width;
|
||||||
|
$this->bold = $bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple PDF object to print label value entries.
|
||||||
|
*
|
||||||
|
* @package PDF
|
||||||
|
* @author Roland Gruber
|
||||||
|
*/
|
||||||
|
class PDFLabelValue implements PDFEntry {
|
||||||
|
|
||||||
|
private $label = '';
|
||||||
|
|
||||||
|
private $value = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param string $label label
|
||||||
|
* @param string $value value
|
||||||
|
*/
|
||||||
|
public function __construct($label, $value) {
|
||||||
|
$this->label = $label;
|
||||||
|
$this->value = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the label.
|
||||||
|
*
|
||||||
|
* @return string $label label
|
||||||
|
*/
|
||||||
|
public function getLabel() {
|
||||||
|
return $this->label;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value.
|
||||||
|
*
|
||||||
|
* @return string $value value
|
||||||
|
*/
|
||||||
|
public function getValue() {
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* @see PDFEntry::getHeadline()
|
||||||
|
*/
|
||||||
|
public function getHeadline() {
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove leading and trailing whitespaces
|
|
||||||
$attrs = trim($attrs);
|
|
||||||
|
|
||||||
if(preg_match($width_pattern,$attrs,$matches)) {
|
|
||||||
if($matches[3] == '%') {
|
|
||||||
$return['width'] = ceil($line_width * $matches[2] / 100);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$return['width'] = ceil($matches[2]);
|
|
||||||
}
|
|
||||||
return processAttributes($matches[1] . $matches[4],$return);
|
|
||||||
}
|
|
||||||
elseif(preg_match($height_pattern,$attrs,$matches)) {
|
|
||||||
$return['height'] = $matches[2];
|
|
||||||
return processAttributes($matches[1] . $matches[3],$return);
|
|
||||||
}
|
|
||||||
elseif(preg_match($align_pattern,$attrs,$matches)) {
|
|
||||||
$return['align'] = $matches[2];
|
|
||||||
return processAttributes($matches[1] . $matches[3],$return);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return $return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,7 +294,7 @@ class Uploader {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// create and save PDF
|
// create and save PDF
|
||||||
$pdfContent = createModulePDF(array($_SESSION['mass_pdfAccount']), $pdfStructure, true);
|
$pdfContent = \LAM\PDF\createModulePDF(array($_SESSION['mass_pdfAccount']), $pdfStructure, true);
|
||||||
$fileName = $dn . '.pdf';
|
$fileName = $dn . '.pdf';
|
||||||
$pdfZip->addFromString($fileName, $pdfContent);
|
$pdfZip->addFromString($fileName, $pdfContent);
|
||||||
$_SESSION['mass_pdf']['counter'] ++;
|
$_SESSION['mass_pdf']['counter'] ++;
|
||||||
|
|
|
@ -60,7 +60,8 @@ class xmlParser {
|
||||||
if(file_exists($filename)) {
|
if(file_exists($filename)) {
|
||||||
$xmlStructure = array();
|
$xmlStructure = array();
|
||||||
$xmlIndex = array();
|
$xmlIndex = array();
|
||||||
xml_parse_into_struct($this->xmlParser, implode("\n", file($filename)), $xmlStructure, $xmlIndex);
|
$xmlContent =
|
||||||
|
xml_parse_into_struct($this->xmlParser, implode("", file($filename)), $xmlStructure, $xmlIndex);
|
||||||
return array($xmlStructure, $xmlIndex);
|
return array($xmlStructure, $xmlIndex);
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
|
|
|
@ -143,11 +143,11 @@ if(isset($_GET['submit'])) {
|
||||||
// add a new text field
|
// add a new text field
|
||||||
elseif(isset($_GET['add_text'])) {
|
elseif(isset($_GET['add_text'])) {
|
||||||
// Check if text for static text field is specified
|
// Check if text for static text field is specified
|
||||||
if(!isset($_GET['text_text']) || ($_GET['text_text'] == '')) {
|
if(empty($_GET['text_text'])) {
|
||||||
StatusMessage('ERROR',_('No static text specified'),_('The static text must contain at least one character.'));
|
StatusMessage('ERROR',_('No static text specified'),_('The static text must contain at least one character.'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$entry = array(array('tag' => 'TEXT','type' => 'complete','level' => '2','value' => $_GET['text_text']));
|
$entry = array(array('tag' => 'TEXT','type' => 'complete','level' => '2','value' => str_replace("\r", "\n", $_GET['text_text'])));
|
||||||
// Insert new field in structure
|
// Insert new field in structure
|
||||||
array_splice($_SESSION['currentPDFStructure'],$_GET['add_text_position'],0,$entry);
|
array_splice($_SESSION['currentPDFStructure'],$_GET['add_text_position'],0,$entry);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue