diff options
author | Evan Prodromou <evan@status.net> | 2010-10-14 15:06:11 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-10-14 15:06:11 -0400 |
commit | fc6711327bcb2319139171ad3353603753f13eaa (patch) | |
tree | cfc4bee3dd7dbf9156be2f6471466884adb40704 | |
parent | 1a4dc03bfe9c02de04635411e1af78821adc4d5e (diff) |
let users set their SSL logo through the admin panel
-rw-r--r-- | actions/designadminpanel.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php index 4285f7d73..587333e06 100644 --- a/actions/designadminpanel.php +++ b/actions/designadminpanel.php @@ -140,7 +140,7 @@ class DesignadminpanelAction extends AdminPanelAction $themeChanged = ($this->trimmed('theme') != $oldtheme); } - static $settings = array('theme', 'logo'); + static $settings = array('theme', 'logo', 'ssllogo'); $values = array(); @@ -230,6 +230,7 @@ class DesignadminpanelAction extends AdminPanelAction function restoreDefaults() { $this->deleteSetting('site', 'logo'); + $this->deleteSetting('site', 'ssllogo'); $this->deleteSetting('site', 'theme'); $settings = array( @@ -293,7 +294,7 @@ class DesignadminpanelAction extends AdminPanelAction /** * Save the custom theme if the user uploaded one. - * + * * @return mixed custom theme name, if succesful, or null if no theme upload. * @throws ClientException for invalid theme archives * @throws ServerException if trouble saving the theme files @@ -331,6 +332,11 @@ class DesignadminpanelAction extends AdminPanelAction $this->clientError(_('Invalid logo URL.')); } + if (!empty($values['ssllogo']) && + !Validate::uri($values['ssllogo'], array('allowed_schemes' => array('https')))) { + $this->clientError(_('Invalid SSL logo URL.')); + } + if (!in_array($values['theme'], Theme::listAvailable())) { $this->clientError(sprintf(_("Theme not available: %s."), $values['theme'])); } @@ -444,6 +450,10 @@ class DesignAdminPanelForm extends AdminForm $this->input('logo', _('Site logo'), 'Logo for the site (full URL)'); $this->unli(); + $this->li(); + $this->input('ssllogo', _('SSL logo'), 'Logo to show on SSL pages'); + $this->unli(); + $this->out->elementEnd('ul'); $this->out->elementEnd('fieldset'); |