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

Commit e6d053ac authored by Siebrand Mazeland's avatar Siebrand Mazeland

Update translator documentation.

L10n/i18n updates.
Whitespace updates.
Break long lines in README files.
parent 413d9e2f
...@@ -39,7 +39,7 @@ if (!defined('STATUSNET')) { ...@@ -39,7 +39,7 @@ if (!defined('STATUSNET')) {
* *
* This plugin adds an extra level of in-process caching to any regular * This plugin adds an extra level of in-process caching to any regular
* cache system like APC, XCache, or Memcache. * cache system like APC, XCache, or Memcache.
* *
* Note that since most caching plugins return false for StartCache* * Note that since most caching plugins return false for StartCache*
* methods, you should add this plugin before them, i.e. * methods, you should add this plugin before them, i.e.
* *
...@@ -53,7 +53,6 @@ if (!defined('STATUSNET')) { ...@@ -53,7 +53,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class InProcessCachePlugin extends Plugin class InProcessCachePlugin extends Plugin
{ {
private $_items = array(); private $_items = array();
...@@ -77,7 +76,7 @@ class InProcessCachePlugin extends Plugin ...@@ -77,7 +76,7 @@ class InProcessCachePlugin extends Plugin
/** /**
* Get an item from the cache * Get an item from the cache
* *
* Called before other cache systems are called (iif this * Called before other cache systems are called (iif this
* plugin was loaded correctly, see class comment). If we * plugin was loaded correctly, see class comment). If we
* have the data, return it, and don't hit the other cache * have the data, return it, and don't hit the other cache
...@@ -88,7 +87,6 @@ class InProcessCachePlugin extends Plugin ...@@ -88,7 +87,6 @@ class InProcessCachePlugin extends Plugin
* *
* @return boolean false if found, else true * @return boolean false if found, else true
*/ */
function onStartCacheGet(&$key, &$value) function onStartCacheGet(&$key, &$value)
{ {
if ($this->active && array_key_exists($key, $this->_items)) { if ($this->active && array_key_exists($key, $this->_items)) {
...@@ -116,7 +114,6 @@ class InProcessCachePlugin extends Plugin ...@@ -116,7 +114,6 @@ class InProcessCachePlugin extends Plugin
* *
* @return boolean hook value, true * @return boolean hook value, true
*/ */
function onEndCacheGet($key, &$value) function onEndCacheGet($key, &$value)
{ {
if ($this->active && (!array_key_exists($key, $this->_items) || if ($this->active && (!array_key_exists($key, $this->_items) ||
...@@ -128,7 +125,7 @@ class InProcessCachePlugin extends Plugin ...@@ -128,7 +125,7 @@ class InProcessCachePlugin extends Plugin
/** /**
* 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 * Always set the cache element; may overwrite existing
* data. * data.
* *
...@@ -139,7 +136,6 @@ class InProcessCachePlugin extends Plugin ...@@ -139,7 +136,6 @@ class InProcessCachePlugin extends Plugin
* *
* @return boolean true * @return boolean true
*/ */
function onEndCacheSet($key, $value, $flag, $expiry) function onEndCacheSet($key, $value, $flag, $expiry)
{ {
if ($this->active) { if ($this->active) {
...@@ -159,7 +155,6 @@ class InProcessCachePlugin extends Plugin ...@@ -159,7 +155,6 @@ class InProcessCachePlugin extends Plugin
* *
* @return boolean true * @return boolean true
*/ */
function onStartCacheDelete(&$key, &$success) function onStartCacheDelete(&$key, &$success)
{ {
if ($this->active && array_key_exists($key, $this->_items)) { if ($this->active && array_key_exists($key, $this->_items)) {
...@@ -175,7 +170,6 @@ class InProcessCachePlugin extends Plugin ...@@ -175,7 +170,6 @@ class InProcessCachePlugin extends Plugin
* *
* @return boolean true * @return boolean true
*/ */
function onPluginVersion(&$versions) function onPluginVersion(&$versions)
{ {
$url = 'http://status.net/wiki/Plugin:InProcessCache'; $url = 'http://status.net/wiki/Plugin:InProcessCache';
...@@ -185,6 +179,7 @@ class InProcessCachePlugin extends Plugin ...@@ -185,6 +179,7 @@ class InProcessCachePlugin extends Plugin
'author' => 'Evan Prodromou', 'author' => 'Evan Prodromou',
'homepage' => $url, 'homepage' => $url,
'description' => 'description' =>
// TRANS: Plugin dscription.
_m('Additional in-process cache for plugins.')); _m('Additional in-process cache for plugins.'));
return true; return true;
} }
...@@ -197,17 +192,16 @@ class InProcessCachePlugin extends Plugin ...@@ -197,17 +192,16 @@ class InProcessCachePlugin extends Plugin
* *
* @return boolean true * @return boolean true
*/ */
function cleanup() function cleanup()
{ {
if ($this->active && common_config('inprocess', 'stats')) { if ($this->active && common_config('inprocess', 'stats')) {
$this->log(LOG_INFO, "cache size: " . $this->log(LOG_INFO, "cache size: " .
count($this->_items)); count($this->_items));
$sum = 0; $sum = 0;
foreach ($this->_hits as $hitcount) { foreach ($this->_hits as $hitcount) {
$sum += $hitcount; $sum += $hitcount;
} }
$this->log(LOG_INFO, $sum . " hits on " . $this->log(LOG_INFO, $sum . " hits on " .
count($this->_hits) . " keys"); count($this->_hits) . " keys");
} }
return true; return true;
......
...@@ -51,6 +51,7 @@ class InfiniteScrollPlugin extends Plugin ...@@ -51,6 +51,7 @@ class InfiniteScrollPlugin extends Plugin
'author' => 'Craig Andrews', 'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:InfiniteScroll', 'homepage' => 'http://status.net/wiki/Plugin:InfiniteScroll',
'rawdescription' => '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.')); _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; 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
============ ============
......
...@@ -58,4 +58,4 @@ class ChannelResponseChannel extends IMChannel { ...@@ -58,4 +58,4 @@ class ChannelResponseChannel extends IMChannel {
$text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text; $text = $user->nickname.': ['.common_config('site', 'name') . '] ' . $text;
$this->imPlugin->sendMessage($this->ircChannel, $text); $this->imPlugin->sendMessage($this->ircChannel, $text);
} }
} }
\ No newline at end of file
...@@ -44,4 +44,4 @@ class Fake_Irc extends Phergie_Driver_Streams { ...@@ -44,4 +44,4 @@ class Fake_Irc extends Phergie_Driver_Streams {
protected function send($command, $args = '') { protected function send($command, $args = '') {
$this->would_be_sent = array('command' => $command, 'args' => $args); $this->would_be_sent = array('command' => $command, 'args' => $args);
} }
} }
\ No newline at end of file
...@@ -47,7 +47,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/ext ...@@ -47,7 +47,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/ext
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class IrcPlugin extends ImPlugin { class IrcPlugin extends ImPlugin {
public $host = null; public $host = null;
public $port = null; public $port = null;
...@@ -76,6 +75,7 @@ class IrcPlugin extends ImPlugin { ...@@ -76,6 +75,7 @@ class IrcPlugin extends ImPlugin {
* @return string Name of service * @return string Name of service
*/ */
public function getDisplayName() { public function getDisplayName() {
// TRANS: Service name for IRC.
return _m('IRC'); return _m('IRC');
} }
...@@ -290,6 +290,9 @@ class IrcPlugin extends ImPlugin { ...@@ -290,6 +290,9 @@ class IrcPlugin extends ImPlugin {
* @return boolean success value * @return boolean success value
*/ */
public function sendConfirmationCode($screenname, $code, $user, $checked = false) { 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. ' . $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: ' . 'If that\'s true, you can confirm by clicking on this URL: ' .
'%4$s' . '%4$s' .
...@@ -339,16 +342,20 @@ class IrcPlugin extends ImPlugin { ...@@ -339,16 +342,20 @@ class IrcPlugin extends ImPlugin {
*/ */
public function initialize() { public function initialize() {
if (!isset($this->host)) { 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)) {
...@@ -390,6 +397,7 @@ class IrcPlugin extends ImPlugin { ...@@ -390,6 +397,7 @@ class IrcPlugin extends ImPlugin {
'author' => 'Luke Fitzgerald', 'author' => 'Luke Fitzgerald',
'homepage' => 'http://status.net/wiki/Plugin:IRC', 'homepage' => 'http://status.net/wiki/Plugin:IRC',
'rawdescription' => 'rawdescription' =>
// TRANS: Plugin description.
_m('The IRC plugin allows users to send and receive notices over an IRC network.')); _m('The IRC plugin allows users to send and receive notices over an IRC network.'));
return true; return true;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/** /**
* Table Definition for irc_waiting_message * Table Definition for irc_waiting_message
*/ */
require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Irc_waiting_message extends Memcached_DataObject { class Irc_waiting_message extends Memcached_DataObject {
...@@ -124,7 +125,9 @@ class Irc_waiting_message extends Memcached_DataObject { ...@@ -124,7 +125,9 @@ class Irc_waiting_message extends Memcached_DataObject {
$result = $this->update($orig); $result = $this->update($orig);
if (!$result) { if (!$result) {
throw Exception(sprintf(_m("Could not increment attempts count for %d"), $this->id)); // TRANS: Exception thrown when an IRC attempts count could not be updated.
// TRANS: %d is the object ID for which the count could not be updated.
throw Exception(sprintf(_m('Could not increment attempts count for %d.'), $this->id));
} }
} }
......
...@@ -28,7 +28,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } ...@@ -28,7 +28,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
* In a multi-site queuedaemon.php run, one connection will be instantiated * 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. * for each site being handled by the current process that has IRC enabled.
*/ */
class IrcManager extends ImManager { class IrcManager extends ImManager {
protected $conn = null; protected $conn = null;
protected $lastPing = null; protected $lastPing = null;
...@@ -231,7 +230,8 @@ class IrcManager extends ImManager { ...@@ -231,7 +230,8 @@ class IrcManager extends ImManager {
// Send message // Send message
$this->plugin->sendConfirmationCode($screenname, $nickdata['code'], $nickdata['user'], true); $this->plugin->sendConfirmationCode($screenname, $nickdata['code'], $nickdata['user'], true);
} else { } 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();
...@@ -243,7 +243,7 @@ class IrcManager extends ImManager { ...@@ -243,7 +243,7 @@ class IrcManager extends ImManager {
if (!$result) { if (!$result) {
common_log_db_error($confirm, 'DELETE', __FILE__); 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.')); $this->serverError(_m('Could not delete confirmation.'));
return; return;
} }
...@@ -285,7 +285,8 @@ class IrcManager extends ImManager { ...@@ -285,7 +285,8 @@ class IrcManager extends ImManager {
if (!$result) { if (!$result) {
common_log_db_error($wm, 'INSERT', __FILE__); 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.'));
} }
return true; return true;
......
...@@ -36,16 +36,18 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin ...@@ -36,16 +36,18 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
function onInitializePlugin(){ function onInitializePlugin(){
parent::onInitializePlugin(); parent::onInitializePlugin();
if(!isset($this->attributes['nickname'])){ 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)); $this->ldapCommon = new LdapCommon(get_object_vars($this));
} }
function onAutoload($cls) function onAutoload($cls)
{ {
switch ($cls) switch ($cls)
{ {
case 'LdapCommon': case 'LdapCommon':
...@@ -63,11 +65,13 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin ...@@ -63,11 +65,13 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
{ {
case 'register': case 'register':
if($this->autoregistration) { 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.');
} }
break; break;
case 'login': case 'login':
$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; break;
default: default:
return true; return true;
...@@ -79,7 +83,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin ...@@ -79,7 +83,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
} }
return true; return true;
} }
//---interface implementation---// //---interface implementation---//
function checkPassword($username, $password) function checkPassword($username, $password)
...@@ -143,6 +147,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin ...@@ -143,6 +147,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
'author' => 'Craig Andrews', 'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication', 'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication',
'rawdescription' => 'rawdescription' =>
// TRANS: Plugin description.
_m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.')); _m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.'));
return true; return true;
} }
......
...@@ -11,8 +11,9 @@ Settings ...@@ -11,8 +11,9 @@ Settings
======== ========
provider_name*: This is a identifier designated to the connection. provider_name*: This is a identifier designated to the connection.
It's how StatusNet will refer to the authentication source. 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. For the most part, any name can be used, so long as each authentication
In most cases there will be only one authentication source used. 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 authoritative (false): Set to true if LDAP's responses are authoritative
(if authorative and LDAP fails, no other password checking will be done). (if authorative and LDAP fails, no other password checking will be done).
autoregistration (false): Set to true if users should be automatically created autoregistration (false): Set to true if users should be automatically created
...@@ -84,4 +85,3 @@ addPlugin('ldapAuthentication', array( ...@@ -84,4 +85,3 @@ addPlugin('ldapAuthentication', array(
'fullname'=>'displayName', 'fullname'=>'displayName',
'password'=>'unicodePwd') 'password'=>'unicodePwd')
)); ));
...@@ -38,10 +38,12 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin ...@@ -38,10 +38,12 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
function onInitializePlugin(){ function onInitializePlugin(){
if(!isset($this->provider_name)){ 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));
} }
...@@ -121,6 +123,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin ...@@ -121,6 +123,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
'author' => 'Craig Andrews', 'author' => 'Craig Andrews',
'homepage' => 'http://status.net/wiki/Plugin:LdapAuthorization', 'homepage' => 'http://status.net/wiki/Plugin:LdapAuthorization',
'rawdescription' => 'rawdescription' =>
// TRANS: Plugin description.
_m('The LDAP Authorization plugin allows for StatusNet to handle authorization through LDAP.')); _m('The LDAP Authorization plugin allows for StatusNet to handle authorization through LDAP.'));
return true; return true;
} }
......
...@@ -13,8 +13,9 @@ Settings ...@@ -13,8 +13,9 @@ Settings
======== ========
provider_name*: This is a identifier designated to the connection. provider_name*: This is a identifier designated to the connection.
It's how StatusNet will refer to the authentication source. 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. For the most part, any name can be used, so long as each authentication
In most cases there will be only one authentication source used. source has a different identifier. In most cases there will be only one
authentication source used.
authoritative (false): should this plugin be authoritative for authoritative (false): should this plugin be authoritative for
authorization? authorization?
uniqueMember_attribute ('uniqueMember')*: the attribute of a group uniqueMember_attribute ('uniqueMember')*: the attribute of a group
...@@ -23,10 +24,10 @@ roles_to_groups: array that maps StatusNet roles to LDAP groups ...@@ -23,10 +24,10 @@ roles_to_groups: array that maps StatusNet roles to LDAP groups
some StatusNet roles are: moderator, administrator, sandboxed, silenced 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 login_group: if this is set to a group DN, only members of that group will be
allowed to login allowed to login
The below settings must be exact copies of the settings used for the The below settings must be exact copies of the settings used for the
corresponding LDAP Authentication plugin. corresponding LDAP Authentication plugin.
host*: LDAP server name to connect to. You can provide several hosts in an 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. 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 See http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
...@@ -91,4 +92,3 @@ addPlugin('ldapAuthorization', array( ...@@ -91,4 +92,3 @@ addPlugin('ldapAuthorization', array(
'attributes'=>array( 'attributes'=>array(
'username'=>'sAMAccountName') 'username'=>'sAMAccountName')
)); ));
...@@ -60,12 +60,15 @@ class LdapCommon ...@@ -60,12 +60,15 @@ class LdapCommon
$this->ldap_config = $this->get_ldap_config(); $this->ldap_config = $this->get_ldap_config();
if(!isset($this->host)){ 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.')); throw new Exception(_m('"basedn" must be specified.'));
} }
if(!isset($this->attributes['username'])){ 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.'));
} }
} }
...@@ -122,9 +125,13 @@ class LdapCommon ...@@ -122,9 +125,13 @@ class LdapCommon
// if we were called with a config, assume caller will handle // if we were called with a config, assume caller will handle
// incorrect username/password (LDAP_INVALID_CREDENTIALS) // incorrect username/password (LDAP_INVALID_CREDENTIALS)
if (isset($config) && $err->getCode() == 0x31) { 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(); $c = Cache::instance();
if (!empty($c)) { if (!empty($c)) {
......
...@@ -38,6 +38,7 @@ class LilUrlPlugin extends UrlShortenerPlugin ...@@ -38,6 +38,7 @@ class LilUrlPlugin extends UrlShortenerPlugin
function onInitializePlugin(){ function onInitializePlugin(){
parent::onInitializePlugin(); parent::onInitializePlugin();
if(!isset($this->serviceUrl)){ if(!isset($this->serviceUrl)){
// TRANS: Exception thrown when URL shortening plugin was configured incorrectly.
throw new Exception(_m('A serviceUrl must be specified.'));