Skip to content

Commit

Permalink
Fixed issue #8642: Unable to create session key in RemoteControl when…
Browse files Browse the repository at this point in the history
… using MSSQL server
  • Loading branch information
c-schmitz committed Jan 31, 2014
1 parent 83259e9 commit 0196d7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -36,13 +36,15 @@ public function get_session_key($username, $password)
{
$this->_jumpStartSession($username);
$sSessionKey = randomChars(32);
$sDatabasetype = Yii::app()->db->getDriverName();

$session = new Session;
$session->id = $sSessionKey;
$session->expire = time() + Yii::app()->getConfig('iSessionExpirationTime');
if($sDatabasetype=='sqlsrv' || $sDatabasetype=='mssql' || $sDatabasetype=='dblib')
$username=new CDbExpression('CONVERT(VARBINARY(MAX), '.$db->quoteValue($username).')');
$session->data = $username;
$session->save();

return $sSessionKey;
}
else
Expand Down

0 comments on commit 0196d7d

Please sign in to comment.