summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/DirectionDetector/DirectionDetectorPlugin.php230
-rw-r--r--plugins/Facebook/FBConnectAuth.php18
-rw-r--r--plugins/GeonamesPlugin.php2
-rw-r--r--plugins/LdapAuthentication/LdapAuthenticationPlugin.php7
-rw-r--r--plugins/MobileProfile/MobileProfilePlugin.php18
-rw-r--r--plugins/OpenID/finishopenidlogin.php18
-rw-r--r--plugins/OpenID/locale/nl/LC_MESSAGES/OpenID.po340
-rw-r--r--plugins/OpenID/openidserver.php4
-rw-r--r--plugins/TwitterBridge/twitter.php26
-rw-r--r--plugins/TwitterBridge/twitterauthorization.php18
-rw-r--r--plugins/TwitterBridge/twitterbasicauthclient.php15
-rw-r--r--plugins/TwitterBridge/twitteroauthclient.php17
12 files changed, 665 insertions, 48 deletions
diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php
new file mode 100644
index 000000000..303e60d5f
--- /dev/null
+++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php
@@ -0,0 +1,230 @@
+<?php
+
+/**
+ * DirectionDetector plugin, detects notices with RTL content & sets RTL
+ * style for them.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Behrooz shabani (everplays) - <behrooz@rock.com>
+ * @copyright 2009-2010 Behrooz shabani
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ *
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+define('DIRECTIONDETECTORPLUGIN_VERSION', '0.1.1');
+
+class DirectionDetectorPlugin extends Plugin {
+ /**
+ * SN plugin API, here we will make changes on rendered column
+ *
+ * @param object $notice notice is going to be saved
+ */
+ public function onStartNoticeSave(&$notice){
+ if(self::isRTL($notice->content))
+ $notice->rendered = '<span class="rtl">'.$notice->rendered.'</span>';
+ return true;
+ }
+
+ /**
+ * SN plugin API, here we will add css needed for modifiyed rendered
+ *
+ * @param
+ */
+ public function onEndShowStatusNetStyles(&$xml){
+ $xml->element('style', array('type' => 'text/css'), 'span.rtl {display:block;direction:rtl;text-align:right;float:right;width:490px;} .notice .author {float:left}');
+ }
+ /**
+ * checks that passed string is a RTL language or not
+ *
+ * @param string $str string to be checked
+ */
+ public static function isRTL($str){
+ self::getClearText($str);
+ if( is_array($cc = self::utf8ToUnicode(mb_substr($str, 0, 1, 'utf-8'))) )
+ $cc = $cc[0];
+ else
+ return false;
+ if($cc>=1536 && $cc<=1791) // arabic, persian, urdu, kurdish, ...
+ return true;
+ if($cc>=65136 && $cc<=65279) // arabic peresent 2
+ return true;
+ if($cc>=64336 && $cc<=65023) // arabic peresent 1
+ return true;
+ if($cc>=1424 && $cc<=1535) // hebrew
+ return true;
+ if($cc>=64256 && $cc<=64335) // hebrew peresent
+ return true;
+ if($cc>=1792 && $cc<=1871) // Syriac
+ return true;
+ if($cc>=1920 && $cc<=1983) // Thaana
+ return true;
+ if($cc>=1984 && $cc<=2047) // NKo
+ return true;
+ if($cc>=11568 && $cc<=11647) // Tifinagh
+ return true;
+ return false;
+ }
+
+ /**
+ * clears text from replys, tags, groups, reteets & whitespaces
+ *
+ * @param string &$str string to be cleared
+ */
+ private static function getClearText(&$str){
+ $str = preg_replace('/@[^ ]+|![^ ]+|#[^ ]+/u', '', $str); // reply, tag, group
+ $str = preg_replace('/^RT[: ]{1}| RT | RT: |^RD[: ]{1}| RD | RD: |[♺♻:]/u', '', $str); // redent, retweet
+ $str = preg_replace("/[ \r\t\n]+/", ' ', trim($str)); // remove spaces
+ }
+
+ /**
+ * Takes an UTF-8 string and returns an array of ints representing the
+ * Unicode characters. Astral planes are supported ie. the ints in the
+ * output can be > 0xFFFF. O$ccurrances of the BOM are ignored. Surrogates
+ * are not allowed. ### modified ### returns first character code
+ *
+ * Returns false if the input string isn't a valid UTF-8 octet sequence.
+ */
+ private static function utf8ToUnicode(&$str){
+ $mState = 0; // cached expected number of octets after the current octet
+ // until the beginning of the next UTF8 character sequence
+ $mUcs4 = 0; // cached Unicode character
+ $mBytes = 1; // cached expected number of octets in the current sequence
+ $out = array();
+ $len = strlen($str);
+
+ for($i = 0; $i < $len; $i++) {
+ $in = ord($str{$i});
+ if (0 == $mState) {
+ // When mState is zero we expect either a US-ASCII character or a
+ // multi-octet sequence.
+ if (0 == (0x80 & ($in))) {
+ // US-ASCII, pass straight through.
+ $out[] = $in;
+ $mBytes = 1;
+ } elseif (0xC0 == (0xE0 & ($in))) {
+ // First octet of 2 octet sequence
+ $mUcs4 = ($in);
+ $mUcs4 = ($mUcs4 & 0x1F) << 6;
+ $mState = 1;
+ $mBytes = 2;
+ } elseif (0xE0 == (0xF0 & ($in))) {
+ // First octet of 3 octet sequence
+ $mUcs4 = ($in);
+ $mUcs4 = ($mUcs4 & 0x0F) << 12;
+ $mState = 2;
+ $mBytes = 3;
+ } elseif (0xF0 == (0xF8 & ($in))) {
+ // First octet of 4 octet sequence
+ $mUcs4 = ($in);
+ $mUcs4 = ($mUcs4 & 0x07) << 18;
+ $mState = 3;
+ $mBytes = 4;
+ } elseif (0xF8 == (0xFC & ($in))) {
+ /* First octet of 5 octet sequence.
+ *
+ * This is illegal because the encoded codepoint must be either
+ * (a) not the shortest form or
+ * (b) outside the Unicode range of 0-0x10FFFF.
+ * Rather than trying to resynchronize, we will carry on until the end
+ * of the sequence and let the later error handling code catch it.
+ */
+ $mUcs4 = ($in);
+ $mUcs4 = ($mUcs4 & 0x03) << 24;
+ $mState = 4;
+ $mBytes = 5;
+ } elseif (0xFC == (0xFE & ($in))) {
+ // First octet of 6 octet sequence, see comments for 5 octet sequence.
+ $mUcs4 = ($in);
+ $mUcs4 = ($mUcs4 & 1) << 30;
+ $mState = 5;
+ $mBytes = 6;
+ } else {
+ /* Current octet is neither in the US-ASCII range nor a legal first
+ * octet of a multi-octet sequence.
+ */
+ return false;
+ }
+ } else {
+ // When mState is non-zero, we expect a continuation of the multi-octet
+ // sequence
+ if (0x80 == (0xC0 & ($in))) {
+ // Legal continuation.
+ $shift = ($mState - 1) * 6;
+ $tmp = $in;
+ $tmp = ($tmp & 0x0000003F) << $shift;
+ $mUcs4 |= $tmp;
+ if (0 == --$mState) {
+ /* End of the multi-octet sequence. mUcs4 now contains the final
+ * Unicode codepoint to be output
+ *
+ * Check for illegal sequences and codepoints.
+ */
+ // From Unicode 3.1, non-shortest form is illegal
+ if (
+ ((2 == $mBytes) && ($mUcs4 < 0x0080)) ||
+ ((3 == $mBytes) && ($mUcs4 < 0x0800)) ||
+ ((4 == $mBytes) && ($mUcs4 < 0x10000)) ||
+ (4 < $mBytes) ||
+ // From Unicode 3.2, surrogate characters are illegal
+ (($mUcs4 & 0xFFFFF800) == 0xD800) ||
+ // Codepoints outside the Unicode range are illegal
+ ($mUcs4 > 0x10FFFF)
+ ){
+ return false;
+ }
+ if (0xFEFF != $mUcs4) {
+ $out[] = $mUcs4;
+ }
+ //initialize UTF8 cache
+ $mState = 0;
+ $mUcs4 = 0;
+ $mBytes = 1;
+ }
+ } else {
+ /* ((0xC0 & (*in) != 0x80) && (mState != 0))
+ *
+ * Incomplete multi-octet sequence.
+ */
+ return false;
+ }
+ }
+ }
+ return $out;
+ }
+
+ /**
+ * plugin details
+ */
+ function onPluginVersion(&$versions){
+ $versions[] = array(
+ 'name' => 'Direction detector',
+ 'version' => DIRECTIONDETECTORPLUGIN_VERSION,
+ 'author' => 'behrooz shabani',
+ 'rawdescription' => _m('shows notices with right-to-left content in correct direction.')
+ );
+ return true;
+ }
+}
+
+/*
+// Example:
+var_dump(DirectionDetectorPlugin::isRTL('RT @everplays ♺: دادگاه به دليل عدم حضور وکلای متهمان بنا بر اصل ١٣٥ قانون اساسی غير قانونی است')); // true
+*/
diff --git a/plugins/Facebook/FBConnectAuth.php b/plugins/Facebook/FBConnectAuth.php
index 51bfc3865..8eba7fc13 100644
--- a/plugins/Facebook/FBConnectAuth.php
+++ b/plugins/Facebook/FBConnectAuth.php
@@ -138,6 +138,11 @@ class FBConnectauthAction extends Action
parent::showPage();
}
+ /**
+ * @fixme much of this duplicates core code, which is very fragile.
+ * Should probably be replaced with an extensible mini version of
+ * the core registration form.
+ */
function showContent()
{
if (!empty($this->message_text)) {
@@ -159,10 +164,15 @@ class FBConnectauthAction extends Action
'name' => 'license',
'value' => 'true'));
$this->elementStart('label', array('class' => 'checkbox', 'for' => 'license'));
- $this->text(_m('My text and files are available under '));
- $this->element('a', array('href' => common_config('license', 'url')),
- common_config('license', 'title'));
- $this->text(_m(' except this private data: password, email address, IM address, phone number.'));
+ $message = _('My text and files are available under %s ' .
+ 'except this private data: password, ' .
+ 'email address, IM address, and phone number.');
+ $link = '<a href="' .
+ htmlspecialchars(common_config('license', 'url')) .
+ '">' .
+ htmlspecialchars(common_config('license', 'title')) .
+ '</a>';
+ $this->raw(sprintf(htmlspecialchars($message), $link));
$this->elementEnd('label');
$this->elementEnd('li');
$this->elementEnd('ul');
diff --git a/plugins/GeonamesPlugin.php b/plugins/GeonamesPlugin.php
index 718af9e0b..bc5899943 100644
--- a/plugins/GeonamesPlugin.php
+++ b/plugins/GeonamesPlugin.php
@@ -458,7 +458,7 @@ class GeonamesPlugin extends Plugin
}
if (!$result->isOk()) {
- throw new Exception("HTTP error code " . $result->code);
+ throw new Exception("HTTP error code " . $result->getStatus());
}
$body = $result->getBody();
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
index 2e01738ec..0dfc4c63b 100644
--- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
+++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
@@ -96,7 +96,12 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
if($entry){
$registration_data = array();
foreach($this->attributes as $sn_attribute=>$ldap_attribute){
- $registration_data[$sn_attribute]=$entry->getValue($ldap_attribute,'single');
+ //ldap won't let us read a user's password,
+ //and we're going to set the password to a random string later anyways,
+ //so don't bother trying to read it.
+ if($sn_attribute != 'password'){
+ $registration_data[$sn_attribute]=$entry->getValue($ldap_attribute,'single');
+ }
}
if(isset($registration_data['email']) && !empty($registration_data['email'])){
$registration_data['email_confirmed']=true;
diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php
index 60bb3b68f..1c61b4fe5 100644
--- a/plugins/MobileProfile/MobileProfilePlugin.php
+++ b/plugins/MobileProfile/MobileProfilePlugin.php
@@ -234,24 +234,6 @@ class MobileProfilePlugin extends WAP20Plugin
}
- function onStartShowHeadElements($action)
- {
- // @fixme nothing appears to set a serveMobile on any action,
- // so this is useless and spews errors. Is this supposed to be
- // checking $this?
- //if (!$action->serveMobile) {
- // return true;
- //}
-
- $action->showTitle();
- $action->showShortcutIcon();
- $action->showStylesheets();
- $action->showFeeds();
- $action->showDescription();
- $action->extraHead();
- }
-
-
function onStartShowStatusNetStyles($action)
{
if (!$this->serveMobile) {
diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php
index f3a483300..32b092a0b 100644
--- a/plugins/OpenID/finishopenidlogin.php
+++ b/plugins/OpenID/finishopenidlogin.php
@@ -79,6 +79,11 @@ class FinishopenidloginAction extends Action
$this->showPage();
}
+ /**
+ * @fixme much of this duplicates core code, which is very fragile.
+ * Should probably be replaced with an extensible mini version of
+ * the core registration form.
+ */
function showContent()
{
if (!empty($this->message_text)) {
@@ -110,10 +115,15 @@ class FinishopenidloginAction extends Action
'value' => 'true'));
$this->elementStart('label', array('for' => 'license',
'class' => 'checkbox'));
- $this->text(_m('My text and files are available under '));
- $this->element('a', array('href' => common_config('license', 'url')),
- common_config('license', 'title'));
- $this->text(_m(' except this private data: password, email address, IM address, phone number.'));
+ $message = _('My text and files are available under %s ' .
+ 'except this private data: password, ' .
+ 'email address, IM address, and phone number.');
+ $link = '<a href="' .
+ htmlspecialchars(common_config('license', 'url')) .
+ '">' .
+ htmlspecialchars(common_config('license', 'title')) .
+ '</a>';
+ $this->raw(sprintf(htmlspecialchars($message), $link));
$this->elementEnd('label');
$this->elementEnd('li');
$this->elementEnd('ul');
diff --git a/plugins/OpenID/locale/nl/LC_MESSAGES/OpenID.po b/plugins/OpenID/locale/nl/LC_MESSAGES/OpenID.po
new file mode 100644
index 000000000..ae0329376
--- /dev/null
+++ b/plugins/OpenID/locale/nl/LC_MESSAGES/OpenID.po
@@ -0,0 +1,340 @@
+# Translation of StatusNet plugin OpenID to Dutch
+#
+# Author@translatewiki.net: Siebrand
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-04-11 21:42+0000\n"
+"PO-Revision-Date: 2010-04-12 00:53+0100\n"
+"Language-Team: Dutch\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Last-Translator: Siebrand Mazeland <s.mazeland@xs4all.nl>\n"
+"MIME-Version: 1.0\n"
+
+#: finishaddopenid.php:67
+msgid "Not logged in."
+msgstr "Niet aangemeld."
+
+#: finishaddopenid.php:88
+#: finishopenidlogin.php:149
+msgid "OpenID authentication cancelled."
+msgstr "De authenticatie via OpenID is afgebroken."
+
+#: finishaddopenid.php:92
+#: finishopenidlogin.php:153
+#, php-format
+msgid "OpenID authentication failed: %s"
+msgstr "De authenticatie via OpenID is mislukt: %s"
+
+#: finishaddopenid.php:112
+msgid "You already have this OpenID!"
+msgstr "U hebt deze OpenID al!"
+
+#: finishaddopenid.php:114
+msgid "Someone else already has this OpenID."
+msgstr "Iemand anders gebruikt deze OpenID al."
+
+#: finishaddopenid.php:126
+msgid "Error connecting user."
+msgstr "Fout bij het verbinden met de gebruiker."
+
+#: finishaddopenid.php:131
+msgid "Error updating profile"
+msgstr "Fout bij het bijwerken van het profiel."
+
+#: finishaddopenid.php:170
+#: openidlogin.php:95
+msgid "OpenID Login"
+msgstr "Aanmelden via OpenID"
+
+#: finishopenidlogin.php:34
+#: openidlogin.php:30
+msgid "Already logged in."
+msgstr "U bent al aangemeld."
+
+#: finishopenidlogin.php:38
+#: openidlogin.php:37
+#: openidsettings.php:194
+msgid "There was a problem with your session token. Try again, please."
+msgstr "Er was een probleem met uw sessietoken. Probeer het opnieuw."
+
+#: finishopenidlogin.php:43
+msgid "You can't register if you don't agree to the license."
+msgstr "U kunt niet registreren als u niet akkoord gaat met de licentie."
+
+#: finishopenidlogin.php:52
+#: openidsettings.php:208
+msgid "Something weird happened."
+msgstr "Er is iets vreemds gebeurd."
+
+#: finishopenidlogin.php:66
+#, php-format
+msgid "This is the first time you've logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one."
+msgstr "Dit is de eerste keer dat u aameldt bij %s en uw OpenID moet gekoppeld worden aan uw lokale gebruiker. U kunt een nieuwe gebruiker aanmaken of koppelen met uw bestaande gebruiker als u die al hebt."
+
+#: finishopenidlogin.php:72
+msgid "OpenID Account Setup"
+msgstr "Instellingen OpenID"
+
+#: finishopenidlogin.php:97
+msgid "Create new account"
+msgstr "Nieuwe gebruiker aanmaken"
+
+#: finishopenidlogin.php:99
+msgid "Create a new user with this nickname."
+msgstr "Nieuwe gebruiker met deze naam aanmaken."
+
+#: finishopenidlogin.php:102
+msgid "New nickname"
+msgstr "Nieuwe gebruiker"
+
+#: finishopenidlogin.php:104
+msgid "1-64 lowercase letters or numbers, no punctuation or spaces"
+msgstr "1-64 kleine letters of getallen; geen leestekens of spaties"
+
+#: finishopenidlogin.php:114
+msgid "My text and files are available under "
+msgstr "Mijn teksten en bestanden zijn beschikbaar onder"
+
+#: finishopenidlogin.php:117
+msgid " except this private data: password, email address, IM address, phone number."
+msgstr "behalve de volgende privégegevens: wachtwoord, e-mailadres, IM-adres, telefoonnummer."
+
+#: finishopenidlogin.php:121
+msgid "Create"
+msgstr "Aanmaken"
+
+#: finishopenidlogin.php:126
+msgid "Connect existing account"
+msgstr "Koppelen met bestaande gebruiker"
+
+#: finishopenidlogin.php:128
+msgid "If you already have an account, login with your username and password to connect it to your OpenID."
+msgstr "Als u al een gebruiker hebt, meld u dan aan met uw gebruikersnaam en wachtwoord om de gebruiker te koppelen met uw OpenID."
+
+#: finishopenidlogin.php:131
+msgid "Existing nickname"
+msgstr "Bestaande gebruiker"
+
+#: finishopenidlogin.php:134
+msgid "Password"
+msgstr "Wachtwoord"
+
+#: finishopenidlogin.php:137
+msgid "Connect"
+msgstr "Koppelen"
+
+#: finishopenidlogin.php:215
+#: finishopenidlogin.php:224
+msgid "Registration not allowed."
+msgstr "Registreren is niet mogelijk."
+
+#: finishopenidlogin.php:231
+msgid "Not a valid invitation code."
+msgstr "De uitnodigingscode is niet geldig."
+
+#: finishopenidlogin.php:241
+msgid "Nickname must have only lowercase letters and numbers and no spaces."
+msgstr "De gebruikersnaam mag alleen uit kleine letters en cijfers bestaan, en geen spaties bevatten."
+
+#: finishopenidlogin.php:246
+msgid "Nickname not allowed."
+msgstr "Deze gebruikersnaam is niet toegestaan."
+
+#: finishopenidlogin.php:251
+msgid "Nickname already in use. Try another one."
+msgstr "Deze gebruikersnaam wordt al gebruikt. Kies een andere."
+
+#: finishopenidlogin.php:258
+#: finishopenidlogin.php:338
+msgid "Stored OpenID not found."
+msgstr "Het opgeslagen OpenID is niet aangetroffen."
+
+#: finishopenidlogin.php:267
+msgid "Creating new account for OpenID that already has a user."
+msgstr "Bezig met het aanmaken van een gebruiker voor OpenID die al een gebruiker heeft."
+
+#: finishopenidlogin.php:327
+msgid "Invalid username or password."
+msgstr "Ongeldige gebruikersnaam of wachtwoord."
+
+#: finishopenidlogin.php:345
+msgid "Error connecting user to OpenID."
+msgstr "Fout bij het koppelen met OpenID."
+
+#: openid.php:141
+msgid "Cannot instantiate OpenID consumer object."
+msgstr "Het was niet mogelijk een OpenID-object aan te maken."
+
+#: openid.php:151
+msgid "Not a valid OpenID."
+msgstr "Geen geldige OpenID."
+
+#: openid.php:153
+#, php-format
+msgid "OpenID failure: %s"
+msgstr "OpenID-fout: %s"
+
+#: openid.php:180
+#, php-format
+msgid "Could not redirect to server: %s"
+msgstr "Het was niet mogelijk door te verwijzen naar de server: %s"
+
+#: openid.php:198
+#, php-format
+msgid "Could not create OpenID form: %s"
+msgstr "Het was niet mogelijk het OpenID-formulier aan te maken: %s"
+
+#: openid.php:214
+msgid "This form should automatically submit itself. If not, click the submit button to go to your OpenID provider."
+msgstr "Dit formulier hoort zichzelf automatisch op te slaan. Als dat niet gebeurt, klik dan op de knop \"Aanmelden\" om naar uw OpenID-provider te gaan."
+
+#: openid.php:246
+msgid "Error saving the profile."
+msgstr "Fout bij het opslaan van het profiel."
+
+#: openid.php:257
+msgid "Error saving the user."
+msgstr "Fout bij het opslaan van de gebruiker."
+
+#: openid.php:277
+msgid "OpenID Auto-Submit"
+msgstr "OpenID automatisch opslaan"
+
+#: openidlogin.php:66
+#, php-format
+msgid "For security reasons, please re-login with your [OpenID](%%doc.openid%%) before changing your settings."
+msgstr "Om veiligheidsreden moet u opnieuw aanmelden met uw [OpenID](%%doc.openid%%) voordat u uw instellingen kunt wijzigen."
+
+#: openidlogin.php:70
+#, php-format
+msgid "Login with an [OpenID](%%doc.openid%%) account."
+msgstr "Aanmelden met een [OpenID](%%doc.openid%%)-gebruiker."
+
+#: openidlogin.php:112
+msgid "OpenID login"
+msgstr "Aanmelden via OpenID"
+
+#: openidlogin.php:117
+#: openidsettings.php:107
+msgid "OpenID URL"
+msgstr "OpenID-URL"
+
+#: openidlogin.php:119
+msgid "Your OpenID URL"
+msgstr "Uw OpenID-URL"
+
+#: openidlogin.php:122
+msgid "Remember me"
+msgstr "Aanmeldgegevens onthouden"
+
+#: openidlogin.php:123
+msgid "Automatically login in the future; not for shared computers!"
+msgstr "In het vervolg automatisch aanmelden. Niet gebruiken op gedeelde computers!"
+
+#: openidlogin.php:127
+msgid "Login"
+msgstr "Aanmelden"
+
+#: OpenIDPlugin.php:123
+#: OpenIDPlugin.php:135
+msgid "OpenID"
+msgstr "OpenID"
+
+#: OpenIDPlugin.php:124
+msgid "Login or register with OpenID"
+msgstr "Aanmelden of registreren met OpenID"
+
+#: OpenIDPlugin.php:136
+msgid "Add or remove OpenIDs"
+msgstr "OpenID's toevoegen of verwijderen"
+
+#: OpenIDPlugin.php:324
+msgid "Use <a href=\"http://openid.net/\">OpenID</a> to login to the site."
+msgstr "Gebruik <a href=\"http://openid.net/\">OpenID</a> om aan te melden bij de site."
+
+#: openidserver.php:106
+#, php-format
+msgid "You are not authorized to use the identity %s."
+msgstr "U mag de identiteit %s niet gebruiken."
+
+#: openidserver.php:126
+msgid "Just an OpenID provider. Nothing to see here, move along..."
+msgstr "Gewoon een OpenID-provider. Niets te zien hier..."
+
+#: openidsettings.php:59
+msgid "OpenID settings"
+msgstr "OpenID-instellingen"
+
+#: openidsettings.php:70
+#, php-format
+msgid "[OpenID](%%doc.openid%%) lets you log into many sites with the same user account. Manage your associated OpenIDs from here."
+msgstr "Met [OpenID](%%doc.openid%%) kunt u aanmelden bij veel websites met dezelfde gebruiker. U kunt hier uw gekoppelde OpenID's beheren."
+
+#: openidsettings.php:99
+msgid "Add OpenID"
+msgstr "OpenID toevoegen"
+
+#: openidsettings.php:102
+msgid "If you want to add an OpenID to your account, enter it in the box below and click \"Add\"."
+msgstr "Als u een OpenID aan uw gebruiker wilt toevoegen, voer deze dan hieronder in en klik op \"Toevoegen\"."
+
+#: openidsettings.php:117
+msgid "Add"
+msgstr "Toevoegen"
+
+#: openidsettings.php:129
+msgid "Remove OpenID"
+msgstr "OpenID verwijderen"
+
+#: openidsettings.php:134
+msgid "Removing your only OpenID would make it impossible to log in! If you need to remove it, add another OpenID first."
+msgstr "Door uw enige OpenID te verwijderen zou het niet meer mogelijk zijn om aan te melden. Als u het wilt verwijderen, voeg dan eerst een andere OpenID toe."
+
+#: openidsettings.php:149
+msgid "You can remove an OpenID from your account by clicking the button marked \"Remove\"."
+msgstr "U kunt een OpenID van uw gebruiker verwijderen door te klikken op de knop \"Verwijderen\"."
+
+#: openidsettings.php:172
+msgid "Remove"
+msgstr "Verwijderen"
+
+#: openidsettings.php:228
+msgid "No such OpenID."
+msgstr "De OpenID bestaat niet."
+
+#: openidsettings.php:233
+msgid "That OpenID does not belong to you."
+msgstr "Die OpenID is niet van u."
+
+#: openidsettings.php:237
+msgid "OpenID removed."
+msgstr "OpenID verwijderd."
+
+#: openidtrust.php:51
+msgid "OpenID Identity Verification"
+msgstr "OpenID-identiteitscontrole"
+
+#: openidtrust.php:69
+msgid "This page should only be reached during OpenID processing, not directly."
+msgstr "Deze pagina hoort alleen bezocht te worden tijdens het verwerken van een OpenID, en niet direct."
+
+#: openidtrust.php:118
+#, php-format
+msgid "%s has asked to verify your identity. Click Continue to verify your identity and login without creating a new password."
+msgstr "%s heeft gevraagd uw identiteit te bevestigen. Klik op \"Doorgaan\" om uw indentiteit te controleren en aan te melden zonder een wachtwoord te hoeven invoeren."
+
+#: openidtrust.php:136
+msgid "Continue"
+msgstr "Doorgaan"
+
+#: openidtrust.php:137
+msgid "Cancel"
+msgstr "Annuleren"
+
diff --git a/plugins/OpenID/openidserver.php b/plugins/OpenID/openidserver.php
index afbca553f..a31596a10 100644
--- a/plugins/OpenID/openidserver.php
+++ b/plugins/OpenID/openidserver.php
@@ -71,7 +71,7 @@ class OpenidserverAction extends Action
}else{
/* Go log in, and then come back. */
common_set_returnto($_SERVER['REQUEST_URI']);
- common_redirect(common_local_url('login'));
+ common_redirect(common_local_url('login'), 303);
return;
}
}else if(common_profile_url($user->nickname) == $request->identity || $request->idSelect()){
@@ -91,7 +91,7 @@ class OpenidserverAction extends Action
$_SESSION['openid_allow_url'] = $allowResponse->encodeToUrl();
$_SESSION['openid_deny_url'] = $denyResponse->encodeToUrl();
//ask the user to trust this trust root
- common_redirect(common_local_url('openidtrust'));
+ common_redirect(common_local_url('openidtrust'), 303);
return;
}
}else{
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 2805b3ab5..21adc7a90 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -124,15 +124,36 @@ function broadcast_twitter($notice)
return true;
}
+/**
+ * Pull any extra information from a notice that we should transfer over
+ * to Twitter beyond the notice text itself.
+ *
+ * @param Notice $notice
+ * @return array of key-value pairs for Twitter update submission
+ * @access private
+ */
+function twitter_update_params($notice)
+{
+ $params = array();
+ if ($notice->lat || $notice->lon) {
+ $params['lat'] = $notice->lat;
+ $params['long'] = $notice->lon;
+ }
+ return $params;
+}
+
+
function broadcast_oauth($notice, $flink) {
$user = $flink->getUser();
$statustxt = format_status($notice);
+ $params = twitter_update_params($notice);
+
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
$status = null;
try {
- $status = $client->statusesUpdate($statustxt);
+ $status = $client->statusesUpdate($statustxt, $params);
} catch (OAuthClientException $e) {
return process_error($e, $flink, $notice);
}
@@ -171,12 +192,13 @@ function broadcast_basicauth($notice, $flink)
$user = $flink->getUser();
$statustxt = format_status($notice);
+ $params = twitter_update_params($notice);
$client = new TwitterBasicAuthClient($flink);
$status = null;
try {
- $status = $client->statusesUpdate($statustxt);
+ $status = $client->statusesUpdate($statustxt, $params);
} catch (BasicAuthException $e) {
return process_error($e, $flink, $notice);
}
diff --git a/plugins/TwitterBridge/twitterauthorization.php b/plugins/TwitterBridge/twitterauthorization.php
index bc004cb95..7a896e168 100644
--- a/plugins/TwitterBridge/twitterauthorization.php
+++ b/plugins/TwitterBridge/twitterauthorization.php
@@ -332,6 +332,11 @@ class TwitterauthorizationAction extends Action
parent::showPage();
}
+ /**
+ * @fixme much of this duplicates core code, which is very fragile.
+ * Should probably be replaced with an extensible mini version of
+ * the core registration form.
+ */
function showContent()
{
if (!empty($this->message_text)) {
@@ -353,10 +358,15 @@ class TwitterauthorizationAction extends Action
'name' => 'license',
'value' => 'true'));
$this->elementStart('label', array('class' => 'checkbox', 'for' => 'license'));
- $this->text(_('My text and files are available under '));
- $this->element('a', array('href' => common_config('license', 'url')),
- common_config('license', 'title'));
- $this->text(_(' except this private data: password, email address, IM address, phone number.'));
+ $message = _('My text and files are available under %s ' .
+ 'except this private data: password, ' .
+ 'email address, IM address, and phone number.');
+ $link = '<a href="' .
+ htmlspecialchars(common_config('license', 'url')) .
+ '">' .
+ htmlspecialchars(common_config('license', 'title')) .
+ '</a>';
+ $this->raw(sprintf(htmlspecialchars($message), $link));
$this->elementEnd('label');
$this->elementEnd('li');
$this->elementEnd('ul');
diff --git a/plugins/TwitterBridge/twitterbasicauthclient.php b/plugins/TwitterBridge/twitterbasicauthclient.php
index fd26293f9..2c18c9469 100644
--- a/plugins/TwitterBridge/twitterbasicauthclient.php
+++ b/plugins/TwitterBridge/twitterbasicauthclient.php
@@ -76,18 +76,21 @@ class TwitterBasicAuthClient
/**
* Calls Twitter's /statuses/update API method
*
- * @param string $status text of the status
- * @param int $in_reply_to_status_id optional id of the status it's
- * a reply to
+ * @param string $status text of the status
+ * @param mixed $params optional other parameters to pass to Twitter,
+ * as defined. For back-compatibility, if an int
+ * is passed we'll consider it a reply-to ID.
*
* @return mixed the status
*/
function statusesUpdate($status, $in_reply_to_status_id = null)
{
$url = 'https://twitter.com/statuses/update.json';
- $params = array('status' => $status,
- 'source' => common_config('integration', 'source'),
- 'in_reply_to_status_id' => $in_reply_to_status_id);
+ if (is_numeric($params)) {
+ $params = array('in_reply_to_status_id' => intval($params));
+ }
+ $params['status'] = $status;
+ $params['source'] = common_config('integration', 'source');
$response = $this->httpRequest($url, $params);
$status = json_decode($response);
return $status;
diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php
index 93f6aadd1..d895d8c73 100644
--- a/plugins/TwitterBridge/twitteroauthclient.php
+++ b/plugins/TwitterBridge/twitteroauthclient.php
@@ -166,17 +166,22 @@ class TwitterOAuthClient extends OAuthClient
/**
* Calls Twitter's /statuses/update API method
*
- * @param string $status text of the status
- * @param int $in_reply_to_status_id optional id of the status it's
- * a reply to
+ * @param string $status text of the status
+ * @param mixed $params optional other parameters to pass to Twitter,
+ * as defined. For back-compatibility, if an int
+ * is passed we'll consider it a reply-to ID.
*
* @return mixed the status
*/
- function statusesUpdate($status, $in_reply_to_status_id = null)
+ function statusesUpdate($status, $params=array())
{
$url = 'https://twitter.com/statuses/update.json';
- $params = array('status' => $status,
- 'in_reply_to_status_id' => $in_reply_to_status_id);
+ if (is_numeric($params)) {
+ $params = array('in_reply_to_status_id' => intval($params));
+ }
+ $params['status'] = $status;
+ // We don't have to pass 'source' as the oauth key is tied to an app.
+
$response = $this->oAuthPost($url, $params);
$status = json_decode($response);
return $status;