| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Rev$ | $LastChangedBy$ |
|---|
| 4 | $LastChangedDate$ |
|---|
| 5 | +-------------------------------------------------------------------------+ |
|---|
| 6 | | Copyright (c) 2004 - 2010, Kreotek LLC | |
|---|
| 7 | | All rights reserved. | |
|---|
| 8 | +-------------------------------------------------------------------------+ |
|---|
| 9 | | | |
|---|
| 10 | | Redistribution and use in source and binary forms, with or without | |
|---|
| 11 | | modification, are permitted provided that the following conditions are | |
|---|
| 12 | | met: | |
|---|
| 13 | | | |
|---|
| 14 | | - Redistributions of source code must retain the above copyright | |
|---|
| 15 | | notice, this list of conditions and the following disclaimer. | |
|---|
| 16 | | | |
|---|
| 17 | | - Redistributions in binary form must reproduce the above copyright | |
|---|
| 18 | | notice, this list of conditions and the following disclaimer in the | |
|---|
| 19 | | documentation and/or other materials provided with the distribution. | |
|---|
| 20 | | | |
|---|
| 21 | | - Neither the name of Kreotek LLC nor the names of its contributore may | |
|---|
| 22 | | be used to endorse or promote products derived from this software | |
|---|
| 23 | | without specific prior written permission. | |
|---|
| 24 | | | |
|---|
| 25 | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
|---|
| 26 | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
|---|
| 27 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | |
|---|
| 28 | | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
|---|
| 29 | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
|---|
| 30 | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
|---|
| 31 | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
|---|
| 32 | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
|---|
| 33 | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
|---|
| 34 | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
|---|
| 35 | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
|---|
| 36 | | | |
|---|
| 37 | +-------------------------------------------------------------------------+ |
|---|
| 38 | */ |
|---|
| 39 | |
|---|
| 40 | include("../../include/session.php"); |
|---|
| 41 | include("include/tables.php"); |
|---|
| 42 | include("include/fields.php"); |
|---|
| 43 | include("include/users.php"); |
|---|
| 44 | |
|---|
| 45 | $thetable = new users($db, "tbld:afe6d297-b484-4f0b-57d4-1c39412e9dfb"); |
|---|
| 46 | $therecord = $thetable->processAddEditPage(); |
|---|
| 47 | |
|---|
| 48 | if(isset($therecord["phpbmsStatus"])) |
|---|
| 49 | $statusmessage = $therecord["phpbmsStatus"]; |
|---|
| 50 | |
|---|
| 51 | $pageTitle="User"; |
|---|
| 52 | |
|---|
| 53 | $phpbms->cssIncludes[] = "pages/users.css"; |
|---|
| 54 | $phpbms->jsIncludes[] = "modules/base/javascript/users.js"; |
|---|
| 55 | |
|---|
| 56 | //Form Elements |
|---|
| 57 | //============================================================== |
|---|
| 58 | $theform = new phpbmsForm(); |
|---|
| 59 | $theform->onsubmit="return submitForm(this);"; |
|---|
| 60 | |
|---|
| 61 | $disabled = false; |
|---|
| 62 | if($therecord["portalaccess"]) |
|---|
| 63 | $disabled = true; |
|---|
| 64 | |
|---|
| 65 | $theinput = new inputCheckbox("adminBox",$therecord["admin"],"administrator", $disabled); |
|---|
| 66 | $theform->addField($theinput); |
|---|
| 67 | |
|---|
| 68 | $theinput = new inputCheckbox("revoked",$therecord["revoked"],"access revoked"); |
|---|
| 69 | $theform->addField($theinput); |
|---|
| 70 | |
|---|
| 71 | $theinput = new inputCheckbox("portalaccess",$therecord["portalaccess"],"portal access"); |
|---|
| 72 | $theform->addField($theinput); |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | $theinput = new inputField("firstname",$therecord["firstname"],"first name",true,NULL,32,64); |
|---|
| 76 | $theinput->setAttribute("class","important"); |
|---|
| 77 | $theform->addField($theinput); |
|---|
| 78 | |
|---|
| 79 | $theinput = new inputField("lastname",$therecord["lastname"],"last name",false,NULL,32,64); |
|---|
| 80 | $theinput->setAttribute("class","important"); |
|---|
| 81 | $theform->addField($theinput); |
|---|
| 82 | |
|---|
| 83 | $theinput = new inputField("login",$therecord["login"],"log in name",true,NULL,32,64); |
|---|
| 84 | $theinput->setAttribute("class","important"); |
|---|
| 85 | $theform->addField($theinput); |
|---|
| 86 | |
|---|
| 87 | $theinput = new inputField("email",$therecord["email"],"e-mail address",false,"email",32,64); |
|---|
| 88 | $theform->addField($theinput); |
|---|
| 89 | |
|---|
| 90 | $theinput = new inputField("phone",$therecord["phone"],"phone/extension",false,"phone",32,64); |
|---|
| 91 | $theform->addField($theinput); |
|---|
| 92 | |
|---|
| 93 | $theinput = new inputField("lastip", $therecord["lastip"], "last log in IP"); |
|---|
| 94 | $theinput->setAttribute("readonly", "readonly"); |
|---|
| 95 | $theinput->setAttribute("class", "uneditable"); |
|---|
| 96 | $theform->addField($theinput); |
|---|
| 97 | |
|---|
| 98 | $theinput = new inputChoiceList($db,"department",$therecord["department"],"department"); |
|---|
| 99 | $theform->addField($theinput); |
|---|
| 100 | |
|---|
| 101 | $thetable->getCustomFieldInfo(); |
|---|
| 102 | $theform->prepCustomFields($db, $thetable->customFieldsQueryResult, $therecord); |
|---|
| 103 | $theform->jsMerge(); |
|---|
| 104 | //============================================================== |
|---|
| 105 | //End Form Elements |
|---|
| 106 | |
|---|
| 107 | include("header.php"); |
|---|
| 108 | |
|---|
| 109 | ?><div class="bodyline"> |
|---|
| 110 | <?php $theform->startForm($pageTitle)?> |
|---|
| 111 | <fieldset id="fsAttributes"> |
|---|
| 112 | <legend>attributes</legend> |
|---|
| 113 | |
|---|
| 114 | <p> |
|---|
| 115 | <input type="hidden" id="admin" name="admin" value="<?php echo $therecord["admin"]?>" /> |
|---|
| 116 | <?php $theform->showField("adminBox");?> |
|---|
| 117 | </p> |
|---|
| 118 | |
|---|
| 119 | <p><?php $theform->showField("revoked");?></p> |
|---|
| 120 | |
|---|
| 121 | <p><?php $theform->showField("portalaccess");?></p> |
|---|
| 122 | |
|---|
| 123 | <p class="notes"> |
|---|
| 124 | user accounts marked as portal access cannot login to phpBMS, but are used by external applications |
|---|
| 125 | when creating/modifying information from outside the application for recording purposes. |
|---|
| 126 | </p> |
|---|
| 127 | </fieldset> |
|---|
| 128 | |
|---|
| 129 | <div id="leftSideDiv"> |
|---|
| 130 | <fieldset id="fsName"> |
|---|
| 131 | <legend>name</legend> |
|---|
| 132 | |
|---|
| 133 | <p id="firstnameP" class="big"><?php $theform->showField("firstname");?></p> |
|---|
| 134 | |
|---|
| 135 | <p class="big"><?php $theform->showField("lastname");?></p> |
|---|
| 136 | |
|---|
| 137 | </fieldset> |
|---|
| 138 | |
|---|
| 139 | <fieldset> |
|---|
| 140 | <legend>log in</legend> |
|---|
| 141 | |
|---|
| 142 | <p class="big"><?php $theform->showField("login");?></p> |
|---|
| 143 | |
|---|
| 144 | <p> |
|---|
| 145 | <label for="lastlogin" >last log in</label><br /> |
|---|
| 146 | <input id="lastlogin" name="lastlogin" type="text" value="<?php echo formatFromSQLDateTime($therecord["lastlogin"]); ?>" size="32" maxlength="64" readonly="readonly" class="uneditable" /> |
|---|
| 147 | </p> |
|---|
| 148 | |
|---|
| 149 | <p><?php $theform->showField("lastip"); ?></p> |
|---|
| 150 | |
|---|
| 151 | <p> |
|---|
| 152 | <label for="password">set new password</label><br /> |
|---|
| 153 | <input id="password" name="password" type="password" size="32" maxlength="32" /> |
|---|
| 154 | </p> |
|---|
| 155 | |
|---|
| 156 | <p> |
|---|
| 157 | <label for="password2">confirm new password</label><br /> |
|---|
| 158 | <input id="password2" name="password2" type="password" size="32" maxlength="32" /> |
|---|
| 159 | </p> |
|---|
| 160 | </fieldset> |
|---|
| 161 | |
|---|
| 162 | <fieldset> |
|---|
| 163 | <legend>contact / user information</legend> |
|---|
| 164 | |
|---|
| 165 | <p><?php $theform->showField("email");?></p> |
|---|
| 166 | |
|---|
| 167 | <p><?php $theform->showField("phone");?></p> |
|---|
| 168 | |
|---|
| 169 | <p><?php $theform->showField("department");?></p> |
|---|
| 170 | |
|---|
| 171 | <p> |
|---|
| 172 | <label for="employeenumber">employee number</label><br /> |
|---|
| 173 | <input type="text" id="employeenumber" name="employeenumber" value="<?php echo htmlQuotes($therecord["employeenumber"]) ?>" size="32" maxlength="32" /> |
|---|
| 174 | </p> |
|---|
| 175 | </fieldset> |
|---|
| 176 | |
|---|
| 177 | <?php $theform->showCustomFields($db, $thetable->customFieldsQueryResult) ?> |
|---|
| 178 | |
|---|
| 179 | <?php if($therecord["id"]){?> |
|---|
| 180 | <fieldset> |
|---|
| 181 | <legend>roles</legend> |
|---|
| 182 | <input type="hidden" name="roleschanged" id="roleschanged" value="0" /> |
|---|
| 183 | <input type="hidden" name="newroles" id="newroles" value="" /> |
|---|
| 184 | <div class="fauxP"> |
|---|
| 185 | <div id="assignedrolesdiv"> |
|---|
| 186 | assigned roles<br /> |
|---|
| 187 | <select id="assignedroles" size="10" multiple="multiple"> |
|---|
| 188 | <?php $thetable->displayRoles($therecord["uuid"], "assigned")?> |
|---|
| 189 | </select> |
|---|
| 190 | </div> |
|---|
| 191 | <div id="rolebuttonsdiv"> |
|---|
| 192 | <p> |
|---|
| 193 | <button type="button" class="Buttons" onclick="moveRole('availableroles','assignedroles')">< add role</button> |
|---|
| 194 | </p> |
|---|
| 195 | <p> |
|---|
| 196 | <button type="button" class="Buttons" onclick="moveRole('assignedroles','availableroles')">remove role ></button> |
|---|
| 197 | </p> |
|---|
| 198 | </div> |
|---|
| 199 | <div id="availablerolesdiv"> |
|---|
| 200 | available roles<br /> |
|---|
| 201 | <select id="availableroles" size="10" multiple="multiple"> |
|---|
| 202 | <?php $thetable->displayRoles($therecord["uuid"],"available")?> |
|---|
| 203 | </select> |
|---|
| 204 | </div> |
|---|
| 205 | </div> |
|---|
| 206 | </fieldset> |
|---|
| 207 | <?php }?> |
|---|
| 208 | </div> |
|---|
| 209 | |
|---|
| 210 | <?php |
|---|
| 211 | $theform->showGeneralInfo($phpbms,$therecord); |
|---|
| 212 | $theform->endForm(); |
|---|
| 213 | ?> |
|---|
| 214 | </div> |
|---|
| 215 | <?php include("footer.php");?> |
|---|