Include Api Token and QR code mockup
This commit is contained in:
parent
d8230dba94
commit
5dc8e19d6d
|
@ -1020,48 +1020,49 @@ if (!$new_user) {
|
||||||
$user_id .= '<span>'.$id.'</span>';
|
$user_id .= '<span>'.$id.'</span>';
|
||||||
$user_id .= html_print_input_hidden('id_user', $id, true);
|
$user_id .= html_print_input_hidden('id_user', $id, true);
|
||||||
$user_id .= '</div>';
|
$user_id .= '</div>';
|
||||||
$user_id .= '<div class="label_select_simple"><p class="edit_user_labels">'.__('API Token').'</p>';
|
|
||||||
$user_id .= html_print_anchor(
|
$apiTokenContentElements[] = '<span style="height: 15px;font-size: 14px;">'.__('API Token').'</span>';
|
||||||
|
$apiTokenContentElements[] = html_print_button(
|
||||||
|
__('Renew'),
|
||||||
|
'renew_api_token',
|
||||||
|
false,
|
||||||
|
sprintf(
|
||||||
|
'javascript:renewAPIToken(\'%s\', \'%s\', \'%s\')',
|
||||||
|
__('Warning'),
|
||||||
|
__('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'),
|
||||||
|
'user_profile_form',
|
||||||
|
),
|
||||||
[
|
[
|
||||||
'onClick' => sprintf(
|
'mode' => 'link',
|
||||||
'javascript:renewAPIToken(\'%s\', \'%s\', \'%s\')',
|
'style' => 'min-width: initial;',
|
||||||
__('Warning'),
|
],
|
||||||
__('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'),
|
true,
|
||||||
'user_profile_form',
|
);
|
||||||
),
|
$apiTokenContentElements[] = html_print_button(
|
||||||
'content' => html_print_image(
|
__('Show'),
|
||||||
'images/icono-refrescar.png',
|
'show_api_token',
|
||||||
true,
|
false,
|
||||||
[
|
sprintf(
|
||||||
'class' => 'renew_api_token_image clickable',
|
'javascript:showAPIToken(\'%s\', \'%s\')',
|
||||||
'title' => __('Renew API Token'),
|
__('API Token'),
|
||||||
]
|
base64_encode(__('Your API Token is:').' <br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br> '.__('Please, avoid share this string with others.')),
|
||||||
),
|
),
|
||||||
'class' => 'renew_api_token_link',
|
[
|
||||||
|
'mode' => 'link',
|
||||||
|
'style' => 'min-width: initial;',
|
||||||
|
],
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
|
||||||
|
$apiTokenContent = html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'flex-row-center',
|
||||||
|
'content' => implode('', $apiTokenContentElements),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$user_id .= html_print_anchor(
|
$user_id .= $apiTokenContent;
|
||||||
[
|
|
||||||
'onClick' => sprintf(
|
|
||||||
'javascript:showAPIToken(\'%s\', \'%s\')',
|
|
||||||
__('API Token'),
|
|
||||||
base64_encode(__('Your API Token is:').' <br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br> '.__('Please, avoid share this string with others.')),
|
|
||||||
),
|
|
||||||
'content' => html_print_image(
|
|
||||||
'images/eye_show.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'class' => 'renew_api_token_image clickable',
|
|
||||||
'title' => __('Show API Token'),
|
|
||||||
]
|
|
||||||
),
|
|
||||||
'class' => 'renew_api_token_link',
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
$user_id .= '</div>';
|
|
||||||
} else {
|
} else {
|
||||||
$user_id = '<div class="label_select_simple">'.html_print_input_text_extended(
|
$user_id = '<div class="label_select_simple">'.html_print_input_text_extended(
|
||||||
'id_user',
|
'id_user',
|
||||||
|
|
|
@ -703,6 +703,34 @@ $userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$contentQrCode = [];
|
||||||
|
$contentQrCode[] = html_print_image(
|
||||||
|
'images/example_qr.png',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'width' => '200px',
|
||||||
|
'height' => '200px',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$contentQrCode[] = '<span class="input_sub_placeholder input_sub_placeholder_qrcode">'.__('Generated automatically with the information provided for the user').'</span>';
|
||||||
|
|
||||||
|
$qrCode = html_print_div(
|
||||||
|
[
|
||||||
|
'style' => 'display: flex;flex-direction: column;align-items: center;',
|
||||||
|
'content' => implode('', $contentQrCode),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
// QR Code and API Token advice.
|
||||||
|
html_print_div(
|
||||||
|
[
|
||||||
|
'id' => 'api_qrcode_display',
|
||||||
|
'content' => $qrCode.$apiTokenContent,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
html_print_table($userManagementTable);
|
html_print_table($userManagementTable);
|
||||||
// User Profile definition table. (Only where user is not creating).
|
// User Profile definition table. (Only where user is not creating).
|
||||||
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
|
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
|
||||||
|
|
|
@ -11173,3 +11173,21 @@ form#satellite_conf_edit > fieldset.full-column {
|
||||||
#principal_action_buttons .select2-container {
|
#principal_action_buttons .select2-container {
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#api_qrcode_display {
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
position: absolute;
|
||||||
|
left: 660px;
|
||||||
|
top: 130px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input_sub_placeholder.input_sub_placeholder_qrcode {
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue