allow to specify SSH port

This commit is contained in:
Roland Gruber 2008-07-03 18:42:26 +00:00
parent f33f26fd19
commit 8eff004b83
3 changed files with 17 additions and 4 deletions

View File

@ -106,8 +106,9 @@ $helpArray = array (
"Text" => _("Here you can select which plugins you want to use for account management.") . "<br><br>"
. _("Account types define which sorts of LDAP entries (e.g. users and groups) should be managed. The account modules define which properties (e.g. Unix and Samba) can be edited.")),
"218" => array ("Headline" => _("Configuration wizard") . " - " . _("Script servers"),
"Text" => _("This is a list of the servers where the lamdaemon scripts are stored. LDAP Account Manager will make a SSH connection to the servers with the user name and password provided at login. Multiple servers are separated by semicolons. You can append a descriptive name after a colon.") . "<br><br>"
. _("Example") . ": <b>127.0.0.1:LOCAL;192.168.0.2:Servername;</b>"),
"Text" => _("This is a list of the servers where the lamdaemon scripts are stored. LDAP Account Manager will make a SSH connection to the servers with the user name and password provided at login. Multiple servers are separated by semicolons. You can append a descriptive name after a colon.") . "<br>"
. _("If your server runs on another port then add a comma and the port number after the server.") . "<br><br>"
. _("Example") . ": <b>127.0.0.1:LOCAL;192.168.0.2,12345:Servername;192.168.0.5</b>"),
"219" => array ("Headline" => _("Configuration wizard") . " - " . _("Rights for the home directory"),
"Text" => _("This defines the rights for the home directories which are created by lamdaemon.")),
"230" => array ("Headline" => _("Profile management") . " - " . _("Add profile"),

View File

@ -98,7 +98,13 @@ function lamdaemonSSH($commands, $server) {
$commands = implode("\n", $commands) . "\n";
// get username and password of the current lam-admin
$credentials = $_SESSION['ldap']->decrypt_login();
$handle = @ssh2_connect($server);
$serverNameParts = explode(",", $server);
if (sizeof($serverNameParts) > 1) {
$handle = @ssh2_connect($serverNameParts[0], $serverNameParts[1]);
}
else {
$handle = @ssh2_connect($server);
}
if ($handle) {
$sr = @ldap_read($_SESSION['ldap']->server(), $credentials[0], "objectClass=posixAccount", array('uid'));
if (!$sr) {

View File

@ -269,7 +269,13 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota) {
echo "<tr class=\"userlist\">\n<td nowrap>" . _("SSH connection") . "&nbsp;&nbsp;</td>\n";
flush();
$sshOk = false;
$handle = @ssh2_connect($serverName);
$serverNameParts = explode(",", $serverName);
if (sizeof($serverNameParts) > 1) {
$handle = @ssh2_connect($serverNameParts[0], $serverNameParts[1]);
}
else {
$handle = @ssh2_connect($serverName);
}
if ($handle) {
if (@ssh2_auth_password($handle, $userName, $credentials[1])) {
$sshOk = true;