summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/apiaccountupdateprofile.php4
-rw-r--r--actions/apigroupshow.php29
-rw-r--r--actions/apioauthauthorize.php4
-rw-r--r--actions/apistatusnetconfig.php14
-rw-r--r--actions/confirmaddress.php2
-rw-r--r--actions/othersettings.php2
-rw-r--r--actions/version.php3
-rw-r--r--classes/File.php2
-rw-r--r--db/08to09.sql31
-rw-r--r--lib/apiaction.php9
-rw-r--r--lib/authenticationplugin.php66
-rw-r--r--lib/authorizationplugin.php2
-rw-r--r--lib/command.php29
-rw-r--r--lib/commandinterpreter.php11
-rw-r--r--lib/default.php1
-rw-r--r--lib/htmloutputter.php55
-rw-r--r--lib/imagefile.php135
-rw-r--r--lib/iomaster.php2
-rw-r--r--lib/queuemanager.php6
-rw-r--r--lib/subs.php45
-rw-r--r--lib/util.php17
-rw-r--r--locale/fr/LC_MESSAGES/statusnet.po34
-rw-r--r--locale/mk/LC_MESSAGES/statusnet.po36
-rw-r--r--locale/nl/LC_MESSAGES/statusnet.po38
-rw-r--r--locale/pl/LC_MESSAGES/statusnet.po46
-rw-r--r--locale/ru/LC_MESSAGES/statusnet.po38
-rw-r--r--locale/statusnet.po12
-rw-r--r--locale/uk/LC_MESSAGES/statusnet.po35
-rw-r--r--plugins/Autocomplete/jquery-autocomplete/indicator.gifbin0 -> 673 bytes
-rw-r--r--plugins/Comet/CometPlugin.php2
-rw-r--r--plugins/Facebook/FacebookPlugin.php2
-rw-r--r--plugins/Facebook/facebookaction.php2
-rw-r--r--plugins/Imap/ImapPlugin.php2
-rw-r--r--plugins/LdapAuthentication/LdapAuthenticationPlugin.php25
-rw-r--r--plugins/LdapAuthentication/README5
-rw-r--r--plugins/LdapAuthorization/LdapAuthorizationPlugin.php5
-rw-r--r--plugins/LdapAuthorization/README5
-rw-r--r--plugins/Minify/MinifyPlugin.php6
-rw-r--r--plugins/OStatus/OStatusPlugin.php4
-rw-r--r--plugins/OpenID/OpenIDPlugin.php11
-rw-r--r--plugins/Orbited/OrbitedPlugin.php4
-rw-r--r--plugins/README-plugins21
-rw-r--r--plugins/Realtime/RealtimePlugin.php4
-rw-r--r--plugins/Realtime/realtimeupdate.js2
-rw-r--r--plugins/Recaptcha/RecaptchaPlugin.php14
-rw-r--r--plugins/ReverseUsernameAuthentication/README5
-rw-r--r--plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php7
-rw-r--r--plugins/TabFocus/TabFocusPlugin.php57
-rw-r--r--plugins/TabFocus/tabfocus.js7
-rw-r--r--plugins/TwitterBridge/twitter.php9
-rwxr-xr-xscripts/useremail.php25
51 files changed, 698 insertions, 234 deletions
diff --git a/actions/apiaccountupdateprofile.php b/actions/apiaccountupdateprofile.php
index fd4384a25..9b371ea95 100644
--- a/actions/apiaccountupdateprofile.php
+++ b/actions/apiaccountupdateprofile.php
@@ -115,11 +115,11 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
$original = clone($profile);
- if (empty($this->name)) {
+ if (!empty($this->name)) {
$profile->fullname = $this->name;
}
- if (empty($this->url)) {
+ if (!empty($this->url)) {
$profile->homepage = $this->url;
}
diff --git a/actions/apigroupshow.php b/actions/apigroupshow.php
index 95d6f95af..5745a81f4 100644
--- a/actions/apigroupshow.php
+++ b/actions/apigroupshow.php
@@ -45,6 +45,7 @@ require_once INSTALLDIR . '/lib/apiprivateauth.php';
* @author Evan Prodromou <evan@status.net>
* @author Jeffery To <jeffery.to@gmail.com>
* @author Zach Copley <zach@status.net>
+ * @author Michele <macno@macno.org>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -68,6 +69,24 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->group = $this->getTargetGroup($this->arg('id'));
+ if (empty($this->group)) {
+ $alias = Group_alias::staticGet(
+ 'alias',
+ common_canonical_nickname($this->arg('id'))
+ );
+ if (!empty($alias)) {
+ $args = array('id' => $alias->group_id, 'format' => $this->format);
+ common_redirect(common_local_url('ApiGroupShow', $args), 301);
+ } else {
+ $this->clientError(
+ _('Group not found!'),
+ 404,
+ $this->format
+ );
+ }
+ return;
+ }
+
return true;
}
@@ -85,15 +104,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
{
parent::handle($args);
- if (empty($this->group)) {
- $this->clientError(
- _('Group not found!'),
- 404,
- $this->format
- );
- return;
- }
-
switch($this->format) {
case 'xml':
$this->showSingleXmlGroup($this->group);
@@ -105,7 +115,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->clientError(_('API method not found.'), 404, $this->format);
break;
}
-
}
/**
diff --git a/actions/apioauthauthorize.php b/actions/apioauthauthorize.php
index 2caa8d20b..e7c6f3761 100644
--- a/actions/apioauthauthorize.php
+++ b/actions/apioauthauthorize.php
@@ -156,7 +156,7 @@ class ApiOauthAuthorizeAction extends ApiOauthAction
if (!$result) {
common_log_db_error($appUser, 'DELETE', __FILE__);
- throw new ServerException(_('DB error deleting OAuth app user.'));
+ throw new ServerException(_('Database error deleting OAuth application user.'));
return;
}
}
@@ -182,7 +182,7 @@ class ApiOauthAuthorizeAction extends ApiOauthAction
if (!$result) {
common_log_db_error($appUser, 'INSERT', __FILE__);
- throw new ServerException(_('DB error inserting OAuth app user.'));
+ throw new ServerException(_('Database error inserting OAuth application user.'));
return;
}
diff --git a/actions/apistatusnetconfig.php b/actions/apistatusnetconfig.php
index 296376d19..bff8313b5 100644
--- a/actions/apistatusnetconfig.php
+++ b/actions/apistatusnetconfig.php
@@ -50,13 +50,17 @@ if (!defined('STATUSNET')) {
class ApiStatusnetConfigAction extends ApiAction
{
var $keys = array(
- 'site' => array('name', 'server', 'theme', 'path', 'fancy', 'language',
- 'email', 'broughtby', 'broughtbyurl', 'closed',
- 'inviteonly', 'private'),
- 'license' => array('url', 'title', 'image'),
+ 'site' => array('name', 'server', 'theme', 'path', 'logo', 'fancy', 'language',
+ 'email', 'broughtby', 'broughtbyurl', 'timezone', 'closed',
+ 'inviteonly', 'private', 'textlimit', 'ssl', 'sslserver', 'shorturllength'),
+ 'license' => array('type', 'owner', 'url', 'title', 'image'),
'nickname' => array('featured'),
+ 'profile' => array('biolimit'),
+ 'group' => array('desclimit'),
+ 'notice' => array('contentlimit'),
'throttle' => array('enabled', 'count', 'timespan'),
- 'xmpp' => array('enabled', 'server', 'user')
+ 'xmpp' => array('enabled', 'server', 'port', 'user'),
+ 'integration' => array('source')
);
/**
diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php
index 6fd74f3ff..cc8351d8d 100644
--- a/actions/confirmaddress.php
+++ b/actions/confirmaddress.php
@@ -141,7 +141,7 @@ class ConfirmaddressAction extends Action
function title()
{
- return _('Confirm Address');
+ return _('Confirm address');
}
/**
diff --git a/actions/othersettings.php b/actions/othersettings.php
index 0de7cd908..10e9873b3 100644
--- a/actions/othersettings.php
+++ b/actions/othersettings.php
@@ -57,7 +57,7 @@ class OthersettingsAction extends AccountSettingsAction
function title()
{
- return _('Other Settings');
+ return _('Other settings');
}
/**
diff --git a/actions/version.php b/actions/version.php
index c1f673c45..b6593e5ed 100644
--- a/actions/version.php
+++ b/actions/version.php
@@ -266,5 +266,6 @@ class VersionAction extends Action
'Craig Andrews',
'mEDI',
'Brett Taylor',
- 'Brigitte Schuster');
+ 'Brigitte Schuster',
+ 'Brion Vibber');
}
diff --git a/classes/File.php b/classes/File.php
index 91b12d2e2..189e04ce0 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -279,6 +279,8 @@ class File extends Memcached_DataObject
if($oembed->modified) $enclosure->modified=$oembed->modified;
unset($oembed->size);
}
+ } else {
+ return false;
}
}
}
diff --git a/db/08to09.sql b/db/08to09.sql
index b10e47dbc..d5f30a26b 100644
--- a/db/08to09.sql
+++ b/db/08to09.sql
@@ -110,3 +110,34 @@ insert into queue_item_new (frame,transport,created,claimed)
alter table queue_item rename to queue_item_old;
alter table queue_item_new rename to queue_item;
+alter table consumer
+ add column consumer_secret varchar(255) not null comment 'secret value';
+
+create table oauth_application (
+ id integer auto_increment primary key comment 'unique identifier',
+ owner integer not null comment 'owner of the application' references profile (id),
+ consumer_key varchar(255) not null comment 'application consumer key' references consumer (consumer_key),
+ name varchar(255) not null comment 'name of the application',
+ description varchar(255) comment 'description of the application',
+ icon varchar(255) not null comment 'application icon',
+ source_url varchar(255) comment 'application homepage - used for source link',
+ organization varchar(255) comment 'name of the organization running the application',
+ homepage varchar(255) comment 'homepage for the organization',
+ callback_url varchar(255) comment 'url to redirect to after authentication',
+ type tinyint default 0 comment 'type of app, 1 = browser, 2 = desktop',
+ access_type tinyint default 0 comment 'default access type, bit 1 = read, bit 2 = write',
+ created datetime not null comment 'date this record was created',
+ modified timestamp comment 'date this record was modified'
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table oauth_application_user (
+ profile_id integer not null comment 'user of the application' references profile (id),
+ application_id integer not null comment 'id of the application' references oauth_application (id),
+ access_type tinyint default 0 comment 'access type, bit 1 = read, bit 2 = write, bit 3 = revoked',
+ token varchar(255) comment 'request or access token',
+ created datetime not null comment 'date this record was created',
+ modified timestamp comment 'date this record was modified',
+ constraint primary key (profile_id, application_id)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+
diff --git a/lib/apiaction.php b/lib/apiaction.php
index 2af150ab9..9bfca3b66 100644
--- a/lib/apiaction.php
+++ b/lib/apiaction.php
@@ -289,11 +289,12 @@ class ApiAction extends Action
$twitter_status['attachments'] = array();
foreach ($attachments as $attachment) {
- if ($attachment->isEnclosure()) {
+ $enclosure_o=$attachment->getEnclosure();
+ if ($enclosure_o) {
$enclosure = array();
- $enclosure['url'] = $attachment->url;
- $enclosure['mimetype'] = $attachment->mimetype;
- $enclosure['size'] = $attachment->size;
+ $enclosure['url'] = $enclosure_o->url;
+ $enclosure['mimetype'] = $enclosure_o->mimetype;
+ $enclosure['size'] = $enclosure_o->size;
$twitter_status['attachments'][] = $enclosure;
}
}
diff --git a/lib/authenticationplugin.php b/lib/authenticationplugin.php
index de479a576..5be3ea5b9 100644
--- a/lib/authenticationplugin.php
+++ b/lib/authenticationplugin.php
@@ -69,13 +69,17 @@ abstract class AuthenticationPlugin extends Plugin
/**
* Automatically register a user when they attempt to login with valid credentials.
* User::register($data) is a very useful method for this implementation
- * @param username
+ * @param username username (that is used to login and find the user in the authentication provider) of the user to be registered
+ * @param nickname nickname of the user in the SN system. If nickname is null, then set nickname = username
* @return mixed instance of User, or false (if user couldn't be created)
*/
- function autoRegister($username)
+ function autoRegister($username, $nickname = null)
{
+ if(is_null($nickname)){
+ $nickname = $username;
+ }
$registration_data = array();
- $registration_data['nickname'] = $username ;
+ $registration_data['nickname'] = $nickname ;
return User::register($registration_data);
}
@@ -92,6 +96,19 @@ abstract class AuthenticationPlugin extends Plugin
return false;
}
+ /**
+ * Given a username, suggest what the nickname should be
+ * Used during autoregistration
+ * Useful if your usernames are ugly, and you want to suggest
+ * nice looking nicknames when users initially sign on
+ * @param username
+ * @return string nickname
+ */
+ function suggestNicknameForUsername($username)
+ {
+ return $username;
+ }
+
//------------Below are the methods that connect StatusNet to the implementing Auth plugin------------\\
function onInitializePlugin(){
if(!isset($this->provider_name)){
@@ -108,10 +125,22 @@ abstract class AuthenticationPlugin extends Plugin
function onAutoRegister($nickname, $provider_name, &$user)
{
if($provider_name == $this->provider_name && $this->autoregistration){
- $user = $this->autoregister($nickname);
- if($user){
- User_username::register($user,$nickname,$this->provider_name);
- return false;
+ $suggested_nickname = $this->suggestNicknameForUsername($nickname);
+ $test_user = User::staticGet('nickname', $suggested_nickname);
+ if($test_user) {
+ //someone already exists with the suggested nickname, so used the passed nickname
+ $suggested_nickname = $nickname;
+ }
+ $test_user = User::staticGet('nickname', $suggested_nickname);
+ if($test_user) {
+ //someone already exists with the suggested nickname
+ //not much else we can do
+ }else{
+ $user = $this->autoRegister($nickname, $suggested_nickname);
+ if($user){
+ User_username::register($user,$nickname,$this->provider_name);
+ return false;
+ }
}
}
}
@@ -122,23 +151,30 @@ abstract class AuthenticationPlugin extends Plugin
$user_username->username=$nickname;
$user_username->provider_name=$this->provider_name;
if($user_username->find() && $user_username->fetch()){
- $username = $user_username->username;
- $authenticated = $this->checkPassword($username, $password);
+ $authenticated = $this->checkPassword($user_username->username, $password);
if($authenticated){
$authenticatedUser = User::staticGet('id', $user_username->user_id);
return false;
}
}else{
- $user = User::staticGet('nickname', $nickname);
+ //$nickname is the username used to login
+ //$suggested_nickname is the nickname the auth provider suggests for that username
+ $suggested_nickname = $this->suggestNicknameForUsername($nickname);
+ $user = User::staticGet('nickname', $suggested_nickname);
if($user){
- //make sure a different provider isn't handling this nickname
+ //make sure this user isn't claimed
$user_username = new User_username();
- $user_username->username=$nickname;
- if(!$user_username->find()){
- //no other provider claims this username, so it's safe for us to handle it
+ $user_username->user_id=$user->id;
+ $we_can_handle = false;
+ if($user_username->find()){
+ //either this provider, or another one, has already claimed this user
+ //so we cannot. Let another plugin try.
+ return;
+ }else{
+ //no other provider claims this user, so it's safe for us to handle it
$authenticated = $this->checkPassword($nickname, $password);
if($authenticated){
- $authenticatedUser = User::staticGet('nickname', $nickname);
+ $authenticatedUser = $user;
User_username::register($authenticatedUser,$nickname,$this->provider_name);
return false;
}
diff --git a/lib/authorizationplugin.php b/lib/authorizationplugin.php
index 733b0c065..07da9b2d1 100644
--- a/lib/authorizationplugin.php
+++ b/lib/authorizationplugin.php
@@ -85,7 +85,7 @@ abstract class AuthorizationPlugin extends Plugin
}
function onStartSetApiUser(&$user) {
- return $this->onStartSetUser(&$user);
+ return $this->onStartSetUser($user);
}
function onStartHasRole($profile, $name, &$has_role) {
diff --git a/lib/command.php b/lib/command.php
index ea7b60372..db8e80030 100644
--- a/lib/command.php
+++ b/lib/command.php
@@ -668,6 +668,34 @@ class LoginCommand extends Command
}
}
+class LoseCommand extends Command
+{
+
+ var $other = null;
+
+ function __construct($user, $other)
+ {
+ parent::__construct($user);
+ $this->other = $other;
+ }
+
+ function execute($channel)
+ {
+ if(!$this->other) {
+ $channel->error($this->user, _('Specify the name of the user to unsubscribe from'));
+ return;
+ }
+
+ $result=subs_unsubscribe_from($this->user, $this->other);
+
+ if ($result) {
+ $channel->output($this->user, sprintf(_('Unsubscribed %s'), $this->other));
+ } else {
+ $channel->error($this->user, $result);
+ }
+ }
+}
+
class SubscriptionsCommand extends Command
{
function execute($channel)
@@ -750,6 +778,7 @@ class HelpCommand extends Command
"d <nickname> <text> - direct message to user\n".
"get <nickname> - get last notice from user\n".
"whois <nickname> - get profile info on user\n".
+ "lose <nickname> - force user to stop following you\n".
"fav <nickname> - add user's last notice as a 'fave'\n".
"fav #<notice_id> - add notice with the given id as a 'fave'\n".
"repeat #<notice_id> - repeat a notice with a given id\n".
diff --git a/lib/commandinterpreter.php b/lib/commandinterpreter.php
index c2add7299..fbc6174bb 100644
--- a/lib/commandinterpreter.php
+++ b/lib/commandinterpreter.php
@@ -47,6 +47,17 @@ class CommandInterpreter
} else {
return new LoginCommand($user);
}
+ case 'lose':
+ if ($arg) {
+ list($other, $extra) = $this->split_arg($arg);
+ if ($extra) {
+ return null;
+ } else {
+ return new LoseCommand($user, $other);
+ }
+ } else {
+ return null;
+ }
case 'subscribers':
if ($arg) {
return null;
diff --git a/lib/default.php b/lib/default.php
index d849055c2..b06b96157 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -279,6 +279,7 @@ $default =
'Geonames' => null,
'Mapstraction' => null,
'WikiHashtags' => null,
+ 'RSSCloud' => null,
'OpenID' => null),
),
'admin' =>
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index 7315fe2ad..7786b5941 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -356,40 +356,47 @@ class HTMLOutputter extends XMLOutputter
if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
{
- $path = common_config('javascript', 'path');
+ if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
- if (empty($path)) {
- $path = common_config('site', 'path') . '/js/';
- }
+ $src = common_path($src) . '?version=' . STATUSNET_VERSION;
- if ($path[strlen($path)-1] != '/') {
- $path .= '/';
- }
+ }else{
- if ($path[0] != '/') {
- $path = '/'.$path;
- }
+ $path = common_config('javascript', 'path');
- $server = common_config('javascript', 'server');
+ if (empty($path)) {
+ $path = common_config('site', 'path') . '/js/';
+ }
- if (empty($server)) {
- $server = common_config('site', 'server');
- }
+ if ($path[strlen($path)-1] != '/') {
+ $path .= '/';
+ }
- $ssl = common_config('javascript', 'ssl');
+ if ($path[0] != '/') {
+ $path = '/'.$path;
+ }
+
+ $server = common_config('javascript', 'server');
- if (is_null($ssl)) { // null -> guess
- if (common_config('site', 'ssl') == 'always' &&
- !common_config('javascript', 'server')) {
- $ssl = true;
- } else {
- $ssl = false;
+ if (empty($server)) {
+ $server = common_config('site', 'server');
}
- }
- $protocol = ($ssl) ? 'https' : 'http';
+ $ssl = common_config('javascript', 'ssl');
- $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
+ if (is_null($ssl)) { // null -> guess
+ if (common_config('site', 'ssl') == 'always' &&
+ !common_config('javascript', 'server')) {
+ $ssl = true;
+ } else {
+ $ssl = false;
+ }
+ }
+
+ $protocol = ($ssl) ? 'https' : 'http';
+
+ $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
+ }
}
$this->element('script', array('type' => $type,
diff --git a/lib/imagefile.php b/lib/imagefile.php
index 6bc8e599b..7b0479455 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -99,6 +99,10 @@ class ImageFile
if ($info[2] !== IMAGETYPE_GIF &&
$info[2] !== IMAGETYPE_JPEG &&
+ $info[2] !== IMAGETYPE_BMP &&
+ $info[2] !== IMAGETYPE_WBMP &&
+ $info[2] !== IMAGETYPE_XBM &&
+ $info[2] !== IMAGETYPE_XPM &&
$info[2] !== IMAGETYPE_PNG) {
@unlink($_FILES[$param]['tmp_name']);
@@ -146,6 +150,18 @@ class ImageFile
case IMAGETYPE_PNG:
$image_src = imagecreatefrompng($this->filepath);
break;
+ case IMAGETYPE_BMP:
+ $image_src = imagecreatefrombmp($this->filepath);
+ break;
+ case IMAGETYPE_WBMP:
+ $image_src = imagecreatefromwbmp($this->filepath);
+ break;
+ case IMAGETYPE_XBM:
+ $image_src = imagecreatefromxbm($this->filepath);
+ break;
+ case IMAGETYPE_XPM:
+ $image_src = imagecreatefromxpm($this->filepath);
+ break;
default:
throw new Exception(_('Unknown file type'));
return;
@@ -153,7 +169,7 @@ class ImageFile
$image_dest = imagecreatetruecolor($size, $size);
- if ($this->type == IMAGETYPE_GIF || $this->type == IMAGETYPE_PNG) {
+ if ($this->type == IMAGETYPE_GIF || $this->type == IMAGETYPE_PNG || $this->type == IMAGETYPE_BMP) {
$transparent_idx = imagecolortransparent($image_src);
@@ -176,6 +192,24 @@ class ImageFile
imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $size, $size, $w, $h);
+ if($this->type == IMAGETYPE_BMP) {
+ //we don't want to save BMP... it's an inefficient, rare, antiquated format
+ //save png instead
+ $this->type = IMAGETYPE_PNG;
+ } else if($this->type == IMAGETYPE_WBMP) {
+ //we don't want to save WBMP... it's a rare format that we can't guarantee clients will support
+ //save png instead
+ $this->type = IMAGETYPE_PNG;
+ } else if($this->type == IMAGETYPE_XBM) {
+ //we don't want to save XBM... it's a rare format that we can't guarantee clients will support
+ //save png instead
+ $this->type = IMAGETYPE_PNG;
+ } else if($this->type == IMAGETYPE_XPM) {
+ //we don't want to save XPM... it's a rare format that we can't guarantee clients will support
+ //save png instead
+ $this->type = IMAGETYPE_PNG;
+ }
+
$outname = Avatar::filename($this->id,
image_type_to_extension($this->type),
$size,
@@ -245,4 +279,101 @@ class ImageFile
return $num;
}
-} \ No newline at end of file
+}
+
+//PHP doesn't (as of 2/24/2010) have an imagecreatefrombmp so conditionally define one
+if(!function_exists('imagecreatefrombmp')){
+ //taken shamelessly from http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
+ function imagecreatefrombmp($p_sFile)
+ {
+ // Load the image into a string
+ $file = fopen($p_sFile,"rb");
+ $read = fread($file,10);
+ while(!feof($file)&&($read<>""))
+ $read .= fread($file,1024);
+
+ $temp = unpack("H*",$read);
+ $hex = $temp[1];
+ $header = substr($hex,0,108);
+
+ // Process the header
+ // Structure: http://www.fastgraph.com/help/bmp_header_format.html
+ if (substr($header,0,4)=="424d")
+ {
+ // Cut it in parts of 2 bytes
+ $header_parts = str_split($header,2);
+
+ // Get the width 4 bytes
+ $width = hexdec($header_parts[19].$header_parts[18]);
+
+ // Get the height 4 bytes
+ $height = hexdec($header_parts[23].$header_parts[22]);
+
+ // Unset the header params
+ unset($header_parts);
+ }
+
+ // Define starting X and Y
+ $x = 0;
+ $y = 1;
+
+ // Create newimage
+ $image = imagecreatetruecolor($width,$height);
+
+ // Grab the body from the image
+ $body = substr($hex,108);
+
+ // Calculate if padding at the end-line is needed
+ // Divided by two to keep overview.
+ // 1 byte = 2 HEX-chars
+ $body_size = (strlen($body)/2);
+ $header_size = ($width*$height);
+
+ // Use end-line padding? Only when needed
+ $usePadding = ($body_size>($header_size*3)+4);
+
+ // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption
+ // Calculate the next DWORD-position in the body
+ for ($i=0;$i<$body_size;$i+=3)
+ {
+ // Calculate line-ending and padding
+ if ($x>=$width)
+ {
+ // If padding needed, ignore image-padding
+ // Shift i to the ending of the current 32-bit-block
+ if ($usePadding)
+ $i += $width%4;
+
+ // Reset horizontal position
+ $x = 0;
+
+ // Raise the height-position (bottom-up)
+ $y++;
+
+ // Reached the image-height? Break the for-loop
+ if ($y>$height)
+ break;
+ }
+
+ // Calculation of the RGB-pixel (defined as BGR in image-data)
+ // Define $i_pos as absolute position in the body
+ $i_pos = $i*2;
+ $r = hexdec($body[$i_pos+4].$body[$i_pos+5]);
+ $g = hexdec($body[$i_pos+2].$body[$i_pos+3]);
+ $b = hexdec($body[$i_pos].$body[$i_pos+1]);
+
+ // Calculate and draw the pixel
+ $color = imagecolorallocate($image,$r,$g,$b);
+ imagesetpixel($image,$x,$height-$y,$color);
+
+ // Raise the horizontal position
+ $x++;
+ }
+
+ // Unset the body / free the memory
+ unset($body);
+
+ // Return image-object
+ return $image;
+ }
+}
diff --git a/lib/iomaster.php b/lib/iomaster.php
index d20837ba5..7cfb2c9a0 100644
--- a/lib/iomaster.php
+++ b/lib/iomaster.php
@@ -330,7 +330,7 @@ abstract class IoMaster
* for per-queue and per-site records.
*
* @param string $key counter name
- * @param array $owners list of owner keys like 'queue:jabber' or 'site:stat01'
+ * @param array $owners list of owner keys like 'queue:xmpp' or 'site:stat01'
*/
public function stats($key, $owners=array())
{
diff --git a/lib/queuemanager.php b/lib/queuemanager.php
index 9fdc80110..87bd356aa 100644
--- a/lib/queuemanager.php
+++ b/lib/queuemanager.php
@@ -213,7 +213,9 @@ abstract class QueueManager extends IoManager
{
if (isset($this->handlers[$queue])) {
$class = $this->handlers[$queue];
- if (class_exists($class)) {
+ if(is_object($class)) {
+ return $class;
+ } else if (class_exists($class)) {
return new $class();
} else {
$this->_log(LOG_ERR, "Nonexistent handler class '$class' for queue '$queue'");
@@ -286,7 +288,7 @@ abstract class QueueManager extends IoManager
* Only registered transports will be reliably picked up!
*
* @param string $transport
- * @param string $class
+ * @param string $class class name or object instance
* @param string $group
*/
public function connect($transport, $class, $group='main')
diff --git a/lib/subs.php b/lib/subs.php
index 1c240c475..e2ce0667e 100644
--- a/lib/subs.php
+++ b/lib/subs.php
@@ -42,4 +42,47 @@ function subs_unsubscribe_to($user, $other)
} catch (Exception $e) {
return $e->getMessage();
}
-} \ No newline at end of file
+}
+
+function subs_unsubscribe_from($user, $other){
+ $local = User::staticGet("nickname",$other);
+ if($local){
+ return subs_unsubscribe_to($local,$user);
+ } else {
+ try {
+ $remote = Profile::staticGet("nickname",$other);
+ if(is_string($remote)){
+ return $remote;
+ }
+ if (Event::handle('StartUnsubscribe', array($remote,$user))) {
+
+ $sub = DB_DataObject::factory('subscription');
+
+ $sub->subscriber = $remote->id;
+ $sub->subscribed = $user->id;
+
+ $sub->find(true);
+
+ // note we checked for existence above
+
+ if (!$sub->delete())
+ return _('Couldn\'t delete subscription.');
+
+ $cache = common_memcache();
+
+ if ($cache) {
+ $cache->delete(common_cache_key('user:notices_with_friends:' . $remote->id));
+ }
+
+
+ $user->blowSubscribersCount();
+ $remote->blowSubscribersCount();
+
+ Event::handle('EndUnsubscribe', array($remote, $user));
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ }
+}
+
diff --git a/lib/util.php b/lib/util.php
index 8381bc63c..1231f4c8d 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -731,20 +731,13 @@ function common_linkify($url) {
}
if (!empty($f)) {
- if ($f->isEnclosure()) {
+ if ($f->getEnclosure()) {
$is_attachment = true;
$attachment_id = $f->id;
- } else {
- $foe = File_oembed::staticGet('file_id', $f->id);
- if (!empty($foe)) {
- // if it has OEmbed info, it's an attachment, too
- $is_attachment = true;
- $attachment_id = $f->id;
-
- $thumb = File_thumbnail::staticGet('file_id', $f->id);
- if (!empty($thumb)) {
- $has_thumb = true;
- }
+
+ $thumb = File_thumbnail::staticGet('file_id', $f->id);
+ if (!empty($thumb)) {
+ $has_thumb = true;
}
}
}
diff --git a/locale/fr/LC_MESSAGES/statusnet.po b/locale/fr/LC_MESSAGES/statusnet.po
index cf0cc849b..f5b771140 100644
--- a/locale/fr/LC_MESSAGES/statusnet.po
+++ b/locale/fr/LC_MESSAGES/statusnet.po
@@ -14,12 +14,12 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:50:48+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:55:22+0000\n"
"Language-Team: French\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: fr\n"
"X-Message-Group: out-statusnet\n"
@@ -3984,17 +3984,17 @@ msgstr "Impossible d’enregistrer l’abonnement."
#: actions/subscribe.php:77
msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Cette action n'accepte que les requêtes de type POST."
#: actions/subscribe.php:107
-#, fuzzy
msgid "No such profile."
-msgstr "Fichier non trouvé."
+msgstr "Profil non-trouvé."
#: actions/subscribe.php:117
-#, fuzzy
msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Vous n’êtes pas abonné(e) à ce profil."
+msgstr ""
+"Vous ne pouvez pas vous abonner à un profil OMB 0.1 distant par cette "
+"action."
#: actions/subscribe.php:145
msgid "Subscribed"
@@ -4816,15 +4816,15 @@ msgstr "Avant"
#: lib/activity.php:382
msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Impossible de gérer le contenu distant pour le moment."
#: lib/activity.php:410
msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Impossible de gérer le contenu XML embarqué pour le moment."
#: lib/activity.php:414
msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Impossible de gérer le contenu en Base64 embarqué pour le moment."
#: lib/adminpanelaction.php:96
msgid "You cannot make changes to this site."
@@ -5214,7 +5214,6 @@ msgstr[0] "Vous êtes membre de ce groupe :"
msgstr[1] "Vous êtes membre de ces groupes :"
#: lib/command.php:769
-#, fuzzy
msgid ""
"Commands:\n"
"on - turn on notifications\n"
@@ -5267,6 +5266,7 @@ msgstr ""
"d <nickname> <text> - message direct à l’utilisateur\n"
"get <nickname> - obtenir le dernier avis de l’utilisateur\n"
"whois <nickname> - obtenir le profil de l’utilisateur\n"
+"lose <nickname> - forcer un utilisateur à arrêter de vous suivre\n"
"fav <nickname> - ajouter de dernier avis de l’utilisateur comme favori\n"
"fav #<notice_id> - ajouter l’avis correspondant à l’identifiant comme "
"favori\n"
@@ -5500,23 +5500,23 @@ msgstr "Erreur système lors du transfert du fichier."
msgid "Not an image or corrupt file."
msgstr "Ceci n’est pas une image, ou c’est un fichier corrompu."
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr "Format de fichier d’image non supporté."
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr "Fichier perdu."
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr "Type de fichier inconnu"
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr "Mo"
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr "Ko"
diff --git a/locale/mk/LC_MESSAGES/statusnet.po b/locale/mk/LC_MESSAGES/statusnet.po
index 14efaf620..8d9e55069 100644
--- a/locale/mk/LC_MESSAGES/statusnet.po
+++ b/locale/mk/LC_MESSAGES/statusnet.po
@@ -9,12 +9,12 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:18+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:05+0000\n"
"Language-Team: Macedonian\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: mk\n"
"X-Message-Group: out-statusnet\n"
@@ -3957,17 +3957,16 @@ msgstr "Не можев да ја зачувам претплатата."
#: actions/subscribe.php:77
msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Ова дејство прифаќа само POST-барања"
#: actions/subscribe.php:107
-#, fuzzy
msgid "No such profile."
-msgstr "Нема таква податотека."
+msgstr "Нема таков профил."
#: actions/subscribe.php:117
-#, fuzzy
msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Не сте претплатени на тој профил."
+msgstr ""
+"Не можете да се претплатите на OMB 0.1 оддалечен профил со ова дејство."
#: actions/subscribe.php:145
msgid "Subscribed"
@@ -4786,15 +4785,15 @@ msgstr "Пред"
#: lib/activity.php:382
msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Сè уште не е поддржана обработката на оддалечена содржина."
#: lib/activity.php:410
msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Сè уште не е поддржана обработката на XML содржина."
#: lib/activity.php:414
msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Сè уште не е достапна обработката на вметната Base64 содржина."
#: lib/adminpanelaction.php:96
msgid "You cannot make changes to this site."
@@ -5143,9 +5142,9 @@ msgid "This link is useable only once, and is good for only 2 minutes: %s"
msgstr "Оваа врска може да се употреби само еднаш, и трае само 2 минути: %s"
#: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
msgid "Unsubscribed %s"
-msgstr "Претплатата на %s е откажана"
+msgstr "Откажана претплата на %s"
#: lib/command.php:709
msgid "You are not subscribed to anyone."
@@ -5178,7 +5177,6 @@ msgstr[0] "Не ни го испративте тој профил."
msgstr[1] "Не ни го испративте тој профил."
#: lib/command.php:769
-#, fuzzy
msgid ""
"Commands:\n"
"on - turn on notifications\n"
@@ -5459,23 +5457,23 @@ msgstr "Системска грешка при подигањето на под
msgid "Not an image or corrupt file."
msgstr "Не е слика или податотеката е пореметена."
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr "Неподдржан фомрат на слики."
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr "Податотеката е изгубена."
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr "Непознат тип на податотека"
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr "МБ"
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr "кб"
diff --git a/locale/nl/LC_MESSAGES/statusnet.po b/locale/nl/LC_MESSAGES/statusnet.po
index 1cd71ad86..e01fb6d3f 100644
--- a/locale/nl/LC_MESSAGES/statusnet.po
+++ b/locale/nl/LC_MESSAGES/statusnet.po
@@ -10,12 +10,12 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:28+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:20+0000\n"
"Language-Team: Dutch\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: nl\n"
"X-Message-Group: out-statusnet\n"
@@ -3981,17 +3981,17 @@ msgstr "Het was niet mogelijk het abonnement op te slaan."
#: actions/subscribe.php:77
msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Deze handeling accepteert alleen POST-verzoeken."
#: actions/subscribe.php:107
-#, fuzzy
msgid "No such profile."
-msgstr "Het bestand bestaat niet."
+msgstr "Het profiel bestaat niet."
#: actions/subscribe.php:117
-#, fuzzy
msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "U bent niet geabonneerd op dat profiel."
+msgstr ""
+"U kunt niet abonneren op een OMB 1.0 profiel van een andere omgeving via "
+"deze handeling."
#: actions/subscribe.php:145
msgid "Subscribed"
@@ -4820,15 +4820,15 @@ msgstr "Eerder"
#: lib/activity.php:382
msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Het is nog niet mogelijk inhoud uit andere omgevingen te verwerken."
#: lib/activity.php:410
msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Het is nog niet mogelijk ingebedde XML-inhoud te verwerken"
#: lib/activity.php:414
msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Het is nog niet mogelijk ingebedde Base64-inhoud te verwerken"
#: lib/adminpanelaction.php:96
msgid "You cannot make changes to this site."
@@ -5182,9 +5182,9 @@ msgstr ""
"geldig: %s"
#: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
msgid "Unsubscribed %s"
-msgstr "Uw abonnement op %s is opgezegd"
+msgstr "Het abonnement van %s is opgeheven"
#: lib/command.php:709
msgid "You are not subscribed to anyone."
@@ -5217,7 +5217,6 @@ msgstr[0] "U bent lid van deze groep:"
msgstr[1] "U bent lid van deze groepen:"
#: lib/command.php:769
-#, fuzzy
msgid ""
"Commands:\n"
"on - turn on notifications\n"
@@ -5270,6 +5269,7 @@ msgstr ""
"d <gebruiker> <tekst> - direct bericht aan gebruiker\n"
"get <gebruiker> - laatste mededeling van gebruiker opvragen\n"
"whois <gebruiker> - profielinformatie van gebruiker opvragen\n"
+"lose <gebruiker> - zorgt ervoor dat de gebruiker u niet meer volgt\n"
"fav <gebruiker> - laatste mededeling van gebruiker op favorietenlijst "
"zetten\n"
"fav #<mededeling-ID> - mededelingen met aangegeven ID op favorietenlijst "
@@ -5501,23 +5501,23 @@ msgstr "Er is een systeemfout opgetreden tijdens het uploaden van het bestand."
msgid "Not an image or corrupt file."
msgstr "Het bestand is geen afbeelding of het bestand is beschadigd."
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr "Niet ondersteund beeldbestandsformaat."
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr "Het bestand is zoekgeraakt."
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr "Onbekend bestandstype"
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr "MB"
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr "kB"
diff --git a/locale/pl/LC_MESSAGES/statusnet.po b/locale/pl/LC_MESSAGES/statusnet.po
index 79b37a5e4..5f4b051cb 100644
--- a/locale/pl/LC_MESSAGES/statusnet.po
+++ b/locale/pl/LC_MESSAGES/statusnet.po
@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:31+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:23+0000\n"
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
@@ -19,7 +19,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: pl\n"
"X-Message-Group: out-statusnet\n"
@@ -1100,7 +1100,7 @@ msgstr "Zmień kolory"
#: actions/designadminpanel.php:510 lib/designsettings.php:191
msgid "Content"
-msgstr "Zawartość"
+msgstr "Treść"
#: actions/designadminpanel.php:523 lib/designsettings.php:204
msgid "Sidebar"
@@ -2160,7 +2160,7 @@ msgstr "Nie można wysłać wiadomości do tego użytkownika."
#: actions/newmessage.php:144 actions/newnotice.php:136 lib/command.php:342
#: lib/command.php:475
msgid "No content!"
-msgstr "Brak zawartości."
+msgstr "Brak treści."
#: actions/newmessage.php:158
msgid "No recipient specified."
@@ -2198,7 +2198,7 @@ msgid ""
"Search for notices on %%site.name%% by their contents. Separate search terms "
"by spaces; they must be 3 characters or more."
msgstr ""
-"Wyszukaj wpisy na %%site.name%% według ich zawartości. Oddziel wyszukiwane "
+"Wyszukaj wpisy na %%site.name%% według ich treści. Oddziel wyszukiwane "
"terminy spacjami. Terminy muszą mieć trzy znaki lub więcej."
#: actions/noticesearch.php:78
@@ -3925,17 +3925,17 @@ msgstr "Nie można zapisać subskrypcji."
#: actions/subscribe.php:77
msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Ta czynność przyjmuje tylko żądania POST."
#: actions/subscribe.php:107
-#, fuzzy
msgid "No such profile."
-msgstr "Nie ma takiego pliku."
+msgstr "Nie ma takiego profilu."
#: actions/subscribe.php:117
-#, fuzzy
msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Nie jesteś subskrybowany do tego profilu."
+msgstr ""
+"Nie można subskrybować zdalnego profilu profilu OMB 0.1 za pomocą tej "
+"czynności."
#: actions/subscribe.php:145
msgid "Subscribed"
@@ -4754,15 +4754,15 @@ msgstr "Wcześniej"
#: lib/activity.php:382
msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Nie można jeszcze obsługiwać zdalnej treści."
#: lib/activity.php:410
msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Nie można jeszcze obsługiwać zagnieżdżonej treści XML."
#: lib/activity.php:414
msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Nie można jeszcze obsługiwać zagnieżdżonej treści Base64."
#: lib/adminpanelaction.php:96
msgid "You cannot make changes to this site."
@@ -5112,7 +5112,7 @@ msgstr ""
"minuty: %s."
#: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
msgid "Unsubscribed %s"
msgstr "Usunięto subskrypcję użytkownika %s"
@@ -5150,7 +5150,6 @@ msgstr[1] "Jesteś członkiem tych grup:"
msgstr[2] "Jesteś członkiem tych grup:"
#: lib/command.php:769
-#, fuzzy
msgid ""
"Commands:\n"
"on - turn on notifications\n"
@@ -5195,14 +5194,15 @@ msgstr ""
"on - włącza powiadomienia\n"
"off - wyłącza powiadomienia\n"
"help - wyświetla tę pomoc\n"
-"follow <pseudonim> - włącza obserwowanie użytkownika\n"
+"follow <pseudonim> - subskrybuje użytkownika\n"
"groups - wyświetla listę grup, do których dołączyłeś\n"
"subscriptions - wyświetla listę obserwowanych osób\n"
"subscribers - wyświetla listę osób, które cię obserwują\n"
-"leave <pseudonim> - rezygnuje z obserwowania użytkownika\n"
+"leave <pseudonim> - usuwa subskrypcję użytkownika\n"
"d <pseudonim> <tekst> - bezpośrednia wiadomość do użytkownika\n"
"get <pseudonim> - zwraca ostatni wpis użytkownika\n"
"whois <pseudonim> - zwraca informacje o profilu użytkownika\n"
+"lose <pseudonim> - wymusza użytkownika do zatrzymania obserwowania cię\n"
"fav <pseudonim> - dodaje ostatni wpis użytkownika jako \"ulubiony\"\n"
"fav #<identyfikator_wpisu> - dodaje wpis z podanym identyfikatorem jako "
"\"ulubiony\"\n"
@@ -5433,23 +5433,23 @@ msgstr "Błąd systemu podczas wysyłania pliku."
msgid "Not an image or corrupt file."
msgstr "To nie jest obraz lub lub plik jest uszkodzony."
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr "Nieobsługiwany format pliku obrazu."
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr "Utracono plik."
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr "Nieznany typ pliku"
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr "MB"
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr "KB"
diff --git a/locale/ru/LC_MESSAGES/statusnet.po b/locale/ru/LC_MESSAGES/statusnet.po
index d4df1a654..a23f7c2f3 100644
--- a/locale/ru/LC_MESSAGES/statusnet.po
+++ b/locale/ru/LC_MESSAGES/statusnet.po
@@ -12,12 +12,12 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:41+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:32+0000\n"
"Language-Team: Russian\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: ru\n"
"X-Message-Group: out-statusnet\n"
@@ -3948,17 +3948,17 @@ msgstr "Не удаётся сохранить подписку."
#: actions/subscribe.php:77
msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Это действие принимает только POST-запросы."
#: actions/subscribe.php:107
-#, fuzzy
msgid "No such profile."
-msgstr "Нет такого файла."
+msgstr "Нет такого профиля."
#: actions/subscribe.php:117
-#, fuzzy
msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Вы не подписаны на этот профиль."
+msgstr ""
+"Вы не можете подписаться на удалённый профиль OMB 0.1 с помощью этого "
+"действия."
#: actions/subscribe.php:145
msgid "Subscribed"
@@ -4774,15 +4774,15 @@ msgstr "Туда"
#: lib/activity.php:382
msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Пока ещё нельзя обрабатывать удалённое содержимое."
#: lib/activity.php:410
msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Пока ещё нельзя обрабатывать встроенный XML."
#: lib/activity.php:414
msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Пока ещё нельзя обрабатывать встроенное содержание Base64."
#: lib/adminpanelaction.php:96
msgid "You cannot make changes to this site."
@@ -5130,9 +5130,9 @@ msgid "This link is useable only once, and is good for only 2 minutes: %s"
msgstr "Эта ссылка действительна только один раз в течение 2 минут: %s"
#: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
msgid "Unsubscribed %s"
-msgstr "Отписано от %s"
+msgstr "Отписано %s"
#: lib/command.php:709
msgid "You are not subscribed to anyone."
@@ -5168,7 +5168,6 @@ msgstr[1] "Вы являетесь участником следующих гр
msgstr[2] "Вы являетесь участником следующих групп:"
#: lib/command.php:769
-#, fuzzy
msgid ""
"Commands:\n"
"on - turn on notifications\n"
@@ -5221,6 +5220,7 @@ msgstr ""
"d <nickname> <text> — прямое сообщение пользователю\n"
"get <nickname> — получить последнюю запись от пользователя\n"
"whois <nickname> — получить информацию из профиля пользователя\n"
+"lose <nickname> — отменить подписку пользователя на вас\n"
"fav <nickname> — добавить последнюю запись пользователя в число любимых\n"
"fav #<notice_id> — добавить запись с заданным id в число любимых\n"
"repeat #<notice_id> — повторить уведомление с заданным id\n"
@@ -5449,23 +5449,23 @@ msgstr "Системная ошибка при загрузке файла."
msgid "Not an image or corrupt file."
msgstr "Не является изображением или повреждённый файл."
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr "Неподдерживаемый формат файла изображения."
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr "Потерян файл."
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr "Неподдерживаемый тип файла"
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr "МБ"
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr "КБ"
diff --git a/locale/statusnet.po b/locale/statusnet.po
index cf44e2d3c..483c7711b 100644
--- a/locale/statusnet.po
+++ b/locale/statusnet.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -5095,23 +5095,23 @@ msgstr ""
msgid "Not an image or corrupt file."
msgstr ""
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr ""
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr ""
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr ""
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr ""
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr ""
diff --git a/locale/uk/LC_MESSAGES/statusnet.po b/locale/uk/LC_MESSAGES/statusnet.po
index c261c310d..cf1a2bf62 100644
--- a/locale/uk/LC_MESSAGES/statusnet.po
+++ b/locale/uk/LC_MESSAGES/statusnet.po
@@ -10,12 +10,12 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:53+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:43+0000\n"
"Language-Team: Ukrainian\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
"X-Language-Code: uk\n"
"X-Message-Group: out-statusnet\n"
@@ -3934,17 +3934,15 @@ msgstr "Не вдалося зберегти підписку."
#: actions/subscribe.php:77
msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Ця дія приймає лише запити POST."
#: actions/subscribe.php:107
-#, fuzzy
msgid "No such profile."
-msgstr "Такого файлу немає."
+msgstr "Немає такого профілю."
#: actions/subscribe.php:117
-#, fuzzy
msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Ви не підписані до цього профілю."
+msgstr "Цією дією Ви не зможете підписатися до віддаленого профілю OMB 0.1."
#: actions/subscribe.php:145
msgid "Subscribed"
@@ -4757,15 +4755,15 @@ msgstr "Назад"
#: lib/activity.php:382
msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Поки що не можу обробити віддалений контент."
#: lib/activity.php:410
msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Поки що не можу обробити вбудований XML контент."
#: lib/activity.php:414
msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Поки що не можу обробити вбудований контент Base64."
#: lib/adminpanelaction.php:96
msgid "You cannot make changes to this site."
@@ -5113,9 +5111,9 @@ msgstr ""
"Це посилання можна використати лише раз, воно дійсне протягом 2 хвилин: %s"
#: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
msgid "Unsubscribed %s"
-msgstr "Відписано від %s"
+msgstr "Відписано %s"
#: lib/command.php:709
msgid "You are not subscribed to anyone."
@@ -5151,7 +5149,6 @@ msgstr[1] "Ви є учасником таких груп:"
msgstr[2] "Ви є учасником таких груп:"
#: lib/command.php:769
-#, fuzzy
msgid ""
"Commands:\n"
"on - turn on notifications\n"
@@ -5429,23 +5426,23 @@ msgstr "Система відповіла помилкою при заванта
msgid "Not an image or corrupt file."
msgstr "Це не зображення, або файл зіпсовано."
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
msgid "Unsupported image file format."
msgstr "Формат зображення не підтримується."
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
msgid "Lost our file."
msgstr "Файл втрачено."
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
msgid "Unknown file type"
msgstr "Тип файлу не підтримується"
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
msgid "MB"
msgstr "Мб"
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
msgid "kB"
msgstr "кб"
diff --git a/plugins/Autocomplete/jquery-autocomplete/indicator.gif b/plugins/Autocomplete/jquery-autocomplete/indicator.gif
new file mode 100644
index 000000000..d0bce1542
--- /dev/null
+++ b/plugins/Autocomplete/jquery-autocomplete/indicator.gif
Binary files differ
diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php
index 300d1e9a2..29cb3004b 100644
--- a/plugins/Comet/CometPlugin.php
+++ b/plugins/Comet/CometPlugin.php
@@ -68,7 +68,7 @@ class CometPlugin extends RealtimePlugin
$ours = array('jquery.comet.js', 'cometupdate.js');
foreach ($ours as $script) {
- $scripts[] = common_path('plugins/Comet/'.$script);
+ $scripts[] = 'plugins/Comet/'.$script;
}
return $scripts;
diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php
index 4266b886d..78c9054e1 100644
--- a/plugins/Facebook/FacebookPlugin.php
+++ b/plugins/Facebook/FacebookPlugin.php
@@ -181,7 +181,7 @@ class FacebookPlugin extends Plugin
if ($this->reqFbScripts($action)) {
$apikey = common_config('facebook', 'apikey');
- $plugin_path = common_path('plugins/Facebook');
+ $plugin_path = 'plugins/Facebook';
$login_url = common_local_url('FBConnectAuth');
$logout_url = common_local_url('logout');
diff --git a/plugins/Facebook/facebookaction.php b/plugins/Facebook/facebookaction.php
index 8437a705a..f65b97c86 100644
--- a/plugins/Facebook/facebookaction.php
+++ b/plugins/Facebook/facebookaction.php
@@ -89,7 +89,7 @@ class FacebookAction extends Action
function showScripts()
{
- $this->script(common_path('plugins/Facebook/facebookapp.js'));
+ $this->script('plugins/Facebook/facebookapp.js');
}
/**
diff --git a/plugins/Imap/ImapPlugin.php b/plugins/Imap/ImapPlugin.php
index 89a775a16..d1e920b00 100644
--- a/plugins/Imap/ImapPlugin.php
+++ b/plugins/Imap/ImapPlugin.php
@@ -86,7 +86,7 @@ class ImapPlugin extends Plugin
}
}
- function onStartIoManagerClasses(&$classes)
+ function onStartQueueDaemonIoManagers(&$classes)
{
$classes[] = new ImapManager($this);
}
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
index eb3a05117..1b5dc92e3 100644
--- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
+++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
@@ -96,8 +96,11 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
}
}
- function autoRegister($username)
+ function autoRegister($username, $nickname)
{
+ if(is_null($nickname)){
+ $nickname = $username;
+ }
$entry = $this->ldap_get_user($username,$this->attributes);
if($entry){
$registration_data = array();
@@ -107,6 +110,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
if(isset($registration_data['email']) && !empty($registration_data['email'])){
$registration_data['email_confirmed']=true;
}
+ $registration_data['nickname'] = $nickname;
//set the database saved password to a random string.
$registration_data['password']=common_good_rand(16);
return User::register($registration_data);
@@ -153,6 +157,22 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
return false;
}
+
+ function suggestNicknameForUsername($username)
+ {
+ $entry = $this->ldap_get_user($username, $this->attributes);
+ if(!$entry){
+ //this really shouldn't happen
+ return $username;
+ }else{
+ $nickname = $entry->getValue($this->attributes['nickname'],'single');
+ if($nickname){
+ return $nickname;
+ }else{
+ return $username;
+ }
+ }
+ }
//---utility functions---//
function ldap_get_config(){
@@ -179,8 +199,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
$ldap->setErrorHandling(PEAR_ERROR_RETURN);
$err=$ldap->bind();
if (Net_LDAP2::isError($err)) {
- common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage());
- return false;
+ throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
}
if($config == null) $this->default_ldap=$ldap;
diff --git a/plugins/LdapAuthentication/README b/plugins/LdapAuthentication/README
index 0460fb639..c188f2dbc 100644
--- a/plugins/LdapAuthentication/README
+++ b/plugins/LdapAuthentication/README
@@ -9,7 +9,10 @@ to the bottom of your config.php
Settings
========
-provider_name*: a unique name for this authentication provider.
+provider_name*: This is a identifier designated to the connection.
+ It's how StatusNet will refer to the authentication source.
+ For the most part, any name can be used, so long as each authentication source has a different identifier.
+ In most cases there will be only one authentication source used.
authoritative (false): Set to true if LDAP's responses are authoritative
(if authorative and LDAP fails, no other password checking will be done).
autoregistration (false): Set to true if users should be automatically created
diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
index 7f48ce5e1..19aff42b8 100644
--- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
+++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
@@ -167,7 +167,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
$ldap->setErrorHandling(PEAR_ERROR_RETURN);
$err=$ldap->bind();
if (Net_LDAP2::isError($err)) {
- common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage());
+ throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
return false;
}
if($config == null) $this->default_ldap=$ldap;
@@ -185,6 +185,9 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
if($ldap==null) {
$ldap = $this->ldap_get_connection();
}
+ if(! $ldap) {
+ throw new Exception("Could not connect to LDAP");
+ }
$filter = Net_LDAP2_Filter::create($this->attributes['username'], 'equals', $username);
$options = array(
'attributes' => $attributes
diff --git a/plugins/LdapAuthorization/README b/plugins/LdapAuthorization/README
index 44239d8e0..3a6d8d25e 100644
--- a/plugins/LdapAuthorization/README
+++ b/plugins/LdapAuthorization/README
@@ -11,7 +11,10 @@ You *cannot* use this plugin without the LDAP Authentication plugin
Settings
========
-provider_name*: name of the LDAP authentication provider that this plugin works with.
+provider_name*: This is a identifier designated to the connection.
+ It's how StatusNet will refer to the authentication source.
+ For the most part, any name can be used, so long as each authentication source has a different identifier.
+ In most cases there will be only one authentication source used.
authoritative (false): should this plugin be authoritative for
authorization?
uniqueMember_attribute ('uniqueMember')*: the attribute of a group
diff --git a/plugins/Minify/MinifyPlugin.php b/plugins/Minify/MinifyPlugin.php
index fe1883ded..69def6064 100644
--- a/plugins/Minify/MinifyPlugin.php
+++ b/plugins/Minify/MinifyPlugin.php
@@ -86,7 +86,11 @@ class MinifyPlugin extends Plugin
$url = parse_url($src);
if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
{
- $src = $this->minifyUrl($src);
+ if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
+ $src = $this->minifyUrl($src);
+ } else {
+ $src = $this->minifyUrl('js/'.$src);
+ }
}
}
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 720dedd0a..02282f2f6 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -284,12 +284,12 @@ class OStatusPlugin extends Plugin
}
function onEndShowStatusNetStyles($action) {
- $action->cssLink(common_path('plugins/OStatus/theme/base/css/ostatus.css'));
+ $action->cssLink('plugins/OStatus/theme/base/css/ostatus.css');
return true;
}
function onEndShowStatusNetScripts($action) {
- $action->script(common_path('plugins/OStatus/js/ostatus.js'));
+ $action->script('plugins/OStatus/js/ostatus.js');
return true;
}
diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php
index 248afe3fa..6b35ec3e1 100644
--- a/plugins/OpenID/OpenIDPlugin.php
+++ b/plugins/OpenID/OpenIDPlugin.php
@@ -235,9 +235,14 @@ class OpenIDPlugin extends Plugin
switch ($name)
{
case 'register':
- $instr = '(Have an [OpenID](http://openid.net/)? ' .
- 'Try our [OpenID registration]'.
- '(%%action.openidlogin%%)!)';
+ if (common_logged_in()) {
+ $instr = '(Have an [OpenID](http://openid.net/)? ' .
+ '[Add an OpenID to your account](%%action.openidsettings%%)!';
+ } else {
+ $instr = '(Have an [OpenID](http://openid.net/)? ' .
+ 'Try our [OpenID registration]'.
+ '(%%action.openidlogin%%)!)';
+ }
break;
case 'login':
$instr = '(Have an [OpenID](http://openid.net/)? ' .
diff --git a/plugins/Orbited/OrbitedPlugin.php b/plugins/Orbited/OrbitedPlugin.php
index ba87b266a..8af71af74 100644
--- a/plugins/Orbited/OrbitedPlugin.php
+++ b/plugins/Orbited/OrbitedPlugin.php
@@ -77,9 +77,9 @@ class OrbitedPlugin extends RealtimePlugin
$root = 'http://'.$server.(($port == 80) ? '':':'.$port);
$scripts[] = $root.'/static/Orbited.js';
- $scripts[] = common_path('plugins/Orbited/orbitedextra.js');
+ $scripts[] = 'plugins/Orbited/orbitedextra.js';
$scripts[] = $root.'/static/protocols/stomp/stomp.js';
- $scripts[] = common_path('plugins/Orbited/orbitedupdater.js');
+ $scripts[] = 'plugins/Orbited/orbitedupdater.js';
return $scripts;
}
diff --git a/plugins/README-plugins b/plugins/README-plugins
new file mode 100644
index 000000000..cdce7eb18
--- /dev/null
+++ b/plugins/README-plugins
@@ -0,0 +1,21 @@
+Several example plugins are included in the plugins/ directory. You
+can enable a plugin with the following line in config.php:
+
+ addPlugin('Example', array('param1' => 'value1',
+ 'param2' => 'value2'));
+
+This will look for and load files named 'ExamplePlugin.php' or
+'Example/ExamplePlugin.php' either in the plugins/ directory (for
+plugins that ship with StatusNet) or in the local/ directory (for
+plugins you write yourself or that you get from somewhere else) or
+local/plugins/.
+
+Plugins are documented in their own directories.
+
+
+Additional information on using and developing plugins can be found
+on the StatusNet wiki:
+
+http://status.net/wiki/Plugins
+http://status.net/wiki/Plugin_development
+
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php
index 2b3cb35f1..b559d80c6 100644
--- a/plugins/Realtime/RealtimePlugin.php
+++ b/plugins/Realtime/RealtimePlugin.php
@@ -117,7 +117,7 @@ class RealtimePlugin extends Plugin
function onEndShowStatusNetStyles($action)
{
- $action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'),
+ $action->cssLink('plugins/Realtime/realtimeupdate.css',
null, 'screen, projection, tv');
return true;
}
@@ -305,7 +305,7 @@ class RealtimePlugin extends Plugin
function _getScripts()
{
- return array(common_path('plugins/Realtime/realtimeupdate.js'));
+ return array('plugins/Realtime/realtimeupdate.js');
}
function _updateInitialize($timeline, $user_id)
diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js
index 2e5851ae5..0f7a680d7 100644
--- a/plugins/Realtime/realtimeupdate.js
+++ b/plugins/Realtime/realtimeupdate.js
@@ -130,7 +130,7 @@ RealtimeUpdate = {
user = data['user'];
html = data['html'].replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&quot;/g,'"').replace(/&amp;/g,'&');
source = data['source'].replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&quot;/g,'"').replace(/&amp;/g,'&');
-
+console.log(data);
ni = "<li class=\"hentry notice\" id=\"notice-"+unique+"\">"+
"<div class=\"entry-title\">"+
"<span class=\"vcard author\">"+
diff --git a/plugins/Recaptcha/RecaptchaPlugin.php b/plugins/Recaptcha/RecaptchaPlugin.php
index 3665214f8..c585da43c 100644
--- a/plugins/Recaptcha/RecaptchaPlugin.php
+++ b/plugins/Recaptcha/RecaptchaPlugin.php
@@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
-define('RECAPTCHA', '0.2');
-
require_once(INSTALLDIR.'/plugins/Recaptcha/recaptchalib.php');
class RecaptchaPlugin extends Plugin
@@ -88,4 +86,16 @@ class RecaptchaPlugin extends Plugin
return false;
}
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'Recaptcha',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Eric Helgeson',
+ 'homepage' => 'http://status.net/wiki/Plugin:Recaptcha',
+ 'rawdescription' =>
+ _m('Uses <a href="http://recaptcha.org/">Recaptcha</a> service to add a '.
+ 'captcha to the registration page.'));
+ return true;
+ }
}
diff --git a/plugins/ReverseUsernameAuthentication/README b/plugins/ReverseUsernameAuthentication/README
index e9160ed9b..57b53219e 100644
--- a/plugins/ReverseUsernameAuthentication/README
+++ b/plugins/ReverseUsernameAuthentication/README
@@ -8,7 +8,10 @@ add "addPlugin('reverseUsernameAuthentication', array('setting'=>'value', 'setti
Settings
========
-provider_name*: a unique name for this authentication provider.
+provider_name*: This is a identifier designated to the connection.
+ It's how StatusNet will refer to the authentication source.
+ For the most part, any name can be used, so long as each authentication source has a different identifier.
+ In most cases there will be only one authentication source used.
password_changeable*: must be set to false. This plugin does not support changing passwords.
authoritative (false): Set to true if this plugin's responses are authoritative (meaning if this fails, do check any other plugins or the internal password database).
autoregistration (false): Set to true if users should be automatically created when they attempt to login.
diff --git a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
index d9d2137f8..dac5a1588 100644
--- a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
+++ b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
@@ -47,10 +47,13 @@ class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin
return $username == strrev($password);
}
- function autoRegister($username)
+ function autoRegister($username, $nickname)
{
+ if(is_null($nickname)){
+ $nickname = $username;
+ }
$registration_data = array();
- $registration_data['nickname'] = $username ;
+ $registration_data['nickname'] = $nickname ;
return User::register($registration_data);
}
diff --git a/plugins/TabFocus/TabFocusPlugin.php b/plugins/TabFocus/TabFocusPlugin.php
new file mode 100644
index 000000000..bf89c478c
--- /dev/null
+++ b/plugins/TabFocus/TabFocusPlugin.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to enable Twitter-like "tab-space" pattern for a user to submit a notice
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @author Paul Irish <paul.irish@isobar.net>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET') && !defined('LACONICA')) {
+ exit(1);
+}
+
+class TabFocusPlugin extends Plugin
+{
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function onEndShowScripts($action)
+ {
+ $action->script('plugins/TabFocus/tabfocus.js');
+ }
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'TabFocus',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews and Paul Irish',
+ 'homepage' => 'http://status.net/wiki/Plugin:TabFocus',
+ 'rawdescription' =>
+ _m('TabFocus changes the notice form behavior so that, while in the text area, pressing the tab key focuses the "Send" button, matching the behavor of Twitter.'));
+ return true;
+ }
+}
diff --git a/plugins/TabFocus/tabfocus.js b/plugins/TabFocus/tabfocus.js
new file mode 100644
index 000000000..e2c1c6521
--- /dev/null
+++ b/plugins/TabFocus/tabfocus.js
@@ -0,0 +1,7 @@
+jQuery(function($){
+ $('#notice_data-text').bind('keydown',function(e){
+ if (e.which==9) {
+ setTimeout(function(){ $('#notice_action-submit').focus(); },15);
+ }
+ });
+});
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index ceb83b037..13e499d65 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -252,8 +252,17 @@ function format_status($notice)
$statustxt = preg_replace('/^@/', ' @', $notice->content);
// Convert !groups to #hashes
+
+ // XXX: Make this an optional setting?
+
$statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
+ if (mb_strlen($statustxt) > 140) {
+ $noticeUrl = common_shorten_url($notice->uri);
+ $urlLen = mb_strlen($noticeUrl);
+ $statustxt = mb_substr($statustxt, 0, 140 - ($urlLen + 3)) . ' … ' . $noticeUrl;
+ }
+
return $statustxt;
}
diff --git a/scripts/useremail.php b/scripts/useremail.php
index 6676a87c8..0a59d36f8 100755
--- a/scripts/useremail.php
+++ b/scripts/useremail.php
@@ -53,7 +53,17 @@ if (have_option('i', 'id')) {
if (!empty($user)) {
if (empty($user->email)) {
- print "No email registered for user '$user->nickname'\n";
+ # Check for unconfirmed emails
+ $unconfirmed_email = new Confirm_address();
+ $unconfirmed_email->user_id = $user->id;
+ $unconfirmed_email->address_type = 'email';
+ $unconfirmed_email->find(true);
+
+ if (empty($unconfirmed_email->address)) {
+ print "No email registered for user '$user->nickname'\n";
+ } else {
+ print "Unconfirmed Adress: $unconfirmed_email->address\n";
+ }
} else {
print "$user->email\n";
}
@@ -65,7 +75,18 @@ if (have_option('e', 'email')) {
$user->email = get_option_value('e', 'email');
$user->find(false);
if (!$user->fetch()) {
- print "No users with email $user->email\n";
+ # Check unconfirmed emails
+ $unconfirmed_email = new Confirm_address();
+ $unconfirmed_email->address = $user->email;
+ $unconfirmed_email->address_type = 'email';
+ $unconfirmed_email->find(true);
+
+ if (empty($unconfirmed_email->user_id)) {
+ print "No users with email $user->email\n";
+ } else {
+ $user=User::staticGet('id', $unconfirmed_email->user_id);
+ print "Unconfirmed Address: $user->id $user->nickname\n";
+ }
exit(0);
}
do {