allow to specify SSH port
This commit is contained in:
parent
f33f26fd19
commit
8eff004b83
|
@ -106,8 +106,9 @@ $helpArray = array (
|
||||||
"Text" => _("Here you can select which plugins you want to use for account management.") . "<br><br>"
|
"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.")),
|
. _("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"),
|
"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>"
|
"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>"
|
||||||
. _("Example") . ": <b>127.0.0.1:LOCAL;192.168.0.2:Servername;</b>"),
|
. _("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"),
|
"219" => array ("Headline" => _("Configuration wizard") . " - " . _("Rights for the home directory"),
|
||||||
"Text" => _("This defines the rights for the home directories which are created by lamdaemon.")),
|
"Text" => _("This defines the rights for the home directories which are created by lamdaemon.")),
|
||||||
"230" => array ("Headline" => _("Profile management") . " - " . _("Add profile"),
|
"230" => array ("Headline" => _("Profile management") . " - " . _("Add profile"),
|
||||||
|
|
|
@ -98,7 +98,13 @@ function lamdaemonSSH($commands, $server) {
|
||||||
$commands = implode("\n", $commands) . "\n";
|
$commands = implode("\n", $commands) . "\n";
|
||||||
// get username and password of the current lam-admin
|
// get username and password of the current lam-admin
|
||||||
$credentials = $_SESSION['ldap']->decrypt_login();
|
$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) {
|
if ($handle) {
|
||||||
$sr = @ldap_read($_SESSION['ldap']->server(), $credentials[0], "objectClass=posixAccount", array('uid'));
|
$sr = @ldap_read($_SESSION['ldap']->server(), $credentials[0], "objectClass=posixAccount", array('uid'));
|
||||||
if (!$sr) {
|
if (!$sr) {
|
||||||
|
|
|
@ -269,7 +269,13 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota) {
|
||||||
echo "<tr class=\"userlist\">\n<td nowrap>" . _("SSH connection") . " </td>\n";
|
echo "<tr class=\"userlist\">\n<td nowrap>" . _("SSH connection") . " </td>\n";
|
||||||
flush();
|
flush();
|
||||||
$sshOk = false;
|
$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 ($handle) {
|
||||||
if (@ssh2_auth_password($handle, $userName, $credentials[1])) {
|
if (@ssh2_auth_password($handle, $userName, $credentials[1])) {
|
||||||
$sshOk = true;
|
$sshOk = true;
|
||||||
|
|
Loading…
Reference in New Issue