summaryrefslogtreecommitdiff
path: root/actions/apiaccountupdateprofilecolors.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-11-09 23:56:02 -0800
committerZach Copley <zach@status.net>2009-11-09 23:56:02 -0800
commitc8bd6d9f7afde597f3b404acb05622a73f3738f7 (patch)
tree218275a6e49175debb0cb28d89c02bd1942a8adb /actions/apiaccountupdateprofilecolors.php
parent312c745884654a461ed6da22eebe78f07f500426 (diff)
Make /api/account/update_profile_background_image.format work even
when there isn't an existing Design for the user. Plus a few other fixups.
Diffstat (limited to 'actions/apiaccountupdateprofilecolors.php')
-rw-r--r--actions/apiaccountupdateprofilecolors.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/actions/apiaccountupdateprofilecolors.php b/actions/apiaccountupdateprofilecolors.php
index d7d2161fe..3cac82974 100644
--- a/actions/apiaccountupdateprofilecolors.php
+++ b/actions/apiaccountupdateprofilecolors.php
@@ -113,6 +113,15 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
return;
}
+ if (!in_array($this->format, array('xml', 'json'))) {
+ $this->clientError(
+ _('API method not found.'),
+ 404,
+ $this->format
+ );
+ return;
+ }
+
$design = $this->user->getDesign();
if (!empty($design)) {
@@ -130,7 +139,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__);
- $this->clientError(_('Couldn\'t update your design.'));
+ $this->clientError(_('Could not update your design.'));
return;
}
@@ -152,7 +161,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (empty($id)) {
common_log_db_error($id, 'INSERT', __FILE__);
- $this->clientError(_('Unable to save your design settings!'));
+ $this->clientError(_('Unable to save your design settings.'));
return;
}
@@ -162,7 +171,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
if (empty($result)) {
common_log_db_error($original, 'UPDATE', __FILE__);
- $this->clientError(_('Unable to save your design settings!'));
+ $this->clientError(_('Unable to save your design settings.'));
$this->user->query('ROLLBACK');
return;
}
@@ -177,7 +186,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
return;
}
- $twitter_user = $this->twitterUserArray($this->user->getProfile(), true);
+ $twitter_user = $this->twitterUserArray($profile, true);
if ($this->format == 'xml') {
$this->initDocument('xml');