Subversion Repositories php_users

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
26 rodolico 1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
    <meta charset="utf-8">
5
    <title>Documentation</title>
6
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
    <base href="../">
8
    <link rel="icon" href="images/favicon.ico"/>
9
    <link rel="stylesheet" href="css/normalize.css">
10
    <link rel="stylesheet" href="css/base.css">
11
            <link rel="preconnect" href="https://fonts.gstatic.com">
12
        <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
13
        <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
14
        <link rel="stylesheet" href="css/template.css">
15
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
16
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
17
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
18
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
19
                <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
20
        <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
21
        <script src="js/search.js"></script>
22
        <script defer src="js/searchIndex.js"></script>
23
    </head>
24
<body id="top">
25
    <header class="phpdocumentor-header phpdocumentor-section">
26
    <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
27
    <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
28
    <label class="phpdocumentor-header__menu-icon" for="menu-button">
29
        <i class="fas fa-bars"></i>
30
    </label>
31
    <section data-search-form class="phpdocumentor-search">
32
    <label>
33
        <span class="visually-hidden">Search for</span>
34
        <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
35
            <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
36
            <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
37
        </svg>
38
        <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
39
    </label>
40
</section>
41
 
42
    <nav class="phpdocumentor-topnav">
43
    <ul class="phpdocumentor-topnav__menu">
44
        </ul>
45
</nav>
46
</header>
47
 
48
    <main class="phpdocumentor">
49
        <div class="phpdocumentor-section">
50
            <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
51
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
52
    Menu
53
</label>
54
<aside class="phpdocumentor-column -four phpdocumentor-sidebar">
55
 
56
    <section class="phpdocumentor-sidebar__category">
57
        <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
58
            </section>
59
 
60
        <section class="phpdocumentor-sidebar__category">
61
        <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
62
                    <h3 class="phpdocumentor-sidebar__root-package"><a href="packages/Application.html"><abbr title="\Application">Application</abbr></a></h3>
63
                        </section>
64
 
65
    <section class="phpdocumentor-sidebar__category">
66
        <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
67
                <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
68
        <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
69
        <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
70
    </section>
71
 
72
    <section class="phpdocumentor-sidebar__category">
73
        <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
74
        <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
75
    </section>
76
</aside>
77
 
78
            <div class="phpdocumentor-column -eight phpdocumentor-content">
79
                    <ul class="phpdocumentor-breadcrumbs">
80
            <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
81
    </ul>
82
 
83
    <article class="phpdocumentor-element -class">
84
        <h2 class="phpdocumentor-content__title">
85
    Users
86
 
87
 
88
            <div class="phpdocumentor-element__package">
89
            in package
90
            <ul class="phpdocumentor-breadcrumbs">
91
                                    <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
92
                            </ul>
93
        </div>
94
 
95
 
96
    </h2>
97
 
98
        <aside class="phpdocumentor-element-found-in">
99
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
100
    :
101
    <span class="phpdocumentor-element-found-in__line">57</span>
102
 
103
    </aside>
104
 
105
            <p class="phpdocumentor-summary">User Login class</p>
106
 
107
    <section class="phpdocumentor-description"><p>IMPORTANT: Requires a data source. See UsersDataSourceMySQLi.class.php
108
for code which provides this for MySQLi</p>
109
<p>Users encapsulates a basic login and authentication package. It
110
provides a login screen, authentication, the ability to edit oneself,
111
and for users with the admin flag set, the ability to edit others.</p>
112
<p>It also allows a user to be disabled.</p>
113
<p>Users was designed to be extensible, adding new fields by the calling
114
program, modifying the HTML elements, etc...</p>
115
</section>
116
 
117
 
118
    <h5 class="phpdocumentor-tag-list__heading" id="tags">
119
        Tags
120
        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
121
    </h5>
122
    <dl class="phpdocumentor-tag-list">
123
                                    <dt class="phpdocumentor-tag-list__entry">
124
                    <span class="phpdocumentor-tag__name">author</span>
125
                </dt>
126
                <dd class="phpdocumentor-tag-list__definition">
127
 
128
                                                 <section class="phpdocumentor-description"><p>R. W. Rodolico <a href="mailto:rodo@unixservertech.com">rodo@unixservertech.com</a></p>
129
</section>
130
 
131
                                    </dd>
132
                                                <dt class="phpdocumentor-tag-list__entry">
133
                    <span class="phpdocumentor-tag__name">version</span>
134
                </dt>
135
                <dd class="phpdocumentor-tag-list__definition">
136
                                            <span class="phpdocumentor-tag-link">0.9.0</span>
137
 
138
                                                 <section class="phpdocumentor-description"><p>(beta)</p>
139
</section>
140
 
141
                                    </dd>
142
                                                <dt class="phpdocumentor-tag-list__entry">
143
                    <span class="phpdocumentor-tag__name">copyright</span>
144
                </dt>
145
                <dd class="phpdocumentor-tag-list__definition">
146
 
147
                                                 <section class="phpdocumentor-description"><p>2021 Daily Data, Inc.</p>
148
</section>
149
 
150
                                    </dd>
151
                        </dl>
152
 
153
 
154
 
155
 
156
 
157
 
158
<h3 id="toc">
159
    Table of Contents
160
    <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
161
</h3>
162
 
163
<dl class="phpdocumentor-table-of-contents">
164
                <dt class="phpdocumentor-table-of-contents__entry -property -protected">
165
    <a href="classes/Users.html#property_configuration">$configuration</a>
166
    <span>
167
                &nbsp;: array&lt;string|int, string&gt;            </span>
168
</dt>
169
<dd></dd>
170
 
171
            <dt class="phpdocumentor-table-of-contents__entry -property -protected">
172
    <a href="classes/Users.html#property_data">$data</a>
173
    <span>
174
                &nbsp;: array&lt;string|int, string&gt;            </span>
175
</dt>
176
<dd></dd>
177
 
178
            <dt class="phpdocumentor-table-of-contents__entry -property -protected">
179
    <a href="classes/Users.html#property_errors">$errors</a>
180
    <span>
181
                &nbsp;: array&lt;string|int, string&gt;            </span>
182
</dt>
183
<dd></dd>
184
 
185
            <dt class="phpdocumentor-table-of-contents__entry -property -protected">
186
    <a href="classes/Users.html#property_workingOn">$workingOn</a>
187
    <span>
188
                &nbsp;: array&lt;string|int, string&gt;            </span>
189
</dt>
190
<dd></dd>
191
 
192
                <dt class="phpdocumentor-table-of-contents__entry -method -public">
193
    <a href="classes/Users.html#method___construct">__construct()</a>
194
    <span>
195
                        &nbsp;: mixed    </span>
196
</dt>
197
<dd>constructor for an instance of the class</dd>
198
 
199
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
200
    <a href="classes/Users.html#method_admin">admin()</a>
201
    <span>
202
                        &nbsp;: string    </span>
203
</dt>
204
<dd>Sets up the admin function which allows users to edit themselves and, optionally, others</dd>
205
 
206
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
207
    <a href="classes/Users.html#method_allUsersHTML">allUsersHTML()</a>
208
    <span>
209
                        &nbsp;: string    </span>
210
</dt>
211
<dd>Get all users from data source and put them in an HTML list</dd>
212
 
213
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
214
    <a href="classes/Users.html#method_clearErrors">clearErrors()</a>
215
    <span>
216
                        &nbsp;: mixed    </span>
217
</dt>
218
<dd>clears the errors array</dd>
219
 
220
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
221
    <a href="classes/Users.html#method_editScreen">editScreen()</a>
222
    <span>
223
                        &nbsp;: string    </span>
224
</dt>
225
<dd>Creates an edit screen for display to user</dd>
226
 
227
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
228
    <a href="classes/Users.html#method_errors">errors()</a>
229
    <span>
230
                        &nbsp;: string    </span>
231
</dt>
232
<dd>getter for $this-&gt;errors</dd>
233
 
234
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
235
    <a href="classes/Users.html#method_HTML">HTML()</a>
236
    <span>
237
                        &nbsp;: string    </span>
238
</dt>
239
<dd>Main display function.</dd>
240
 
241
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
242
    <a href="classes/Users.html#method_isAdmin">isAdmin()</a>
243
    <span>
244
                        &nbsp;: bool    </span>
245
</dt>
246
<dd>getter for isAdmin</dd>
247
 
248
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
249
    <a href="classes/Users.html#method_logOut">logOut()</a>
250
    <span>
251
                        &nbsp;: mixed    </span>
252
</dt>
253
<dd>Logs user out of system</dd>
254
 
255
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
256
    <a href="classes/Users.html#method_name">name()</a>
257
    <span>
258
                        &nbsp;: string    </span>
259
</dt>
260
<dd>getter for login name</dd>
261
 
262
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
263
    <a href="classes/Users.html#method_addEdit">addEdit()</a>
264
    <span>
265
                        &nbsp;: mixed    </span>
266
</dt>
267
<dd></dd>
268
 
269
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
270
    <a href="classes/Users.html#method_emptyWorkingOn">emptyWorkingOn()</a>
271
    <span>
272
                        &nbsp;: array&lt;string|int, string&gt;    </span>
273
</dt>
274
<dd>Creates a variable designed to replace $this-&gt;workingOn</dd>
275
 
276
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
277
    <a href="classes/Users.html#method_getNextScript">getNextScript()</a>
278
    <span>
279
                        &nbsp;: string    </span>
280
</dt>
281
<dd>Simple helper script to calculate next script to call</dd>
282
 
283
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
284
    <a href="classes/Users.html#method_initWorkingOn">initWorkingOn()</a>
285
    <span>
286
                        &nbsp;: mixed    </span>
287
</dt>
288
<dd></dd>
289
 
290
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
291
    <a href="classes/Users.html#method_logInScreen">logInScreen()</a>
292
    <span>
293
                        &nbsp;: string    </span>
294
</dt>
295
<dd>Creates the fields needed for a login screen</dd>
296
 
297
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
298
    <a href="classes/Users.html#method_makeHTMLField">makeHTMLField()</a>
299
    <span>
300
                        &nbsp;: string    </span>
301
</dt>
302
<dd>Creates an HTML field for display</dd>
303
 
304
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
305
    <a href="classes/Users.html#method_validate">validate()</a>
306
    <span>
307
                        &nbsp;: mixed    </span>
308
</dt>
309
<dd>Validates a connection and, on success, populates $data</dd>
310
 
311
        </dl>
312
 
313
 
314
 
315
 
316
 
317
 
318
    <section class="phpdocumentor-properties">
319
        <h3 class="phpdocumentor-elements__header" id="properties">
320
            Properties
321
            <a href="classes/Users.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
322
        </h3>
323
                    <article
324
        class="
325
            phpdocumentor-element
326
            -property
327
            -protected
328
                                                        "
329
>
330
    <h4 class="phpdocumentor-element__name" id="property_configuration">
331
        $configuration
332
        <a href="classes/Users.html#property_configuration" class="headerlink"><i class="fas fa-link"></i></a>
333
        <span class="phpdocumentor-element__modifiers">
334
                                </span>
335
    </h4>
336
    <aside class="phpdocumentor-element-found-in">
337
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
338
    :
339
    <span class="phpdocumentor-element-found-in__line">64</span>
340
 
341
    </aside>
342
 
343
 
344
    <code class="phpdocumentor-code phpdocumentor-signature ">
345
    <span class="phpdocumentor-signature__visibility">protected</span>
346
        <span class="phpdocumentor-signature__type">array&lt;string|int, string&gt;</span>
347
    <span class="phpdocumentor-signature__name">$configuration</span>
348
     = <span class="phpdocumentor-signature__default-value">array(
349
    /*
350
     * what to use for html input fields
351
     * These are passed to sprintf, with label, fieldname, title, placeholder and current value, in that order
352
     */
353
    &#039;screens&#039; =&gt; array(&#039;login form&#039; =&gt; &quot;&lt;h1&gt;Login&lt;/h1&gt;
354
&lt;form class=&#039;login_form&#039; action=&#039;%s&#039; method=&#039;post&#039;&gt;
355
%s
356
&lt;input type=&#039;submit&#039; value=&#039;Login&#039;&gt;&lt;/form&gt;
357
&quot;, &#039;edit form&#039; =&gt; &quot;&lt;form class=&#039;login_form&#039; action=&#039;%s&#039; method=&#039;post&#039;&gt;
358
%s
359
&lt;input type=&#039;submit&#039; name=&#039;btnUpdate&#039; value=&#039;Update&#039;&gt;
360
&lt;/form&gt;&quot;, &#039;loginScreen&#039; =&gt; &quot;&lt;div class=&#039;login_field&#039;&gt;
361
&lt;input class=&#039;login_field&#039; type=&#039;text&#039; name=&#039;username&#039; placeholder=&#039;Username&#039; required autofocus&gt;
362
&lt;/div&gt;
363
&lt;div class=&#039;login_field&#039;&gt;
364
&lt;input class=&#039;login_field&#039; type=&#039;password&#039; name=&#039;password&#039; placeholder=&#039;Password&#039; required&gt;
365
&lt;/div&gt;&quot;, &#039;adminScreen&#039; =&gt; &quot;&lt;input type=&#039;hidden&#039; name=&#039;doAdmin&#039; value=&#039;1&#039;&gt;
366
&quot;, &#039;validateScript&#039; =&gt; &#039;&#039;),
367
    &#039;html input fields&#039; =&gt; array(&#039;text&#039; =&gt; &quot;&lt;div class=&#039;login_field&#039;&gt;
368
&lt;label&gt;%s
369
&lt;input class=&#039;login_field&#039; type=&#039;text&#039; name=&#039;%s&#039; title=&#039;%s&#039; placeholder=&#039;%s&#039; value=&#039;~~%s~~&#039;&gt;
370
&lt;/label&gt;
371
&lt;/div&gt;&quot;, &#039;password&#039; =&gt; &quot;&lt;div class=&#039;login_field&#039;&gt;
372
&lt;label&gt;%s
373
&lt;input class=&#039;login_field&#039; type=&#039;password&#039; name=&#039;%s&#039; title=&#039;%s&#039; placeholder=&#039;%s&#039;&gt;
374
&lt;/label&gt;
375
&lt;/div&gt;&quot;, &#039;boolean&#039; =&gt; &quot;&lt;div class=&#039;login_field&#039;&gt;
376
&lt;label&gt;%s
377
&lt;input class=&#039;login_field&#039; type=&#039;checkbox&#039; name=&#039;%s&#039; title=&#039;%s&#039; value=&#039;1&#039; %s ~~%s~~&gt;
378
&lt;/label&gt;
379
&lt;/div&gt;&quot;, &#039;textarea&#039; =&gt; &quot;&lt;div class=&#039;login_field&#039;&gt;
380
&lt;label&gt;%s
381
&lt;textarea class=&#039;login_field&#039; name=&#039;%s&#039; title=&#039;%s&#039; placeholder=&#039;%s&#039;&gt;~~%s~~&lt;/textarea&gt;
382
&lt;/label&gt;
383
&lt;/div&gt;&quot;),
384
    &#039;input prefix&#039; =&gt; &#039;admin_&#039;,
