Commit version 24.12.13800
This commit is contained in:
@ -1,100 +1,98 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium Network Management and Monitoring System
|
||||
* Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage webui
|
||||
* @author Adam Armstrong <adama@observium.org>
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @subpackage web
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
$isUserlist = (isset($vars['user_id']) ? true : false);
|
||||
|
||||
$navbar['class'] = 'navbar-narrow';
|
||||
$navbar['brand'] = 'Users';
|
||||
|
||||
$navbar['options']['user_edit']['url'] = generate_url(array('page' => 'user_edit'));
|
||||
$navbar['options']['user_edit']['url'] = generate_url(['page' => 'user_edit']);
|
||||
$navbar['options']['user_edit']['text'] = 'Users';
|
||||
$navbar['options']['user_edit']['icon'] = $config['icon']['user-edit'];
|
||||
|
||||
$navbar['options']['roles']['url'] = generate_url(array('page' => 'roles'));
|
||||
$navbar['options']['roles']['url'] = generate_url(['page' => 'roles']);
|
||||
$navbar['options']['roles']['text'] = 'Roles';
|
||||
$navbar['options']['roles']['icon'] = $config['icon']['users'];
|
||||
|
||||
$navbar['options_right']['authlog']['url'] = generate_url(array('page' => 'authlog'));
|
||||
$navbar['options_right']['authlog']['url'] = generate_url(['page' => 'authlog']);
|
||||
$navbar['options_right']['authlog']['text'] = 'Authentication Log';
|
||||
$navbar['options_right']['authlog']['icon'] = $config['icon']['user-log'];
|
||||
|
||||
if (auth_usermanagement())
|
||||
{
|
||||
$navbar['options_right']['user_add']['url'] = generate_url(array('page' => 'user_add'));
|
||||
$navbar['options_right']['user_add']['text'] = 'Add User';
|
||||
$navbar['options_right']['user_add']['icon'] = $config['icon']['user-add'];
|
||||
if (auth_usermanagement()) {
|
||||
$navbar['options_right']['user_add']['url'] = generate_url(['page' => 'user_add']);
|
||||
$navbar['options_right']['user_add']['text'] = 'Add User';
|
||||
$navbar['options_right']['user_add']['icon'] = $config['icon']['user-add'];
|
||||
}
|
||||
|
||||
$navbar['options_right']['role_add']['url'] = '#modal-role_add';
|
||||
$navbar['options_right']['role_add']['link_opts'] = 'data-toggle="modal"';
|
||||
$navbar['options_right']['role_add']['text'] = 'Add Role';
|
||||
$navbar['options_right']['role_add']['icon'] = $config['icon']['plus'];
|
||||
$navbar['options_right']['role_add']['url'] = '#modal-role_add';
|
||||
$navbar['options_right']['role_add']['link_opts'] = 'data-toggle="modal"';
|
||||
$navbar['options_right']['role_add']['text'] = 'Add Role';
|
||||
$navbar['options_right']['role_add']['icon'] = $config['icon']['plus'];
|
||||
|
||||
if(isset($navbar['options'][$vars['page']])) { $navbar['options'][$vars['page']]['class'] = 'active'; }
|
||||
if (isset($navbar['options'][$vars['page']])) {
|
||||
$navbar['options'][$vars['page']]['class'] = 'active';
|
||||
}
|
||||
|
||||
if ($isUserlist)
|
||||
{
|
||||
$navbar['options_right']['edit']['url'] = generate_url(array('page' => 'edituser'));
|
||||
$navbar['options_right']['edit']['text'] = 'Back to userlist';
|
||||
$navbar['options_right']['edit']['icon'] = 'icon-chevron-left';
|
||||
if (isset($vars['user_id'])) {
|
||||
// User list
|
||||
$navbar['options_right']['edit']['url'] = generate_url(['page' => 'edituser']);
|
||||
$navbar['options_right']['edit']['text'] = 'Back to userlist';
|
||||
$navbar['options_right']['edit']['icon'] = 'icon-chevron-left';
|
||||
}
|
||||
|
||||
print_navbar($navbar);
|
||||
unset($navbar);
|
||||
|
||||
$form = array('type' => 'horizontal',
|
||||
'userlevel' => 10, // Minimum user level for display form
|
||||
'id' => 'modal-role_add',
|
||||
'title' => 'Add Role',
|
||||
'url' => generate_url(array('page' => 'roles')),
|
||||
);
|
||||
$form = ['type' => 'horizontal',
|
||||
'userlevel' => 10, // Minimum user level for display form
|
||||
'id' => 'modal-role_add',
|
||||
'title' => 'Add Role',
|
||||
'url' => generate_url(['page' => 'roles']),
|
||||
];
|
||||
//$form['fieldset']['body'] = array('class' => 'modal-body'); // Required this class for modal body!
|
||||
//$form['fieldset']['footer'] = array('class' => 'modal-footer'); // Required this class for modal footer!
|
||||
|
||||
$form_params = array();
|
||||
$form_params = [];
|
||||
|
||||
$form['row'][1]['role_name'] = array(
|
||||
$form['row'][1]['role_name'] = [
|
||||
'type' => 'text',
|
||||
'fieldset' => 'body',
|
||||
'name' => 'Role Name',
|
||||
'class' => 'input-xlarge',
|
||||
'placeholder' => 'Network Technician',
|
||||
'value' => '');
|
||||
$form['row'][2]['role_descr'] = array(
|
||||
'value' => ''];
|
||||
$form['row'][2]['role_descr'] = [
|
||||
'type' => 'text',
|
||||
'fieldset' => 'body',
|
||||
'name' => 'Description',
|
||||
'class' => 'input-xlarge',
|
||||
'placeholder' => 'Permits read access to all devices',
|
||||
'value' => '');
|
||||
'value' => ''];
|
||||
|
||||
$form['row'][99]['close'] = array(
|
||||
'type' => 'submit',
|
||||
'fieldset' => 'footer',
|
||||
'div_class' => '', // Clean default form-action class!
|
||||
'name' => 'Close',
|
||||
'icon' => '',
|
||||
'attribs' => array('data-dismiss' => 'modal',
|
||||
'aria-hidden' => 'true'));
|
||||
$form['row'][99]['action'] = array(
|
||||
'type' => 'submit',
|
||||
'fieldset' => 'footer',
|
||||
'div_class' => '', // Clean default form-action class!
|
||||
'name' => 'Add Role',
|
||||
'icon' => 'icon-ok icon-white',
|
||||
$form['row'][99]['close'] = [
|
||||
'type' => 'submit',
|
||||
'fieldset' => 'footer',
|
||||
'div_class' => '', // Clean default form-action class!
|
||||
'name' => 'Close',
|
||||
'icon' => '',
|
||||
'attribs' => ['data-dismiss' => 'modal',
|
||||
'aria-hidden' => 'true']];
|
||||
$form['row'][99]['action'] = [
|
||||
'type' => 'submit',
|
||||
'fieldset' => 'footer',
|
||||
'div_class' => '', // Clean default form-action class!
|
||||
'name' => 'Add Role',
|
||||
'icon' => 'icon-ok icon-white',
|
||||
//'right' => TRUE,
|
||||
'class' => 'btn-primary',
|
||||
'value' => 'role_add');
|
||||
'class' => 'btn-primary',
|
||||
'value' => 'role_add'];
|
||||
|
||||
echo generate_form_modal($form);
|
||||
unset($form, $form_params);
|
||||
|
Reference in New Issue
Block a user