We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit c751be1c authored by Evan Prodromou's avatar Evan Prodromou

Merge branch '1.0.x' into testing

parents 95032a39 95abad5a

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
This diff is collapsed.
This diff is collapsed.
Plugins
=======
Beginning with the 0.7.x branch, StatusNet has supported a simple but
powerful plugin architecture. Important events in the code are named,
like 'StartNoticeSave', and other software can register interest
in those events. When the events happen, the other software is called
and has a choice of accepting or rejecting the events.
In the simplest case, you can add a function to config.php and use the
Event::addHandler() function to hook an event:
function AddGoogleLink($action)
{
$action->menuItem('http://www.google.com/', _('Google'), _('Search engine'));
return true;
}
Event::addHandler('EndPrimaryNav', 'AddGoogleLink');
This adds a menu item to the end of the main navigation menu. You can
see the list of existing events, and parameters that handlers must
implement, in EVENTS.txt.
The Plugin class in lib/plugin.php makes it easier to write more
complex plugins. Sub-classes can just create methods named
'onEventName', where 'EventName' is the name of the event (case
matters!). These methods will be automatically registered as event
handlers by the Plugin constructor (which you must call from your own
class's constructor).
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.
This diff is collapsed.
Upgrading
=========
IMPORTANT NOTE: StatusNet 0.7.4 introduced a fix for some
incorrectly-stored international characters ("UTF-8"). For new
installations, it will now store non-ASCII characters correctly.
However, older installations will have the incorrect storage, and will
consequently show up "wrong" in browsers. See below for how to deal
with this situation.
If you've been using StatusNet 0.7, 0.6, 0.5 or lower, or if you've
been tracking the "git" version of the software, you will probably
want to upgrade and keep your existing data. There is no automated
upgrade procedure in StatusNet 0.9.9. Try these step-by-step
instructions; read to the end first before trying them.
0. Download StatusNet and set up all the prerequisites as if you were
doing a new install.
1. Make backups of both your database and your Web directory. UNDER NO
CIRCUMSTANCES should you try to do an upgrade without a known-good
backup. You have been warned.
2. Shut down Web access to your site, either by turning off your Web
server or by redirecting all pages to a "sorry, under maintenance"
page.
3. Shut down XMPP access to your site, typically by shutting down the
xmppdaemon.php process and all other daemons that you're running.
If you've got "monit" or "cron" automatically restarting your
daemons, make sure to turn that off, too.
4. Shut down SMS and email access to your site. The easy way to do
this is to comment out the line piping incoming email to your
maildaemon.php file, and running something like "newaliases".
5. Once all writing processes to your site are turned off, make a
final backup of the Web directory and database.
6. Move your StatusNet directory to a backup spot, like "statusnet.bak".
7. Unpack your StatusNet 0.9.9 tarball and move it to "statusnet" or
wherever your code used to be.
8. Copy the config.php file and the contents of the avatar/, background/,
file/, and local/ subdirectories from your old directory to your new
directory.
9. Copy htaccess.sample to .htaccess in the new directory. Change the
RewriteBase to use the correct path.
10. Rebuild the database.
NOTE: this step is destructive and cannot be
reversed. YOU CAN EASILY DESTROY YOUR SITE WITH THIS STEP. Don't
do it without a known-good backup!
If your database is at version 0.8.0 or higher in the 0.8.x line, you can run a
special upgrade script:
mysql -u<rootuser> -p<rootpassword> <database> db/08to09.sql
If you are upgrading from any 0.9.x version like 0.9.6, run this script:
mysql -u<rootuser> -p<rootpassword> <database> db/096to097.sql
Despite the name, it should work for any 0.9.x branch.
Otherwise, go to your StatusNet directory and AFTER YOU MAKE A
BACKUP run the rebuilddb.sh script like this:
./scripts/rebuilddb.sh rootuser rootpassword database db/statusnet.sql
Here, rootuser and rootpassword are the username and password for a
user who can drop and create databases as well as tables; typically
that's _not_ the user StatusNet runs as. Note that rebuilddb.sh drops
your database and rebuilds it; if there is an error you have no
database. Make sure you have a backup.
For PostgreSQL databases there is an equivalent, rebuilddb_psql.sh,
which operates slightly differently. Read the documentation in that
script before running it.
11. Use mysql or psql client to log into your database and make sure that
the notice, user, profile, subscription etc. tables are non-empty.
12. Turn back on the Web server, and check that things still work.
13. Turn back on XMPP bots and email maildaemon. Note that the XMPP
bots have changed since version 0.5; see above for details.
If you're upgrading from very old versions, you may want to look at
the fixup_* scripts in the scripts directories. These will store some
precooked data in the DB. All upgraders should check out the inboxes
options below.
NOTE: the database definition file, laconica.ini, has been renamed to
statusnet.ini (since this is the recommended database name). If you
have a line in your config.php pointing to the old name, you'll need
to update it.
NOTE: the 1.0.0 version of StatusNet changed the URLs for all admin
panels from /admin/* to /panel/*. This now allows the (popular)
username 'admin', but blocks the considerably less popular username
'panel'. If you have an existing user named 'panel', you should rename
them before upgrading.
Notice inboxes
--------------
Notice inboxes are now required. If you don't have inboxes enabled,
StatusNet will no longer run.
UTF-8 Database
--------------
StatusNet 0.7.4 introduced a fix for some incorrectly-stored
international characters ("UTF-8"). This fix is not
backwards-compatible; installations from before 0.7.4 will show
non-ASCII characters of old notices incorrectly. This section explains
what to do.
0. You can disable the new behaviour by setting the 'db''utf8' config
option to "false". You should only do this until you're ready to
convert your DB to the new format.
1. When you're ready to convert, you can run the fixup_utf8.php script
in the scripts/ subdirectory. If you've had the "new behaviour"
enabled (probably a good idea), you can give the ID of the first
"new" notice as a parameter, and only notices before that one will
be converted. Notices are converted in reverse chronological order,
so the most recent (and visible) ones will be converted first. The
script should work whether or not you have the 'db''utf8' config
option enabled.
2. When you're ready, set $config['db']['utf8'] to true, so that
new notices will be stored correctly.
......@@ -187,9 +187,9 @@ class AccessAdminPanelForm extends AdminForm
*/
function formActions()
{
// TRANS: Title for button to save access settings in site admin panel.
$title = _('Save access settings');
// TRANS: Tooltip for button to save access settings in site admin panel.
// TRANS: Button title to save access settings in site admin panel.
$title = _('Save access settings.');
// TRANS: Button text to save access settings in site admin panel.
$this->out->submit('submit', _m('BUTTON', 'Save'), 'submit', null, $title);
}
}
......@@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Show a stream of notices in a particular conversation
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
......@@ -46,12 +46,11 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class ApiconversationAction extends ApiAuthAction
{
protected $conversation = null;
protected $notices = null;
protected $conversation = null;
protected $notices = null;
/**
* For initializing members of the class.
*
......@@ -59,35 +58,36 @@ class ApiconversationAction extends ApiAuthAction
*
* @return boolean true
*/
function prepare($argarray)
{
parent::prepare($argarray);
$convId = $this->trimmed('id');
if (empty($convId)) {
throw new ClientException(_m('no conversation id'));
// TRANS: Client exception thrown when no conversation ID is given.
throw new ClientException(_('No conversation ID.'));
}
$this->conversation = Conversation::staticGet('id', $convId);
if (empty($this->conversation)) {
throw new ClientException(sprintf(_m('No conversation with id %d'), $convId),
404);
// TRANS: Client exception thrown when referring to a non-existing conversation ID (%d).
throw new ClientException(sprintf(_('No conversation with ID %d.'), $convId),
404);
}
$profile = Profile::current();
$stream = new ConversationNoticeStream($convId, $profile);
$notice = $stream->getNotices(($this->page-1) * $this->count,
$this->count,
$this->since_id,
$this->max_id);
$this->notices = $notice->fetchAll();
return true;
}
......@@ -98,17 +98,16 @@ class ApiconversationAction extends ApiAuthAction
*
* @return void
*/
function handle($argarray=null)
{
$sitename = common_config('site', 'name');
// TRANS: Timeline title for user and friends. %s is a user nickname.
$title = _("Conversation");
// TRANS: Title for conversion timeline.
$title = _m('TITLE', 'Conversation');
$id = common_local_url('apiconversation', array('id' => $this->conversation->id, 'format' => $this->format));
$link = common_local_url('conversation', array('id' => $this->conversation->id));
$self = $id;
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
......@@ -168,7 +167,6 @@ class ApiconversationAction extends ApiAuthAction
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
......@@ -202,7 +200,6 @@ class ApiconversationAction extends ApiAuthAction
*
* @return string etag http header
*/
function etag()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
......@@ -220,7 +217,7 @@ class ApiconversationAction extends ApiAuthAction
)
. '"';
}
return null;
}
......@@ -229,7 +226,6 @@ class ApiconversationAction extends ApiAuthAction
*
* @return boolean true if delete, else false
*/
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
......@@ -239,4 +235,4 @@ class ApiconversationAction extends ApiAuthAction
return true;
}
}
}
\ No newline at end of file
}
......@@ -267,15 +267,14 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
break;
case 'as':
header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title);
$doc->addLink($link,'alternate', 'text/html');
$doc = new ActivityStreamJSONDocument($this->auth_user, $title);
$doc->addLink($link, 'alternate', 'text/html');
$doc->addItemsFromNotices($this->notices);
$this->raw($doc->asString());
break;
default:
// TRANS: Client error displayed when coming across a non-supported API method.
$this->clientError(_('API method not found.'), $code = 404);
$this->clientError(_('API method not found.'), 404);
break;
}
}
......
......@@ -258,14 +258,18 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
{
$notices = array();
$notice = Notice::publicStream(
($this->page - 1) * $this->count, $this->count, $this->since_id,
$this->max_id
);
$profile = ($this->auth_user) ? $this->auth_user->getProfile() : null;
while ($notice->fetch()) {
$notices[] = clone($notice);
}
$stream = new PublicNoticeStream($profile);
$notice = $stream->getNotices(($this->page - 1) * $this->count,
$this->count,
$this->since_id,
$this->max_id);
$notices = $notice->fetchAll();
NoticeList::prefill($notices);
return $notices;
}
......
......@@ -320,6 +320,6 @@ class DeleteAccountForm extends Form
'submit',
null,
// TRANS: Button title for user account deletion.
_('Permanently delete your account'));
_('Permanently delete your account.'));
}
}
......@@ -67,7 +67,7 @@ class ImsettingsAction extends SettingsAction
// TRANS: [instant messages] is link text, "(%%doc.im%%)" is the link.
// TRANS: the order and formatting of link text and link should remain unchanged.
return _('You can send and receive notices through '.
'instant messaging [instant messages](%%doc.im%%). '.
'[instant messaging](%%doc.im%%). '.
'Configure your addresses and settings below.');
}
......
......@@ -131,6 +131,10 @@ class JoingroupAction extends Action
try {
$result = $cur->joinGroup($this->group);
} catch (Exception $e) {
common_log(LOG_ERR, sprintf("Couldn't join user %s to group %s: '%s'",
$cur->nickname,
$this->group->nickname,
$e->getMessage()));
// TRANS: Server error displayed when joining a group failed in the database.
// TRANS: %1$s is the joining user's nickname, $2$s is the group nickname for which the join failed.
$this->serverError(sprintf(_('Could not join user %1$s to group %2$s.'),
......
......@@ -462,7 +462,7 @@ class PathsAdminPanelForm extends AdminForm
// TRANS: Button text to store form data in the Paths admin panel.
$this->out->submit('save', _m('BUTTON','Save'), 'submit',
// TRANS: Button title text to store form data in the Paths admin panel.
'save', _('Save paths'));
'save', _('Save path settings.'));
}
/**
......
......@@ -213,7 +213,7 @@ class PeopletagsbyuserAction extends Action
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' .
'You can easily keep track of what they ' .
'are doing by subscribing to the tag\'s timeline.' ), $this->tagger->nickname);
'are doing by subscribing to the list\'s timeline.' ), $this->tagger->nickname);
$this->elementStart('div', array('id' => 'anon_notice'));
$this->raw(common_markup_to_html($notice));
$this->elementEnd('div');
......
......@@ -111,7 +111,7 @@ class PeopletagsforuserAction extends Action
'(http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' .
'You can easily keep track of what they ' .
'are doing by subscribing to the tag\'s timeline.' ), $this->tagged->nickname);
'are doing by subscribing to the list\'s timeline.' ), $this->tagged->nickname);
$this->elementStart('div', array('id' => 'anon_notice'));
$this->raw(common_markup_to_html($notice));
$this->elementEnd('div');
......
......@@ -95,7 +95,7 @@ class PublicAction extends Action
if (!$this->notice) {
// TRANS: Server error displayed when a public timeline cannot be retrieved.
$this->serverError(_('Could not retrieve public stream.'));
$this->serverError(_('Could not retrieve public timeline.'));
return;
}
......@@ -166,20 +166,20 @@ class PublicAction extends Action
common_local_url('ApiTimelinePublic',
array('format' => 'as')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (Activity Streams JSON)')),
_('Public Timeline Feed (Activity Streams JSON)')),
new Feed(Feed::RSS1, common_local_url('publicrss'),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 1.0)')),
_('Public Timeline Feed (RSS 1.0)')),
new Feed(Feed::RSS2,
common_local_url('ApiTimelinePublic',
array('format' => 'rss')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (RSS 2.0)')),
_('Public Timeline Feed (RSS 2.0)')),
new Feed(Feed::ATOM,
common_local_url('ApiTimelinePublic',
array('format' => 'atom')),
// TRANS: Link description for public timeline feed.
_('Public Stream Feed (Atom)')));
_('Public Timeline Feed (Atom)')));
}
function showEmptyList()
......
......@@ -339,7 +339,7 @@ class RestoreAccountForm extends Form
$this->out->elementStart('p', 'instructions');
// TRANS: Form instructions for feed restore.
$this->out->raw(_('You can upload a backed-up stream in '.
$this->out->raw(_('You can upload a backed-up timeline in '.
'<a href="http://activitystrea.ms/">Activity Streams</a> format.'));
$this->out->elementEnd('p');
......
......@@ -251,21 +251,24 @@ class ShowApplicationAction extends Action
$this->elementStart('div', 'entity_data');
// TRANS: Header on the OAuth application page.
$this->element('h2', null, _('Application info'));
$this->element('div',
'entity_consumer_key',
$consumer->consumer_key);
$this->element('div',
'entity_consumer_secret',
$consumer->consumer_secret);
$this->element('div',
'entity_request_token_url',
common_local_url('ApiOauthRequestToken'));
$this->element('div', 'entity_access_token_url', common_local_url('ApiOauthAccessToken'));
$this->element('div', 'entity_authorize_url', common_local_url('ApiOauthAuthorize'));
$this->elementStart('dl');
// TRANS: Field label on application page.
$this->element('dt', null, _('Consumer key'));
$this->element('dd', null, $consumer->consumer_key);
// TRANS: Field label on application page.
$this->element('dt', null, _('Consumer secret'));
$this->element('dd', null, $consumer->consumer_secret);
// TRANS: Field label on application page.
$this->element('dt', null, _('Request token URL'));
$this->element('dd', null, common_local_url('ApiOauthRequestToken'));
// TRANS: Field label on application page.
$this->element('dt', null, _('Access token URL'));
$this->element('dd', null, common_local_url('ApiOauthAccessToken'));
// TRANS: Field label on application page.
$this->element('dt', null, _('Authorize URL'));
$this->element('dd', null, common_local_url('ApiOauthAuthorize'));
$this->elementEnd('dl');
$this->element('p', 'note',
// TRANS: Note on the OAuth application page about signature support.
......
......@@ -65,11 +65,11 @@ class ShowstreamAction extends ProfileAction
$base = $this->profile->getFancyName();
if (!empty($this->tag)) {
if ($this->page == 1) {
// TRANS: Page title showing tagged notices in one user's stream.
// TRANS: Page title showing tagged notices in one user's timeline.
// TRANS: %1$s is the username, %2$s is the hash tag.
return sprintf(_('Notices by %1$s tagged %2$s'), $base, $this->tag);
} else {
// TRANS: Page title showing tagged notices in one user's stream.
// TRANS: Page title showing tagged notices in one user's timeline.
// TRANS: %1$s is the username, %2$s is the hash tag, %3$d is the page number.
return sprintf(_('Notices by %1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page);
}
......@@ -77,7 +77,7 @@ class ShowstreamAction extends ProfileAction
if ($this->page == 1) {
return $base;
} else {
// TRANS: Extended page title showing tagged notices in one user's stream.
// TRANS: Extended page title showing tagged notices in one user's timeline.
// TRANS: %1$s is the username, %2$d is the page number.
return sprintf(_('Notices by %1$s, page %2$d'),
$base,
......@@ -205,7 +205,7 @@ class ShowstreamAction extends ProfileAction
function showEmptyListMessage()
{
// TRANS: First sentence of empty list message for a stream. $1%s is a user nickname.
// TRANS: First sentence of empty list message for a timeline. $1%s is a user nickname.
$message = sprintf(_('This is the timeline for %1$s, but %1$s hasn\'t posted anything yet.'), $this->user->nickname) . ' ';
if (common_logged_in()) {
......@@ -214,7 +214,7 @@ class ShowstreamAction extends ProfileAction
// TRANS: Second sentence of empty list message for a stream for the user themselves.
$message .= _('Seen anything interesting recently? You haven\'t posted any notices yet, now would be a good time to start :)');
} else {
// TRANS: Second sentence of empty list message for a non-self stream. %1$s is a user nickname, %2$s is a part of a URL.
// TRANS: Second sentence of empty list message for a non-self timeline. %1$s is a user nickname, %2$s is a part of a URL.
// TRANS: This message contains a Markdown link. Keep "](" together.
$message .= sprintf(_('You can try to nudge %1$s or [post something to them](%%%%action.newnotice%%%%?status_textarea=%2$s).'), $this->user->nickname, '@' . $this->user->nickname);
}
......@@ -257,14 +257,14 @@ class ShowstreamAction extends ProfileAction
function showAnonymousMessage()
{
if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
// TRANS: Announcement for anonymous users showing a stream if site registrations are open.
// TRANS: Announcement for anonymous users showing a timeline if site registrations are open.
// TRANS: This message contains a Markdown link. Keep "](" together.
$m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. ' .
'[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'),
$this->user->nickname, $this->user->nickname);
} else {
// TRANS: Announcement for anonymous users showing a stream if site registrations are closed or invite only.
// TRANS: Announcement for anonymous users showing a timeline if site registrations are closed or invite only.
// TRANS: This message contains a Markdown link. Keep "](" together.
$m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
'based on the Free Software [StatusNet](http://status.net/) tool. '),
......
......@@ -197,7 +197,7 @@ class SiteNoticeAdminPanelForm extends AdminForm
_m('BUTTON','Save'),
'submit',
null,
// TRANS: Title for button to save site notice in admin panel.
// TRANS: Button title to save site notice in admin panel.
_('Save site notice.')
);
}
......
......@@ -252,7 +252,7 @@ class SnapshotAdminPanelForm extends AdminForm
_m('BUTTON','Save'),
'submit',
null,
// TRANS: Title for button to save snapshot settings.
// TRANS: Button title to save snapshot settings.
_('Save snapshot settings.')
);
}
......
......@@ -300,7 +300,7 @@ class UserAdminPanelForm extends AdminForm
_m('BUTTON','Save'),
'submit',
null,
// TRANS: Title for button to save user settings in user admin panel.
// TRANS: Button title to save user settings in user admin panel.
_('Save user settings.'));
}
}
<?php
/**
* StatusNet - the distributed open-source microblogging tool
* Copyright (C) 2008, 2009, StatusNet, Inc.
* Copyright (C) 2008-2011, StatusNet, Inc.
*
* Show version information for this software and plugins