responsive
This commit is contained in:
parent
b71ae14684
commit
5ee8a052ac
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
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 Leonhard Walchshaeusl
|
Copyright (C) 2003 Leonhard Walchshaeusl
|
||||||
Copyright (C) 2005 - 2017 Roland Gruber
|
Copyright (C) 2005 - 2018 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
|
||||||
|
@ -358,6 +358,7 @@ table.collapse {
|
||||||
|
|
||||||
.smallPaddingContent {
|
.smallPaddingContent {
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
padding-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** titles */
|
/** titles */
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace LAM\TOOLS\TESTS;
|
||||||
|
use \htmlResponsiveRow;
|
||||||
|
use \htmlOutputText;
|
||||||
|
use \htmlLink;
|
||||||
|
use \htmlTitle;
|
||||||
/*
|
/*
|
||||||
|
|
||||||
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/)
|
||||||
|
@ -57,8 +62,6 @@ $container->addVerticalSpacer('2rem');
|
||||||
$container->add(new htmlLink(_("Schema test"), 'schemaTest.php', '../../graphics/schemaTest.png'), 12, 4);
|
$container->add(new htmlLink(_("Schema test"), 'schemaTest.php', '../../graphics/schemaTest.png'), 12, 4);
|
||||||
$container->add(new htmlOutputText(_("Check if the LDAP schema fits the requirements of the selected account modules.")), 12, 8);
|
$container->add(new htmlOutputText(_("Check if the LDAP schema fits the requirements of the selected account modules.")), 12, 8);
|
||||||
|
|
||||||
$container->addVerticalSpacer('2rem');
|
|
||||||
|
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
parseHtml(null, $container, array(), true, $tabindex, 'user');
|
parseHtml(null, $container, array(), true, $tabindex, 'user');
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
namespace LAM\TOOLS\TESTS;
|
namespace LAM\TOOLS\TESTS;
|
||||||
use \LAM\REMOTE\Remote;
|
use \LAM\REMOTE\Remote;
|
||||||
use \htmlTable;
|
|
||||||
use \htmlTitle;
|
use \htmlTitle;
|
||||||
use \htmlOutputText;
|
use \htmlOutputText;
|
||||||
use \htmlSelect;
|
use \htmlResponsiveSelect;
|
||||||
use \htmlInputCheckbox;
|
use \htmlResponsiveInputCheckbox;
|
||||||
use \htmlSpacer;
|
|
||||||
use \htmlButton;
|
use \htmlButton;
|
||||||
use \htmlStatusMessage;
|
use \htmlStatusMessage;
|
||||||
use \htmlImage;
|
use \htmlImage;
|
||||||
use \htmlSubTitle;
|
use \htmlSubTitle;
|
||||||
use \Exception;
|
use \Exception;
|
||||||
|
use \htmlResponsiveRow;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$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) 2006 - 2017 Roland Gruber
|
Copyright (C) 2006 - 2018 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
|
||||||
|
@ -59,12 +57,12 @@ checkIfToolIsActive('toolTests');
|
||||||
|
|
||||||
setlanguage();
|
setlanguage();
|
||||||
|
|
||||||
include '../main_header.php';
|
include '../../lib/adminHeader.inc';
|
||||||
echo "<div class=\"user-bright smallPaddingContent\">\n";
|
echo "<div class=\"user-bright smallPaddingContent\">\n";
|
||||||
echo "<form action=\"lamdaemonTest.php\" method=\"post\">\n";
|
echo "<form action=\"lamdaemonTest.php\" method=\"post\">\n";
|
||||||
|
|
||||||
$container = new htmlTable();
|
$container = new htmlResponsiveRow();
|
||||||
$container->addElement(new htmlTitle(_("Lamdaemon test")), true);
|
$container->add(new htmlTitle(_("Lamdaemon test")), 12);
|
||||||
|
|
||||||
$servers = explode(";", $_SESSION['config']->get_scriptServers());
|
$servers = explode(";", $_SESSION['config']->get_scriptServers());
|
||||||
$serverIDs = array();
|
$serverIDs = array();
|
||||||
|
@ -84,7 +82,6 @@ if (isset($_POST['runTest'])) {
|
||||||
lamRunTestSuite($_POST['server'], $serverTitles[$_POST['server']] , isset($_POST['checkQuotas']), $container);
|
lamRunTestSuite($_POST['server'], $serverTitles[$_POST['server']] , isset($_POST['checkQuotas']), $container);
|
||||||
}
|
}
|
||||||
else if ((sizeof($servers) > 0) && isset($servers[0]) && ($servers[0] != '')) {
|
else if ((sizeof($servers) > 0) && isset($servers[0]) && ($servers[0] != '')) {
|
||||||
$container->addElement(new htmlOutputText(_("Server")));
|
|
||||||
$serverOptions = array();
|
$serverOptions = array();
|
||||||
for ($i = 0; $i < sizeof($servers); $i++) {
|
for ($i = 0; $i < sizeof($servers); $i++) {
|
||||||
$servers[$i] = explode(":", $servers[$i]);
|
$servers[$i] = explode(":", $servers[$i]);
|
||||||
|
@ -95,21 +92,21 @@ else if ((sizeof($servers) > 0) && isset($servers[0]) && ($servers[0] != '')) {
|
||||||
}
|
}
|
||||||
$serverOptions[$title] = $serverName;
|
$serverOptions[$title] = $serverName;
|
||||||
}
|
}
|
||||||
$serverSelect = new htmlSelect('server', $serverOptions);
|
$serverSelect = new htmlResponsiveSelect('server', $serverOptions, array(), _("Server"));
|
||||||
$serverSelect->setHasDescriptiveElements(true);
|
$serverSelect->setHasDescriptiveElements(true);
|
||||||
$container->addElement($serverSelect, true);
|
$container->add($serverSelect, 12);
|
||||||
|
|
||||||
$container->addElement(new htmlOutputText(_("Check quotas")));
|
$container->add(new htmlResponsiveInputCheckbox('checkQuotas', false, _("Check quotas")), 12);
|
||||||
$container->addElement(new htmlInputCheckbox('checkQuotas', false), true);
|
|
||||||
|
|
||||||
$container->addElement(new htmlSpacer(null, '10px'), true);
|
$container->addVerticalSpacer('1rem');
|
||||||
|
|
||||||
$okButton = new htmlButton('runTest', _("Ok"));
|
$okButton = new htmlButton('runTest', _("Ok"));
|
||||||
$okButton->colspan = 2;
|
$okButton->colspan = 2;
|
||||||
$container->addElement($okButton);
|
$container->addLabel($okButton);
|
||||||
|
$container->addField(new htmlOutputText(' ', false));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$container->addElement(new htmlStatusMessage("ERROR", _('No lamdaemon server set, please update your LAM configuration settings.')));
|
$container->add(new htmlStatusMessage("ERROR", _('No lamdaemon server set, please update your LAM configuration settings.')), 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
|
@ -117,7 +114,7 @@ parseHtml(null, $container, array(), false, $tabindex, 'user');
|
||||||
|
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
include '../main_footer.php';
|
include '../../lib/adminFooter.inc';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -127,17 +124,15 @@ include '../main_footer.php';
|
||||||
* @param boolean $stopTest specifies if test should be run
|
* @param boolean $stopTest specifies if test should be run
|
||||||
* @param Remote $remote SSH connection
|
* @param Remote $remote SSH connection
|
||||||
* @param string $testText describing text
|
* @param string $testText describing text
|
||||||
* @param htmlTable $container container for HTML output
|
* @param htmlResponsiveRow $container container for HTML output
|
||||||
* @return boolean true, if errors occured
|
* @return boolean true, if errors occured
|
||||||
*/
|
*/
|
||||||
function testRemoteCommand($command, $stopTest, $remote, $testText, $container) {
|
function testRemoteCommand($command, $stopTest, $remote, $testText, $container) {
|
||||||
$okImage = "../../graphics/pass.png";
|
$okImage = "../../graphics/pass.png";
|
||||||
$failImage = "../../graphics/fail.png";
|
$failImage = "../../graphics/fail.png";
|
||||||
$spacer = new htmlSpacer('10px', null);
|
|
||||||
// run remote command
|
// run remote command
|
||||||
if (!$stopTest) {
|
if (!$stopTest) {
|
||||||
$container->addElement(new htmlOutputText($testText));
|
$container->add(new htmlOutputText($testText), 10, 4);
|
||||||
$container->addElement($spacer);
|
|
||||||
flush();
|
flush();
|
||||||
$lamdaemonOk = false;
|
$lamdaemonOk = false;
|
||||||
$output = $remote->execute($command);
|
$output = $remote->execute($command);
|
||||||
|
@ -145,34 +140,32 @@ function testRemoteCommand($command, $stopTest, $remote, $testText, $container)
|
||||||
$lamdaemonOk = true;
|
$lamdaemonOk = true;
|
||||||
}
|
}
|
||||||
if ($lamdaemonOk) {
|
if ($lamdaemonOk) {
|
||||||
$container->addElement(new htmlImage($okImage));
|
$container->add(new htmlImage($okImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(_("Lamdaemon successfully run.")), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(_("Lamdaemon successfully run.")), true);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$container->addElement(new htmlImage($failImage));
|
$container->add(new htmlImage($failImage), 2);
|
||||||
$container->addElement($spacer);
|
|
||||||
if (!(strpos($output, 'ERROR,') === 0) && !(strpos($output, 'WARN,') === 0)) {
|
if (!(strpos($output, 'ERROR,') === 0) && !(strpos($output, 'WARN,') === 0)) {
|
||||||
// error messages from console (e.g. sudo)
|
// error messages from console (e.g. sudo)
|
||||||
$container->addElement(new htmlStatusMessage('ERROR', $output), true);
|
$container->add(new htmlStatusMessage('ERROR', $output), 12, 6);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// error messages from lamdaemon
|
// error messages from lamdaemon
|
||||||
$parts = explode(",", $output);
|
$parts = explode(",", $output);
|
||||||
if (sizeof($parts) == 2) {
|
if (sizeof($parts) == 2) {
|
||||||
$container->addElement(new htmlStatusMessage($parts[0], $parts[1]), true);
|
$container->add(new htmlStatusMessage($parts[0], $parts[1]), 12, 6);
|
||||||
}
|
}
|
||||||
elseif (sizeof($parts) == 3) {
|
elseif (sizeof($parts) == 3) {
|
||||||
$container->addElement(new htmlStatusMessage($parts[0], $parts[1], $parts[2]), true);
|
$container->add(new htmlStatusMessage($parts[0], $parts[1], $parts[2]), 12, 6);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$container->addElement(new htmlOutputText($output), true);
|
$container->add(new htmlOutputText($output), 12, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$stopTest = true;
|
$stopTest = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flush();
|
$container->addVerticalSpacer('0.5rem');
|
||||||
return $stopTest;
|
return $stopTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +175,7 @@ function testRemoteCommand($command, $stopTest, $remote, $testText, $container)
|
||||||
* @param String $serverName server ID
|
* @param String $serverName server ID
|
||||||
* @param String $serverTitle server name
|
* @param String $serverTitle server name
|
||||||
* @param boolean $testQuota true, if Quotas should be checked
|
* @param boolean $testQuota true, if Quotas should be checked
|
||||||
* @param htmlTable $container container for HTML output
|
* @param htmlResponsiveRow $container container for HTML output
|
||||||
*/
|
*/
|
||||||
function lamRunTestSuite($serverName, $serverTitle, $testQuota, $container) {
|
function lamRunTestSuite($serverName, $serverTitle, $testQuota, $container) {
|
||||||
$SPLIT_DELIMITER = "###x##y##x###";
|
$SPLIT_DELIMITER = "###x##y##x###";
|
||||||
|
@ -190,47 +183,38 @@ function lamRunTestSuite($serverName, $serverTitle, $testQuota, $container) {
|
||||||
$okImage = "../../graphics/pass.png";
|
$okImage = "../../graphics/pass.png";
|
||||||
$failImage = "../../graphics/fail.png";
|
$failImage = "../../graphics/fail.png";
|
||||||
|
|
||||||
flush();
|
|
||||||
$stopTest = false;
|
$stopTest = false;
|
||||||
$spacer = new htmlSpacer('10px', null);
|
|
||||||
|
|
||||||
$container->addElement(new htmlSubTitle($serverTitle), true);
|
$container->add(new htmlSubTitle($serverTitle), 12);
|
||||||
|
|
||||||
// check script server and path
|
// check script server and path
|
||||||
$container->addElement(new htmlOutputText(_("Lamdaemon server and path")));
|
$container->add(new htmlOutputText(_("Lamdaemon server and path")), 10, 4);
|
||||||
$container->addElement(new htmlSpacer('10px', null));
|
|
||||||
if (!isset($serverName) || (strlen($serverName) < 3)) {
|
if (!isset($serverName) || (strlen($serverName) < 3)) {
|
||||||
$container->addElement(new htmlImage($failImage));
|
$container->add(new htmlImage($failImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(_("No lamdaemon server set, please update your LAM configuration settings.")), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(_("No lamdaemon server set, please update your LAM configuration settings.")), true);
|
|
||||||
}
|
}
|
||||||
elseif (($_SESSION['config']->get_scriptPath() == null) || (strlen($_SESSION['config']->get_scriptPath()) < 10)) {
|
elseif (($_SESSION['config']->get_scriptPath() == null) || (strlen($_SESSION['config']->get_scriptPath()) < 10)) {
|
||||||
$container->addElement(new htmlImage($failImage));
|
$container->add(new htmlImage($failImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(_("No lamdaemon path set, please update your LAM configuration settings.")), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(_("No lamdaemon path set, please update your LAM configuration settings.")), true);
|
|
||||||
$stopTest = true;
|
$stopTest = true;
|
||||||
}
|
}
|
||||||
elseif (substr($_SESSION['config']->get_scriptPath(), -3) != '.pl') {
|
elseif (substr($_SESSION['config']->get_scriptPath(), -3) != '.pl') {
|
||||||
$container->addElement(new htmlImage($failImage));
|
$container->add(new htmlImage($failImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(_("Lamdaemon path does not end with \".pl\". Did you enter the full path to the script?")), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(_("Lamdaemon path does not end with \".pl\". Did you enter the full path to the script?")), true);
|
|
||||||
$stopTest = true;
|
$stopTest = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$container->addElement(new htmlImage($okImage));
|
$container->add(new htmlImage($okImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(sprintf(_("Using %s as lamdaemon remote server."), $serverName)), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(sprintf(_("Using %s as lamdaemon remote server."), $serverName)), true);
|
|
||||||
}
|
}
|
||||||
|
$container->addVerticalSpacer('0.5rem');
|
||||||
flush();
|
|
||||||
|
|
||||||
// check Unix account of LAM admin
|
// check Unix account of LAM admin
|
||||||
$credentials = $_SESSION['ldap']->decrypt_login();
|
$credentials = $_SESSION['ldap']->decrypt_login();
|
||||||
if (!$stopTest) {
|
if (!$stopTest) {
|
||||||
$scriptUserName = $_SESSION['config']->getScriptUserName();
|
$scriptUserName = $_SESSION['config']->getScriptUserName();
|
||||||
if (empty($scriptUserName)) {
|
if (empty($scriptUserName)) {
|
||||||
$container->addElement(new htmlOutputText(_("Unix account")));
|
$container->add(new htmlOutputText(_("Unix account")), 10, 4);
|
||||||
$container->addElement($spacer);
|
|
||||||
$unixOk = false;
|
$unixOk = false;
|
||||||
$sr = @ldap_read($_SESSION['ldap']->server(), $credentials[0], "objectClass=posixAccount", array('uid'), 0, 0, 0, LDAP_DEREF_NEVER);
|
$sr = @ldap_read($_SESSION['ldap']->server(), $credentials[0], "objectClass=posixAccount", array('uid'), 0, 0, 0, LDAP_DEREF_NEVER);
|
||||||
if ($sr) {
|
if ($sr) {
|
||||||
|
@ -241,46 +225,39 @@ function lamRunTestSuite($serverName, $serverTitle, $testQuota, $container) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($unixOk) {
|
if ($unixOk) {
|
||||||
$container->addElement(new htmlImage($okImage));
|
$container->add(new htmlImage($okImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(sprintf(_("Using %s to connect to remote server."), $userName)), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(sprintf(_("Using %s to connect to remote server."), $userName)), true);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$container->addElement(new htmlImage($failImage));
|
$container->add(new htmlImage($failImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(sprintf(_("Your LAM admin user (%s) must be a valid Unix account to work with lamdaemon!"), $credentials[0])), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(sprintf(_("Your LAM admin user (%s) must be a valid Unix account to work with lamdaemon!"), $credentials[0])), true);
|
|
||||||
$stopTest = true;
|
$stopTest = true;
|
||||||
}
|
}
|
||||||
|
$container->addVerticalSpacer('0.5rem');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$userName = $_SESSION['config']->getScriptUserName();
|
$userName = $_SESSION['config']->getScriptUserName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flush();
|
|
||||||
|
|
||||||
// check SSH login
|
// check SSH login
|
||||||
$remote = new Remote();
|
$remote = new Remote();
|
||||||
if (!$stopTest) {
|
if (!$stopTest) {
|
||||||
$container->addElement(new htmlOutputText(_("SSH connection")));
|
$container->add(new htmlOutputText(_("SSH connection")), 10, 4);
|
||||||
$container->addElement($spacer);
|
|
||||||
flush();
|
flush();
|
||||||
$sshOk = false;
|
$sshOk = false;
|
||||||
try {
|
try {
|
||||||
$remote->connect($serverName);
|
$remote->connect($serverName);
|
||||||
$container->addElement(new htmlImage($okImage));
|
$container->add(new htmlImage($okImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText(_("SSH connection established.")), 12, 6);
|
||||||
$container->addElement(new htmlOutputText(_("SSH connection established.")), true);
|
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
$container->addElement(new htmlImage($failImage));
|
$container->add(new htmlImage($failImage), 2);
|
||||||
$container->addElement($spacer);
|
$container->add(new htmlOutputText($e->getMessage()), 12, 6);
|
||||||
$container->addElement(new htmlOutputText($e->getMessage()), true);
|
|
||||||
$stopTest = true;
|
$stopTest = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$container->addVerticalSpacer('0.5rem');
|
||||||
flush();
|
|
||||||
|
|
||||||
if (!$stopTest) {
|
if (!$stopTest) {
|
||||||
$stopTest = testRemoteCommand("+" . $SPLIT_DELIMITER . "test" . $SPLIT_DELIMITER . "basic", $stopTest, $remote, _("Execute lamdaemon"), $container);
|
$stopTest = testRemoteCommand("+" . $SPLIT_DELIMITER . "test" . $SPLIT_DELIMITER . "basic", $stopTest, $remote, _("Execute lamdaemon"), $container);
|
||||||
|
@ -299,10 +276,10 @@ function lamRunTestSuite($serverName, $serverTitle, $testQuota, $container) {
|
||||||
}
|
}
|
||||||
$remote->disconnect();
|
$remote->disconnect();
|
||||||
|
|
||||||
$container->addElement(new htmlSpacer(null, '10px'), true);
|
$container->addVerticalSpacer('1rem');
|
||||||
$endMessage = new htmlOutputText(_("Lamdaemon test finished."));
|
$endMessage = new htmlOutputText(_("Lamdaemon test finished."));
|
||||||
$endMessage->colspan = 5;
|
$endMessage->colspan = 5;
|
||||||
$container->addElement($endMessage);
|
$container->add($endMessage, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace LAM\TOOLS\TESTS;
|
||||||
|
use \htmlResponsiveRow;
|
||||||
|
use \htmlTitle;
|
||||||
|
use \htmlStatusMessage;
|
||||||
|
use \htmlSubTitle;
|
||||||
|
use \htmlOutputText;
|
||||||
|
use \htmlImage;
|
||||||
/*
|
/*
|
||||||
$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) 2007 - 2017 Roland Gruber
|
Copyright (C) 2007 - 2018 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
|
||||||
|
@ -48,18 +54,18 @@ checkIfToolIsActive('toolTests');
|
||||||
|
|
||||||
setlanguage();
|
setlanguage();
|
||||||
|
|
||||||
include '../main_header.php';
|
include '../../lib/adminHeader.inc';
|
||||||
echo "<div class=\"user-bright smallPaddingContent\">\n";
|
echo "<div class=\"user-bright smallPaddingContent\">\n";
|
||||||
|
|
||||||
$container = new htmlTable();
|
$container = new htmlResponsiveRow();
|
||||||
|
|
||||||
$container->addElement(new htmlTitle(_("Schema test")), true);
|
$container->add(new htmlTitle(_("Schema test")), 12);
|
||||||
|
|
||||||
get_schema_objectclasses();
|
get_schema_objectclasses();
|
||||||
$classes = get_cached_schema('objectclasses');
|
$classes = get_cached_schema('objectclasses');
|
||||||
|
|
||||||
if (!is_array($classes)) {
|
if (!is_array($classes)) {
|
||||||
$container->addElement(new htmlStatusMessage('ERROR', _('Unable to retrieve schema!'), _('You do not have the required access rights or the LDAP schema is not published by your server.')));
|
$container->add(new htmlStatusMessage('ERROR', _('Unable to retrieve schema!'), _('You do not have the required access rights or the LDAP schema is not published by your server.')), 12);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// loop for active account types
|
// loop for active account types
|
||||||
|
@ -67,7 +73,7 @@ else {
|
||||||
$types = $typeManager->getConfiguredTypes();
|
$types = $typeManager->getConfiguredTypes();
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
$modules = $_SESSION['config']->get_AccountModules($type->getId());
|
$modules = $_SESSION['config']->get_AccountModules($type->getId());
|
||||||
$container->addElement(new htmlSubTitle($type->getAlias()), true);
|
$container->add(new htmlSubTitle($type->getAlias()), 12);
|
||||||
for ($m = 0; $m < sizeof($modules); $m++) {
|
for ($m = 0; $m < sizeof($modules); $m++) {
|
||||||
$error = checkSchemaForModule($modules[$m], $type->getScope(), $type->getId());
|
$error = checkSchemaForModule($modules[$m], $type->getScope(), $type->getId());
|
||||||
$message = _("No problems found.");
|
$message = _("No problems found.");
|
||||||
|
@ -77,13 +83,12 @@ else {
|
||||||
$message = $error;
|
$message = $error;
|
||||||
}
|
}
|
||||||
// module name
|
// module name
|
||||||
$container->addElement(new htmlOutputText(getModuleAlias($modules[$m], $type->getScope())));
|
$container->add(new htmlOutputText(getModuleAlias($modules[$m], $type->getScope())), 10, 3);
|
||||||
$container->addElement(new htmlSpacer('10px', null));
|
|
||||||
// icon
|
// icon
|
||||||
$container->addElement(new htmlImage($icon));
|
$container->add(new htmlImage($icon), 2);
|
||||||
$container->addElement(new htmlSpacer('10px', null));
|
|
||||||
// text
|
// text
|
||||||
$container->addElement(new htmlOutputText($message), true);
|
$container->add(new htmlOutputText($message), 12, 7);
|
||||||
|
$container->addVerticalSpacer('0.5rem');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +97,7 @@ $tabindex = 1;
|
||||||
parseHtml(null, $container, array(), true, $tabindex, 'user');
|
parseHtml(null, $container, array(), true, $tabindex, 'user');
|
||||||
|
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
include '../main_footer.php';
|
include '../../lib/adminFooter.inc';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the object classes and attributes for this module are available.
|
* Checks if the object classes and attributes for this module are available.
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
namespace LAM\TOOLS\TESTS;
|
||||||
|
use \htmlResponsiveRow;
|
||||||
|
use \htmlTitle;
|
||||||
|
use \htmlOutputText;
|
||||||
|
use \htmlLink;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue