mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
WIP: Improve somethings
This commit is contained in:
parent
e3b2ec529a
commit
a9df7e2ec5
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
// Load global vars.
|
// Load global vars.
|
||||||
global $config;
|
global $config;
|
||||||
hd($_REQUEST);
|
// hd($_REQUEST); //TODO. For testing purposes.
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
require_once $config['homedir'].'/vendor/autoload.php';
|
require_once $config['homedir'].'/vendor/autoload.php';
|
||||||
@ -1424,7 +1424,7 @@ $size_pagination .= html_print_input_text(
|
|||||||
true
|
true
|
||||||
).'</div>';
|
).'</div>';
|
||||||
|
|
||||||
if ($id == $config['id_user']) {
|
if ($id === $config['id_user']) {
|
||||||
$language .= html_print_input_hidden(
|
$language .= html_print_input_hidden(
|
||||||
'quick_language_change',
|
'quick_language_change',
|
||||||
1,
|
1,
|
||||||
@ -1432,7 +1432,7 @@ if ($id == $config['id_user']) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enterprise_installed() && defined('METACONSOLE')) {
|
if (enterprise_installed() && is_metaconsole() === true) {
|
||||||
$user_info_metaconsole_access = 'only_console';
|
$user_info_metaconsole_access = 'only_console';
|
||||||
if (isset($user_info['metaconsole_access'])) {
|
if (isset($user_info['metaconsole_access'])) {
|
||||||
$user_info_metaconsole_access = $user_info['metaconsole_access'];
|
$user_info_metaconsole_access = $user_info['metaconsole_access'];
|
||||||
@ -1457,36 +1457,37 @@ if (enterprise_installed() && defined('METACONSOLE')) {
|
|||||||
).'</div>';
|
).'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$not_login = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Not Login').'</p>';
|
/*
|
||||||
$not_login .= ui_print_help_tip(
|
$not_login = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Not Login').'</p>';
|
||||||
|
$not_login .= ui_print_help_tip(
|
||||||
__('The user with not login set only can access to API.'),
|
__('The user with not login set only can access to API.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$not_login .= html_print_checkbox_switch(
|
$not_login .= html_print_checkbox_switch(
|
||||||
'not_login',
|
'not_login',
|
||||||
1,
|
1,
|
||||||
$user_info['not_login'],
|
$user_info['not_login'],
|
||||||
true
|
true
|
||||||
).'</div>';
|
).'</div>';
|
||||||
|
|
||||||
$local_user = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Local user').'</p>';
|
$local_user = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Local user').'</p>';
|
||||||
$local_user .= ui_print_help_tip(
|
$local_user .= ui_print_help_tip(
|
||||||
__('The user with local authentication enabled will always use local authentication.'),
|
__('The user with local authentication enabled will always use local authentication.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$local_user .= html_print_checkbox_switch(
|
$local_user .= html_print_checkbox_switch(
|
||||||
'local_user',
|
'local_user',
|
||||||
1,
|
1,
|
||||||
$user_info['local_user'],
|
$user_info['local_user'],
|
||||||
true
|
true
|
||||||
).'</div>';
|
).'</div>';
|
||||||
|
|
||||||
$session_time = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Session Time');
|
$session_time = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Session Time');
|
||||||
$session_time .= ui_print_help_tip(
|
$session_time .= ui_print_help_tip(
|
||||||
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
|
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
|
||||||
true
|
true
|
||||||
).'</p>';
|
).'</p>';
|
||||||
$session_time .= html_print_input_text(
|
$session_time .= html_print_input_text(
|
||||||
'session_time',
|
'session_time',
|
||||||
$user_info['session_time'],
|
$user_info['session_time'],
|
||||||
'',
|
'',
|
||||||
@ -1496,8 +1497,8 @@ $session_time .= html_print_input_text(
|
|||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
'class="input_line_small"'
|
'class="input_line_small"'
|
||||||
).'</div>';
|
).'</div>';
|
||||||
|
*/
|
||||||
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
|
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
|
||||||
|
|
||||||
if (empty($user_groups) === false) {
|
if (empty($user_groups) === false) {
|
||||||
@ -1820,33 +1821,15 @@ echo '</div>
|
|||||||
<div class="edit_user_comments">'.$comments.'</div>
|
<div class="edit_user_comments">'.$comments.'</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'user_edit_third_row white_box',
|
|
||||||
'content' => html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'edit_user_allowed_ip',
|
|
||||||
'content' => $allowedIP,
|
|
||||||
],
|
|
||||||
true
|
|
||||||
),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!empty($ehorus)) {
|
if (!empty($ehorus)) {
|
||||||
echo '<div class="user_edit_third_row white_box">'.$ehorus.'</div>';
|
echo '<div class="user_edit_third_row white_box">'.$ehorus.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
echo '<div class="action-buttons w100p">';
|
|
||||||
if ($config['admin_can_add_user']) {
|
if ($config['admin_can_add_user']) {
|
||||||
html_print_csrf_hidden();
|
html_print_csrf_hidden();
|
||||||
if ($new_user) {
|
html_print_input_hidden((($new_user === true) ? 'create_user' : 'update_user'), 1);
|
||||||
html_print_input_hidden('create_user', 1);
|
|
||||||
} else {
|
|
||||||
html_print_input_hidden('update_user', 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
@ -1857,40 +1840,38 @@ if ($new_user === true) {
|
|||||||
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
if ($is_err === true && $new_user === true) {
|
$actionButtons = [];
|
||||||
profile_print_profile_table($id, io_safe_output($json_profile), false, true);
|
|
||||||
} else {
|
|
||||||
profile_print_profile_table($id, io_safe_output($json_profile));
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<br />';
|
if ((bool) $config['admin_can_add_user'] === true) {
|
||||||
|
if ($new_user === true) {
|
||||||
echo '<div class="action-buttons w100p">';
|
$submitButtonCaption = __('Create');
|
||||||
if ($config['admin_can_add_user']) {
|
$submitButtonName = 'crtbutton';
|
||||||
if ($new_user) {
|
$submitButtonIcon = 'wand';
|
||||||
html_print_submit_button(
|
|
||||||
__('Create'),
|
|
||||||
'crtbutton',
|
|
||||||
false,
|
|
||||||
[
|
|
||||||
'icon' => 'wand',
|
|
||||||
'form' => 'user_profile_form',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
html_print_submit_button(
|
$submitButtonCaption = __('Update');
|
||||||
__('Update'),
|
$submitButtonName = 'uptbutton';
|
||||||
'uptbutton',
|
$submitButtonIcon = 'update';
|
||||||
false,
|
|
||||||
[
|
|
||||||
'icon' => 'update',
|
|
||||||
'form' => 'user_profile_form',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$actionButtons[] = html_print_submit_button(
|
||||||
|
$submitButtonCaption,
|
||||||
|
$submitButtonName,
|
||||||
|
false,
|
||||||
|
[
|
||||||
|
'icon' => $submitButtonIcon,
|
||||||
|
'form' => 'user_profile_form',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
$actionButtons[] = html_print_go_back_button(
|
||||||
|
ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0'),
|
||||||
|
['button_class' => ''],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
html_print_action_buttons(implode('', $actionButtons), ['type' => 'form_action']);
|
||||||
|
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
@ -585,6 +585,10 @@ $userManagementTable->data['title_additionalSettings'][1] = html_print_subtitle_
|
|||||||
$userManagementTable->rowclass['captions_addSettings'] = 'field_half_width pdd_t_10px';
|
$userManagementTable->rowclass['captions_addSettings'] = 'field_half_width pdd_t_10px';
|
||||||
$userManagementTable->rowclass['fields_addSettings'] = 'field_half_width';
|
$userManagementTable->rowclass['fields_addSettings'] = 'field_half_width';
|
||||||
$userManagementTable->cellstyle['fields_addSettings'][1] = 'flex-wrap: wrap';
|
$userManagementTable->cellstyle['fields_addSettings'][1] = 'flex-wrap: wrap';
|
||||||
|
$userManagementTable->cellstyle['captions_addSettings'][1] = 'width: 35%';
|
||||||
|
$userManagementTable->cellstyle['captions_addSettings'][2] = 'width: 15%';
|
||||||
|
$userManagementTable->cellstyle['fields_addSettings'][1] = 'width: 35%';
|
||||||
|
$userManagementTable->cellstyle['fields_addSettings'][2] = 'width: 15%';
|
||||||
$userManagementTable->data['captions_addSettings'][0] = __('Comments');
|
$userManagementTable->data['captions_addSettings'][0] = __('Comments');
|
||||||
$userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
$userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
||||||
'comments',
|
'comments',
|
||||||
@ -600,16 +604,23 @@ $userManagementTable->data['captions_addSettings'][1] .= ui_print_help_tip(
|
|||||||
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$userManagementTable->data['fields_addSettings'][1] = html_print_textarea(
|
$userManagementTable->data['fields_addSettings'][1] = html_print_div(
|
||||||
'allowed_ip_list',
|
[
|
||||||
2,
|
'class' => 'edit_user_allowed_ip',
|
||||||
65,
|
'content' => html_print_textarea(
|
||||||
$user_info['allowed_ip_list'],
|
'allowed_ip_list',
|
||||||
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
|
2,
|
||||||
|
65,
|
||||||
|
$user_info['allowed_ip_list'],
|
||||||
|
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
|
||||||
|
true
|
||||||
|
),
|
||||||
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
$userManagementTable->data['captions_addSettings'][2] = __('Allow all IPs');
|
||||||
|
$userManagementTable->data['fields_addSettings'][2] = html_print_div(
|
||||||
[
|
[
|
||||||
'class' => 'margin-top-10',
|
'class' => 'margin-top-10',
|
||||||
'content' => html_print_checkbox_switch(
|
'content' => html_print_checkbox_switch(
|
||||||
@ -617,9 +628,60 @@ $userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
|||||||
0,
|
0,
|
||||||
$user_info['allowed_ip_active'],
|
$user_info['allowed_ip_active'],
|
||||||
true
|
true
|
||||||
).'<span class="margin-top-10">'.__('Allow all IPs').'</span>',
|
),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width pdd_t_10px';
|
||||||
|
$userManagementTable->rowclass['fields_loginErrorUser'] = 'field_half_width';
|
||||||
|
$userManagementTable->cellstyle['captions_loginErrorUser'][0] = 'width: 25%';
|
||||||
|
$userManagementTable->cellstyle['captions_loginErrorUser'][1] = 'width: 25%';
|
||||||
|
$userManagementTable->cellstyle['fields_loginErrorUser'][0] = 'width: 25%';
|
||||||
|
$userManagementTable->cellstyle['fields_loginErrorUser'][1] = 'width: 25%';
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][0] = __('Not Login');
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_help_tip(
|
||||||
|
__('The user with not login set only can access to API.'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$userManagementTable->data['fields_loginErrorUser'][0] = html_print_checkbox_switch(
|
||||||
|
'not_login',
|
||||||
|
1,
|
||||||
|
$user_info['not_login'],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][1] = __('Local user');
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_help_tip(
|
||||||
|
__('The user with local authentication enabled will always use local authentication.'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$userManagementTable->data['fields_loginErrorUser'][1] = html_print_checkbox_switch(
|
||||||
|
'local_user',
|
||||||
|
1,
|
||||||
|
$user_info['local_user'],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][2] = __('Session time');
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][2] .= ui_print_help_tip(
|
||||||
|
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$userManagementTable->data['fields_loginErrorUser'][2] = html_print_input_text(
|
||||||
|
'session_time',
|
||||||
|
$user_info['session_time'],
|
||||||
|
'',
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
true.false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'class="input_line_small"'
|
||||||
|
);
|
||||||
|
|
||||||
html_print_table($userManagementTable);
|
html_print_table($userManagementTable);
|
||||||
|
|
||||||
|
// User Profile definition table.
|
||||||
|
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true && $new_user === true));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user