diff --git a/api/actions/profile.php b/api/actions/getprofile.php similarity index 77% rename from api/actions/profile.php rename to api/actions/getprofile.php index a6ec639..3e8f420 100644 --- a/api/actions/profile.php +++ b/api/actions/getprofile.php @@ -7,13 +7,13 @@ */ if (empty($VARS["id"])) { - $profile = $database->get("accounts", ["[>]authkeys" => ["accountid"]], ["publicid", "name", "username", "type", "verified"], ["key" => $VARS["key"]]); + $profile = $database->get("accounts", ["[>]authkeys" => ["accountid"]], ["publicid", "name", "username", "type", "verified", "bio"], ["key" => $VARS["key"]]); } else { if (!$database->has("accounts", ["publicid" => $VARS["id"]])) { sendJsonResp($Strings->get("Could not find a matching account.", false), "ERROR"); } - $profile = $database->get("accounts", ["publicid", "name", "username", "type", "verified"], ["publicid" => $VARS["id"]]); + $profile = $database->get("accounts", ["publicid", "name", "username", "type", "verified", "bio"], ["publicid" => $VARS["id"]]); } // Make sure the name field always has something useful @@ -21,6 +21,10 @@ if (empty($profile["name"])) { $profile["name"] = $profile["username"]; } +if (empty($profile["bio"])) { + $profile["bio"] = ""; +} + $profile["verified"] = $profile["verified"] == 1; exitWithJson([ diff --git a/api/apisettings.php b/api/apisettings.php index c801160..a97ec6f 100644 --- a/api/apisettings.php +++ b/api/apisettings.php @@ -60,7 +60,7 @@ $APIS = [ ] ], "getprofile" => [ - "load" => "profile.php", + "load" => "getprofile.php", "vars" => [ "key" => $keyregex, "id (optional)" => "/[0-9a-z]+/" diff --git a/database.mwb b/database.mwb index 9b44091..393a5e6 100644 Binary files a/database.mwb and b/database.mwb differ