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

Commit a3d5e00f authored by Sean Murphy's avatar Sean Murphy

Merge commit 'upstream/0.7.x' into 0.7.x

Conflicts:

	actions/showstream.php
parents d9008931 08db50b2
......@@ -2,8 +2,8 @@
README
------
Laconica 0.7.0 ("Rockville")
30 January 2009
Laconica 0.7.1 ("West of the Fields")
6 February 2009
This is the README file for Laconica, the Open Source microblogging
platform. It includes installation instructions, descriptions of
......@@ -26,14 +26,14 @@ instant messenger programs (GTalk/Jabber), and specially-designed
desktop clients that support the Twitter API.
Laconica supports an open standard called OpenMicroBlogging
(http://openmicroblogging.org/) that lets users on different Web sites
<http://openmicroblogging.org/> that lets users on different Web sites
or in different companies subscribe to each others' notices. It
enables a distributed social network spread all across the Web.
Laconica was originally developed for the Open Software Service,
Identi.ca (http://identi.ca/). It is shared with you in hope that you
Identi.ca <http://identi.ca/>. It is shared with you in hope that you
too make an Open Software Service available to your users. To learn
more, please see the Open Software Service Definition 1.0:
more, please see the Open Software Service Definition 1.1:
http://www.opendefinition.org/ossd
......@@ -71,8 +71,27 @@ for additional terms.
New this version
================
This is a major feature release, and includes some bug fixes from the
previous version (0.6.4, released December 14 2008.)
This is a minor bug-fix release since version 0.7.0, released Jan 29
2009. Notable changes this version:
- Vast improvement in auto-linking to URLs.
- Link to group search from user's group page
- Improved interface in Facebook application
- Fix bad redirects in delete notice
- Updated PostgreSQL database creation script
- Show filesize in avatar/logo upload
- Vastly improved avatar/logo upload
- Allow re-authentication with OpenID
- Correctly link hashtabs inside parens and brackets
- Group and avatar image transparency works
- Better handling of commands through the Web and Ajax channels
- Fix links for profile page feeds
- Fixed destroy method in API
- Fix endpoint of Connect menu when XMPP disabled
- Show number of group members
- Enable configuration files in /etc/laconica/
Changes in version 0.7.0:
- Support for groups. Users can join groups and send themed notices
to those groups. All other members of the group receive the notices.
......@@ -199,9 +218,9 @@ especially if you've previously installed PHP/MySQL packages.
1. Unpack the tarball you downloaded on your Web server. Usually a
command like this will work:
tar zxf laconica-0.7.0.tar.gz
tar zxf laconica-0.7.1.tar.gz
...which will make a laconica-0.7.0 subdirectory in your current
...which will make a laconica-0.7.1 subdirectory in your current
directory. (If you don't have shell access on your Web server, you
may have to unpack the tarball on your local computer and FTP the
files to the server.)
......@@ -209,7 +228,7 @@ especially if you've previously installed PHP/MySQL packages.
2. Move the tarball to a directory of your choosing in your Web root
directory. Usually something like this will work:
mv laconica-0.7.0 /var/www/mublog
mv laconica-0.7.1 /var/www/mublog
This will make your Laconica instance available in the mublog path of
your server, like "http://example.net/mublog". "microblog" or
......@@ -404,7 +423,7 @@ config.php, and access to the Laconica database from the mail server.
XMPP
----
XMPP (eXtended Message and Presence Protocol, http://xmpp.org/) is the
XMPP (eXtended Message and Presence Protocol, <http://xmpp.org/>) is the
instant-messenger protocol that drives Jabber and GTalk IM. You can
distribute messages via XMPP using the system below; however, you
need to run the XMPP incoming daemon to allow incoming messages as
......@@ -537,7 +556,7 @@ Sample cron job:
Sitemaps
--------
Sitemap files (http://sitemaps.org/) are a very nice way of telling
Sitemap files <http://sitemaps.org/> are a very nice way of telling
search engines and other interested bots what's available on your site
and what's changed recently. You can generate sitemap files for your
Laconica instance.
......@@ -558,7 +577,7 @@ Laconica instance.
like './sitemapindex.xml'. sitemap-directory is the directory where
you want the sitemaps stored, like './sitemaps/' (make sure the dir
exists). URL-prefix-for-sitemaps is the full URL for the sitemap dir,
typically something like 'http://example.net/mublog/sitemaps/'.
typically something like <http://example.net/mublog/sitemaps/>.
You can use several methods for submitting your sitemap index to
search engines to get your site indexed. One is to add a line like the
......@@ -612,7 +631,7 @@ modification to use the new output format.
Translation
-----------
Translations in Laconica use the gettext system (http://www.gnu.org/software/gettext/).
Translations in Laconica use the gettext system <http://www.gnu.org/software/gettext/>.
Theoretically, you can add your own sub-directory to the locale/
subdirectory to add a new language to your system. You'll need to
compile the ".po" files into ".mo" files, however.
......@@ -627,7 +646,7 @@ Backups
There is no built-in system for doing backups in Laconica. You can make
backups of a working Laconica system by backing up the database and
the Web directory. To backup the database use mysqldump (http://ur1.ca/7xo)
the Web directory. To backup the database use mysqldump <http://ur1.ca/7xo>
and to backup the Web directory, try tar.
Private
......@@ -653,7 +672,7 @@ Upgrading
If you've been using Laconica 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 Laconica 0.7.0. Try these step-by-step instructions; read
procedure in Laconica 0.7.1. Try these step-by-step instructions; read
to the end first before trying them.
0. Download Laconica and set up all the prerequisites as if you were
......@@ -819,7 +838,7 @@ db
--
This section is a reference to the configuration options for
DB_DataObject (see http://ur1.ca/7xp). The ones that you may want to
DB_DataObject (see <http://ur1.ca/7xp>). The ones that you may want to
set are listed below for clarity.
database: a DSN (Data Source Name) for your Laconica database. This is
......@@ -919,7 +938,7 @@ server: If set, defines another server where avatars are stored in the
the client to speed up page loading, either with another
virtual server or with an NFS or SAMBA share. Clients
typically only make 2 connections to a single server at a
time (http://ur1.ca/6ih), so this can parallelize the job.
time <http://ur1.ca/6ih>, so this can parallelize the job.
Defaults to null.
public
......@@ -1000,7 +1019,7 @@ memcached
---------
You can get a significant boost in performance by caching some
database data in memcached (http://www.danga.com/memcached/).
database data in memcached <http://www.danga.com/memcached/>.
enabled: Set to true to enable. Default false.
server: a string with the hostname of the memcached server. Can also
......@@ -1011,7 +1030,7 @@ sphinx
You can get a significant boost in performance using Sphinx Search
instead of your database server to search for users and notices.
(http://sphinxsearch.com/).
<http://sphinxsearch.com/>.
enabled: Set to true to enable. Default false.
server: a string with the hostname of the sphinx server.
......@@ -1024,7 +1043,7 @@ A catch-all for integration with other systems.
source: The name to use for the source of posts to Twitter. Defaults
to 'laconica', but if you request your own source name from
Twitter (http://twitter.com/help/request_source), you can use
Twitter <http://twitter.com/help/request_source>, you can use
that here instead. Status updates on Twitter will then have
links to your site.
......@@ -1070,7 +1089,7 @@ repository (see below), and you get a compilation error ("unexpected
T_STRING") in the browser, check to see that you don't have any
conflicts in your code.
If you upgraded to Laconica 0.7.0 without reading the "Notice inboxes"
If you upgraded to Laconica 0.7.1 without reading the "Notice inboxes"
section above, and all your users' 'Personal' tabs are empty, read the
"Notice inboxes" section above.
......@@ -1101,7 +1120,7 @@ Unstable version
If you're adventurous or impatient, you may want to install the
development version of Laconica. To get it, use the git version
control tool (http://git-scm.com/) like so:
control tool <http://git-scm.com/> like so:
git clone http://laconi.ca/software/laconica.git
......@@ -1114,7 +1133,7 @@ There are several ways to get more information about Laconica.
* There is a mailing list for Laconica developers and admins at
http://mail.laconi.ca/mailman/listinfo/laconica-dev
* The #laconica IRC channel on freenode.net (http://www.freenode.net/).
* The #laconica IRC channel on freenode.net <http://www.freenode.net/>.
* The Laconica wiki, http://laconi.ca/trac/
Feedback
......@@ -1155,6 +1174,7 @@ if anyone's been overlooked in error.
* Meitar Moscovitz
* Ken Sheppardson (Trac server, man-about-town)
* Tiago 'gouki' Faria (i18n managerx)
* Sean Murphy
Thanks also to the developers of our upstream library code and to the
thousands of people who have tried out Identi.ca, installed Laconi.ca,
......
......@@ -42,6 +42,9 @@ class AllAction extends Action
if (!$this->page) {
$this->page = 1;
}
common_set_returnto($this->selfUrl());
return true;
}
......@@ -101,4 +104,15 @@ class AllAction extends Action
$this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
$this->page, 'all', array('nickname' => $this->user->nickname));
}
function showPageTitle()
{
$user =& common_current_user();
if ($user && ($user->id == $this->user->id)) {
$this->element('h1', NULL, _("You and friends"));
} else {
$this->element('h1', NULL, sprintf(_('%s and friends'), $this->user->nickname));
}
}
}
......@@ -90,9 +90,9 @@ class AvatarbynicknameAction extends Action
$url = $avatar->url;
} else {
if ($size == 'original') {
$url = common_default_avatar(AVATAR_PROFILE_SIZE);
$url = Avatar::defaultImage(AVATAR_PROFILE_SIZE);
} else {
$url = common_default_avatar($size+0);
$url = Avatar::defaultImage($size+0);
}
}
common_redirect($url, 302);
......
......@@ -75,7 +75,7 @@ class AvatarsettingsAction extends AccountSettingsAction
function getInstructions()
{
return _('You can upload your personal avatar. The maximum file size is '.ImageFile::maxFileSize().'.');
return sprintf(_('You can upload your personal avatar. The maximum file size is %s.'), ImageFile::maxFileSize());
}
/**
......@@ -155,7 +155,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
'value' => ImageFile::maxFileSize(true)));
'value' => ImageFile::maxFileSizeInt()));
$this->elementEnd('li');
$this->elementEnd('ul');
......@@ -200,7 +200,7 @@ class AvatarsettingsAction extends AccountSettingsAction
'class' => 'avatar_view'));
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
'height' => $this->filedata['height'],
'alt' => $user->nickname));
......@@ -212,7 +212,7 @@ class AvatarsettingsAction extends AccountSettingsAction
'class' => 'avatar_view'));
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $user->nickname));
......@@ -281,12 +281,12 @@ class AvatarsettingsAction extends AccountSettingsAction
$cur = common_current_user();
$filename = common_avatar_filename($cur->id,
image_type_to_extension($imagefile->type),
null,
'tmp'.common_timestamp());
$filename = Avatar::filename($cur->id,
image_type_to_extension($imagefile->type),
null,
'tmp'.common_timestamp());
$filepath = common_avatar_path($filename);
$filepath = Avatar::path($filename);
move_uploaded_file($imagefile->filepath, $filepath);
......@@ -320,7 +320,7 @@ class AvatarsettingsAction extends AccountSettingsAction
$this->serverError(_('Lost our file data.'));
return;
}
// If image is not being cropped assume pos & dimentions of original
$dest_x = $this->arg('avatar_crop_x') ? $this->arg('avatar_crop_x'):0;
$dest_y = $this->arg('avatar_crop_y') ? $this->arg('avatar_crop_y'):0;
......@@ -328,10 +328,10 @@ class AvatarsettingsAction extends AccountSettingsAction
$dest_h = $this->arg('avatar_crop_h') ? $this->arg('avatar_crop_h'):$filedata['height'];
$size = min($dest_w, $dest_h);
$size = ($size > MAX_ORIGINAL) ? MAX_ORIGINAL:$size;
$user = common_current_user();
$profile = $user->getProfile();
$imagefile = new ImageFile($user->id, $filedata['filepath']);
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
......@@ -373,12 +373,14 @@ class AvatarsettingsAction extends AccountSettingsAction
{
parent::showScripts();
$jcropPack = common_path('js/jcrop/jquery.Jcrop.pack.js');
$jcropGo = common_path('js/jcrop/jquery.Jcrop.go.js');
if ($this->mode == 'crop') {
$jcropPack = common_path('js/jcrop/jquery.Jcrop.pack.js');
$jcropGo = common_path('js/jcrop/jquery.Jcrop.go.js');
$this->element('script', array('type' => 'text/javascript',
'src' => $jcropPack));
$this->element('script', array('type' => 'text/javascript',
'src' => $jcropGo));
$this->element('script', array('type' => 'text/javascript',
'src' => $jcropPack));
$this->element('script', array('type' => 'text/javascript',
'src' => $jcropGo));
}
}
}
......@@ -103,17 +103,18 @@ class DeletenoticeAction extends DeleteAction
function showContent()
{
$this->elementStart('form', array('id' => 'notice_delete_form',
$this->elementStart('form', array('id' => 'form_notice_delete',
'class' => 'form_settings',
'method' => 'post',
'action' => common_local_url('deletenotice')));
$this->elementStart('fieldset');
$this->element('legend', null, _('Delete notice'));
$this->hidden('token', common_session_token());
$this->hidden('notice', $this->trimmed('notice'));
$this->elementStart('p');
$this->element('span', array('id' => 'confirmation_text'),
_('Are you sure you want to delete this notice?'));
$this->submit('yes', _('Yes'));
$this->submit('no', _('No'));
$this->elementEnd('p');
$this->element('p', null, _('Are you sure you want to delete this notice?'));
$this->submit('form_action-yes', _('Yes'), 'submit form_action-primary', 'yes');
$this->submit('form_action-no', _('No'), 'submit form_action-secondary', 'no');
$this->elementEnd('fieldset');
$this->elementEnd('form');
}
......
......@@ -148,14 +148,11 @@ class FacebookhomeAction extends FacebookAction
function showNoticeForm()
{
$post_action = "$this->app_uri/index.php";
$notice_form = new FacebookNoticeForm($this, $post_action, null,
$post_action, $this->user);
$notice_form->show();
}
function title()
......@@ -169,7 +166,6 @@ class FacebookhomeAction extends FacebookAction
function showContent()
{
$notice = $this->user->noticesWithFriends(($this->page-1) *
NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
......@@ -179,7 +175,6 @@ class FacebookhomeAction extends FacebookAction
$this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
$this->page, 'index.php', array('nickname' => $this->user->nickname));
}
function showNoticeList($notice)
......
......@@ -73,7 +73,7 @@ class FacebookinviteAction extends FacebookAction
$friend_ids = $_POST['ids']; // XXX: Hmm... is this the best way to acces the list?
$this->elementStart("ul");
$this->elementStart('ul', array('id' => 'facebook-friends'));
foreach ($friend_ids as $friend) {
$this->elementStart('li');
......@@ -112,11 +112,11 @@ class FacebookinviteAction extends FacebookAction
$this->element('h2', null, sprintf(_('Friends already using %s:'),
common_config('site', 'name')));
$this->elementStart("ul");
$this->elementStart('ul', array('id' => 'facebook-friends'));
foreach ($exclude_ids as $friend) {
$this->elementStart('li');
$this->element('fb:profile-pic', array('uid' => $friend));
$this->element('fb:profile-pic', array('uid' => $friend, 'size' => 'square'));
$this->element('fb:name', array('uid' => $friend,
'capitalize' => 'true'));
$this->elementEnd('li');
......
......@@ -104,6 +104,9 @@ class FavoritedAction extends Action
{
parent::prepare($args);
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
common_set_returnto($this->selfUrl());
return true;
}
......
......@@ -30,7 +30,7 @@ class FinishopenidloginAction extends Action
function handle($args)
{
parent::handle($args);
if (common_logged_in()) {
if (common_is_real_login()) {
$this->clientError(_('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$token = $this->trimmed('token');
......
......@@ -152,7 +152,7 @@ class GrouplogoAction extends Action
function getInstructions()
{
return _('You can upload a logo image for your group. The maximum file size is '.ImageFile::maxFileSize().'.');
return sprintf(_('You can upload a logo image for your group. The maximum file size is %s.'), ImageFile::maxFileSize());
}
/**
......@@ -229,7 +229,7 @@ class GrouplogoAction extends Action
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
'value' => ImageFile::maxFileSize(true)));
'value' => ImageFile::maxFileSizeInt()));
$this->elementEnd('li');
$this->elementEnd('ul');
......@@ -263,7 +263,7 @@ class GrouplogoAction extends Action
'class' => 'avatar_view'));
$this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => $this->filedata['width'],
'height' => $this->filedata['height'],
'alt' => $this->group->nickname));
......@@ -275,7 +275,7 @@ class GrouplogoAction extends Action
'class' => 'avatar_view'));
$this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => common_avatar_url($this->filedata['filename']),
$this->element('img', array('src' => Avatar::url($this->filedata['filename']),
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $this->group->nickname));
......@@ -343,12 +343,12 @@ class GrouplogoAction extends Action
return;
}
$filename = common_avatar_filename($this->group->id,
image_type_to_extension($imagefile->type),
null,
'group-temp-'.common_timestamp());
$filename = Avatar::filename($this->group->id,
image_type_to_extension($imagefile->type),
null,
'group-temp-'.common_timestamp());
$filepath = common_avatar_path($filename);
$filepath = Avatar::path($filename);
move_uploaded_file($imagefile->filepath, $filepath);
......@@ -382,7 +382,7 @@ class GrouplogoAction extends Action
$this->serverError(_('Lost our file data.'));
return;
}
// If image is not being cropped assume pos & dimentions of original
$dest_x = $this->arg('avatar_crop_x') ? $this->arg('avatar_crop_x'):0;
$dest_y = $this->arg('avatar_crop_y') ? $this->arg('avatar_crop_y'):0;
......@@ -390,7 +390,7 @@ class GrouplogoAction extends Action
$dest_h = $this->arg('avatar_crop_h') ? $this->arg('avatar_crop_h'):$filedata['height'];
$size = min($dest_w, $dest_h);
$size = ($size > MAX_ORIGINAL) ? MAX_ORIGINAL:$size;
$imagefile = new ImageFile($this->group->id, $filedata['filepath']);
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
......
......@@ -97,7 +97,7 @@ class LoginAction extends Action
{
// XXX: login throttle
// CSRF protection - token set in common_notice_form()
// CSRF protection - token set in NoticeForm
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
$this->clientError(_('There was a problem with your session token. '.
......@@ -107,35 +107,14 @@ class LoginAction extends Action
$nickname = common_canonical_nickname($this->trimmed('nickname'));
$password = $this->arg('password');
if (common_check_user($nickname, $password)) {
// success!
if (!common_set_user($nickname)) {
$this->serverError(_('Error setting user.'));
return;
}
common_real_login(true);
if ($this->boolean('rememberme')) {
common_debug('Adding rememberme cookie for ' . $nickname);
common_rememberme();
}
// success!
$url = common_get_returnto();
if ($url) {
// We don't have to return to it again
common_set_returnto(null);
} else {
$url = common_local_url('all',
array('nickname' =>
$nickname));
}
common_redirect($url);
} else {
if (!common_check_user($nickname, $password)) {
$this->showForm(_('Incorrect username or password.'));
return;
}
// success!
if (!common_set_user($user)) {
if (!common_set_user($nickname)) {
$this->serverError(_('Error setting user.'));
return;
}
......@@ -143,11 +122,11 @@ class LoginAction extends Action
common_real_login(true);
if ($this->boolean('rememberme')) {
common_debug('Adding rememberme cookie for ' . $nickname);
common_rememberme($user);
}
// success!
$url = common_get_returnto();
if ($url) {
// We don't have to return to it again
common_set_returnto(null);
......@@ -156,6 +135,7 @@ class LoginAction extends Action
array('nickname' =>
$nickname));
}
common_redirect($url);
}
......
......@@ -90,7 +90,7 @@ class NewnoticeAction extends Action
$this->clientError(_('Not logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// CSRF protection - token set in common_notice_form()
// CSRF protection
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
$this->clientError(_('There was a problem with your session token. '.
......@@ -141,9 +141,9 @@ class NewnoticeAction extends Action
if ($cmd) {
if ($this->boolean('ajax')) {
$cmd->execute(new AjaxWebChannel());
$cmd->execute(new AjaxWebChannel($this));
} else {
$cmd->execute(new WebChannel());
$cmd->execute(new WebChannel($this));
}
return;
}
......@@ -195,7 +195,7 @@ class NewnoticeAction extends Action
function ajaxErrorMsg($msg)
{
common_start_html('text/xml;charset=utf-8', true);
$this->startHTML('text/xml;charset=utf-8', true);
$this->elementStart('head');
$this->element('title', null, _('Ajax Error'));
$this->elementEnd('head');
......
......@@ -48,6 +48,16 @@ require_once INSTALLDIR.'/lib/searchaction.php';
*/
class NoticesearchAction extends SearchAction
{
function prepare($args)
{
parent::prepare($args);
common_set_returnto($this->selfUrl());
return true;
}
/**
* Get instructions
*
......@@ -154,8 +164,9 @@ class NoticesearchAction extends SearchAction
$this->elementStart('div', 'entry-title');
$this->elementStart('span', 'vcard author');
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
$this->elementStart('a', array('href' => $profile->profileurl));
$this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
$this->elementStart('a', array('href'