mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-05 10:49:31 +02:00
refactoring
This commit is contained in:
parent
88e864dfcf
commit
6aea0181d3
5 changed files with 12 additions and 9 deletions
|
@ -2,7 +2,7 @@
|
|||
"name": "ldap-account-manager/ldap-account-manager",
|
||||
"description": "LDAP Account Manager",
|
||||
"require-dev" : {
|
||||
"phpunit/phpunit" : "9.5.1",
|
||||
"phpunit/phpunit" : "9.5.21",
|
||||
"squizlabs/php_codesniffer" : "3.4.0",
|
||||
"phpstan/phpstan": "^1.2"
|
||||
},
|
||||
|
|
|
@ -1968,7 +1968,7 @@ class LAMException extends Exception {
|
|||
* @param Exception $cause (optional)
|
||||
* @param int $ldapErrorCode original LDAP error code
|
||||
*/
|
||||
public function __construct($title, $message = null, $cause = null, $ldapErrorCode = null) {
|
||||
public function __construct($title, $message = '', $cause = null, $ldapErrorCode = null) {
|
||||
parent::__construct($message, 0, $cause);
|
||||
$this->title = $title;
|
||||
$this->ldapErrorCode = $ldapErrorCode;
|
||||
|
|
|
@ -1338,9 +1338,13 @@ class PDFStructureWriter {
|
|||
$writer->setIndent(true);
|
||||
$writer->setIndentString("\t");
|
||||
$writer->startElement('pdf');
|
||||
if ($structure->getLogo() !== null) {
|
||||
$writer->writeAttribute('filename', $structure->getLogo());
|
||||
}
|
||||
$writer->writeAttribute('headline', $structure->getTitle());
|
||||
if ($structure->getFoldingMarks() !== null) {
|
||||
$writer->writeAttribute('foldingmarks', $structure->getFoldingMarks());
|
||||
}
|
||||
foreach ($structure->getSections() as $section) {
|
||||
if ($section instanceof PDFTextSection) {
|
||||
$writer->startElement('text');
|
||||
|
|
|
@ -134,7 +134,9 @@ function checkClientIP() {
|
|||
}
|
||||
$allowedHosts = $cfg->allowedHosts;
|
||||
$url = getCallingURL();
|
||||
if ((strpos($url, '/selfService/selfService') !== false) || ((strpos($url, '/misc/ajax.php?') !== false) && strpos($url, 'selfservice=1') !== false)) {
|
||||
if (($url !== null) &&
|
||||
((strpos($url, '/selfService/selfService') !== false)
|
||||
|| ((strpos($url, '/misc/ajax.php?') !== false) && strpos($url, 'selfservice=1') !== false))) {
|
||||
// self service pages have separate IP list
|
||||
$allowedHosts = $cfg->allowedHostsSelfService;
|
||||
}
|
||||
|
@ -295,9 +297,6 @@ function logNewMessage($level, $message) : void {
|
|||
fclose($file);
|
||||
}
|
||||
}
|
||||
else {
|
||||
StatusMessage('ERROR', 'Unable to write to log file!', $cfg->logDestination);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
* @param boolean $returnOutput if set to true this function will return the generated HTML code instead of printing it directly (default: false)
|
||||
* @return String HTML code if $returnOutput is set to true, otherwise null
|
||||
*/
|
||||
function StatusMessage($MessageTyp,$MessageHeadline,$MessageText='',$MessageVariables = array(), $returnOutput = false) {
|
||||
function StatusMessage($MessageTyp, $MessageHeadline, $MessageText = '', $MessageVariables = array(), $returnOutput = false) {
|
||||
/* Setting CSS-StyleSheet class depending on the $MessageTyp and rewriting $MessageTyp with a readable string. */
|
||||
if ($MessageTyp == "INFO") {
|
||||
$class = "class=\"statusInfo lam-status-message\"";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue