L10n/i18n updates.
Whitespace updates.
Break long lines in README files.
17 files changed:
*
* This plugin adds an extra level of in-process caching to any regular
* cache system like APC, XCache, or Memcache.
*
* This plugin adds an extra level of in-process caching to any regular
* cache system like APC, XCache, or Memcache.
* Note that since most caching plugins return false for StartCache*
* methods, you should add this plugin before them, i.e.
*
* Note that since most caching plugins return false for StartCache*
* methods, you should add this plugin before them, i.e.
*
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class InProcessCachePlugin extends Plugin
{
private $_items = array();
class InProcessCachePlugin extends Plugin
{
private $_items = array();
/**
* Get an item from the cache
/**
* Get an item from the cache
* Called before other cache systems are called (iif this
* plugin was loaded correctly, see class comment). If we
* have the data, return it, and don't hit the other cache
* Called before other cache systems are called (iif this
* plugin was loaded correctly, see class comment). If we
* have the data, return it, and don't hit the other cache
*
* @return boolean false if found, else true
*/
*
* @return boolean false if found, else true
*/
function onStartCacheGet(&$key, &$value)
{
if ($this->active && array_key_exists($key, $this->_items)) {
function onStartCacheGet(&$key, &$value)
{
if ($this->active && array_key_exists($key, $this->_items)) {
*
* @return boolean hook value, true
*/
*
* @return boolean hook value, true
*/
function onEndCacheGet($key, &$value)
{
if ($this->active && (!array_key_exists($key, $this->_items) ||
function onEndCacheGet($key, &$value)
{
if ($this->active && (!array_key_exists($key, $this->_items) ||
/**
* Called at the end of setting a cache element
/**
* Called at the end of setting a cache element
* Always set the cache element; may overwrite existing
* data.
*
* Always set the cache element; may overwrite existing
* data.
*
*
* @return boolean true
*/
*
* @return boolean true
*/
function onEndCacheSet($key, $value, $flag, $expiry)
{
if ($this->active) {
function onEndCacheSet($key, $value, $flag, $expiry)
{
if ($this->active) {
*
* @return boolean true
*/
*
* @return boolean true
*/
function onStartCacheDelete(&$key, &$success)
{
if ($this->active && array_key_exists($key, $this->_items)) {
function onStartCacheDelete(&$key, &$success)
{
if ($this->active && array_key_exists($key, $this->_items)) {
*
* @return boolean true
*/
*
* @return boolean true
*/
function onPluginVersion(&$versions)
{
$url = 'http://status.net/wiki/Plugin:InProcessCache';
function onPluginVersion(&$versions)
{
$url = 'http://status.net/wiki/Plugin:InProcessCache';
'author' => 'Evan Prodromou',
'homepage' => $url,
'description' =>
'author' => 'Evan Prodromou',
'homepage' => $url,
'description' =>
+ // TRANS: Plugin dscription.
_m('Additional in-process cache for plugins.'));
return true;
}
_m('Additional in-process cache for plugins.'));
return true;
}
*
* @return boolean true
*/
*
* @return boolean true
*/
function cleanup()
{
if ($this->active && common_config('inprocess', 'stats')) {
function cleanup()
{
if ($this->active && common_config('inprocess', 'stats')) {
- $this->log(LOG_INFO, "cache size: " .
+ $this->log(LOG_INFO, "cache size: " .
count($this->_items));
$sum = 0;
foreach ($this->_hits as $hitcount) {
$sum += $hitcount;
}
count($this->_items));
$sum = 0;
foreach ($this->_hits as $hitcount) {
$sum += $hitcount;
}
- $this->log(LOG_INFO, $sum . " hits on " .
+ $this->log(LOG_INFO, $sum . " hits on " .
count($this->_hits) . " keys");
}
return true;
count($this->_hits) . " keys");
}
return true;
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:InfiniteScroll',
'rawdescription' =>
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:InfiniteScroll',
'rawdescription' =>
+ // TRANS: Plugin dscription.
_m('Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.'));
return true;
}
_m('Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.'));
return true;
}
-Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.
+Infinite Scroll adds the following functionality to your StatusNet installation:
+When a user scrolls towards the bottom of the page, the next page of notices is
+automatically retrieved and appended. This means they never need to click "Next
+Page", which dramatically increases stickiness.
Installation
============
Installation
============
$text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;\r
$this->imPlugin->sendMessage($this->ircChannel, $text);\r
}\r
$text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;\r
$this->imPlugin->sendMessage($this->ircChannel, $text);\r
}\r
-}
\ No newline at end of file
protected function send($command, $args = '') {
$this->would_be_sent = array('command' => $command, 'args' => $args);
}
protected function send($command, $args = '') {
$this->would_be_sent = array('command' => $command, 'args' => $args);
}
-}
\ No newline at end of file
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class IrcPlugin extends ImPlugin {
public $host = null;
public $port = null;
class IrcPlugin extends ImPlugin {
public $host = null;
public $port = null;
* @return string Name of service
*/
public function getDisplayName() {
* @return string Name of service
*/
public function getDisplayName() {
+ // TRANS: Service name for IRC.
* @return boolean success value
*/
public function sendConfirmationCode($screenname, $code, $user, $checked = false) {
* @return boolean success value
*/
public function sendConfirmationCode($screenname, $code, $user, $checked = false) {
+ // TRANS: Body text for e-mail confirmation message for IRC.
+ // TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename,
+ // TRANS: %3$s is the plugin display name ("IRC"), %4$s is the confirm address URL.
$body = sprintf(_m('User "%1$s" on %2$s has said that your %3$s screenname belongs to them. ' .
'If that\'s true, you can confirm by clicking on this URL: ' .
'%4$s' .
$body = sprintf(_m('User "%1$s" on %2$s has said that your %3$s screenname belongs to them. ' .
'If that\'s true, you can confirm by clicking on this URL: ' .
'%4$s' .
*/
public function initialize() {
if (!isset($this->host)) {
*/
public function initialize() {
if (!isset($this->host)) {
- throw new Exception('must specify a host');
+ // TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
+ throw new Exception(_m('You must specify a host.'));
}
if (!isset($this->username)) {
}
if (!isset($this->username)) {
- throw new Exception('must specify a username');
+ // TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
+ throw new Exception(_m('You must specify a username.'));
}
if (!isset($this->realname)) {
}
if (!isset($this->realname)) {
- throw new Exception('must specify a "real name"');
+ // TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
+ throw new Exception(_m('You must specify a "real name".'));
}
if (!isset($this->nick)) {
}
if (!isset($this->nick)) {
- throw new Exception('must specify a nickname');
+ // TRANS: Exception thrown when initialising the IRC plugin fails because of an incorrect configuration.
+ throw new Exception(_m('You must specify a nickname.'));
}
if (!isset($this->port)) {
}
if (!isset($this->port)) {
'author' => 'Luke Fitzgerald',
'homepage' => 'http://status.net/wiki/Plugin:IRC',
'rawdescription' =>
'author' => 'Luke Fitzgerald',
'homepage' => 'http://status.net/wiki/Plugin:IRC',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('The IRC plugin allows users to send and receive notices over an IRC network.'));
return true;
}
_m('The IRC plugin allows users to send and receive notices over an IRC network.'));
return true;
}
/**\r
* Table Definition for irc_waiting_message\r
*/\r
/**\r
* Table Definition for irc_waiting_message\r
*/\r
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';\r
\r
class Irc_waiting_message extends Memcached_DataObject {\r
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';\r
\r
class Irc_waiting_message extends Memcached_DataObject {\r
$result = $this->update($orig);\r
\r
if (!$result) {\r
$result = $this->update($orig);\r
\r
if (!$result) {\r
- throw Exception(sprintf(_m("Could not increment attempts count for %d"), $this->id));\r
+ // TRANS: Exception thrown when an IRC attempts count could not be updated.\r
+ // TRANS: %d is the object ID for which the count could not be updated.\r
+ throw Exception(sprintf(_m('Could not increment attempts count for %d.'), $this->id));\r
* In a multi-site queuedaemon.php run, one connection will be instantiated
* for each site being handled by the current process that has IRC enabled.
*/
* In a multi-site queuedaemon.php run, one connection will be instantiated
* for each site being handled by the current process that has IRC enabled.
*/
class IrcManager extends ImManager {
protected $conn = null;
protected $lastPing = null;
class IrcManager extends ImManager {
protected $conn = null;
protected $lastPing = null;
// Send message
$this->plugin->sendConfirmationCode($screenname, $nickdata['code'], $nickdata['user'], true);
} else {
// Send message
$this->plugin->sendConfirmationCode($screenname, $nickdata['code'], $nickdata['user'], true);
} else {
- $this->plugin->sendMessage($screenname, _m('Your nickname is not registered so IRC connectivity cannot be enabled'));
+ // TRANS: Message given when using an unregistered IRC nickname.
+ $this->plugin->sendMessage($screenname, _m('Your nickname is not registered so IRC connectivity cannot be enabled.'));
$confirm = new Confirm_address();
$confirm = new Confirm_address();
if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__);
if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__);
- // TRANS: Server error thrown on database error canceling IM address confirmation.
+ // TRANS: Server error thrown on database error when deleting IRC nickname confirmation.
$this->serverError(_m('Could not delete confirmation.'));
return;
}
$this->serverError(_m('Could not delete confirmation.'));
return;
}
if (!$result) {
common_log_db_error($wm, 'INSERT', __FILE__);
if (!$result) {
common_log_db_error($wm, 'INSERT', __FILE__);
- throw new ServerException('DB error inserting IRC waiting queue item');
+ // TRANS: Server exception thrown when an IRC waiting queue item could not be added to the database.
+ throw new ServerException(_m('Database error inserting IRC waiting queue item.'));
function onInitializePlugin(){
parent::onInitializePlugin();
if(!isset($this->attributes['nickname'])){
function onInitializePlugin(){
parent::onInitializePlugin();
if(!isset($this->attributes['nickname'])){
- throw new Exception("must specify a nickname attribute");
+ // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
+ throw new Exception(_m('You must specify a nickname attribute.'));
}
if($this->password_changeable && (! isset($this->attributes['password']) || !isset($this->password_encoding))){
}
if($this->password_changeable && (! isset($this->attributes['password']) || !isset($this->password_encoding))){
- throw new Exception("if password_changeable is set, the password attribute and password_encoding must also be specified");
+ // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
+ throw new Exception(_m('If password_changeable is set, the password attribute and password_encoding must also be specified.'));
}
$this->ldapCommon = new LdapCommon(get_object_vars($this));
}
function onAutoload($cls)
}
$this->ldapCommon = new LdapCommon(get_object_vars($this));
}
function onAutoload($cls)
switch ($cls)
{
case 'LdapCommon':
switch ($cls)
{
case 'LdapCommon':
{
case 'register':
if($this->autoregistration) {
{
case 'register':
if($this->autoregistration) {
- $instr = 'Have an LDAP account? Use your standard username and password.';
+ // TRANS: Instructions for LDAP authentication.
+ $instr = _m('Do you have an LDAP account? Use your standard username and password.');
- $instr = 'Have an LDAP account? Use your standard username and password.';
+ // TRANS: Instructions for LDAP authentication.
+ $instr = _m('Do you have an LDAP account? Use your standard username and password.');
break;
default:
return true;
break;
default:
return true;
//---interface implementation---//
function checkPassword($username, $password)
//---interface implementation---//
function checkPassword($username, $password)
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication',
'rawdescription' =>
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.'));
return true;
}
_m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.'));
return true;
}
========
provider_name*: This is a identifier designated to the connection.
It's how StatusNet will refer to the authentication source.
========
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.
+ 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
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
'fullname'=>'displayName',
'password'=>'unicodePwd')
));
'fullname'=>'displayName',
'password'=>'unicodePwd')
));
function onInitializePlugin(){
if(!isset($this->provider_name)){
function onInitializePlugin(){
if(!isset($this->provider_name)){
- throw new Exception("provider_name must be set. Use the provider_name from the LDAP Authentication plugin.");
+ // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
+ throw new Exception(_m('provider_name must be set. Use the provider_name from the LDAP Authentication plugin.'));
}
if(!isset($this->uniqueMember_attribute)){
}
if(!isset($this->uniqueMember_attribute)){
- throw new Exception("uniqueMember_attribute must be set.");
+ // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration.
+ throw new Exception(_m('uniqueMember_attribute must be set.'));
}
$this->ldapCommon = new LdapCommon(get_object_vars($this));
}
}
$this->ldapCommon = new LdapCommon(get_object_vars($this));
}
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthorization',
'rawdescription' =>
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthorization',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('The LDAP Authorization plugin allows for StatusNet to handle authorization through LDAP.'));
return true;
}
_m('The LDAP Authorization plugin allows for StatusNet to handle authorization through LDAP.'));
return true;
}
========
provider_name*: This is a identifier designated to the connection.
It's how StatusNet will refer to the authentication source.
========
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.
+ 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
authoritative (false): should this plugin be authoritative for
authorization?
uniqueMember_attribute ('uniqueMember')*: the attribute of a group
some StatusNet roles are: moderator, administrator, sandboxed, silenced
login_group: if this is set to a group DN, only members of that group will be
allowed to login
some StatusNet roles are: moderator, administrator, sandboxed, silenced
login_group: if this is set to a group DN, only members of that group will be
allowed to login
The below settings must be exact copies of the settings used for the
corresponding LDAP Authentication plugin.
The below settings must be exact copies of the settings used for the
corresponding LDAP Authentication plugin.
host*: LDAP server name to connect to. You can provide several hosts in an
array in which case the hosts are tried from left to right.
See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
host*: LDAP server name to connect to. You can provide several hosts in an
array in which case the hosts are tried from left to right.
See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
'attributes'=>array(
'username'=>'sAMAccountName')
));
'attributes'=>array(
'username'=>'sAMAccountName')
));
$this->ldap_config = $this->get_ldap_config();
if(!isset($this->host)){
$this->ldap_config = $this->get_ldap_config();
if(!isset($this->host)){
- throw new Exception(_m("A host must be specified."));
+ // TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration.
+ throw new Exception(_m('A host must be specified.'));
}
if(!isset($this->basedn)){
}
if(!isset($this->basedn)){
+ // TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration.
throw new Exception(_m('"basedn" must be specified.'));
}
if(!isset($this->attributes['username'])){
throw new Exception(_m('"basedn" must be specified.'));
}
if(!isset($this->attributes['username'])){
+ // TRANS: Exception thrown when initialising the LDAP Common plugin fails because of an incorrect configuration.
throw new Exception(_m('The username attribute must be set.'));
}
}
throw new Exception(_m('The username attribute must be set.'));
}
}
// if we were called with a config, assume caller will handle
// incorrect username/password (LDAP_INVALID_CREDENTIALS)
if (isset($config) && $err->getCode() == 0x31) {
// if we were called with a config, assume caller will handle
// incorrect username/password (LDAP_INVALID_CREDENTIALS)
if (isset($config) && $err->getCode() == 0x31) {
- throw new LdapInvalidCredentialsException('Could not connect to LDAP server: '.$err->getMessage());
+ // TRANS: Exception thrown in the LDAP Common plugin when LDAP server is not available.
+ // TRANS: %s is the error message.
+ throw new LdapInvalidCredentialsException(sprintf(_m('Could not connect to LDAP server: %s'),$err->getMessage()));
- throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
+ // TRANS: Exception thrown in the LDAP Common plugin when LDAP server is not available.
+ // TRANS: %s is the error message.
+ throw new Exception(sprintf(_m('Could not connect to LDAP server: %s.'),$err->getMessage()));
}
$c = Cache::instance();
if (!empty($c)) {
}
$c = Cache::instance();
if (!empty($c)) {
function onInitializePlugin(){
parent::onInitializePlugin();
if(!isset($this->serviceUrl)){
function onInitializePlugin(){
parent::onInitializePlugin();
if(!isset($this->serviceUrl)){
+ // TRANS: Exception thrown when URL shortening plugin was configured incorrectly.
throw new Exception(_m('A serviceUrl must be specified.'));
}
}
throw new Exception(_m('A serviceUrl must be specified.'));
}
}
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LilUrl',
'rawdescription' =>
'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LilUrl',
'rawdescription' =>
+ // TRANS: Plugin description.
+ // TRANS: %1$s is the service URL.
sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
$this->shortenerName));
sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
$this->shortenerName));
'author' => 'Brion Vibber',
'homepage' => 'http://status.net/wiki/Plugin:LinkPreview',
'rawdescription' =>
'author' => 'Brion Vibber',
'homepage' => 'http://status.net/wiki/Plugin:LinkPreview',
'rawdescription' =>
- _m('UI extensions previewing thumbnails from links.'));
+ // TRANS: Plugin description.
+ _m('UI extension for previewing thumbnails from links.'));
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class OembedproxyAction extends OembedAction
{
class OembedproxyAction extends OembedAction
{
function handle($args)
{
// Trigger short error responses; not a human-readable web page.
function handle($args)
{
// Trigger short error responses; not a human-readable web page.
// We're not a general oEmbed proxy service; limit to valid sessions.
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
// We're not a general oEmbed proxy service; limit to valid sessions.
$token = $this->trimmed('token');
if (!$token || $token != common_session_token()) {
+ // TRANS: Client error displayed when the session token does not match or is not given.
$this->clientError(_m('There was a problem with your session token. '.
'Try again, please.'));
}
$format = $this->arg('format');
if ($format && $format != 'json') {
$this->clientError(_m('There was a problem with your session token. '.
'Try again, please.'));
}
$format = $this->arg('format');
if ($format && $format != 'json') {
- throw new ClientException('Invalid format; only JSON supported.');
+ // TRANS: Client exception thrown when requesting a different format than JSON.
+ throw new ClientException(_m('Invalid format; only JSON supported.'));
}
$url = $this->arg('url');
if (!common_valid_http_url($url)) {
}
$url = $this->arg('url');
if (!common_valid_http_url($url)) {
- throw new ClientException('Invalid URL.');
+ // TRANS: Client exception thrown when not providing a valid URL.
+ throw new ClientException(_m('Invalid URL.'));
$this->init_document('json');
print json_encode($data);
}
$this->init_document('json');
print json_encode($data);
}
{
$profile = $this->notice->getProfile();
{
$profile = $this->notice->getProfile();
+ // TRANS: Trackback title.
+ // TRANS: %1$s is a profile nickname, %2$s is a timestamp.
$args = array('title' => sprintf(_m('%1$s\'s status on %2$s'),
$profile->nickname,
common_exact_date($this->notice->created)),
$args = array('title' => sprintf(_m('%1$s\'s status on %2$s'),
$profile->nickname,
common_exact_date($this->notice->created)),
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:Linkback',
'rawdescription' =>
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:Linkback',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('Notify blog authors when their posts have been linked in '.
'microblog notices using '.
'<a href="http://www.hixie.ch/specs/pingback/pingback">Pingback</a> '.
_m('Notify blog authors when their posts have been linked in '.
'microblog notices using '.
'<a href="http://www.hixie.ch/specs/pingback/pingback">Pingback</a> '.