summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-19 10:59:14 -0700
committerBrion Vibber <brion@pobox.com>2010-05-19 10:59:14 -0700
commita39a934dd4a133bad6e76fa9a5018cedcb70225c (patch)
treef82b4248da5447780df322c35ca041956bcd887e /actions
parentd0ba34e0f32ac71b552302ec875943e0e9236720 (diff)
parent74a89b1fc37067d91d31bd66922053361eb4e616 (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'actions')
-rw-r--r--actions/login.php22
-rw-r--r--actions/register.php7
-rw-r--r--actions/twitapisearchatom.php20
3 files changed, 46 insertions, 3 deletions
diff --git a/actions/login.php b/actions/login.php
index dc6352368..d3e4312f7 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -63,6 +63,28 @@ class LoginAction extends Action
}
/**
+ * Prepare page to run
+ *
+ *
+ * @param $args
+ * @return string title
+ */
+
+ function prepare($args)
+ {
+ parent::prepare($args);
+
+ // @todo this check should really be in index.php for all sensitive actions
+ $ssl = common_config('site', 'ssl');
+ if (empty($_SERVER['HTTPS']) && ($ssl == 'always' || $ssl == 'sometimes')) {
+ common_redirect(common_local_url('login'));
+ // exit
+ }
+
+ return true;
+ }
+
+ /**
* Handle input, produce output
*
* Switches on request method; either shows the form or handles its input.
diff --git a/actions/register.php b/actions/register.php
index 7fdbb4ded..2fc7ef921 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -74,6 +74,13 @@ class RegisterAction extends Action
parent::prepare($args);
$this->code = $this->trimmed('code');
+ // @todo this check should really be in index.php for all sensitive actions
+ $ssl = common_config('site', 'ssl');
+ if (empty($_SERVER['HTTPS']) && ($ssl == 'always' || $ssl == 'sometimes')) {
+ common_redirect(common_local_url('register'));
+ // exit
+ }
+
if (empty($this->code)) {
common_ensure_session();
if (array_key_exists('invitecode', $_SESSION)) {
diff --git a/actions/twitapisearchatom.php b/actions/twitapisearchatom.php
index 24aa619bd..51e8a8881 100644
--- a/actions/twitapisearchatom.php
+++ b/actions/twitapisearchatom.php
@@ -342,10 +342,24 @@ class TwitapisearchatomAction extends ApiAction
'rel' => 'related',
'href' => $profile->avatarUrl()));
- // TODO: Here is where we'd put in a link to an atom feed for threads
+ // @todo: Here is where we'd put in a link to an atom feed for threads
+
+ $source = null;
+
+ $ns = $notice->getSource();
+ if ($ns) {
+ if (!empty($ns->name) && !empty($ns->url)) {
+ $source = '<a href="'
+ . htmlspecialchars($ns->url)
+ . '" rel="nofollow">'
+ . htmlspecialchars($ns->name)
+ . '</a>';
+ } else {
+ $source = $ns->code;
+ }
+ }
- $this->element("twitter:source", null,
- htmlentities($this->sourceLink($notice->source)));
+ $this->element("twitter:source", null, $source);
$this->elementStart('author');