Exemplo n.º 1
0
// show new group form
if ($groupAction == 'add') {
    ?>
    <h2><?php 
    print $text['header'];
    ?>
</h2>
    <p id="user_message"><?php 
    print $message;
    ?>
</p>

    <div id="groupCreate">
    <form name="group_create" action="?action=group&amp;group_action=addsave" method="post">
    <input type="hidden" name="csrf" value="<?php 
    print $user->getCsrfTokenFromSession();
    ?>
" />
        <fieldset>
            <legend><?php 
    print $text['addGroup'];
    ?>
</legend>
                <div class="input_row">
                    <label for="group_name"><?php 
    print $text['addGroup_name'];
    ?>
</label>
                    <input type="text" name="group_name" value="<?php 
    print isset($group_name) ? $group_name : '';
    ?>
Exemplo n.º 2
0
         // display error messages and show form again
     } else {
         $userAction = 'add';
         $message = '<p class="alert alert-danger">';
         foreach ($messages as $err) {
             $message .= $err . '<br />';
         }
         $message .= '</p>';
     }
 }
 if (!isset($message)) {
     $message = '';
 }
 // show new user form
 if ($userAction == 'add' && $user->perm->checkRight($user->getUserId(), 'adduser')) {
     $twig->loadTemplate('user/add.twig')->display(array('PMF_LANG' => $PMF_LANG, 'csrfToken' => $user->getCsrfTokenFromSession(), 'userEmail' => isset($user_email) ? $user_email : '', 'userName' => isset($user_name) ? $user_name : '', 'userPassword' => isset($user_password) ? $user_password : '', 'userPasswordConfirm' => isset($user_password_confirm) ? $user_password_confirm : '', 'userRealName' => isset($user_realname) ? $user_realname : ''));
 }
 // show list of users
 if ($userAction == 'list') {
     $templateVars = array('PMF_LANG' => $PMF_LANG, 'message' => $message, 'renderUpdateUserScript' => false, 'rights' => $user->perm->getAllRightsData(), 'showListAllUsers' => $permission['edituser']);
     if (isset($_GET['user_id'])) {
         $templateVars['renderUpdateUserScript'] = true;
         $templateVars['updateUserId'] = PMF_Filter::filterInput(INPUT_GET, 'user_id', FILTER_VALIDATE_INT, 0);
     }
     $twig->loadTemplate('user/list.twig')->display($templateVars);
 }
 // show list of all users
 if ($userAction == 'listallusers' && $user->perm->checkRight($user->getUserId(), 'edituser')) {
     $templateVars = array('PMF_LANG' => $PMF_LANG, 'displayPagination' => false, 'message' => $message, 'users' => array());
     $allUsers = $user->getAllUsers();
     $numUsers = count($allUsers);