Commit 26aeb193 authored by Franco Fichtner's avatar Franco Fichtner

system: fixup scattered gettext() usage in the user manager

(cherry picked from commit a52ec237)
parent 3daed677
...@@ -172,7 +172,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -172,7 +172,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$userdeleted = $a_user[$id]['name']; $userdeleted = $a_user[$id]['name'];
unset($a_user[$id]); unset($a_user[$id]);
write_config(); write_config();
$savemsg = gettext("User")." {$userdeleted} ". gettext("successfully deleted"); $savemsg = sprintf(gettext('The user "%s" was successfully removed.'), $userdeleted);
header("Location: system_usermanager.php?savemsg=".$savemsg); header("Location: system_usermanager.php?savemsg=".$savemsg);
exit; exit;
} }
...@@ -182,8 +182,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -182,8 +182,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$certdeleted = $certdeleted['descr']; $certdeleted = $certdeleted['descr'];
unset($a_user[$id]['cert'][$pconfig['certid']]); unset($a_user[$id]['cert'][$pconfig['certid']]);
write_config(); write_config();
$savemsg = gettext("Certificate")." {$certdeleted} ". $savemsg = sprintf(gettext('The certificate association "%s" was successfully removed.'), $certdeleted);
gettext("association removed.");
header("Location: system_usermanager.php?savemsg=".$savemsg."&act=edit&userid=".$id); header("Location: system_usermanager.php?savemsg=".$savemsg."&act=edit&userid=".$id);
exit; exit;
} elseif ($act == "newApiKey" && isset($id)) { } elseif ($act == "newApiKey" && isset($id)) {
...@@ -205,8 +204,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -205,8 +204,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$authFactory = new \OPNsense\Auth\AuthenticationFactory(); $authFactory = new \OPNsense\Auth\AuthenticationFactory();
$authenticator = $authFactory->get("Local API"); $authenticator = $authFactory->get("Local API");
$authenticator->dropKey($username, $pconfig['api_delete']); $authenticator->dropKey($username, $pconfig['api_delete']);
$savemsg = gettext("API key")." {$pconfig['api_delete']} ". $savemsg = sprintf(gettext('The API key "%s" was successfully removed.'), $pconfig['api_delete']);
gettext("removed.");
} else { } else {
$savemsg = gettext('No API key found'); $savemsg = gettext('No API key found');
} }
...@@ -221,9 +219,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -221,9 +219,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$reqdfieldsn = array(gettext("Username")); $reqdfieldsn = array(gettext("Username"));
} else { } else {
$reqdfields = explode(" ", "usernamefld passwordfld1"); $reqdfields = explode(" ", "usernamefld passwordfld1");
$reqdfieldsn = array( $reqdfieldsn = array(gettext("Username"), gettext("Password"));
gettext("Username"),
gettext("Password"));
} }
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment