40 return htmlescape(_(
'You have no permission to delete this object!'));
43 if (!is_array($name)) {
44 return htmlescape(_(
'You have no permission to delete the object:')).
"<br/><br/><i>$name</i>";
47 if (count($name) == 1) {
62 return htmlescape(_(
'You have no permission to create this object!'));
65 if (!is_array($name)) {
66 return htmlescape(_(
'You have no permission to create the object:')).
'<br/><br/><i>'.
htmlescape($name).
'</i>';
69 if (count($name) == 1) {
82 public static function permModify ($name =
'', $field =
'')
85 return htmlescape(_(
'You have no permission to modify this object!'));
88 if (!is_array($name)) {
90 return htmlescape(sprintf(_(
'You have no permission to modify the field "%s" of object "%s"'), $field, $name));
92 return sprintf(
htmlescape(_(
'You have no permission to modify the object:%s')),
'<br/><br/><i>'.
htmlescape($name).
'</i>');
96 if (count($name) == 1) {
111 return htmlescape(_(
'You have no permission to view this object!'));
114 if (!is_array($name)) {
115 return htmlescape(_(
'You have no permission to view the object:')).
"<br/><br/><i>".
htmlescape($name).
"</i>";
118 if (count($name) == 1) {
133 return htmlescape(_(
'You have no permission to move this object!'));
136 if (!is_array($name)) {
137 return htmlescape(_(
'You have no permission to move the object:')).
"<br/><br/><i>".
htmlescape($name).
"</i>";
140 if (count($name) == 1) {
154 return htmlescape(sprintf(_(
'The field "%s" contains a reserved keyword!'), $name));
168 if ($command ==
'') {
170 return htmlescape(sprintf(_(
'Cannot execute "%s" command!'), $type));
172 return htmlescape(sprintf(_(
'Cannot execute "%s" command for plugin %s!'), $type, $plugin));
176 return htmlescape(sprintf(_(
'Cannot execute "%s" command (%s)!'), $type, $command));
178 return htmlescape(sprintf(_(
'Cannot execute "%s" command (%s) for plugin %s!'), $type, $command, $plugin));
190 public static function toobig ($name, $min =
'')
193 return htmlescape(sprintf(_(
'Value for "%s" is too large!'), $name));
195 return htmlescape(sprintf(_(
'"%s" must be smaller than %s!'), $name, $min));
209 return htmlescape(sprintf(_(
'Value for "%s" is too small!'), $name));
211 return htmlescape(sprintf(_(
'"%s" must be %d or above!'), $name, $min));
222 public static function depends ($name1, $name2)
224 return htmlescape(sprintf(_(
'"%s" depends on "%s" - please provide both values!'), $name1, $name2));
236 return htmlescape(sprintf(_(
'There is already an entry with this "%s" attribute in the system!'), $name));
238 return htmlescape(sprintf(_(
'The entry "%s" already uses this "%s" attribute!'), $dn, $name));
249 return htmlescape(sprintf(_(
'The required field "%s" is empty!'), $name));
261 public static function invalid (
string $name, $data =
'',
string $example =
''): string
263 if (!is_string($data)) {
264 $data = var_export($data, TRUE);
266 $error =
htmlescape(sprintf(_(
'The field "%s" contains an invalid value.'), $name));
267 $error .=
'<br/><br/> "'.htmlescape($data).
'"';
270 if ($example !==
'') {
271 $error .=
'<br/><br/><i>'.htmlescape(sprintf(_(
'Example: %s'), $example)).
'</i> ';
284 return htmlescape(sprintf(_(
'Missing %s PHP extension!'), $name));
407 foreach ($data as $key => $value) {
408 if (is_numeric($key)) {
409 $objects .=
"<li>\n<i>".htmlescape($value).
"</i></li>";
411 $objects .=
"<li>\n".htmlescape($value).
" (<i>".
htmlescape($key).
"</i>)</li>";
425 return htmlescape(sprintf(_(
'This account has no valid %s extensions!'), $name));
437 if (($depends ==
'') || (is_array($depends) && (count($depends) == 0))) {
438 return htmlescape(sprintf(_(
'This account has %s settings enabled. You can disable them by clicking below.'), $name));
440 if (is_array($depends)) {
441 $depends = implode(
' / ', $depends);
443 return htmlescape(sprintf(_(
'This account has %s settings enabled. To disable them, you\'ll need to remove the %s settings first!'), $name, $depends));
456 public static function featuresDisabled ($name, array $depends = [], array $conflicts = [])
458 if (empty($depends) && empty($conflicts)) {
459 return htmlescape(sprintf(_(
'This account has %s settings disabled. You can enable them by clicking below.'), $name));
460 } elseif (!empty($depends)) {
461 return htmlescape(sprintf(_(
'This account has %s settings disabled. To enable them, you\'ll need to add the %s settings first!'), $name, implode(
' / ', $depends)));
463 return htmlescape(sprintf(_(
'This account has %s settings disabled. To enable them, you\'ll need to disable the %s settings first!'), $name, implode(
' / ', $conflicts)));
474 return htmlescape(sprintf(_(
'Add %s settings'), $name));
485 return htmlescape(sprintf(_(
'Remove %s settings'), $name));
493 return htmlescape(_(
'Click the "Edit" button on the bottom right corner of the page to edit the fields'));
501 return [_(
'January'), _(
'February'), _(
'March'), _(
'April'),
502 _(
'May'), _(
'June'), _(
'July'), _(
'August'), _(
'September'),
503 _(
'October'), _(
'November'), _(
'December')];
512 return [ _(
'Sunday'), _(
'Monday'), _(
'Tuesday'), _(
'Wednesday'), _(
'Thursday'), _(
'Friday'), _(
'Saturday')];
526 public static function ldaperror ($error, $dn =
'', $type = 0, $plugin =
'')
529 $typemap = [1 => _(
'read operation'), _(
'add operation'), _(
'modify operation'),
530 _(
'delete operation'), _(
'search operation'), _(
'authentication')];
532 if (isset($typemap[$type])) {
533 $msg =
htmlescape(sprintf(_(
'LDAP %s failed!'), $typemap[$type]));
535 $msg =
htmlescape(_(
'LDAP operation failed!'));
540 $msg .=
'<br/><br/><i>'.htmlescape(_(
'Object')).
':</i> '.
htmlescape($dn);
543 $msg .=
'<br/><br/><i>'.htmlescape(_(
'Error')).
':</i> '.
htmlescape($error);
570 return htmlescape(_(
'Communication failure with the infrastructure service!'));
572 return nl2br(
htmlescape(sprintf(_(
"Communication failure with the infrastructure service:\n\nError: %s"), $error)));
582 return htmlescape(sprintf(_(
'Checking for %s support'), $what));
592 return htmlescape(sprintf(_(
'Install and activate the %s PHP module.'), $what));
600 return htmlescape(_(
'The supplied base is not valid and has been reset to the previous value!'));
static incorrectUpload($reason='')
Display error about an incorrect upload.
htmlescape(string $str)
Escape string for HTML output.
static months()
Build an array with the months.
static invalid(string $name, $data='', string $example='')
Return error about invalid value.
static installPhpModule($what)
Display install or activate a PHP module.
static delButton($escape=TRUE)
Text for an delete button.
static cmdexecfailed($type, $command='', $plugin='')
Display that a command execution failed in this plugin.
static featuresEnabled($name, $depends='')
List the features settings enabled.
static required($name)
Display error about required field empty.
static addButton($escape=TRUE)
Text for an add button.
static checkingFor($what)
Display checking for a support.
static applyButton($escape=TRUE)
Text for an apply button.
static editButton($escape=TRUE)
Text for an edit button.
static addFeaturesButton($name)
Display Add features button.
static permCreate($name='')
Display that we have no permission to create an object.
static weekdays()
Build an array with the days of a week. Start by Sunday.
static featuresDisabled($name, array $depends=[], array $conflicts=[])
List the features settings disabled.
static reserved($name)
Display field contains reserved keyword.
static check_base()
Display error when checking the base.
static permDelete($name='')
Display that we have no permission to delete an object.
static duplicated($name, $dn=NULL)
Display error about existing entry in the system.
static siError($error='')
Display error about communication failure with the infrastructure service.
static cancelButton($escape=TRUE)
Text for a cancel button.
static noValidExtension($name)
Display error about invalid extension from account.
static ldaperror($error, $dn='', $type=0, $plugin='')
Display LDAP error.
This class contains all the messages for the various actions.
static toobig($name, $min='')
Display error about too larged value.
static permMove($name='')
Display that we have no permission to move an object.
static saveButton($escape=TRUE)
Text for a save button.
static missingext($name)
Display about missing PHP extension.
static permView($name='')
Display that we have no permission to view an object.
static backButton($escape=TRUE)
Text for a back button.
static okButton($escape=TRUE)
Text for a ok button.
static permModify($name='', $field='')
Display that we have no permission to modify an object.
static depends($name1, $name2)
Display a dependence between two objects.
static buildList($data)
a list from an array
static toosmall($name, $min='')
Display error about too small value.
static removeFeaturesButton($name)
Display Remove features button.
static clickEditToChange()
Display : Click the "Edit" button below to change information in this dialog.