Markers
Table of Contents
UsersInitDB.php
| Type | Line | Description | 
|---|---|---|
| 21 | For Users class | |
| 22 | this will be the display label on the form | |
| 24 | the input type to use for data entry | |
| 26 | you can only edit this if an admin and changing someone | |
| 27 | else' record | |
| 29 | will be displayed on a hover in HTML5 (ie, title=) | |
| 31 | this is entered in an empty box, ie placeholder= | |
| 33 | for Data Source | |
| 35 | actual mySQL column type | |
| 37 | set it to not null if we build the table ourselves | |
| 39 | set a default value | 
UsersPermissionsInitDB.php
| Type | Line | Description | 
|---|---|---|
| 20 | For Users class | |
| 21 | this will be the display label on the form | |
| 23 | the input type to use for data entry | |
| 25 | you can only edit this if an admin and changing someone | |
| 26 | else' record | |
| 28 | will be displayed on a hover in HTML5 (ie, title=) | |
| 30 | this is entered in an empty box, ie placeholder= | |
| 32 | for Data Source | |
| 34 | actual mySQL column type | |
| 36 | set it to not null if we build the table ourselves | |
| 38 | set a default value | 
UsersPermissionsTestExtended.php
| Type | Line | Description | 
|---|---|---|
| 6 | session_destroy(); die; | |
| 31 | For Users class | |
| 32 | this will be the display label on the form | |
| 34 | the input type to use for data entry | |
| 36 | you can only edit this if an admin and changing someone | |
| 37 | else' record | |
| 39 | will be displayed on a hover in HTML5 (ie, title=) | |
| 41 | this is entered in an empty box, ie placeholder= | |
| 43 | for Data Source | |
| 45 | actual mySQL column type | |
| 47 | set it to not null if we build the table ourselves | |
| 66 | Pass the same custom fields to the Users class | |
| 70 | check if the user has request a log out. | |
| 84 | if ( isset( $_SESSION['user'] ) ) print_r( $_SESSION['user']->data() ); ?></pre> | |
| 88 | only used when we need to log in, empty otherwise | |
| 96 | build a little menu | |
| 107 | this only displays something if doAdmin is set | 
UsersTest.php
| Type | Line | Description | 
|---|---|---|
| 6 | session_destroy(); die; | |
| 7 | make a connection to the database | |
| 10 | create a data source | |
| 12 | check if table exists and, if not, create it with username admin, password admin | |
| 24 | create an empty Users instance and save it in the session | |
| 28 | if they asked to log out, log out | |
| 45 | displays/processes login page if needed, empty otherwise | 
UsersTestExtended.php
| Type | Line | Description | 
|---|---|---|
| 6 | session_destroy(); die; | |
| 31 | For Users class | |
| 32 | this will be the display label on the form | |
| 34 | the input type to use for data entry | |
| 36 | you can only edit this if an admin and changing someone | |
| 37 | else' record | |
| 39 | will be displayed on a hover in HTML5 (ie, title=) | |
| 41 | this is entered in an empty box, ie placeholder= | |
| 43 | for Data Source | |
| 45 | actual mySQL column type | |
| 47 | set it to not null if we build the table ourselves | |
| 66 | Pass the same custom fields to the Users class | |
| 70 | check if the user has request a log out. | |
| 86 | only used when we need to log in, empty otherwise | |
| 94 | build a little menu | |
| 105 | this only displays something if doAdmin is set | 
Users.class.php
| Type | Line | Description | 
|---|---|---|
| 82 | prefix the name with this in a form | |
| 85 | table name for user records | |
| 86 | ID column name | |
| 87 | fields which are displayed to select | |
| 90 | field to test if form submitted | |
| 93 | login name column name | |
| 101 | password column name | |
| 118 | fields | |
| 119 | table users | |
| 120 | tables | |
| 142 | constructor | |
| 234 | validate | |
| 252 | don't do ourselves | |
| 257 | wrap in ul, then put a div around it | |
| 356 | boolean is set by checkboxes | |
| 359 | case | |
| 362 | makeHTMLField | |
| 384 | if this field is restricted and we are not admin, just skip it | |
| 385 | also skip if it is our record | |
| 388 | now process the field | |
| 392 | editScreen | |
| 417 | else | |
| 418 | foreach | |
| 425 | if this field is restricted it is our record, skip it | |
| 444 | text, textarea, other things like this | |
| 453 | switch | |
| 454 | foreach | |
| 455 | we have some errors | |
| 468 | we're working on ourself | |
| 470 | a new user | |
| 472 | this is an existing user | |
| 475 | initWorkingOn | |
| 520 | display screen for data entry | |
| 521 | $return[] = 'Initializing $workingOn'; | |
| 523 | $return[] = "<pre>WorkingOn\n" . print_r( $this->workingOn, true) . '</pre>'; | |
| 532 | they submitted the form | |
| 533 | $return[] = 'Posting'; | |
| 536 | we just updated us, reload record | |
| 544 | admin | |
| 546 | class Users | 
UsersDataSourceMySQLi.class.php
| Type | Line | Description | 
|---|---|---|
| 75 | table name for user records | |
| 76 | ID column name | |
| 77 | fields which are displayed to select | |
| 80 | These fields are stored encrypted | |
| 85 | login name column name | |
| 92 | password column name | |
| 133 | they sent us some login values | |
| 176 | always get the ID field | |
| 178 | Get the rest of the available fields | |
| 180 | do not use this one if $fieldList doesn't have it | |
| 184 | Change it into something SQL can handle | |
| 186 | now, build the rest of the query | |
| 216 | run the query, placing value in $result | |
| 219 | got one, so return it | |
| 222 | WTFO? nothing, so return empty array | |
| 303 | foreach table | |
| 304 | buildTable | |
| 348 | just return the table name | |
| 350 | looking for the index | |
| 352 | return the column name | |
| 370 | test | |
| 384 | make sure they sent us something | |
| 385 | we are doing an update | |
| 390 | if | |
| 396 | we are doing an insert | |
| 403 | if | |
| 411 | update | |
| 422 | print "<p>$query</p>\n"; | 
UsersPermissions.class.php
| Type | Line | Description | 
|---|---|---|
| 29 | Let's make sure we have the Users class loaded. | |
| 64 | constructor | |
| 134 | now we process all of the permissions | |
| 141 | if a new user, the permission is whatever is in the form | |
| 144 | otherwise, if it is not a new user, only do an update if it has changed | |
| 148 | foreach | |
| 150 | if not an error | |
| 152 | addEdit | 
UsersPermissionsDataSourceMySQLi.class.php
| Type | Line | Description | 
|---|---|---|
| 89 | table name for user records | |
| 90 | ID column name | |
| 91 | fields which are displayed to select | |
| 103 | permissions categories table | |
| 105 | table name for user records | |
| 106 | ID column name | |
| 107 | fields which are displayed to select | |
| 135 | permissions table | |
| 137 | table name for user records | |
| 138 | ID column name | |
| 158 | users permissions table | |
| 164 | users permissions view | |
| 170 | constructor | |
| 182 | add a unique constraint on users permissions for user id and permission id | |
| 183 | we do it this way since there is no way to do it automagically | |
| 184 | without rewriting the $configuration code | |
| 191 | create a convenience view | |
| 250 | we did not find the category, so add it | |
| 263 | if category not found | |
| 282 | addPermission | |
| 338 | setUsersPermissions | |
| 433 | update |