Skip to content

Commit

Permalink
Merge pull request #10 from intelvwi/master
Browse files Browse the repository at this point in the history
Fix for login problem sending users to the wrong region
  • Loading branch information
cmickeyb committed Apr 2, 2013
2 parents 265ce13 + cfdb556 commit a4f07e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Grid/lib/Class.GetScene.php
Expand Up @@ -45,6 +45,7 @@ public function Execute($db, $params)

if (isset($params["SceneID"]) && UUID::TryParse($params["SceneID"], $this->SceneID))
{
log_message('debug',"GetScene by SceneID " . $params["SceneID"]);
$sql = "SELECT ID, Name, Address, Enabled, ExtraData, LastUpdate,
CONCAT('<', MinX, ',', MinY, ',', MinZ, '>') AS MinPosition,
CONCAT('<', MaxX, ',', MaxY, ',', MaxZ, '>') AS MaxPosition
Expand All @@ -55,6 +56,7 @@ public function Execute($db, $params)
}
else if (isset($params["Name"]))
{
log_message('debug',"GetScene by Name " . $params["Name"]);
$sql = "SELECT ID, Name, Address, Enabled, ExtraData, LastUpdate,
CONCAT('<', MinX, ',', MinY, ',', MinZ, '>') AS MinPosition,
CONCAT('<', MaxX, ',', MaxY, ',', MaxZ, '>') AS MaxPosition
Expand All @@ -63,8 +65,6 @@ public function Execute($db, $params)
if (isset($params["Enabled"]) && $params["Enabled"])
$sql .= " AND Enabled=1";

log_message('error',"Get Name SQL: " . $sql);

}
else if (isset($params["Position"]) && Vector3::TryParse($params["Position"], $this->Position))
{
Expand Down
11 changes: 5 additions & 6 deletions Grid/login/index.php
Expand Up @@ -292,14 +292,13 @@ function lookup_scene_by_name($name)
$gridService = $config['grid_service'];

$response = webservice_post($gridService, array(
'RequestMethod' => 'GetScenes',
'NameQuery' => $name,
'Enabled' => '1',
'MaxNumber' => '1')
'RequestMethod' => 'GetScene',
'Name' => $name,
'Enabled' => '1')
);

if (!empty($response['Success']) && is_array($response['Scenes']) && count($response['Scenes']) > 0)
return Scene::fromOSD($response['Scenes'][0]);
if (!empty($response['Success']))
return Scene::fromOSD($response);

return null;
}
Expand Down

0 comments on commit a4f07e7

Please sign in to comment.