webroot/profile.php

- Create usersettings record if none exists on user_preferences_request
- Changed capitalization on boolean constants

OpenSimProfile/Modules/ProfileModule/OpenProfile.cs
- Check for null for email value after receiving user preferences


git-svn-id: http://forge.opensimulator.org/svn/osprofile/trunk@75 19860011-0018-435d-96ae-4a7b0aaa3128
This commit is contained in:
kcozens
2010-10-08 03:48:34 +00:00
parent 4082846eaa
commit 5b8d2a99cc
2 changed files with 27 additions and 7 deletions
@@ -554,11 +554,15 @@ namespace OpenSimProfile.Modules.OpenProfile
if (dataArray != null && dataArray[0] != null)
{
Hashtable d = (Hashtable)dataArray[0];
string mail = "";
if (d["email"] != null)
mail = d["email"].ToString();
remoteClient.SendUserInfoReply(
Convert.ToBoolean(d["imviaemail"]),
Convert.ToBoolean(d["visible"]),
d["email"].ToString());
mail);
}
}
+22 -6
View File
@@ -227,7 +227,7 @@ function pickinforequest($method_name, $params, $app_data)
"pickuuid = '". mysql_escape_string($pick) ."'");
$row = mysql_fetch_assoc($result);
if ($row != FALSE)
if ($row != False)
{
if ($row["description"] == null || $row["description"] == "")
$row["description"] = "No description given";
@@ -327,7 +327,7 @@ function picks_update($method_name, $params, $app_data)
}
$result = mysql_query($query);
if ($result != FALSE)
if ($result != False)
$result = True;
$response_xml = xmlrpc_encode(array(
@@ -352,7 +352,7 @@ function picks_delete($method_name, $params, $app_data)
$result = mysql_query("DELETE FROM userpicks WHERE ".
"pickuuid = '".mysql_escape_string($pickuuid) ."'");
if ($result != FALSE)
if ($result != False)
$result = True;
$response_xml = xmlrpc_encode(array(
@@ -385,7 +385,7 @@ function avatarnotesrequest($method_name, $params, $app_data)
"targetuuid = '". mysql_escape_string($targetuuid) ."'");
$row = mysql_fetch_row($result);
if ($row == FALSE)
if ($row == False)
$notes = "";
else
$notes = $row[0];
@@ -471,7 +471,7 @@ function avatar_properties_request($method_name, $params, $app_data)
"useruuid = '". mysql_escape_string($uuid) ."'");
$row = mysql_fetch_assoc($result);
if ($row != FALSE)
if ($row != False)
{
$data[] = array(
"ProfileUrl" => $row["profileURL"],
@@ -599,13 +599,29 @@ function user_preferences_request($method_name, $params, $app_data)
$result = mysql_query("SELECT imviaemail,visible,email FROM usersettings WHERE ".
"useruuid = '". mysql_escape_string($uuid) ."'");
while (($row = mysql_fetch_assoc($result)))
$row = mysql_fetch_assoc($result);
if ($row != False)
{
$data[] = array(
"imviaemail" => $row["imviaemail"],
"visible" => $row["visible"],
"email" => $row["email"]);
}
else
{
//Insert empty record for avatar.
//NOTE: The 'false' values here are enums defined in database
$sql = "INSERT INTO usersettings VALUES ".
"('". mysql_escape_string($uuid) ."', ".
"'false', 'false', '')";
$result = mysql_query($sql);
$data[] = array(
"imviaemail" => False,
"visible" => False,
"email" => "");
}
$response_xml = xmlrpc_encode(array(
'success' => True,