385
    // prefix the name with this in a form
386
    &#039;tables&#039; =&gt; array(&#039;users&#039; =&gt; array(
387
        &#039;table&#039; =&gt; &#039;_users&#039;,
388
        // table name for user records
389
        &#039;id&#039; =&gt; &#039;_user_id&#039;,
390
        // ID column name
391
        &#039;display&#039; =&gt; array(
392
            // fields which are displayed to select
393
            &#039;login&#039;,
394
        ),
395
        &#039;form test&#039; =&gt; &#039;login&#039;,
396
        // field to test if form submitted
397
        &#039;fields&#039; =&gt; array(&#039;login&#039; =&gt; array(
398
            &#039;label&#039; =&gt; &#039;Username&#039;,
399
            // login name column name
400
            &#039;html type&#039; =&gt; &#039;text&#039;,
401
            &#039;filter&#039; =&gt; &#039;/^[a-zA-Z0-9_]+$/&#039;,
402
            &#039;instructions&#039; =&gt; &#039;Username can only contain alpha numerics and an underscore&#039;,
403
            &#039;hint&#039; =&gt; &#039;Change User Name&#039;,
404
            &#039;unique&#039; =&gt; 	rue,
405
        ), &#039;pass&#039; =&gt; array(
406
            &#039;label&#039; =&gt; &#039;Password&#039;,
407
            // password column name
408
            &#039;html type&#039; =&gt; &#039;password&#039;,
409
            &#039;instructions&#039; =&gt; &#039;Leave blank to keep same password&#039;,
410
            &#039;hint&#039; =&gt; &#039;Change Password&#039;,
411
        ), &#039;admin&#039; =&gt; array(&#039;label&#039; =&gt; &#039;isAdmin&#039;, &#039;html type&#039; =&gt; &#039;boolean&#039;, &#039;restrict&#039; =&gt; 	rue, &#039;instructions&#039; =&gt; &#039;If checked, user will be able to add/edit users&#039;), &#039;enabled&#039; =&gt; array(&#039;label&#039; =&gt; &#039;Enabled&#039;, &#039;html type&#039; =&gt; &#039;boolean&#039;, &#039;restrict&#039; =&gt; 	rue, &#039;instructions&#039; =&gt; &#039;Uncheck to disable log in&#039;)),
412
    )),
413
)</span></code>
414
 
415
 
416
        <section class="phpdocumentor-description"><p>Contains the configuration for the class</p>
417
<p>May be modified by the calling program. Must be replicated in userDataSource class</p>
418
</section>
419
 
420
 
421
 
422
</article>
423
                    <article
424
        class="
425
            phpdocumentor-element
426
            -property
427
            -protected
428
                                                        "
429
>
430
    <h4 class="phpdocumentor-element__name" id="property_data">
431
        $data
432
        <a href="classes/Users.html#property_data" class="headerlink"><i class="fas fa-link"></i></a>
433
        <span class="phpdocumentor-element__modifiers">
434
                                </span>
435
    </h4>
436
    <aside class="phpdocumentor-element-found-in">
437
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
438
    :
439
    <span class="phpdocumentor-element-found-in__line">124</span>
440
 
441
    </aside>
442
 
443
 
444
    <code class="phpdocumentor-code phpdocumentor-signature ">
445
    <span class="phpdocumentor-signature__visibility">protected</span>
446
        <span class="phpdocumentor-signature__type">array&lt;string|int, string&gt;</span>
447
    <span class="phpdocumentor-signature__name">$data</span>
448
     = <span class="phpdocumentor-signature__default-value">array()</span></code>
449
 
450
 
451
        <section class="phpdocumentor-description"><p>Contains the information for the current logged in user</p>
452
</section>
453
 
454
 
455
 
456
</article>
457
                    <article
458
        class="
459
            phpdocumentor-element
460
            -property
461
            -protected
462
                                                        "
463
>
464
    <h4 class="phpdocumentor-element__name" id="property_errors">
465
        $errors
466
        <a href="classes/Users.html#property_errors" class="headerlink"><i class="fas fa-link"></i></a>
467
        <span class="phpdocumentor-element__modifiers">
468
                                </span>
469
    </h4>
470
    <aside class="phpdocumentor-element-found-in">
471
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
472
    :
473
    <span class="phpdocumentor-element-found-in__line">126</span>
474
 
475
    </aside>
476
 
477
 
478
    <code class="phpdocumentor-code phpdocumentor-signature ">
479
    <span class="phpdocumentor-signature__visibility">protected</span>
480
        <span class="phpdocumentor-signature__type">array&lt;string|int, string&gt;</span>
481
    <span class="phpdocumentor-signature__name">$errors</span>
482
     = <span class="phpdocumentor-signature__default-value">array()</span></code>
483
 
484
 
485
        <section class="phpdocumentor-description"><p>Contains errors that can occur</p>
486
</section>
487
 
488
 
489
 
490
</article>
491
                    <article
492
        class="
493
            phpdocumentor-element
494
            -property
495
            -protected
496
                                                        "
497
>
498
    <h4 class="phpdocumentor-element__name" id="property_workingOn">
499
        $workingOn
500
        <a href="classes/Users.html#property_workingOn" class="headerlink"><i class="fas fa-link"></i></a>
501
        <span class="phpdocumentor-element__modifiers">
502
                                </span>
503
    </h4>
504
    <aside class="phpdocumentor-element-found-in">
505
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
506
    :
507
    <span class="phpdocumentor-element-found-in__line">128</span>
508
 
509
    </aside>
510
 
511
 
512
    <code class="phpdocumentor-code phpdocumentor-signature ">
513
    <span class="phpdocumentor-signature__visibility">protected</span>
514
        <span class="phpdocumentor-signature__type">array&lt;string|int, string&gt;</span>
515
    <span class="phpdocumentor-signature__name">$workingOn</span>
516
     = <span class="phpdocumentor-signature__default-value">array()</span></code>
517
 
518
 
519
        <section class="phpdocumentor-description"><p>During administration, contains the record being modified</p>
520
</section>
521
 
522
 
523
 
524
</article>
525
            </section>
526
 
527
            <section class="phpdocumentor-methods">
528
        <h3 class="phpdocumentor-elements__header" id="methods">
529
            Methods
530
            <a href="classes/Users.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
531
        </h3>
532
                    <article
533
        class="phpdocumentor-element
534
            -method
535
            -public
536
                                                        "
537
>
538
    <h4 class="phpdocumentor-element__name" id="method___construct">
539
        __construct()
540
        <a href="classes/Users.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
541
    </h4>
542
    <aside class="phpdocumentor-element-found-in">
543
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
544
    :
545
    <span class="phpdocumentor-element-found-in__line">138</span>
546
 
547
    </aside>
548
 
549
        <p class="phpdocumentor-summary">constructor for an instance of the class</p>
550
 
551
    <code class="phpdocumentor-code phpdocumentor-signature ">
552
    <span class="phpdocumentor-signature__visibility">public</span>
553
                <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$customFields</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">array()</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
554
 
555
        <section class="phpdocumentor-description"><p>Anything in $customFields will be recursively merged with $configuration, overwriting
556
as necessary.</p>
557
</section>
558
 
559
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
560
    <dl class="phpdocumentor-argument-list">
561
                    <dt class="phpdocumentor-argument-list__entry">
562
                <span class="phpdocumentor-signature__argument__name">$customFields</span>
563
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
564
                 = <span class="phpdocumentor-signature__argument__default-value">array()</span>            </dt>
565
            <dd class="phpdocumentor-argument-list__definition">
566
                    <section class="phpdocumentor-description"><p>array to merge into $configuration</p>
567
</section>
568
 
569
            </dd>
570
            </dl>
571
 
572
 
573
 
574
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
575
    <span class="phpdocumentor-signature__response_type">mixed</span>
576
            &mdash;
577
 
578
 
579
</article>
580
                    <article
581
        class="phpdocumentor-element
582
            -method
583
            -public
584
                                                        "
585
>
586
    <h4 class="phpdocumentor-element__name" id="method_admin">
587
        admin()
588
        <a href="classes/Users.html#method_admin" class="headerlink"><i class="fas fa-link"></i></a>
589
    </h4>
590
    <aside class="phpdocumentor-element-found-in">
591
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
592
    :
593
    <span class="phpdocumentor-element-found-in__line">502</span>
594
 
595
    </aside>
596
 
597
        <p class="phpdocumentor-summary">Sets up the admin function which allows users to edit themselves and, optionally, others</p>
598
 
599
    <code class="phpdocumentor-code phpdocumentor-signature ">
600
    <span class="phpdocumentor-signature__visibility">public</span>
601
                <span class="phpdocumentor-signature__name">admin</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nextScript</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
602
 
603
        <section class="phpdocumentor-description"><p>This should be called the first time, then repeatedly called until it is done
