do not translate system and unused messages

This commit is contained in:
Roland Gruber 2011-07-08 08:29:26 +00:00
parent b14b6a7bbe
commit 1650625dc5
17 changed files with 141 additions and 146 deletions

View File

@ -48,12 +48,12 @@ $www['page'] = new page($app['server']->getIndex());
if (trim($www['cmd'])) { if (trim($www['cmd'])) {
# If this is a READ-WRITE operation, the LDAP server must not be in READ-ONLY mode. # If this is a READ-WRITE operation, the LDAP server must not be in READ-ONLY mode.
if ($app['server']->isReadOnly() && ! in_array(get_request('cmd','REQUEST'),$app['readwrite_cmds'])) if ($app['server']->isReadOnly() && ! in_array(get_request('cmd','REQUEST'),$app['readwrite_cmds']))
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php'); error(('You cannot perform updates while server is in read-only mode'),'error','index.php');
# If this command has been disabled by the config. # If this command has been disabled by the config.
if (! $_SESSION[APPCONFIG]->isCommandAvailable('script',$www['cmd'])) { if (! $_SESSION[APPCONFIG]->isCommandAvailable('script',$www['cmd'])) {
system_message(array('title'=>_('Command disabled by the server configuration'), system_message(array('title'=>('Command disabled by the server configuration'),
_('Error'),'body'=>sprintf('%s: <b>%s</b>.',_('The command could not be run'),htmlspecialchars($www['cmd'])),'type'=>'error'),'index.php'); ('Error'),'body'=>sprintf('%s: <b>%s</b>.',('The command could not be run'),htmlspecialchars($www['cmd'])),'type'=>'error'),'index.php');
$app['script_cmd'] = null; $app['script_cmd'] = null;
} }

View File

@ -22,10 +22,10 @@ $ldap['DST'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id_dst'));
# Error checking # Error checking
if (! trim($request['dnDST'])) if (! trim($request['dnDST']))
error(_('You left the destination DN blank.'),'error','index.php'); error(('You left the destination DN blank.'),'error','index.php');
if ($ldap['DST']->isReadOnly()) if ($ldap['DST']->isReadOnly())
error(_('Destination server is currently READ-ONLY.'),'error','index.php'); error(('Destination server is currently READ-ONLY.'),'error','index.php');
if ($ldap['DST']->dnExists($request['dnDST'])) if ($ldap['DST']->dnExists($request['dnDST']))
error(sprintf(_('The destination entry (%s) already exists.'),pretty_print_dn($request['dnDST'])),'error','index.php'); error(sprintf(_('The destination entry (%s) already exists.'),pretty_print_dn($request['dnDST'])),'error','index.php');

View File

@ -91,11 +91,6 @@ echo "\n";
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints'))
printf('<div style="text-align: center;"><small><img src="%s/light.png" alt="Light" /><span class="hint">%s</span></small></div>',
IMGDIR,_('Hint: Copying between different servers only works if there are no schema violations'));
# Draw the javascrpt to enable/disable the filter field if this may be a recursive copy # Draw the javascrpt to enable/disable the filter field if this may be a recursive copy
if (count($request['children']) > 0) if (count($request['children']) > 0)
printf('<script type="text/javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);

View File

@ -64,21 +64,21 @@ if (! extension_loaded('session'))
# Make sure this PHP install has gettext, we use it for language translation # Make sure this PHP install has gettext, we use it for language translation
if (! extension_loaded('gettext')) if (! extension_loaded('gettext'))
system_message(array( system_message(array(
'title'=>_('Missing required extension'), 'title'=>('Missing required extension'),
'body'=>'Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>', 'body'=>'Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error')); 'type'=>'error'));
# Make sure this PHP install has all our required extensions # Make sure this PHP install has all our required extensions
if (! extension_loaded('ldap')) if (! extension_loaded('ldap'))
system_message(array( system_message(array(
'title'=>_('Missing required extension'), 'title'=>('Missing required extension'),
'body'=>'Your install of PHP appears to be missing LDAP support.<br /><br />Please install LDAP support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>', 'body'=>'Your install of PHP appears to be missing LDAP support.<br /><br />Please install LDAP support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error')); 'type'=>'error'));
# Make sure that we have php-xml loaded. # Make sure that we have php-xml loaded.
if (! function_exists('xml_parser_create')) if (! function_exists('xml_parser_create'))
system_message(array( system_message(array(
'title'=>_('Missing required extension'), 'title'=>('Missing required extension'),
'body'=>'Your install of PHP appears to be missing XML support.<br /><br />Please install XML support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>', 'body'=>'Your install of PHP appears to be missing XML support.<br /><br />Please install XML support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error')); 'type'=>'error'));
@ -101,7 +101,7 @@ if (isset($app['function_files']) && is_array($app['function_files']))
# Configuration File check # Configuration File check
if (! file_exists($app['config_file'])) { if (! file_exists($app['config_file'])) {
error(sprintf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),app_name(),$app['config_file'],$app['config_file']),'error',null,true); error(sprintf(('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),app_name(),$app['config_file'],$app['config_file']),'error',null,true);
} elseif (! is_readable($app['config_file'])) { } elseif (! is_readable($app['config_file'])) {
error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',null,true); error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',null,true);
@ -125,7 +125,7 @@ if ($uri = get_request('URI','GET'))
if (! preg_match('/^([0-9]+\.?)+/',app_version())) { if (! preg_match('/^([0-9]+\.?)+/',app_version())) {
system_message(array( system_message(array(
'title'=>_('This is a development version of phpLDAPadmin'), 'title'=>('This is a development version of phpLDAPadmin'),
'body'=>'This is a development version of phpLDAPadmin! You should <b>NOT</b> use it in a production environment (although we dont think it should do any damage).', 'body'=>'This is a development version of phpLDAPadmin! You should <b>NOT</b> use it in a production environment (although we dont think it should do any damage).',
'type'=>'info','special'=>true)); 'type'=>'info','special'=>true));

View File

@ -721,8 +721,8 @@ class Attribute {
case 'helper': case 'helper':
if (! isset($values['post']) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! isset($values['post']) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Missing [post] setting in XML file'),$index), 'title'=>sprintf('%s [<i>%s</i>]',('Missing [post] setting in XML file'),$index),
'body'=>_('[helper] needs an accompanying [post] action.'), 'body'=>('[helper] needs an accompanying [post] action.'),
'type'=>'warn')); 'type'=>'warn'));
if (isset($value['value']) && ! is_array($value['value']) && preg_match('/^=php\.(\w+)\((.*)\)$/',$value['value'],$matches)) { if (isset($value['value']) && ! is_array($value['value']) && preg_match('/^=php\.(\w+)\((.*)\)$/',$value['value'],$matches)) {
@ -736,8 +736,8 @@ class Attribute {
if (! in_array($i,array('default','display','id','value'))) { if (! in_array($i,array('default','display','id','value'))) {
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown XML setting'),$i), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown XML setting'),$i),
'body'=>sprintf('%s <small>[%s]</small>',_('Unknown XML type setting for helper will be ignored.'),$detail), 'body'=>sprintf('%s <small>[%s]</small>',('Unknown XML type setting for helper will be ignored.'),$detail),
'type'=>'warn')); 'type'=>'warn'));
unset($value[$i]); unset($value[$i]);
@ -758,8 +758,8 @@ class Attribute {
case 'type': case 'type':
if (! in_array($value,array('password','multiselect','select','textarea')) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! in_array($value,array('password','multiselect','select','textarea')) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown XML setting'),$index), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown XML setting'),$index),
'body'=>sprintf('%s <small>[%s]</small>',_('Unknown XML type setting will be ignored.'),$value), 'body'=>sprintf('%s <small>[%s]</small>',('Unknown XML type setting will be ignored.'),$value),
'type'=>'warn')); 'type'=>'warn'));
break; break;
@ -772,8 +772,8 @@ class Attribute {
} else } else
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown XML setting'),$index), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown XML setting'),$index),
'body'=>sprintf('%s <small>[%s]</small>',_('Unknown XML type setting will be ignored.'),$value), 'body'=>sprintf('%s <small>[%s]</small>',('Unknown XML type setting will be ignored.'),$value),
'type'=>'warn')); 'type'=>'warn'));
case 'value': case 'value':
@ -781,8 +781,8 @@ class Attribute {
foreach ($value as $y) { foreach ($value as $y) {
if (! $this->haveMoreValues()) { if (! $this->haveMoreValues()) {
system_message(array( system_message(array(
'title'=>_('Automatically removed attribute values from template'), 'title'=>('Automatically removed attribute values from template'),
'body'=>sprintf('%s <small>[%s]</small>',_('Template defines more values than can be accepted by attribute.'),$this->getName(true)), 'body'=>sprintf('%s <small>[%s]</small>',('Template defines more values than can be accepted by attribute.'),$this->getName(true)),
'type'=>'warn')); 'type'=>'warn'));
$this->clearValue(); $this->clearValue();
@ -801,7 +801,7 @@ class Attribute {
# We'll add a hint too # We'll add a hint too
if (! $this->hint) if (! $this->hint)
$this->hint = _('Automatically determined'); $this->hint = ('Automatically determined');
} else } else
$this->addValue($value); $this->addValue($value);
@ -835,8 +835,8 @@ class Attribute {
default: default:
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown XML setting'),$index), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown XML setting'),$index),
'body'=>sprintf('%s <small>[%s]</small>',_('Unknown attribute setting will be ignored.'),serialize($value)), 'body'=>sprintf('%s <small>[%s]</small>',('Unknown attribute setting will be ignored.'),serialize($value)),
'type'=>'warn')); 'type'=>'warn'));
} }

