Example #1
0
 public function index()
 {
     $this->loadModel(SLASH . 'users' . SLASH . 'user');
     $user = new User();
     $data['users'] = $user->get_users();
     $this->loadView(SLASH . 'application' . SLASH . 'schnippets', TRUE, $data);
 }
 public function action_index()
 {
     $this->xml_content_users = $this->xml_content->appendChild($this->dom->createElement('users'));
     $fields = array();
     foreach (User::get_data_fields() as $field_id => $field_name) {
         $fields['field id="' . $field_id . '"'] = $field_name;
     }
     xml::to_XML($fields, $this->xml_content_users);
     xml::to_XML(User::get_users(FALSE, 0, 100, array('username' => 'ASC')), $this->xml_content_users, 'user', 'id');
 }
Example #3
0
 public function listusers()
 {
     if (!isset($_SESSION[APP_SES . 'id']) || $_SESSION[APP_SES . 'id'] == 0) {
         gotoUrl('/?route=/users/users');
         exit;
     }
     $this->loadModel(SLASH . 'users' . SLASH . 'user');
     $user = new User();
     $data['list_of_users'] = $user->get_users();
     $this->setTitle('Users');
     $this->loadView(SLASH . 'users' . SLASH . 'display_users', TRUE, $data);
 }
Example #4
0
					<th>
						<tr>
							<th>userID</th>
							<th>username</th>
							<th>password</th>
						</tr>
					</th>
					<tbody>
						<?php 
$get_user_role = $user->get_user_role($_SESSION['user']);
if ($get_user_role == 'user') {
    //if the user role equals user then show a single user(only the logged in user can change his own password)
    $get_users = $user->get_single_user($_SESSION['user']);
} elseif ($get_user_role == 'admin') {
    // if the user role equals admin then show all users(admin can change all user passwords)
    $get_users = $user->get_users();
}
foreach ($get_users as $user) {
    $_GET['ID'] = $user['ID'];
    echo '
										<form method="get">
											<tr>
												<td>' . $user['ID'] . '</td>
												<td>' . $user['email'] . '</td>
												<td><a href="resetpassword.php?ID=' . $_GET["ID"] . '">Reset wachtwoord</a></td>
												<td>' . $user['role'] . '</td>
										  </tr>
										</form>';
}
?>
					</tbody>
Example #5
0
        <?php 
include '../includes/admin_sidebar.php';
?>
        <!-- End sidebar -->
        <div id="page-wrapper">

            <div class="container-fluid">
              <div class="intro">
                <h2>Vacature overzicht</h2>
              </div>
              <div class="vacature_overzicht">
                <?php 
include '../includes/filters.php';
?>
                <?php 