604
(it returns the string &quot;Updated&quot;, &quot;Failed&quot; or &quot;No changes&quot;.</p>
605
<p>The first iteration returns an edit screen displaying the users
606
information for them to edit. It will display an HTML INPUT for
607
each field that is not restricted. The user can then edit the
608
chosen entries and press the button, which will call the script
609
again, and update the record.</p>
610
<p>If the user has the admin right, the Edit screen also displays a
611
list of all users as an unsigned list of anchors. If the user
612
clicks on one of those, it will choose that user, load their data
613
and allow the user to edit that users record. NOTE: this is the
614
only way to edit fields with the restrict flag set.</p>
615
</section>
616
 
617
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
618
    <dl class="phpdocumentor-argument-list">
619
                    <dt class="phpdocumentor-argument-list__entry">
620
                <span class="phpdocumentor-signature__argument__name">$connection</span>
621
                : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
622
                            </dt>
623
            <dd class="phpdocumentor-argument-list__definition">
624
                    <section class="phpdocumentor-description"><p>A connection to the data source</p>
625
</section>
626
 
627
            </dd>
628
                    <dt class="phpdocumentor-argument-list__entry">
629
                <span class="phpdocumentor-signature__argument__name">$nextScript</span>
630
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
631
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
632
            <dd class="phpdocumentor-argument-list__definition">
633
                    <section class="phpdocumentor-description"></section>
634
 
635
            </dd>
636
            </dl>
637
 
638
 
639
 
640
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
641
    <span class="phpdocumentor-signature__response_type">string</span>
642
            &mdash;
643
            <section class="phpdocumentor-description"><p>This may be an HTML table or a single screen</p>
644
</section>
645
 
646
 
647
</article>
648
                    <article
649
        class="phpdocumentor-element
650
            -method
651
            -public
652
                                                        "
653
>
654
    <h4 class="phpdocumentor-element__name" id="method_allUsersHTML">
655
        allUsersHTML()
656
        <a href="classes/Users.html#method_allUsersHTML" class="headerlink"><i class="fas fa-link"></i></a>
657
    </h4>
658
    <aside class="phpdocumentor-element-found-in">
659
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
660
    :
661
    <span class="phpdocumentor-element-found-in__line">247</span>
662
 
663
    </aside>
664
 
665
        <p class="phpdocumentor-summary">Get all users from data source and put them in an HTML list</p>
666
 
667
    <code class="phpdocumentor-code phpdocumentor-signature ">
668
    <span class="phpdocumentor-signature__visibility">public</span>
669
                <span class="phpdocumentor-signature__name">allUsersHTML</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nextPage</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
670
 
671
        <section class="phpdocumentor-description"><p>Will retrieve the ID and login name of all users, putting them
672
in a list of anchors to allow an admin to select one for editing</p>
673
</section>
674
 
675
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
676
    <dl class="phpdocumentor-argument-list">
677
                    <dt class="phpdocumentor-argument-list__entry">
678
                <span class="phpdocumentor-signature__argument__name">$connection</span>
679
                : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
680
                            </dt>
681
            <dd class="phpdocumentor-argument-list__definition">
682
                    <section class="phpdocumentor-description"><p>A connection to the data source</p>
683
</section>
684
 
685
            </dd>
686
                    <dt class="phpdocumentor-argument-list__entry">
687
                <span class="phpdocumentor-signature__argument__name">$nextPage</span>
688
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
689
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
690
            <dd class="phpdocumentor-argument-list__definition">
691
                    <section class="phpdocumentor-description"><p>The URL of the page to be used in the link</p>
692
</section>
693
 
694
            </dd>
695
            </dl>
696
 
697
 
698
 
699
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
700
    <span class="phpdocumentor-signature__response_type">string</span>
701
            &mdash;
702
            <section class="phpdocumentor-description"><p>an unordered list (UL) containing links with names</p>
703
</section>
704
 
705
 
706
</article>
707
                    <article
708
        class="phpdocumentor-element
709
            -method
710
            -public
711
                                                        "
712
>
713
    <h4 class="phpdocumentor-element__name" id="method_clearErrors">
714
        clearErrors()
715
        <a href="classes/Users.html#method_clearErrors" class="headerlink"><i class="fas fa-link"></i></a>
716
    </h4>
717
    <aside class="phpdocumentor-element-found-in">
718
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
719
    :
720
    <span class="phpdocumentor-element-found-in__line">157</span>
721
 
722
    </aside>
723
 
724
        <p class="phpdocumentor-summary">clears the errors array</p>
725
 
726
    <code class="phpdocumentor-code phpdocumentor-signature ">
727
    <span class="phpdocumentor-signature__visibility">public</span>
728
                <span class="phpdocumentor-signature__name">clearErrors</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
729
 
730
 
731
 
732
 
733
 
734
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
735
    <span class="phpdocumentor-signature__response_type">mixed</span>
736
            &mdash;
737
 
738
 
739
</article>
740
                    <article
741
        class="phpdocumentor-element
742
            -method
743
            -public
744
                                                        "
745
>
746
    <h4 class="phpdocumentor-element__name" id="method_editScreen">
747
        editScreen()
748
        <a href="classes/Users.html#method_editScreen" class="headerlink"><i class="fas fa-link"></i></a>
749
    </h4>
750
    <aside class="phpdocumentor-element-found-in">
751
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
752
    :
753
    <span class="phpdocumentor-element-found-in__line">379</span>
754
 
755
    </aside>
756
 
757
        <p class="phpdocumentor-summary">Creates an edit screen for display to user</p>
758
 
759
    <code class="phpdocumentor-code phpdocumentor-signature ">
760
    <span class="phpdocumentor-signature__visibility">public</span>
761
                <span class="phpdocumentor-signature__name">editScreen</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
762
 
763
        <section class="phpdocumentor-description"><p>This function will create an edit screen which, when displayed to
764
the user, allows them to edit a users record. The record is stored
765
in $this-&gt;workingOn</p>
766
<p>Function will go through each field in the users table and call makeHTMLField
767
for it, unless the field is restricted and the user is editing their own
768
entry. It will also create a hidden input field with the users ID</p>
769
<p>NOTE: this will not create the form; the form is created someplace else</p>
770
</section>
771
 
772
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
773
    <dl class="phpdocumentor-argument-list">
774
                    <dt class="phpdocumentor-argument-list__entry">
775
                <span class="phpdocumentor-signature__argument__name">$connection</span>
776
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
777
                            </dt>
778
            <dd class="phpdocumentor-argument-list__definition">
779
                    <section class="phpdocumentor-description"></section>
780
 
781
            </dd>
782
            </dl>
783
 
784
 
785
 
786
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
787
    <span class="phpdocumentor-signature__response_type">string</span>
788
            &mdash;
789
            <section class="phpdocumentor-description"><p>HTML containing all of the INPUT records a user can edit</p>
790
</section>
791
 
792
 
793
</article>
794
                    <article
795
        class="phpdocumentor-element
796
            -method
797
            -public
798
                                                        "
799
>
800
    <h4 class="phpdocumentor-element__name" id="method_errors">
801
        errors()
802
        <a href="classes/Users.html#method_errors" class="headerlink"><i class="fas fa-link"></i></a>
803
    </h4>
804
    <aside class="phpdocumentor-element-found-in">
805
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
806
    :
807
    <span class="phpdocumentor-element-found-in__line">149</span>
808
 
809
    </aside>
810
 
811
        <p class="phpdocumentor-summary">getter for $this-&gt;errors</p>
812
 
813
    <code class="phpdocumentor-code phpdocumentor-signature ">
814
    <span class="phpdocumentor-signature__visibility">public</span>
815
                <span class="phpdocumentor-signature__name">errors</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
816
 
817
 
818
 
819
 
820
 
821
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
822
    <span class="phpdocumentor-signature__response_type">string</span>
823
            &mdash;
824
            <section class="phpdocumentor-description"><p>html div containing one paragraph for every error</p>
825
</section>
826
 
827
 
828
</article>
829
                    <article
830
        class="phpdocumentor-element
831
            -method
832
            -public
833
                                                        "
834
>
835
    <h4 class="phpdocumentor-element__name" id="method_HTML">
836
        HTML()
837
        <a href="classes/Users.html#method_HTML" class="headerlink"><i class="fas fa-link"></i></a>
838
    </h4>
839
    <aside class="phpdocumentor-element-found-in">
840
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
841
    :
842
    <span class="phpdocumentor-element-found-in__line">191</span>
843
 
844
    </aside>
845
 
846
        <p class="phpdocumentor-summary">Main display function.</p>
847
 
848
    <code class="phpdocumentor-code phpdocumentor-signature ">
849
    <span class="phpdocumentor-signature__visibility">public</span>
850
                <span class="phpdocumentor-signature__name">HTML</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nextScript</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
851
 
852
        <section class="phpdocumentor-description"><p>This function should be called to perform the login. It performs all functions
853
needed to log in and validate, but once logged in, will return an empty string.</p>
854
</section>
855
 
856
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
857
    <dl class="phpdocumentor-argument-list">
858
                    <dt class="phpdocumentor-argument-list__entry">
859
                <span class="phpdocumentor-signature__argument__name">$connection</span>
860
                : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
861
                            </dt>
862
            <dd class="phpdocumentor-argument-list__definition">
863
                    <section class="phpdocumentor-description"><p>A connection to the data source</p>
864
</section>
865
 
866
            </dd>
867
                    <dt class="phpdocumentor-argument-list__entry">
868
                <span class="phpdocumentor-signature__argument__name">$nextScript</span>
869
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
870
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
871
            <dd class="phpdocumentor-argument-list__definition">
872
                    <section class="phpdocumentor-description"><p>The url to be run when logged in</p>
873
</section>
874
 
875
            </dd>
876
            </dl>
877
 
878
 
879
 
880
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
881
    <span class="phpdocumentor-signature__response_type">string</span>
882
            &mdash;
883
            <section class="phpdocumentor-description"><p>A (possibly empty) HTML div</p>
884
</section>
885
 
886
 
887
</article>
888
                    <article
889
        class="phpdocumentor-element
890
            -method
891
            -public
892
                                                        "
893
>
894
    <h4 class="phpdocumentor-element__name" id="method_isAdmin">
895
        isAdmin()
896
        <a href="classes/Users.html#method_isAdmin" class="headerlink"><i class="fas fa-link"></i></a>
897
    </h4>
898
    <aside class="phpdocumentor-element-found-in">
899
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
900
    :
901
    <span class="phpdocumentor-element-found-in__line">166</span>
902
 
903
    </aside>
904
 
905
        <p class="phpdocumentor-summary">getter for isAdmin</p>
906
 
907
    <code class="phpdocumentor-code phpdocumentor-signature ">
908
    <span class="phpdocumentor-signature__visibility">public</span>
909
                <span class="phpdocumentor-signature__name">isAdmin</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
910
 
911
 
912
 
913
 
914
 
915
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
916
    <span class="phpdocumentor-signature__response_type">bool</span>
917
            &mdash;
918
            <section class="phpdocumentor-description"><p>true if user is an admin, false if not</p>
919
</section>
920
 
921
 
922
</article>
923
                    <article
924
        class="phpdocumentor-element
925
            -method
926
            -public
927
                                                        "
928
>
929
    <h4 class="phpdocumentor-element__name" id="method_logOut">
930
        logOut()
931
        <a href="classes/Users.html#method_logOut" class="headerlink"><i class="fas fa-link"></i></a>
932
    </h4>
933
    <aside class="phpdocumentor-element-found-in">
934
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
935
    :
936
    <span class="phpdocumentor-element-found-in__line">271</span>
937
 
938
    </aside>
939
 
940
        <p class="phpdocumentor-summary">Logs user out of system</p>
941
 
942
    <code class="phpdocumentor-code phpdocumentor-signature ">
943
    <span class="phpdocumentor-signature__visibility">public</span>
944
                <span class="phpdocumentor-signature__name">logOut</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nextScript</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
945
 
946
        <section class="phpdocumentor-description"><p>destroys itself ($_SESSION['user'], then session, then calls
947
$nextScript by doing a header call.</p>
948
</section>
949
 
950
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
951
    <dl class="phpdocumentor-argument-list">
952
                    <dt class="phpdocumentor-argument-list__entry">
953
                <span class="phpdocumentor-signature__argument__name">$nextScript</span>
954
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
955
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
956
            <dd class="phpdocumentor-argument-list__definition">
957
                    <section class="phpdocumentor-description"><p>URL of next script to call</p>
958
</section>
959
 
960
            </dd>
961
            </dl>
962
 
963
 
964
 
965
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
966
    <span class="phpdocumentor-signature__response_type">mixed</span>
967
            &mdash;
968
 
969
 
970
</article>
971
                    <article
972
        class="phpdocumentor-element
973
            -method
974
            -public
975
                                                        "
976
>
977
    <h4 class="phpdocumentor-element__name" id="method_name">
978
        name()
979
        <a href="classes/Users.html#method_name" class="headerlink"><i class="fas fa-link"></i></a>
980
    </h4>
981
    <aside class="phpdocumentor-element-found-in">
982
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
983
    :
984
    <span class="phpdocumentor-element-found-in__line">175</span>
985
 
986
    </aside>
987
 
988
        <p class="phpdocumentor-summary">getter for login name</p>
989
 
990
    <code class="phpdocumentor-code phpdocumentor-signature ">
991
    <span class="phpdocumentor-signature__visibility">public</span>
992
                <span class="phpdocumentor-signature__name">name</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
993
 
994
 
995
 
996
 
997
 
998
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
999
    <span class="phpdocumentor-signature__response_type">string</span>
1000
            &mdash;
1001
            <section class="phpdocumentor-description"><p>user name</p>
1002
</section>
1003
 
1004
 
1005
</article>
1006
                    <article
1007
        class="phpdocumentor-element
1008
            -method
1009
            -protected
1010
                                                        "
1011
>
1012
    <h4 class="phpdocumentor-element__name" id="method_addEdit">
1013
        addEdit()
1014
        <a href="classes/Users.html#method_addEdit" class="headerlink"><i class="fas fa-link"></i></a>
1015
    </h4>
1016
    <aside class="phpdocumentor-element-found-in">
1017
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1018
    :
1019
    <span class="phpdocumentor-element-found-in__line">422</span>
1020
 
1021
    </aside>
1022
 
1023
 
1024
    <code class="phpdocumentor-code phpdocumentor-signature ">
1025
    <span class="phpdocumentor-signature__visibility">protected</span>
1026
                <span class="phpdocumentor-signature__name">addEdit</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
1027
 
1028
        <section class="phpdocumentor-description"></section>
1029
 
1030
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1031
    <dl class="phpdocumentor-argument-list">
1032
                    <dt class="phpdocumentor-argument-list__entry">
1033
                <span class="phpdocumentor-signature__argument__name">$connection</span>
1034
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1035
                            </dt>
1036
            <dd class="phpdocumentor-argument-list__definition">
1037
                    <section class="phpdocumentor-description"></section>
1038
 
1039
            </dd>
1040
            </dl>
1041
 
1042
 
1043
 
1044
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1045
    <span class="phpdocumentor-signature__response_type">mixed</span>
1046
            &mdash;
1047
 
1048
 
1049
</article>
1050
                    <article
1051
        class="phpdocumentor-element
1052
            -method
1053
            -protected
1054
                                                        "
1055
>
1056
    <h4 class="phpdocumentor-element__name" id="method_emptyWorkingOn">
1057
        emptyWorkingOn()
1058
        <a href="classes/Users.html#method_emptyWorkingOn" class="headerlink"><i class="fas fa-link"></i></a>
1059
    </h4>
1060
    <aside class="phpdocumentor-element-found-in">
1061
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1062
    :
1063
    <span class="phpdocumentor-element-found-in__line">401</span>
1064
 
1065
    </aside>
1066
 
1067
        <p class="phpdocumentor-summary">Creates a variable designed to replace $this-&gt;workingOn</p>
1068
 
1069
    <code class="phpdocumentor-code phpdocumentor-signature ">
1070
    <span class="phpdocumentor-signature__visibility">protected</span>
1071
                <span class="phpdocumentor-signature__name">emptyWorkingOn</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span></code>
1072
 
1073
        <section class="phpdocumentor-description"><p>Initializes all fields to something non-null and sets id to -1</p>
1074
</section>
1075
 
1076
 
1077
 
1078
 
1079
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1080
    <span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span>
1081
            &mdash;
1082
            <section class="phpdocumentor-description"><p>An array initialized with all records needed</p>
1083
</section>
1084
 
1085
 
1086
</article>
1087
                    <article
1088
        class="phpdocumentor-element
1089
            -method
1090
            -protected
1091
                                                        "
1092
>
1093
    <h4 class="phpdocumentor-element__name" id="method_getNextScript">
1094
        getNextScript()
1095
        <a href="classes/Users.html#method_getNextScript" class="headerlink"><i class="fas fa-link"></i></a>
1096
    </h4>
1097
    <aside class="phpdocumentor-element-found-in">
1098
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1099
    :
1100
    <span class="phpdocumentor-element-found-in__line">289</span>
1101
 
1102
    </aside>
1103
 
1104
        <p class="phpdocumentor-summary">Simple helper script to calculate next script to call</p>
1105
 
1106
    <code class="phpdocumentor-code phpdocumentor-signature ">
1107
    <span class="phpdocumentor-signature__visibility">protected</span>
1108
                <span class="phpdocumentor-signature__name">getNextScript</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nextScript</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
1109
 
1110
        <section class="phpdocumentor-description"><p>Returns one of three URL strings, in order of precedence
1111
$nextScript
1112
$configuration['screens']['validateScript']
1113
PHP_SELF</p>
1114
</section>
1115
 
1116
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1117
    <dl class="phpdocumentor-argument-list">
1118
                    <dt class="phpdocumentor-argument-list__entry">
1119
                <span class="phpdocumentor-signature__argument__name">$nextScript</span>
1120
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1121
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
1122
            <dd class="phpdocumentor-argument-list__definition">
1123
                    <section class="phpdocumentor-description"><p>URL to call</p>
1124
</section>
1125
 
1126
            </dd>
1127
            </dl>
1128
 
1129
 
1130
 
1131
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1132
    <span class="phpdocumentor-signature__response_type">string</span>
1133
            &mdash;
1134
            <section class="phpdocumentor-description"><p>URL</p>
1135
</section>
1136
 
1137
 
1138
</article>
1139
                    <article
1140
        class="phpdocumentor-element
1141
            -method
1142
            -protected
1143
                                                        "
1144
>
1145
    <h4 class="phpdocumentor-element__name" id="method_initWorkingOn">
1146
        initWorkingOn()
1147
        <a href="classes/Users.html#method_initWorkingOn" class="headerlink"><i class="fas fa-link"></i></a>
1148
    </h4>
1149
    <aside class="phpdocumentor-element-found-in">
1150
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1151
    :
1152
    <span class="phpdocumentor-element-found-in__line">467</span>
1153
 
1154
    </aside>
1155
 
1156
 
1157
    <code class="phpdocumentor-code phpdocumentor-signature ">
1158
    <span class="phpdocumentor-signature__visibility">protected</span>
1159
                <span class="phpdocumentor-signature__name">initWorkingOn</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$id</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
1160
 
1161
        <section class="phpdocumentor-description"></section>
1162
 
1163
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1164
    <dl class="phpdocumentor-argument-list">
1165
                    <dt class="phpdocumentor-argument-list__entry">
1166
                <span class="phpdocumentor-signature__argument__name">$connection</span>
1167
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1168
                            </dt>
1169
            <dd class="phpdocumentor-argument-list__definition">
1170
                    <section class="phpdocumentor-description"></section>
1171
 
1172
            </dd>
1173
                    <dt class="phpdocumentor-argument-list__entry">
1174
                <span class="phpdocumentor-signature__argument__name">$id</span>
1175
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1176
                            </dt>
1177
            <dd class="phpdocumentor-argument-list__definition">
1178
                    <section class="phpdocumentor-description"></section>
1179
 
1180
            </dd>
1181
            </dl>
1182
 
1183
 
1184
 
1185
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1186
    <span class="phpdocumentor-signature__response_type">mixed</span>
1187
            &mdash;
1188
 
1189
 
1190
</article>
1191
                    <article
1192
        class="phpdocumentor-element
1193
            -method
1194
            -protected
1195
                                                        "
1196
>
1197
    <h4 class="phpdocumentor-element__name" id="method_logInScreen">
1198
        logInScreen()
1199
        <a href="classes/Users.html#method_logInScreen" class="headerlink"><i class="fas fa-link"></i></a>
1200
    </h4>
1201
    <aside class="phpdocumentor-element-found-in">
1202
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1203
    :
1204
    <span class="phpdocumentor-element-found-in__line">307</span>
1205
 
1206
    </aside>
1207
 
1208
        <p class="phpdocumentor-summary">Creates the fields needed for a login screen</p>
1209
 
1210
    <code class="phpdocumentor-code phpdocumentor-signature ">
1211
    <span class="phpdocumentor-signature__visibility">protected</span>
1212
                <span class="phpdocumentor-signature__name">logInScreen</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nextScript</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
1213
 
1214
        <section class="phpdocumentor-description"><p>Populates %s's in 'login form' with values for $nextScript and
1215
'loginScreen'</p>
1216
</section>
1217
 
1218
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1219
    <dl class="phpdocumentor-argument-list">
1220
                    <dt class="phpdocumentor-argument-list__entry">
1221
                <span class="phpdocumentor-signature__argument__name">$nextScript</span>
1222
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1223
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
1224
            <dd class="phpdocumentor-argument-list__definition">
1225
                    <section class="phpdocumentor-description"><p>URL to call form</p>
1226
</section>
1227
 
1228
            </dd>
1229
            </dl>
1230
 
1231
 
1232
 
1233
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1234
    <span class="phpdocumentor-signature__response_type">string</span>
1235
            &mdash;
1236
            <section class="phpdocumentor-description"><p>HTML code for display</p>
1237
</section>
1238
 
1239
 
1240
</article>
1241
                    <article
1242
        class="phpdocumentor-element
1243
            -method
1244
            -protected
1245
                                                        "
1246
>
1247
    <h4 class="phpdocumentor-element__name" id="method_makeHTMLField">
1248
        makeHTMLField()
1249
        <a href="classes/Users.html#method_makeHTMLField" class="headerlink"><i class="fas fa-link"></i></a>
1250
    </h4>
1251
    <aside class="phpdocumentor-element-found-in">
1252
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1253
    :
1254
    <span class="phpdocumentor-element-found-in__line">339</span>
1255
 
1256
    </aside>
1257
 
1258
        <p class="phpdocumentor-summary">Creates an HTML field for display</p>
1259
 
1260
    <code class="phpdocumentor-code phpdocumentor-signature ">
1261
    <span class="phpdocumentor-signature__visibility">protected</span>
1262
                <span class="phpdocumentor-signature__name">makeHTMLField</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$field</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$record</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
1263
 
1264
        <section class="phpdocumentor-description"><p>Retrieves the template for the record type, then populates it from
1265
$record, $value and $field. The template MUST have %s's in the
1266
following order for an HTML INPUT field
1267
label=
1268
name=
1269
title=
1270
placeholder=
1271
value</p>
1272
<p>Knows how to handle INPUT types TEXT, TEXTAREA, PASSWORD and
1273
special html type boolean, which is checkboxes.</p>
1274
</section>
1275
 
1276
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1277
    <dl class="phpdocumentor-argument-list">
1278
                    <dt class="phpdocumentor-argument-list__entry">
1279
                <span class="phpdocumentor-signature__argument__name">$field</span>
1280
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1281
                            </dt>
1282
            <dd class="phpdocumentor-argument-list__definition">
1283
                    <section class="phpdocumentor-description"><p>name of the field to populate</p>
1284
</section>
1285
 
1286
            </dd>
1287
                    <dt class="phpdocumentor-argument-list__entry">
1288
                <span class="phpdocumentor-signature__argument__name">$record</span>
1289
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
1290
                            </dt>
1291
            <dd class="phpdocumentor-argument-list__definition">
1292
                    <section class="phpdocumentor-description"><p>Record from $configuration[...][fields]</p>
1293
</section>
1294
 
1295
            </dd>
1296
                    <dt class="phpdocumentor-argument-list__entry">
1297
                <span class="phpdocumentor-signature__argument__name">$value</span>
1298
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1299
                            </dt>
1300
            <dd class="phpdocumentor-argument-list__definition">
1301
                    <section class="phpdocumentor-description"><p>the current value to put in INPUT</p>
1302
</section>
1303
 
1304
            </dd>
1305
            </dl>
1306
 
1307
 
1308
 
1309
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1310
    <span class="phpdocumentor-signature__response_type">string</span>
1311
            &mdash;
1312
            <section class="phpdocumentor-description"><p>An HTML INPUT entity</p>
1313
</section>
1314
 
1315
 
1316
</article>
1317
                    <article
1318
        class="phpdocumentor-element
1319
            -method
1320
            -protected
1321
                                                        "
1322
>
1323
    <h4 class="phpdocumentor-element__name" id="method_validate">
1324
        validate()
1325
        <a href="classes/Users.html#method_validate" class="headerlink"><i class="fas fa-link"></i></a>
1326
    </h4>
1327
    <aside class="phpdocumentor-element-found-in">
1328
    <abbr class="phpdocumentor-element-found-in__file" title="Users.class.php"><a href="files/users-class.html"><abbr title="Users.class.php">Users.class.php</abbr></a></abbr>
1329
    :
1330
    <span class="phpdocumentor-element-found-in__line">217</span>
1331
 
1332
    </aside>
1333
 
1334
        <p class="phpdocumentor-summary">Validates a connection and, on success, populates $data</p>
1335
 
1336
    <code class="phpdocumentor-code phpdocumentor-signature ">
1337
    <span class="phpdocumentor-signature__visibility">protected</span>
1338
                <span class="phpdocumentor-signature__name">validate</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$username</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$password</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
1339
 
1340
        <section class="phpdocumentor-description"><p>Function will validate the username and password passed in, using
1341
data connection $connection. On success, populates class member $data
1342
with the values from the database (only those listed in $configuration)</p>
1343
<p>On Failure, appends $error with a failure string</p>
1344
</section>
1345
 
1346
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1347
    <dl class="phpdocumentor-argument-list">
1348
                    <dt class="phpdocumentor-argument-list__entry">
1349
                <span class="phpdocumentor-signature__argument__name">$username</span>
1350
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1351
                            </dt>
1352
            <dd class="phpdocumentor-argument-list__definition">
1353
                    <section class="phpdocumentor-description"><p>The username to be matched in database</p>
1354
</section>
1355
 
1356
            </dd>
1357
                    <dt class="phpdocumentor-argument-list__entry">
1358
                <span class="phpdocumentor-signature__argument__name">$password</span>
1359
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1360
                            </dt>
1361
            <dd class="phpdocumentor-argument-list__definition">
1362
                    <section class="phpdocumentor-description"><p>The password (unencrypted) the user entered</p>
1363
</section>
1364
 
1365
            </dd>
1366
                    <dt class="phpdocumentor-argument-list__entry">
1367
                <span class="phpdocumentor-signature__argument__name">$connection</span>
1368
                : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
1369
                            </dt>
1370
            <dd class="phpdocumentor-argument-list__definition">
1371
                    <section class="phpdocumentor-description"><p>A connection to the data source</p>
1372
</section>
1373
 
1374
            </dd>
1375
            </dl>
1376
 
1377
 
1378
 
1379
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1380
    <span class="phpdocumentor-signature__response_type">mixed</span>
1381
            &mdash;
1382
 
1383
 
1384
</article>
1385
            </section>
1386
 
1387
 
1388
    <script type="text/javascript">
1389
        function loadExternalCodeSnippets(line) {
1390
            Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
1391
                var src = pre.getAttribute('data-src').replace( /\\/g, '/');
1392
                var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
1393
                var language = 'php';
1394
 
1395
                var code = document.createElement('code');
1396
                code.className = 'language-' + language;
1397
 
1398
                pre.textContent = '';
1399
 
1400
                pre.setAttribute('data-line', line)
1401
                code.textContent = 'Loading…';
1402
 
1403
                pre.appendChild(code);
1404
 
1405
                var xhr = new XMLHttpRequest();
1406
 
1407
                xhr.open('GET', src, true);
1408
 
1409
                xhr.onreadystatechange = function () {
1410
                    if (xhr.readyState == 4) {
1411
 
1412
                        if (xhr.status < 400 && xhr.responseText) {
1413
                            code.textContent = xhr.responseText;
1414
 
1415
                            Prism.highlightElement(code);
1416
                        }
1417
                        else if (xhr.status >= 400) {
1418
                            code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
1419
                        }
1420
                        else {
1421
                            code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
1422
                        }
1423
                    }
1424
                };
1425
 
1426
                xhr.send(null);
1427
            });
1428
        }