View File

@ -27,8 +27,8 @@ class AttributeFactory {
default: default:
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown template [post] function'),$matches[1]), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown template [post] function'),$matches[1]),
'body'=>sprintf('%s <small>[%s]</small>',_('The template function is not known and will be ignored.'),$values['post']), 'body'=>sprintf('%s <small>[%s]</small>',('The template function is not known and will be ignored.'),$values['post']),
'type'=>'warn')); 'type'=>'warn'));
unset($values['post']); unset($values['post']);
@ -42,8 +42,8 @@ class AttributeFactory {
if (! in_array($matches[1],array('GetNextNumber','PasswordEncryptionTypes'))) { if (! in_array($matches[1],array('GetNextNumber','PasswordEncryptionTypes'))) {
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown template helper function'),$matches[1]), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown template helper function'),$matches[1]),
'body'=>sprintf('%s <small>[%s]</small>',_('The template helper function is not known and will be ignored.'),$values['helper']['value']), 'body'=>sprintf('%s <small>[%s]</small>',('The template helper function is not known and will be ignored.'),$values['helper']['value']),
'type'=>'warn')); 'type'=>'warn'));
unset($values['helper']['value']); unset($values['helper']['value']);
@ -71,8 +71,8 @@ class AttributeFactory {
default: default:
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>sprintf('%s [<i>%s</i>]',_('Unknown template function'),$matches[1]), 'title'=>sprintf('%s [<i>%s</i>]',('Unknown template function'),$matches[1]),
'body'=>sprintf('%s <small>[%s]</small>',_('The template function is not known and will be ignored.'),$values['value']), 'body'=>sprintf('%s <small>[%s]</small>',('The template function is not known and will be ignored.'),$values['value']),
'type'=>'warn')); 'type'=>'warn'));
unset($values['value']); unset($values['value']);

View File

