Author: jfthomps
Date: Tue Feb 28 17:26:22 2017
New Revision: 1784785
URL: http://svn.apache.org/viewvc?rev=1784785&view=rev
Log:
VCL-277 - Add support for images to join Active Directory domains
VCL-867 - Active Directory Authentication for Windows VM's
requests.php: modified AJconnectRequest: if domainDNSName is set for image and
password is empty, append domainDNSName to username
utils.php:
-modified getRequestInfo: added domainDNSName to returned data as part of the
$data['reservations'] array
-modified sendRDPfile: if domainDNSName is set for image and password is empty,
append domainDNSName to username
Modified:
vcl/trunk/web/.ht-inc/requests.php
vcl/trunk/web/.ht-inc/utils.php
Modified: vcl/trunk/web/.ht-inc/requests.php
URL:
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/requests.php?rev=1784785&r1=1784784&r2=1784785&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/requests.php (original)
+++ vcl/trunk/web/.ht-inc/requests.php Tue Feb 28 17:26:22 2017
@@ -4334,6 +4334,8 @@ function AJconnectRequest() {
$conuser = $matches[1];
else
$conuser = $user['unityid'];
+ if($requestData['reservations'][0]['domainDNSName'] !=
'' && ! strlen($passwd))
+ $conuser .= "@" .
$requestData['reservations'][0]['domainDNSName'];
if(! strlen($passwd))
$passwd = i('(use your campus password)');
if($cluster)
Modified: vcl/trunk/web/.ht-inc/utils.php
URL:
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1784785&r1=1784784&r2=1784785&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Tue Feb 28 17:26:22 2017
@@ -5489,7 +5489,9 @@ function findManagementNode($compid, $st
/// \b forcheckout - whether or not the image is intended for checkout\n
/// \b password - password for this computer\n
/// \b connectIP - IP to which user will connect\n
-/// \b remoteIP - IP of remote user\n\n
+/// \b remoteIP - IP of remote user\n
+/// \b domainDNSName - AD domain DNS name associated with image if image is
+/// using AD integration; empty string if AD integration not being used\n\n
/// an array of arrays of passwords whose key is 'passwds', with the next key
/// being the reservationid and the elements being the userid as a key and that
/// user's password as the value
@@ -5544,9 +5546,12 @@ function getRequestInfo($id, $returnNULL
. "i.forcheckout, "
. "rs.pw AS password, "
. "COALESCE(nh.publicIPaddress, c.IPaddress) AS
connectIP, "
- . "rs.remoteIP "
+ . "rs.remoteIP, "
+ . "ad.domainDNSName "
. "FROM reservation rs, "
- . "image i, "
+ . "image i "
+ . "LEFT JOIN imageaddomain iadd ON (i.id = iadd.imageid) "
+ . "LEFT JOIN addomain ad ON (iadd.addomainid = ad.id), "
. "imagerevision ir, "
. "OS o, "
. "computer c "
@@ -9944,9 +9949,12 @@ function sendRDPfile() {
print "username:s:Administrator\r\n";
else {
if(preg_match('/(.*)@(.*)/', $user['unityid'], $matches))
- print "username:s:" . $matches[1] . "\r\n";
+ $userid = $matches[1];
else
- print "username:s:" . $user["unityid"] . "\r\n";
+ $userid = $user["unityid"];
+ if($request['reservations'][0]['domainDNSName'] != '' && !
strlen($passwd))
+ $userid .= "@" .
$request['reservations'][0]['domainDNSName'];
+ print "username:s:$userid\r\n";
}
print "clear password:s:$passwd\r\n";
print "domain:s:\r\n";