$get_sollicitanten = $user->get_users();
foreach ($get_sollicitanten as $get_sollicitant) {
    $_GET['sollicitantID'] = $get_sollicitant['sollicitantID'];
    echo '
                  <div class="item col-md-3"> <!--Begin of one item -->
                  <form method="post"><input type="hidden" name="sollicitantID" value="' . $get_sollicitant['sollicitantID'] . '"><button style="background: none; border: none; position: absolute; top: 2em; right: 2em;"><i class="fa fa-times" aria-hidden="true"></i></button></form>
                    <div class="item-header "><!--Begin of item header shows titel, place and kind of employment  -->
                      <span class="item-titel"><h2>' . $get_sollicitant['voornaam'] . ' ' . $get_sollicitant['achternaam'] . '</h2></span>
                      <div class="item-info">
                        <span><i class="fa fa-map-marker"></i>' . $get_sollicitant['email'] . '</span>
                      </div>
                    </div><!--End of item header -->
                    <div class="expand">
                      <span><a href="edit_sollicitant.php?sollicitantID=' . $_GET['sollicitantID'] . '">Wijzig User</a></span>
                    </div>
                  </div><!--End of one item -->
Example #6
0
function displayGroupManagement()
{
    global $tool, $propertyForm;
    $groups = Group::get_groups();
    echo "<style>";
    foreach ($groups as $id => $value) {
        echo "#modalBox #allUserDialog" . $id;
        echo "{\n\t\t\twidth:auto;\n\t\t\tmax-width: 80%;\n\t\t\tmin-width:40%;\n\t\t\theight:auto;\n\t\t\tpadding:10px;\n\t\t\tpadding-top:10px;\n\t\t\toverflow:auto;\n\t\t}";
    }
    echo "</style>";
    $toolNames = array("Add Group");
    $toolIcons = array("add");
    $formType = array("newDialog");
    echo $tool->createNewModal($toolNames, $toolIcons, $formType);
    foreach ($groups as $id => $value) {
        $curGroup = new Group($id);
        $groupID = $id;
        $access = $curGroup->get_access_level();
        switch ($access) {
            case 0:
                $access = "No Access";
                break;
            case 25:
                $access = "Read Only";
                break;
            case 50:
                $access = "Read Write Only";
                break;
            case 100:
                $access = "Admin";
                break;
        }
        echo "<form method='post' action='' style='width:1024px;'><input type='hidden' name='groupID' value='" . $curGroup->get_group_id() . "' />\n\t\t<table id=\"sortDataTable\" class='sortable' cellspacing=\"0\" cellpadding=\"0\" border=\"1\" style='width:100%; clear:left;'>\n\t\t<thead>\n\t\t<tr>\n\t\t<th style='text-align:left;'>" . $curGroup->get_name() . "</th>\n\t\t<th colspan='10'><a name='modal' href='#dialog" . $id . "' style='float:right; margin-bottom:5px; margin-right: 5px;'>Edit</a></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>";
        if ($curGroup->get_group_pass() == true) {
            $myModalID = "modalPass" . $curGroup->get_group_id();
            // Check if it already has a password or not.
            if ($curGroup->has_password() == 1) {
                // Already has a password
                // this is to update existing pass
                // Create custom input field for password
                // as type password is not defined in class...
                $group_pass = "******" . $myModalID . "'>Update Group Password</a>";
                $heading = array("Update Group Password");
                $title = array("Old Password", "New Password", "New Password", "group_id", "action");
                $keys = array("old_pass", "new_pass1", "new_pass2", "group_id", "update_group_key");
                $data = array("", "", "", $curGroup->get_group_id(), "update_group_key");
                $fieldType = array(0 => "password", 1 => "password", 2 => "password", 3 => "hidden", 4 => "hidden");
            } elseif ($curGroup->has_password() == 0) {
                // Group does not yet have a pass
                // Inital password will be set below
                $group_pass = "******" . $myModalID . "'>Set Group Password</a>";
                $heading = array("Configure Group Password");
                $title = array("Old Password", "New Password", "New Password", "group_id", "action");
                $keys = array("old_pass", "new_pass1", "new_pass2", "group_id", "update_group_key");
                $data = array("dummy", "", "", $curGroup->get_group_id(), "update_group_key");
                $fieldType = array(0 => 'hidden', 1 => 'password', 2 => 'password', 3 => "hidden", 4 => "hidden");
            }
            // Modal for password update
            $form = new Form("auto", 2);
            $form->setHeadings($heading);
            $form->setTitles($title);
            $form->setData($data);
            $form->setDatabase($keys);
            $form->setFieldType($fieldType);
            $form->setModalID($myModalID);
            //set the table size
            $form->setTableWidth("1024px");
            $form->setTitleWidth("20%");
            $modal_group_pass .= $form->modalForm();
            // End Modal for group pass
        } else {
            $group_pass = "******";
        }
        echo "\n\t\t<tr class='form'><td style='text-align:left; width:200px;'><h3>Description</h3>" . $curGroup->get_description() . "</td>\n\t\t<td style='text-align:left; width:200px;'><h3>LDAP Group Name</h3>" . $curGroup->get_ldap_group_name() . "</td>\n\t\t<td style='text-align:left; width:100px;'><h3>Access Level</h3>" . $access . "</td>\n\t\t<td style='text-align:left; width:100px;'><h3>Access To Private Data</h3>" . $group_pass . "</td></tr>";
        echo "<tr class='form'><td colspan='4'>";
        $groupUsers = $curGroup->get_users();
        foreach ($groupUsers as $id => $value) {
            echo "<input type='checkbox' name='userList[]' value='" . $id . "'>" . $value . " | ";
        }
        echo "<a name=modal href='#allUserDialog" . $groupID . "'>Add User...</a>\n\t\t</td></tr>";
        echo "</tbody>\n\t\t</table>";
        echo "<input type='submit' name='delUserFromGroup' value='Delete Users From Group' style='float:right; margin-bottom:5px; margin-right: 5px;' />";
        echo "<input type='submit' name='delGroup' value='Delete Group' style='float:left; clear:left; margin-bottom:20px;' />\n\t\t</form>";
        echo "<div id='modalBox'>";
        $users = User::get_users();
        echo "<div id='allUserDialog" . $groupID . "' class='window'>\n\t\t\t <a href='#'class='close' /><img src='icons/close.png'></a>\n\t\t\t <form method='post' action=''>\n\t\t\t <input type='hidden' name='groups2' value='" . $curGroup->get_group_id() . "' />";
        foreach ($users as $id => $value) {
            $isIn = false;
            foreach ($groupUsers as $gid => $gvalue) {
                if ($value == $gvalue) {
                    $isIn = true;
                }
            }
            if (!$isIn) {
                echo "<input type='checkbox' name='list[]' value='" . $id . "'>" . $value . " | ";
            }
        }
        echo "<input type='submit' name='userToGroup' value='Add Users to Group' />";
        echo "</form>\n\t\t\t </div>";
        echo "<div id='mask'></div>\n\t\t\t </div>";
    }
    $heading = array("Group Information");
    $title = array("Group Name", "Group Description", "Access Level");
    $key = array("name", "desc", "access");
    foreach ($groups as $id => $value) {
        $curGroup = new Group($id);
        switch ($curGroup->get_access_level()) {
            case 0:
                $value = "No Access";
                break;
            case 25:
                $value = "Read Only";
                break;
            case 50:
                $value = "Read Write Only";
                break;
            case 100:
                $value = "Admin";
                break;
        }
        if ($curGroup->get_group_pass() == true) {
            $group_pass = "******";
        } else {
            $group_pass = "******";
        }
        $info = array($id, $curGroup->get_name(), $curGroup->get_description(), $value, $curGroup->get_ldap_group_name(), $group_pass);
        // Only render group pass if it's
        $heading2 = array("Group Information");
        $title2 = array("ID", "Group Name", "Group Description", "Access Level", "LDAP Group", "Enable Private Data access");
        $key2 = array("id", "name", "desc", "access", "ldap", "group_pass");
        //create a new modal form for a new interface ports
        $fieldType = array(0 => "static", 3 => "drop_down", 5 => "drop_down");
        $propertyForm->setFieldType($fieldType);
        $accessLevel = array(0 => "No Access", 25 => "Read Only", 50 => "Read Write Only", 100 => "Admin");
        $group_pass = array(0 => "Disabled", 1 => "Enabled");
        $propertyForm->setType($accessLevel);
        $propertyForm->setType($group_pass);
        echo $propertyForm->editModalForm($heading2, $title2, $info, $key2, "dialog" . $id, "updateGroup");
    }
    //create a new modal form for a new interface ports
    $fieldType = array(2 => "drop_down");
    $propertyForm->setFieldType($fieldType);
    $accessLevel = array(0 => "No Access", 25 => "Read Only", 50 => "Read Write Only", 100 => "Admin");
    $propertyForm->setType($accessLevel);
    echo $propertyForm->newModalForm($heading, $title, $key, "addGroup");
    echo $modal_group_pass;
}