From 2500bf434161b95824deb7390745f609e466793e Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 31 Dec 2007 13:25:09 +0000 Subject: [PATCH] style changes --- lam/templates/tests/index.php | 4 +- lam/templates/tests/lamdaemonTest.php | 63 ++++++++++++++------------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/lam/templates/tests/index.php b/lam/templates/tests/index.php index dca13973..6f8b0dea 100644 --- a/lam/templates/tests/index.php +++ b/lam/templates/tests/index.php @@ -55,10 +55,10 @@ echo "

" . _("LAM tests") . "

\n"; echo "\n"; -echo ""; +echo ""; echo ""; -echo ""; +echo ""; echo ""; echo "
" . _("Lamdaemon test") . "  
" . _("Lamdaemon test") . "  " . _("Check if quotas and homedirectories can be managed.") . "
" . _("Schema test") . "  
" . _("Schema test") . "  " . _("Check if the LDAP schema fits the requirements of the selected account modules.") . "
\n"; diff --git a/lam/templates/tests/lamdaemonTest.php b/lam/templates/tests/lamdaemonTest.php index ea741589..c56e14df 100644 --- a/lam/templates/tests/lamdaemonTest.php +++ b/lam/templates/tests/lamdaemonTest.php @@ -64,9 +64,11 @@ echo "

" . _("Lamdaemon test") . "

\n"; * @return boolean true, if errors occured */ function lamTestLamdaemon($command, $stopTest, $handle, $testText) { + $okImage = "\"\"\n"; + $failImage = "\"\"\n"; // run lamdaemon and get user quotas if (!$stopTest) { - echo "\n" . $testText . "  \n"; + echo "\n" . $testText . "  \n"; flush(); $lamdaemonOk = false; $errorMessage = ""; @@ -99,12 +101,12 @@ function lamTestLamdaemon($command, $stopTest, $handle, $testText) { $lamdaemonOk = true; } if ($lamdaemonOk) { - echo "" . _("Ok") . ""; - echo "" . _("Lamdaemon successfully run.") . ""; + echo "" . $okImage . ""; + echo "" . _("Lamdaemon successfully run.") . ""; } else { - echo "" . _("Error") . "  \n"; - echo "\n"; + echo "" . $failImage . "  \n"; + echo "\n"; for ($i = 0; $i < sizeof($return); $i++) { call_user_func_array('StatusMessage', split(",", $return[$i])); } @@ -117,6 +119,9 @@ function lamTestLamdaemon($command, $stopTest, $handle, $testText) { return $stopTest; } +$okImage = "\"\"\n"; +$failImage = "\"\"\n"; + $servers = explode(";", $_SESSION['config']->get_scriptServers()); for ($i = 0; $i < sizeof($servers); $i++) { $servers[$i] = explode(":", $servers[$i]); @@ -136,19 +141,19 @@ for ($i = 0; $i < sizeof($servers); $i++) { echo "\n$title\n\n"; // check script server and path - echo "\n" . _("Lamdaemon server and path") . "  \n"; + echo "\n" . _("Lamdaemon server and path") . "  \n"; if (!isset($serverName) || (strlen($serverName) < 3)) { - echo "" . _("Error") . "\n"; - echo "" . _("No lamdaemon server set, please update your LAM configuration settings.") . ""; + echo "" . $failImage . "\n"; + echo "" . _("No lamdaemon server set, please update your LAM configuration settings.") . ""; } elseif (($_SESSION['config']->get_scriptPath() == null) || (strlen($_SESSION['config']->get_scriptPath()) < 10)) { - echo "" . _("Error") . "  \n"; - echo "" . _("No lamdaemon path set, please update your LAM configuration settings.") . ""; + echo "" . $failImage . "  \n"; + echo "" . _("No lamdaemon path set, please update your LAM configuration settings.") . ""; $stopTest = true; } else { - echo "" . _("Ok") . "  \n"; - echo "" . sprintf(_("Using %s as lamdaemon remote server."), $serverName) . ""; + echo "" . $okImage . "  \n"; + echo "" . sprintf(_("Using %s as lamdaemon remote server."), $serverName) . ""; } echo "\n"; @@ -156,7 +161,7 @@ for ($i = 0; $i < sizeof($servers); $i++) { // check Unix account of LAM admin if (!$stopTest) { - echo "\n" . _("Unix account") . "  \n"; + echo "\n" . _("Unix account") . "  \n"; $credentials = $_SESSION['ldap']->decrypt_login(); $unixOk = false; $sr = @ldap_read($_SESSION['ldap']->server(), $credentials[0], "objectClass=posixAccount", array('uid')); @@ -168,12 +173,12 @@ for ($i = 0; $i < sizeof($servers); $i++) { } } if ($unixOk) { - echo "" . _("Ok") . "\n"; - echo "" . sprintf(_("Using %s to connect to remote server."), $userName) . ""; + echo "" . $okImage . "\n"; + echo "" . sprintf(_("Using %s to connect to remote server."), $userName) . ""; } else { - echo "" . _("Error") . "  \n"; - echo "" . sprintf(_("Your LAM admin user (%s) must be a valid Unix account to work with lamdaemon!"), $credentials[0]) . ""; + echo "" . $failImage . "  \n"; + echo "" . sprintf(_("Your LAM admin user (%s) must be a valid Unix account to work with lamdaemon!"), $credentials[0]) . ""; $stopTest = true; } echo "\n"; @@ -183,14 +188,14 @@ for ($i = 0; $i < sizeof($servers); $i++) { // check SSH2 function if (!$stopTest) { - echo "\n" . _("SSH2 module") . "  \n"; + echo "\n" . _("SSH2 module") . "  \n"; if (function_exists("ssh2_connect")) { - echo "" . _("Ok") . ""; - echo "" . _("SSH2 module is installed.") . ""; + echo "" . $okImage . ""; + echo "" . _("SSH2 module is installed.") . ""; } else { - echo "" . _("Error") . "  \n"; - echo "" . _("Please install the SSH2 module for PHP and activate it in your php.ini!") . ""; + echo "" . $failImage . "  \n"; + echo "" . _("Please install the SSH2 module for PHP and activate it in your php.ini!") . ""; $stopTest = true; } echo "\n"; @@ -200,7 +205,7 @@ for ($i = 0; $i < sizeof($servers); $i++) { // check SSH login if (!$stopTest) { - echo "\n" . _("SSH connection") . "  \n"; + echo "\n" . _("SSH connection") . "  \n"; flush(); $sshOk = false; $handle = @ssh2_connect($serverName); @@ -210,12 +215,12 @@ for ($i = 0; $i < sizeof($servers); $i++) { } } if ($sshOk) { - echo "" . _("Ok") . ""; - echo "" . _("SSH connection could be established.") . ""; + echo "" . $okImage . ""; + echo "" . _("SSH connection could be established.") . ""; } else { - echo "" . _("Error") . "  \n"; - echo "" . _("Unable to connect to remote server!") . ""; + echo "" . $failImage . "  \n"; + echo "" . _("Unable to connect to remote server!") . ""; $stopTest = true; } echo "\n"; @@ -227,9 +232,7 @@ for ($i = 0; $i < sizeof($servers); $i++) { $stopTest = lamTestLamdaemon("+ test quota\n", $stopTest, $handle, _("Lamdaemon: Quota module installed")); $stopTest = lamTestLamdaemon("+ quota get user\n", $stopTest, $handle, _("Lamdaemon: read quotas")); - echo "
"; - - echo "\n"; + echo "
\n"; } echo "

" . _("Lamdaemon test finished.") . "

\n";