@ -67,9 +67,9 @@ class HTMLTree extends Tree {
# We didnt get any baseDN entries in our tree? # We didnt get any baseDN entries in our tree?
printf('<tr><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s<br />%s<br /><b>%s</b></small></td></tr>', printf('<tr><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s<br />%s<br /><b>%s</b></small></td></tr>',
$this->getDepth()+3-2, $this->getDepth()+3-2,
_('Could not determine the root of your LDAP tree.'), ('Could not determine the root of your LDAP tree.'),
_('It appears that the LDAP server has been configured to not reveal its root.'), ('It appears that the LDAP server has been configured to not reveal its root.'),
_('Please specify it in config.php')); ('Please specify it in config.php'));
echo '</table>'; echo '</table>';
@ -108,10 +108,10 @@ class HTMLTree extends Tree {
if (preg_match('/,/',$base->getDN())) if (preg_match('/,/',$base->getDN()))
printf('<tr><td class="spacer"></td><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s</small></td></tr>', printf('<tr><td class="spacer"></td><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s</small></td></tr>',
$this->getDepth()+3-3,_('This base cannot be created with PLA.')); $this->getDepth()+3-3,('This base cannot be created with PLA.'));
else else
printf('<tr><td class="spacer"></td><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s <a href="javascript:document.getElementById(\'create_base_form_%s_%s\').submit()">%s</a></small></td></tr>', printf('<tr><td class="spacer"></td><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s <a href="javascript:document.getElementById(\'create_base_form_%s_%s\').submit()">%s</a></small></td></tr>',
$this->getDepth()+3-3,_('This base entry does not exist.'),$server->getIndex(),$javascript_id,_('Create it?')); $this->getDepth()+3-3,('This base entry does not exist.'),$server->getIndex(),$javascript_id,('Create it?'));
} else { } else {
$this->draw_item($base->getDN(),-1); $this->draw_item($base->getDN(),-1);
@ -168,7 +168,7 @@ class HTMLTree extends Tree {
printf('%s',$server->getName()); printf('%s',$server->getName());
if (! is_null($server->inactivityTime())) { if (! is_null($server->inactivityTime())) {
$m = sprintf(_('Inactivity will log you off at %s'), $m = sprintf(('Inactivity will log you off at %s'),
strftime('%H:%M',$server->inactivityTime())); strftime('%H:%M',$server->inactivityTime()));
printf(' <img width="14" height="14" src="%s/timeout.png" title="%s" alt="%s"/>',IMGDIR,$m,'Timeout'); printf(' <img width="14" height="14" src="%s/timeout.png" title="%s" alt="%s"/>',IMGDIR,$m,'Timeout');
} }
@ -217,11 +217,11 @@ class HTMLTree extends Tree {
return ''; return '';
$menu['cmd'] = 'schema'; $menu['cmd'] = 'schema';
$menu['ajax'] = _('Loading Schema'); $menu['ajax'] = ('Loading Schema');
$menu['div'] = 'BODY'; $menu['div'] = 'BODY';
$menu['title'] = _('View schema for'); $menu['title'] = ('View schema for');
$menu['img'] = 'schema-big.png'; $menu['img'] = 'schema-big.png';
$menu['name'] = _('schema'); $menu['name'] = ('schema');
break; break;
@ -257,11 +257,11 @@ class HTMLTree extends Tree {
return ''; return '';
$menu['cmd'] = 'server_info'; $menu['cmd'] = 'server_info';
$menu['ajax'] = _('Loading Info'); $menu['ajax'] = ('Loading Info');
$menu['div'] = 'BODY'; $menu['div'] = 'BODY';
$menu['title'] = _('Info'); $menu['title'] = ('Info');
$menu['img'] = 'info-big.png'; $menu['img'] = 'info-big.png';
$menu['name'] = _('info'); $menu['name'] = ('info');
break; break;
@ -274,11 +274,11 @@ class HTMLTree extends Tree {
return ''; return '';
$menu['cmd'] = 'monitor'; $menu['cmd'] = 'monitor';
$menu['ajax'] = _('Loading Monitor Info'); $menu['ajax'] = ('Loading Monitor Info');
$menu['div'] = 'BODY'; $menu['div'] = 'BODY';
$menu['title'] = _('Monitor'); $menu['title'] = ('Monitor');
$menu['img'] = 'monitorserver-big.png'; $menu['img'] = 'monitorserver-big.png';
$menu['name'] = _('monitor'); $menu['name'] = ('monitor');
break; break;
@ -333,7 +333,7 @@ class HTMLTree extends Tree {
return ''; return '';
else else
return sprintf('<a href="%s" title="%s"><img src="%s/%s" alt="%s" /><br />%s</a>', return sprintf('<a href="%s" title="%s"><img src="%s/%s" alt="%s" /><br />%s</a>',
htmlspecialchars($href),_('Logout of this server'),IMGDIR,'logout-big.png',_('logout'),_('logout')); htmlspecialchars($href),('Logout of this server'),IMGDIR,'logout-big.png',('logout'),('logout'));
} }
/** /**
@ -348,7 +348,7 @@ class HTMLTree extends Tree {
$logged_in_dn = $server->getLogin(null); $logged_in_dn = $server->getLogin(null);
echo '<tr>'; echo '<tr>';
echo '<td class="spacer"></td>'; echo '<td class="spacer"></td>';
printf('<td class="logged_in" colspan="%s">%s: ',$this->getDepth()+3-1,_('Logged in as')); printf('<td class="logged_in" colspan="%s">%s: ',$this->getDepth()+3-1,('Logged in as'));
if ($server->getContainerTop($logged_in_dn) == $logged_in_dn) { if ($server->getContainerTop($logged_in_dn) == $logged_in_dn) {
$logged_in_branch = ''; $logged_in_branch = '';
@ -521,9 +521,9 @@ class HTMLTree extends Tree {
if (isAjaxEnabled()) { if (isAjaxEnabled()) {
printf('<td class="icon"><a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s %s"><img src="%s/%s" alt="%s" /></a></td>', printf('<td class="icon"><a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s %s"><img src="%s/%s" alt="%s" /></a></td>',
$href_parm,$href_parm,_('Loading Login'),_('Login to'),$server->getName(),IMGDIR,'login.png',_('login')); $href_parm,$href_parm,('Loading Login'),('Login to'),$server->getName(),IMGDIR,'login.png',('login'));
printf('<td class="logged_in" colspan="%s"><a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s %s">%s</a></td>', printf('<td class="logged_in" colspan="%s"><a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s %s">%s</a></td>',
$this->getDepth()+3-2,$href_parm,$href_parm,_('Loading Login'),_('Login to'),$server->getName(),_('login')); $this->getDepth()+3-2,$href_parm,$href_parm,('Loading Login'),('Login to'),$server->getName(),('login'));
} else { } else {
printf('<td class="icon"><a href="cmd.php?%s"><img src="%s/%s" alt="%s" /></a></td>',$href_parm,IMGDIR,'login.png',_('login')); printf('<td class="icon"><a href="cmd.php?%s"><img src="%s/%s" alt="%s" /></a></td>',$href_parm,IMGDIR,'login.png',_('login'));

View File

@ -197,8 +197,8 @@ class PageRender extends Visitor {
$blank++; $blank++;
system_message(array( system_message(array(
'title'=>_('Invalid value count for [post] processing'), 'title'=>('Invalid value count for [post] processing'),
'body'=>sprintf('%s (<b>%s [%s]</b>)',_('Function() variable expansion can only handle 1 value'), 'body'=>sprintf('%s (<b>%s [%s]</b>)',('Function() variable expansion can only handle 1 value'),
$attribute->getName(false),count($attribute->getValues())), $attribute->getName(false),count($attribute->getValues())),
'type'=>'warn')); 'type'=>'warn'));
@ -227,8 +227,8 @@ class PageRender extends Visitor {
case 'PasswordEncrypt': case 'PasswordEncrypt':
if (count($args) != 2) { if (count($args) != 2) {
system_message(array( system_message(array(
'title'=>_('Invalid argument count for PasswordEncrypt'), 'title'=>('Invalid argument count for PasswordEncrypt'),
'body'=>sprintf('%s (<b>%s</b>)',_('PasswordEncrypt() only accepts two arguments'),$autovalue['args']), 'body'=>sprintf('%s (<b>%s</b>)',('PasswordEncrypt() only accepts two arguments'),$autovalue['args']),
'type'=>'warn')); 'type'=>'warn'));
return; return;
@ -241,8 +241,8 @@ class PageRender extends Visitor {
if (preg_match_all('/%(\w+)(\|.+)?(\/[lU])?%/U',strtolower($args[1]),$matchall)) { if (preg_match_all('/%(\w+)(\|.+)?(\/[lU])?%/U',strtolower($args[1]),$matchall)) {
if (count($matchall[1]) != 1) if (count($matchall[1]) != 1)
system_message(array( system_message(array(
'title'=>_('Invalid value count for PasswordEncrypt'), 'title'=>('Invalid value count for PasswordEncrypt'),
'body'=>sprintf('%s (<b>%s</b>)',_('Unable to get the attribute value for PasswordEncrypt()'),count($matchall[1])), 'body'=>sprintf('%s (<b>%s</b>)',('Unable to get the attribute value for PasswordEncrypt()'),count($matchall[1])),
'type'=>'warn')); 'type'=>'warn'));
$passwordattr = $matchall[1][0]; $passwordattr = $matchall[1][0];
@ -258,8 +258,8 @@ class PageRender extends Visitor {
if ($passwordattr && preg_match_all('/%(\w+)(\|.+)?(\/[lU])?%/U',strtolower($args[0]),$matchall)) { if ($passwordattr && preg_match_all('/%(\w+)(\|.+)?(\/[lU])?%/U',strtolower($args[0]),$matchall)) {
if (count($matchall[1]) != 1) if (count($matchall[1]) != 1)
system_message(array( system_message(array(
'title'=>_('Invalid value count for PasswordEncrypt'), 'title'=>('Invalid value count for PasswordEncrypt'),
'body'=>sprintf('%s (<b>%s</b>)',_('Unable to get the attribute value for PasswordEncrypt()'),count($matchall[1])), 'body'=>sprintf('%s (<b>%s</b>)',('Unable to get the attribute value for PasswordEncrypt()'),count($matchall[1])),
'type'=>'warn')); 'type'=>'warn'));
$enc = $_REQUEST[$matchall[1][0]][$passwordattr][$i]; $enc = $_REQUEST[$matchall[1][0]][$passwordattr][$i];
@ -371,7 +371,7 @@ class PageRender extends Visitor {
elseif ($attribute->getLDAPtype()) elseif ($attribute->getLDAPtype())
printf('<a href="%s" title="%s: %s">%s</a>', printf('<a href="%s" title="%s: %s">%s</a>',
htmlspecialchars($href), htmlspecialchars($href),
_('Click to view the schema definition for attribute type'),$attribute->getName(false),_($attribute->getFriendlyName())); ('Click to view the schema definition for attribute type'),$attribute->getName(false),_($attribute->getFriendlyName()));
else else
printf('<acronym title="%s">%s</acronym>',_('This attribute is not defined in the LDAP schema'),_($attribute->getFriendlyName())); printf('<acronym title="%s">%s</acronym>',_('This attribute is not defined in the LDAP schema'),_($attribute->getFriendlyName()));

View File

@ -68,7 +68,7 @@ class Query extends xmlTemplate {
else else
$this->base = array($xmldata['query'][$xml_key]['base']); $this->base = array($xmldata['query'][$xml_key]['base']);
else else
error(sprintf(_('In the XML file (%s), [%s] contains an unknown key.'), error(sprintf(('In the XML file (%s), [%s] contains an unknown key.'),
$this->filename,$xml_key),'error','index.php'); $this->filename,$xml_key),'error','index.php');
$this->base = array_unique($this->base); $this->base = array_unique($this->base);
@ -98,7 +98,7 @@ class Query extends xmlTemplate {
# Items that should not be an array # Items that should not be an array
if (! in_array($xml_key,$allowed_arrays) && is_array($xml_value)) { if (! in_array($xml_key,$allowed_arrays) && is_array($xml_value)) {
debug_dump(array(__METHOD__,'key'=>$xml_key,'value'=>$xml_value)); debug_dump(array(__METHOD__,'key'=>$xml_key,'value'=>$xml_value));
error(sprintf(_('In the XML file (%s), [%s] is an array, it must be a string.'), error(sprintf(('In the XML file (%s), [%s] is an array, it must be a string.'),
$this->filename,$xml_key),'error'); $this->filename,$xml_key),'error');
} }
@ -111,7 +111,7 @@ class Query extends xmlTemplate {
if (! isset($this->$key) if (! isset($this->$key)
|| (! is_array($this->$key) && ! trim($this->$key))) { || (! is_array($this->$key) && ! trim($this->$key))) {
$this->setInvalid(sprintf(_('Missing %s in the XML file.'),$key)); $this->setInvalid(sprintf(('Missing %s in the XML file.'),$key));
break; break;
} }
} }

View File

@ -108,8 +108,8 @@ class Template extends xmlTemplate {
elseif (! is_object($soc) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) elseif (! is_object($soc) && ! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>_('Automatically removed objectClass from template'), 'title'=>('Automatically removed objectClass from template'),
'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$details,_('removed from template as it is not defined in the schema')), 'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$details,('removed from template as it is not defined in the schema')),
'type'=>'warn')); 'type'=>'warn'));
} }
@ -171,19 +171,19 @@ class Template extends xmlTemplate {
# Items that should not be an array # Items that should not be an array
if (! in_array($xml_key,$allowed_arrays) && is_array($xml_value)) { if (! in_array($xml_key,$allowed_arrays) && is_array($xml_value)) {
debug_dump(array(__METHOD__,'key'=>$xml_key,'value'=>$xml_value)); debug_dump(array(__METHOD__,'key'=>$xml_key,'value'=>$xml_value));
error(sprintf(_('In the XML file (%s), [%s] is an array, it must be a string.'), error(sprintf(('In the XML file (%s), [%s] is an array, it must be a string.'),
$this->filename,$xml_key),'error'); $this->filename,$xml_key),'error');
} }
$this->$xml_key = $xml_value; $this->$xml_key = $xml_value;
if ($xml_key == 'invalid' && $xml_value) if ($xml_key == 'invalid' && $xml_value)
$this->setInvalid(_('Disabled by XML configuration'),true); $this->setInvalid(('Disabled by XML configuration'),true);
} }
} }
if (! count($objectclasses)) { if (! count($objectclasses)) {
$this->setInvalid(_('ObjectClasses in XML dont exist in LDAP server.')); $this->setInvalid(('ObjectClasses in XML dont exist in LDAP server.'));
return; return;
} else { } else {
@ -200,7 +200,7 @@ class Template extends xmlTemplate {
if (! isset($this->$key) if (! isset($this->$key)
|| (! is_array($this->$key) && ! trim($this->$key))) { || (! is_array($this->$key) && ! trim($this->$key))) {
$this->setInvalid(sprintf(_('Missing %s in the XML file.'),$key)); $this->setInvalid(sprintf(('Missing %s in the XML file.'),$key));
break; break;
} }
} }
@ -216,7 +216,7 @@ class Template extends xmlTemplate {
if (! is_null($attribute)) if (! is_null($attribute))
$attribute->setRDN($counter++); $attribute->setRDN($counter++);
elseif ($this->isType('creation')) elseif ($this->isType('creation'))
$this->setInvalid(sprintf(_('Missing RDN attribute %s in the XML file.'),$key)); $this->setInvalid(sprintf(('Missing RDN attribute %s in the XML file.'),$key));
} }
} }
@ -1379,8 +1379,8 @@ class Template extends xmlTemplate {
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning')) if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_template_warning'))
system_message(array( system_message(array(
'title'=>_('Automatically removed attribute from template'), 'title'=>('Automatically removed attribute from template'),
'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$attribute->getName(false),_('removed from template as it is not defined by an ObjectClass')), 'body'=>sprintf('%s: <b>%s</b> %s',$this->getTitle(),$attribute->getName(false),('removed from template as it is not defined by an ObjectClass')),
'type'=>'warn')); 'type'=>'warn'));
} }
} }
@ -1463,7 +1463,7 @@ class Template extends xmlTemplate {
} }
if (! $haveStructural) if (! $haveStructural)
error(_('An entry should have one structural objectClass.'),'error','index.php'); error(('An entry should have one structural objectClass.'),'error','index.php');
# Work out the attributes to delete. # Work out the attributes to delete.
foreach ($this->getAttribute('objectclass')->getRemovedValues() as $value) { foreach ($this->getAttribute('objectclass')->getRemovedValues() as $value) {

View File

@ -102,8 +102,8 @@ class TemplateRender extends PageRender {
default: default:
system_message(array( system_message(array(
'title'=>_('Unknown Default Attribute context'), 'title'=>('Unknown Default Attribute context'),
'body'=>sprintf('%s (<b>%s</b>)',_('A call was made to getDefaultAttribute() with an unkown context'),$type), 'body'=>sprintf('%s (<b>%s</b>)',('A call was made to getDefaultAttribute() with an unkown context'),$type),
'type'=>'warn')); 'type'=>'warn'));
return; return;
@ -132,8 +132,8 @@ class TemplateRender extends PageRender {
if (count($args) && count($args) > 1) { if (count($args) && count($args) > 1) {
system_message(array( system_message(array(
'title'=>_('Too many arguments'), 'title'=>('Too many arguments'),
'body'=>sprintf('%s (<b>%s</b>)',_('Function() only takes two arguments and more than two were specified'),count($args)), 'body'=>sprintf('%s (<b>%s</b>)',('Function() only takes two arguments and more than two were specified'),count($args)),
'type'=>'warn')); 'type'=>'warn'));
return; return;
@ -146,8 +146,8 @@ class TemplateRender extends PageRender {
else else
system_message(array( system_message(array(
'title'=>_('Function doesnt exist'), 'title'=>('Function doesnt exist'),
'body'=>sprintf('%s (<b>%s</b>)',_('An attempt was made to call a function that doesnt exist'),$function), 'body'=>sprintf('%s (<b>%s</b>)',('An attempt was made to call a function that doesnt exist'),$function),
'type'=>'warn')); 'type'=>'warn'));
break; break;
@ -1035,7 +1035,7 @@ class TemplateRender extends PageRender {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
return sprintf($this->layout['hint'],_('Hint: To view the schema for an attribute, click the attribute name.')); return sprintf($this->layout['hint'],('Hint: To view the schema for an attribute, click the attribute name.'));
} }
/** PAGE ENTRY MENU ITEMS DETAILS **/ /** PAGE ENTRY MENU ITEMS DETAILS **/
@ -1063,11 +1063,11 @@ class TemplateRender extends PageRender {
$href = sprintf('cmd=template_engine&%s&template=',$this->url_base); $href = sprintf('cmd=template_engine&%s&template=',$this->url_base);
if (isAjaxEnabled()) if (isAjaxEnabled())
return sprintf($this->layout['actionajax'],IMGDIR,'switch.png',_('Switch Template'), return sprintf($this->layout['actionajax'],IMGDIR,'switch.png',('Switch Template'),
htmlspecialchars($href),_('Change to another template'),htmlspecialchars($href),str_replace('\'','\\\'',_('Loading')),_('Switch Template')); htmlspecialchars($href),('Change to another template'),htmlspecialchars($href),str_replace('\'','\\\'',('Loading')),('Switch Template'));
else else
return sprintf($this->layout['action'],IMGDIR,'switch.png',_('Switch Template'), return sprintf($this->layout['action'],IMGDIR,'switch.png',('Switch Template'),
htmlspecialchars($href),_('Change to another template'),_('Switch Template')); htmlspecialchars($href),('Change to another template'),('Switch Template'));
} }
protected function getMenuItemExportBase() { protected function getMenuItemExportBase() {
@ -2170,8 +2170,8 @@ function fillRec(id,value) {
$id = isset($params['id']) ? $params['id'] : ''; $id = isset($params['id']) ? $params['id'] : '';
if (is_array($id)) { if (is_array($id)) {
system_message(array( system_message(array(
'title'=>_('Too many arguments'), 'title'=>('Too many arguments'),
'body'=>sprintf('%s (<b>%s</b>)',_('Helper attribute has too many ID values, only the first one is used'),count($id)), 'body'=>sprintf('%s (<b>%s</b>)',('Helper attribute has too many ID values, only the first one is used'),count($id)),
'type'=>'warn')); 'type'=>'warn'));
$id = $id[0]; $id = $id[0];
@ -2181,8 +2181,8 @@ function fillRec(id,value) {
$display = isset($params['display']) ? $params['display'] : ''; $display = isset($params['display']) ? $params['display'] : '';
if (is_array($display)) { if (is_array($display)) {
system_message(array( system_message(array(
'title'=>_('Too many arguments'), 'title'=>('Too many arguments'),
'body'=>sprintf('%s (<b>%s</b>)',_('Helper attribute has too many DISPLAY values, only the first one is used'),count($display)), 'body'=>sprintf('%s (<b>%s</b>)',('Helper attribute has too many DISPLAY values, only the first one is used'),count($display)),
'type'=>'warn')); 'type'=>'warn'));
$display = $display[0]; $display = $display[0];
@ -2192,8 +2192,8 @@ function fillRec(id,value) {
$default = isset($params['default']) ? $params['default'] : ''; $default = isset($params['default']) ? $params['default'] : '';
if (is_array($default)) { if (is_array($default)) {
system_message(array( system_message(array(
'title'=>_('Too many arguments'), 'title'=>('Too many arguments'),
'body'=>sprintf('%s (<b>%s</b>)',_('Helper attribute has too many DISPLAY values, only the first one is used'),count($default)), 'body'=>sprintf('%s (<b>%s</b>)',('Helper attribute has too many DISPLAY values, only the first one is used'),count($default)),
'type'=>'warn')); 'type'=>'warn'));
$default = $default[0]; $default = $default[0];

View File

@ -90,7 +90,7 @@ abstract class DS {
public function setValue($key,$setting,$value) { public function setValue($key,$setting,$value) {
if (isset($this->custom->{$key}[$setting])) if (isset($this->custom->{$key}[$setting]))
system_message(array( system_message(array(
'title'=>_('Configuration setting already defined.'), 'title'=>('Configuration setting already defined.'),
'body'=>sprintf('A call has been made to reset a configuration value (%s,%s,%s)', 'body'=>sprintf('A call has been made to reset a configuration value (%s,%s,%s)',
$key,$setting,$value), $key,$setting,$value),
'type'=>'info')); 'type'=>'info'));

View File

@ -453,8 +453,8 @@ class ldap_pla extends myldap {
unset($attrs[$attr]); unset($attrs[$attr]);
system_message(array( system_message(array(
'title'=>_('Attribute not added'), 'title'=>('Attribute not added'),
'body'=>sprintf('%s (<b>%s</b>)',_('Hook pre_attr_add prevented attribute from being added'),$attr), 'body'=>sprintf('%s (<b>%s</b>)',('Hook pre_attr_add prevented attribute from being added'),$attr),
'type'=>'warn')); 'type'=>'warn'));
} else } else
@ -467,8 +467,8 @@ class ldap_pla extends myldap {
unset($attrs[$attr]); unset($attrs[$attr]);
system_message(array( system_message(array(
'title'=>_('Attribute not modified'), 'title'=>('Attribute not modified'),
'body'=>sprintf('%s (<b>%s</b>)',_('Hook pre_attr_modify prevented attribute from being modified'),$attr), 'body'=>sprintf('%s (<b>%s</b>)',('Hook pre_attr_modify prevented attribute from being modified'),$attr),
'type'=>'warn')); 'type'=>'warn'));
} else { } else {
@ -483,8 +483,8 @@ class ldap_pla extends myldap {
unset($attrs[$attr]); unset($attrs[$attr]);
system_message(array( system_message(array(
'title'=>_('Attribute not deleted'), 'title'=>('Attribute not deleted'),
'body'=>sprintf('%s (<b>%s</b>)',_('Hook pre_attr_delete prevented attribute from being deleted'),$attr), 'body'=>sprintf('%s (<b>%s</b>)',('Hook pre_attr_delete prevented attribute from being deleted'),$attr),
'type'=>'warn')); 'type'=>'warn'));
} else } else
@ -577,8 +577,8 @@ class ldap_pla extends myldap {
# Check see and use our alternate uid_dn and password if we have it. # Check see and use our alternate uid_dn and password if we have it.
if (! $this->login($this->getValue('unique','dn'),$this->getValue('unique','pass'),'unique')) { if (! $this->login($this->getValue('unique','dn'),$this->getValue('unique','pass'),'unique')) {
system_message(array( system_message(array(
'title'=>_('UNIQUE invalid login/password'), 'title'=>('UNIQUE invalid login/password'),
'body'=>sprintf('%s (<b>%s</b>)',_('Unable to connect to LDAP server with the unique login/password, please check your configuration.'), 'body'=>sprintf('%s (<b>%s</b>)',('Unable to connect to LDAP server with the unique login/password, please check your configuration.'),
$this->getName()), $this->getName()),
'type'=>'warn')); 'type'=>'warn'));
@ -612,9 +612,9 @@ class ldap_pla extends myldap {
$href = sprintf('cmd.php?cmd=query_engine&server_id=%s&filter=%s&scope=sub&query=none&format=list&search=true',$this->index,$query['filter']); $href = sprintf('cmd.php?cmd=query_engine&server_id=%s&filter=%s&scope=sub&query=none&format=list&search=true',$this->index,$query['filter']);
system_message(array( system_message(array(
'title'=>_('Attribute value would not be unique'), 'title'=>('Attribute value would not be unique'),
'body'=>sprintf('%s (<b><a href="%s">%s</a></b>)', 'body'=>sprintf('%s (<b><a href="%s">%s</a></b>)',
_('This update has been or will be cancelled, it would result in an attribute value not being unique. You might like to search the LDAP server for the offending entry.'), ('This update has been or will be cancelled, it would result in an attribute value not being unique. You might like to search the LDAP server for the offending entry.'),
htmlspecialchars($href), htmlspecialchars($href),
_('Search')), _('Search')),
'type'=>'warn')); 'type'=>'warn'));

View File

@ -631,7 +631,7 @@ class myldap extends DS {
# Invalid regex? # Invalid regex?
if (is_null($CACHE['authz_id'])) if (is_null($CACHE['authz_id']))
error(sprintf(_('It seems that sasl_authz_id_regex "%s" contains invalid PCRE regular expression. The error is "%s".'), error(sprintf(('It seems that sasl_authz_id_regex "%s" contains invalid PCRE regular expression. The error is "%s".'),
$this->getValue('sasl','authz_id_regex'),(isset($php_errormsg) ? $php_errormsg : '')), $this->getValue('sasl','authz_id_regex'),(isset($php_errormsg) ? $php_errormsg : '')),
'error','index.php'); 'error','index.php');

View File

@ -62,7 +62,7 @@ function __autoload($className) {
system_message(array( system_message(array(
'title'=>_('Generic Error'), 'title'=>_('Generic Error'),
'body'=>sprintf('%s: %s [%s]', 'body'=>sprintf('%s: %s [%s]',
__METHOD__,_('Called to load a class that cant be found'),$className), __METHOD__,('Called to load a class that cant be found'),$className),
'type'=>'error')); 'type'=>'error'));
} }
@ -224,7 +224,7 @@ function check_config($config_file) {
# Make sure their PHP version is current enough # Make sure their PHP version is current enough
if (strcmp(phpversion(),REQUIRED_PHP_VERSION) < 0) if (strcmp(phpversion(),REQUIRED_PHP_VERSION) < 0)
system_message(array( system_message(array(
'title'=>_('Incorrect version of PHP'), 'title'=>('Incorrect version of PHP'),
'body'=>sprintf('phpLDAPadmin requires PHP version %s or greater.<br /><small>(You are using %s)</small>', 'body'=>sprintf('phpLDAPadmin requires PHP version %s or greater.<br /><small>(You are using %s)</small>',
REQUIRED_PHP_VERSION,phpversion()), REQUIRED_PHP_VERSION,phpversion()),
'type'=>'error')); 'type'=>'error'));
@ -322,24 +322,24 @@ function cmd_control_pane($type) {
case 'main' : case 'main' :
return array( return array(
'home'=>array( 'home'=>array(
'title'=>_('Home'), 'title'=>('Home'),
'enable'=>false, 'enable'=>false,
'link'=>sprintf('href="index.php" title="%s"',_('Home')), 'link'=>sprintf('href="index.php" title="%s"',('Home')),
'image'=>sprintf('<img src="%s/home-big.png" alt="%s" />',IMGDIR,_('Home'))), 'image'=>sprintf('<img src="%s/home-big.png" alt="%s" />',IMGDIR,('Home'))),
'purge'=>array( 'purge'=>array(
'title'=>_('Purge caches'), 'title'=>('Purge caches'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('script','purge_cache') : false, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('script','purge_cache') : false,
'link'=>sprintf('href="cmd.php?cmd=purge_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=purge_cache\',\'%s\');" title="%s"', 'link'=>sprintf('href="cmd.php?cmd=purge_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=purge_cache\',\'%s\');" title="%s"',
_('Clearing cache'),_('Purge caches')), ('Clearing cache'),('Purge caches')),
'image'=>sprintf('<img src="%s/trash-big.png" alt="%s" />',IMGDIR,_('Purge caches'))), 'image'=>sprintf('<img src="%s/trash-big.png" alt="%s" />',IMGDIR,('Purge caches'))),
'hide_debug_info'=>array( 'hide_debug_info'=>array(
'title'=>_('Show Cache'), 'title'=>('Show Cache'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('script','show_cache') : false, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('script','show_cache') : false,
'link'=>sprintf('href="cmd.php?cmd=show_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=show_cache\',\'%s\');" title="%s"', 'link'=>sprintf('href="cmd.php?cmd=show_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=show_cache\',\'%s\');" title="%s"',
_('Loading'),_('Show Cache'),_('Show Cache')), ('Loading'),('Show Cache'),('Show Cache')),
'image'=>sprintf('<img src="%s/debug-cache.png" alt="%s" />',IMGDIR,_('Show Cache'))), 'image'=>sprintf('<img src="%s/debug-cache.png" alt="%s" />',IMGDIR,('Show Cache'))),
); );
break; break;
@ -349,32 +349,32 @@ function cmd_control_pane($type) {
'forum'=>array( 'forum'=>array(
'title'=>_('Forum'), 'title'=>_('Forum'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('forum'),_('Forum')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('forum'),('Forum')),
'image'=>sprintf('<img src="%s/forum-big.png" alt="%s" />',IMGDIR,_('Forum'))), 'image'=>sprintf('<img src="%s/forum-big.png" alt="%s" />',IMGDIR,('Forum'))),
'feature'=>array( 'feature'=>array(
'title'=>_('Request feature'), 'title'=>_('Request feature'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('add_rfe'),_('Request feature')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('add_rfe'),('Request feature')),
'image'=>sprintf('<img src="%s/request-feature-big.png" alt="%s" />',IMGDIR,_('Request feature'))), 'image'=>sprintf('<img src="%s/request-feature-big.png" alt="%s" />',IMGDIR,('Request feature'))),
'bug'=>array( 'bug'=>array(
'title'=>_('Report a bug'), 'title'=>_('Report a bug'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('add_bug'),_('Report a bug')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('add_bug'),('Report a bug')),
'image'=>sprintf('<img src="%s/bug-big.png" alt="%s" />',IMGDIR,_('Report a bug'))), 'image'=>sprintf('<img src="%s/bug-big.png" alt="%s" />',IMGDIR,('Report a bug'))),
'donation'=>array( 'donation'=>array(
'title'=>_('Donate'), 'title'=>_('Donate'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('donate'),_('Donate')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('donate'),('Donate')),
'image'=>sprintf('<img src="%s/smile-big.png" alt="%s" />',IMGDIR,_('Donate'))), 'image'=>sprintf('<img src="%s/smile-big.png" alt="%s" />',IMGDIR,('Donate'))),
'help'=>array( 'help'=>array(
'title'=>_('Help'), 'title'=>_('Help'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('documentation'),_('Help')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('documentation'),('Help')),
'image'=>sprintf('<img src="%s/help-big.png" alt="%s" />',IMGDIR,_('Help'))) 'image'=>sprintf('<img src="%s/help-big.png" alt="%s" />',IMGDIR,('Help')))
); );
break; break;
@ -422,7 +422,7 @@ function debug_dump_backtrace($msg='Calling BackTrace',$die=false) {
* Send a debug as a sys message * Send a debug as a sys message
*/ */
function debug_sysmsg($msg) { function debug_sysmsg($msg) {
system_message(array('title'=>_('Debug'),'body'=>$msg,'type'=>'debug')); system_message(array('title'=>('Debug'),'body'=>$msg,'type'=>'debug'));
} }
/** /**
@ -1356,8 +1356,8 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
if (! $server->getValue('auto_number','enable')) { if (! $server->getValue('auto_number','enable')) {
system_message(array( system_message(array(
'title'=>_('AUTO_NUMBER is disabled for this server'), 'title'=>('AUTO_NUMBER is disabled for this server'),
'body'=>sprintf('%s (<b>%s</b>)',_('A call was made to get_next_number(), however, it is disabled for this server'),$attr), 'body'=>sprintf('%s (<b>%s</b>)',('A call was made to get_next_number(), however, it is disabled for this server'),$attr),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;
@ -1366,8 +1366,8 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
# Check see and use our alternate uid_dn and password if we have it. # Check see and use our alternate uid_dn and password if we have it.
if (! $server->login($server->getValue('auto_number','dn'),$server->getValue('auto_number','pass'),'auto_number')) { if (! $server->login($server->getValue('auto_number','dn'),$server->getValue('auto_number','pass'),'auto_number')) {
system_message(array( system_message(array(
'title'=>_('AUTO_NUMBER invalid login/password'), 'title'=>('AUTO_NUMBER invalid login/password'),
'body'=>sprintf('%s (<b>%s</b>)',_('Unable to connect to LDAP server with the auto_number login/password, please check your configuration.'), 'body'=>sprintf('%s (<b>%s</b>)',('Unable to connect to LDAP server with the auto_number login/password, please check your configuration.'),
$server->getName()), $server->getName()),
'type'=>'warn')); 'type'=>'warn'));
@ -1380,8 +1380,8 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
if (! trim($query['base'])) { if (! trim($query['base'])) {
system_message(array( system_message(array(
'title'=>_('No AUTO_NUMBER search_base configured for this server'), 'title'=>('No AUTO_NUMBER search_base configured for this server'),
'body'=>_('A call was made to get_next_number(), however, the base to search is empty.'), 'body'=>('A call was made to get_next_number(), however, the base to search is empty.'),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;
@ -1392,8 +1392,8 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
if (! $server->dnExists($query['base'])) { if (! $server->dnExists($query['base'])) {
system_message(array( system_message(array(
'title'=>_('No AUTO_NUMBER search_base exists for this server'), 'title'=>('No AUTO_NUMBER search_base exists for this server'),
'body'=>sprintf('%s (<b>%s</b>)',_('A call was made to get_next_number(), however, the base to search does not exist for this server.'),$query['base']), 'body'=>sprintf('%s (<b>%s</b>)',('A call was made to get_next_number(), however, the base to search does not exist for this server.'),$query['base']),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;
@ -1401,8 +1401,8 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
if (! is_string($attr) || ! $server->getSchemaAttribute($attr)) { if (! is_string($attr) || ! $server->getSchemaAttribute($attr)) {
system_message(array( system_message(array(
'title'=>_('AUTO_NUMBER search attribute invalid'), 'title'=>('AUTO_NUMBER search attribute invalid'),
'body'=>sprintf('%s (<b>%s</b>)',_('The search attribute for AUTO_NUMBER is invalid, expecting a single valid attribute.'),$attr), 'body'=>sprintf('%s (<b>%s</b>)',('The search attribute for AUTO_NUMBER is invalid, expecting a single valid attribute.'),$attr),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;
@ -1478,16 +1478,16 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
case '0': case '0':
system_message(array( system_message(array(
'title'=>_('AUTO_NUMBER pool filter didnt return any DNs'), 'title'=>('AUTO_NUMBER pool filter didnt return any DNs'),
'body'=>sprintf('%s (<b>%s</b>)',_('Please change your filter parameter, or check your auto_number,search_base configuration'),$query['filter']), 'body'=>sprintf('%s (<b>%s</b>)',('Please change your filter parameter, or check your auto_number,search_base configuration'),$query['filter']),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;
default: default:
system_message(array( system_message(array(
'title'=>_('AUTO_NUMBER pool filter returned too many DNs'), 'title'=>('AUTO_NUMBER pool filter returned too many DNs'),
'body'=>sprintf('%s (<b>%s</b>)',_('Please change your filter parameter, or check your auto_number,search_base configuration'),$query['filter']), 'body'=>sprintf('%s (<b>%s</b>)',('Please change your filter parameter, or check your auto_number,search_base configuration'),$query['filter']),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;
@ -1511,8 +1511,8 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu
# No other cases allowed. The user has an error in the configuration # No other cases allowed. The user has an error in the configuration
default: default:
system_message(array( system_message(array(
'title'=>_('Invalid AUTO_NUMBER mechanism'), 'title'=>('Invalid AUTO_NUMBER mechanism'),
'body'=>sprintf('%s (<b>%s</b>)',_('Your config file specifies an unknown AUTO_NUMBER search mechanism.'),$server->getValue('auto_number','mechanism')), 'body'=>sprintf('%s (<b>%s</b>)',('Your config file specifies an unknown AUTO_NUMBER search mechanism.'),$server->getValue('auto_number','mechanism')),
'type'=>'warn')); 'type'=>'warn'));
return false; return false;

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* @author Benjamin Drieu <benjamin.drieu@fr.alcove.com> and AlcÃ?ve * @author Benjamin Drieu <benjamin.drieu@fr.alcove.com> and Alc<EFBFBD>?ve
* @package phpLDAPadmin * @package phpLDAPadmin
*/ */
@ -123,7 +123,7 @@ function add_hook($hook_name,$hook_function,$priority=0,$rollback_function=null)
# First, see if the hook function exists. # First, see if the hook function exists.
if (! function_exists($hook_function)) { if (! function_exists($hook_function)) {
system_message(array( system_message(array(
'title'=>_('Hook function does not exist'), 'title'=>('Hook function does not exist'),
'body'=>sprintf('Hook name: %s<br/>Hook function: %s',$hook_name,$hook_function), 'body'=>sprintf('Hook name: %s<br/>Hook function: %s',$hook_name,$hook_function),
'type'=>'warn')); 'type'=>'warn'));

View File

@ -93,8 +93,8 @@ abstract class xmlTemplates {
$changed = true; $changed = true;
system_message(array( system_message(array(
'title'=>_('New Template XML found.'), 'title'=>('New Template XML found.'),
'body'=>sprintf('%s %s (%s)',_('A new template XML file has been loaded'),$file,$type), 'body'=>sprintf('%s %s (%s)',('A new template XML file has been loaded'),$file,$type),
'type'=>'info','special'=>true)); 'type'=>'info','special'=>true));
} }
} }