1429
 
1430
        var modals = document.querySelectorAll("[data-modal]");
1431
 
1432
        modals.forEach(function (trigger) {
1433
            trigger.addEventListener("click", function (event) {
1434
                //event.preventDefault();
1435
                const modal = document.getElementById(trigger.dataset.modal);
1436
                modal.classList.add("phpdocumentor-modal__open");
1437
                loadExternalCodeSnippets(trigger.dataset.line)
1438
                const exits = modal.querySelectorAll("[data-exit-button]");
1439
                exits.forEach(function (exit) {
1440
                    exit.addEventListener("click", function (event) {
1441
                        event.preventDefault();
1442
                        modal.classList.remove("phpdocumentor-modal__open");
1443
                    });
1444
                });
1445
            });
1446
        });
1447
    </script>
1448
 
1449
    </article>
1450
                <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
1451
    <section class="phpdocumentor-search-results__dialog">
1452
        <header class="phpdocumentor-search-results__header">
1453
            <h2 class="phpdocumentor-search-results__title">Search results</h2>
1454
            <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
1455
        </header>
1456
        <section class="phpdocumentor-search-results__body">
1457
            <ul class="phpdocumentor-search-results__entries"></ul>
1458
        </section>
1459
    </section>
1460
</section>
1461
            </div>
1462
        </div>
1463
        <a href="classes/Users.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
1464
 
1465
    </main>
1466
 
1467
    <script>
1468
        cssVars({});
1469
    </script>
1470
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
1471
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
1472
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
1473
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
1474
</body>
1475
</html>