Beispiel #1
0
    <body>
        <div class="container">
            <div class="jumbotron">
            </div>
            <div class="tables">    
                <form action="?action=newUser" method="post">
                    <input type="submit" class="btn btn-block btn-primary" value="Create a new user">
                </form>
            <form action="?action=login" method="post">
                    <input type="submit" class="btn btn-block btn-primary" value="Login">
                </form>
               <?php 
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case "newUser":
            echo insert_user_form();
            break;
        case "login":
            echo login_form1();
            break;
    }
}
?>

               
                
            </div>

                
        </div> <!--end of container-->
        <script src="https://code.jquery.com/jquery.js"></script>
Beispiel #2
0
    $cmbUGrp = new CComboBox('filter_usrgrpid', $_REQUEST['filter_usrgrpid'], 'submit()');
    $cmbUGrp->AddItem(0, S_ALL_S);
    $result = DBselect('SELECT usrgrpid, name FROM usrgrp WHERE ' . DBin_node('usrgrpid') . ' ORDER BY name');
    while ($usrgrp = DBfetch($result)) {
        $cmbUGrp->AddItem($usrgrp['usrgrpid'], $usrgrp['name']);
    }
    $frmForm->AddItem(array(SPACE . SPACE, S_USER_GROUP, $cmbUGrp));
}
$frmForm->AddItem(SPACE . '|' . SPACE);
$frmForm->AddItem($btnNew = new CButton('form', $_REQUEST['config'] == 0 ? S_CREATE_USER : S_CREATE_GROUP));
show_table_header(S_CONFIGURATION_OF_USERS_AND_USER_GROUPS, $frmForm);
echo SBR;
$row_count = 0;
if ($_REQUEST['config'] == 0) {
    if (isset($_REQUEST['form'])) {
        insert_user_form(get_request('userid', null));
    } else {
        $form = new CForm(null, 'post');
        $form->SetName('users');
        $numrows = new CSpan(null, 'info');
        $numrows->addOption('name', 'numrows');
        $header = get_table_header(array(S_USERS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
        show_table_header($header);
        $table = new CTableInfo(S_NO_USERS_DEFINED);
        $table->setHeader(array(array(new CCheckBox('all_users', NULL, "CheckAll('" . $form->GetName() . "','all_users','group_userid');"), make_sorting_link(S_ALIAS, 'u.alias')), make_sorting_link(S_NAME, 'u.name'), make_sorting_link(S_SURNAME, 'u.surname'), make_sorting_link(S_USER_TYPE, 'u.type'), S_GROUPS, S_IS_ONLINE_Q, S_GUI_ACCESS, S_STATUS, S_ACTIONS));
        $cond_from = '';
        $cond_where = '';
        if ($_REQUEST['filter_usrgrpid'] > 0) {
            $cond_from = ', users_groups ug, usrgrp ugrp ';
            $cond_where = ' AND ug.userid = u.userid ' . ' AND ug.usrgrpid=' . $_REQUEST['filter_usrgrpid'];
        }
Beispiel #3
0
    access_deny();
}
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('password1' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({form})&&({form}!="update")&&isset({change_password})'), 'password2' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&isset({form})&&({form}!="update")&&isset({change_password})'), 'lang' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), 'theme' => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), 'autologin' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'autologout' => array(T_ZBX_INT, O_OPT, null, BETWEEN(90, 10000), null), 'url' => array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), 'refresh' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 3600), 'isset({save})'), 'change_password' => array(T_ZBX_STR, O_OPT, null, null, null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_STR, O_OPT, null, null, null));
check_fields($fields);
if (isset($_REQUEST['cancel'])) {
    $url = get_profile('web.menu.view.last', 'index.php');
    redirect($url);
} else {
    if (isset($_REQUEST['save'])) {
        $_REQUEST['password1'] = get_request('password1', null);
        $_REQUEST['password2'] = get_request('password2', null);
        if (isset($_REQUEST['password1']) && $_REQUEST['password1'] == '') {
            show_error_message(S_ONLY_FOR_GUEST_ALLOWED_EMPTY_PASSWORD);
        } else {
            if ($_REQUEST['password1'] == $_REQUEST['password2']) {
                $result = update_user_profile($USER_DETAILS['userid'], $_REQUEST['password1'], $_REQUEST['url'], get_request('autologin', 0), get_request('autologout', 0), $_REQUEST['lang'], $_REQUEST['theme'], $_REQUEST['refresh']);
                show_messages($result, S_USER_UPDATED, S_CANNOT_UPDATE_USER);
                if ($result) {
                    add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_USER, 'User alias [' . $USER_DETAILS['alias'] . '] name [' . $USER_DETAILS['name'] . '] surname [' . $USER_DETAILS['surname'] . '] profile id [' . $USER_DETAILS['userid'] . ']');
                }
            } else {
                show_error_message(S_CANNOT_UPDATE_USER_BOTH_PASSWORDS);
            }
        }
    }
}
show_table_header(S_USER_PROFILE_BIG . ' : ' . $USER_DETAILS['name'] . ' ' . $USER_DETAILS['surname']);
echo '<br>';
insert_user_form($USER_DETAILS['userid'], 1);
include_once 'include/page_footer.php';