Blame | Last modification | View Log | Download | RSS feed
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Documentation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../">
<link rel="icon" href="images/favicon.ico"/>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/base.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/template.css">
<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" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/search.js"></script>
<script defer src="js/searchIndex.js"></script>
</head>
<body id="top">
<header class="phpdocumentor-header phpdocumentor-section">
<h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
<label class="phpdocumentor-header__menu-icon" for="menu-button">
<i class="fas fa-bars"></i>
</label>
<section data-search-form class="phpdocumentor-search">
<label>
<span class="visually-hidden">Search for</span>
<svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
<line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
</svg>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
</label>
</section>
<nav class="phpdocumentor-topnav">
<ul class="phpdocumentor-topnav__menu">
</ul>
</nav>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
<input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
Menu
</label>
<aside class="phpdocumentor-column -four phpdocumentor-sidebar">
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="packages/Application.html"><abbr title="\Application">Application</abbr></a></h3>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
<h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
</section>
<section class="phpdocumentor-sidebar__category">
<h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
<h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
</section>
</aside>
<div class="phpdocumentor-column -eight phpdocumentor-content">
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
</ul>
<article class="phpdocumentor-element -class">
<h2 class="phpdocumentor-content__title">
Users
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
<li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
</ul>
</div>
</h2>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">57</span>
</aside>
<p class="phpdocumentor-summary">User Login class</p>
<section class="phpdocumentor-description"><p>IMPORTANT: Requires a data source. See UsersDataSourceMySQLi.class.php
for code which provides this for MySQLi</p>
<p>Users encapsulates a basic login and authentication package. It
provides a login screen, authentication, the ability to edit oneself,
and for users with the admin flag set, the ability to edit others.</p>
<p>It also allows a user to be disabled.</p>
<p>Users was designed to be extensible, adding new fields by the calling
program, modifying the HTML elements, etc...</p>
</section>
<h5 class="phpdocumentor-tag-list__heading" id="tags">
Tags
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
</h5>
<dl class="phpdocumentor-tag-list">
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">author</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>R. W. Rodolico <a href="mailto:rodo@unixservertech.com">rodo@unixservertech.com</a></p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">version</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<span class="phpdocumentor-tag-link">0.9.0</span>
<section class="phpdocumentor-description"><p>(beta)</p>
</section>
</dd>
<dt class="phpdocumentor-tag-list__entry">
<span class="phpdocumentor-tag__name">copyright</span>
</dt>
<dd class="phpdocumentor-tag-list__definition">
<section class="phpdocumentor-description"><p>2021 Daily Data, Inc.</p>
</section>
</dd>
</dl>
<h3 id="toc">
Table of Contents
<a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<dl class="phpdocumentor-table-of-contents">
<dt class="phpdocumentor-table-of-contents__entry -property -protected">
<a href="classes/Users.html#property_configuration">$configuration</a>
<span>
: array<string|int, string> </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -property -protected">
<a href="classes/Users.html#property_data">$data</a>
<span>
: array<string|int, string> </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -property -protected">
<a href="classes/Users.html#property_errors">$errors</a>
<span>
: array<string|int, string> </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -property -protected">
<a href="classes/Users.html#property_workingOn">$workingOn</a>
<span>
: array<string|int, string> </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method___construct">__construct()</a>
<span>
: mixed </span>
</dt>
<dd>constructor for an instance of the class</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_admin">admin()</a>
<span>
: string </span>
</dt>
<dd>Sets up the admin function which allows users to edit themselves and, optionally, others</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_allUsersHTML">allUsersHTML()</a>
<span>
: string </span>
</dt>
<dd>Get all users from data source and put them in an HTML list</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_clearErrors">clearErrors()</a>
<span>
: mixed </span>
</dt>
<dd>clears the errors array</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_editScreen">editScreen()</a>
<span>
: string </span>
</dt>
<dd>Creates an edit screen for display to user</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_errors">errors()</a>
<span>
: string </span>
</dt>
<dd>getter for $this->errors</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_HTML">HTML()</a>
<span>
: string </span>
</dt>
<dd>Main display function.</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_isAdmin">isAdmin()</a>
<span>
: bool </span>
</dt>
<dd>getter for isAdmin</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_logOut">logOut()</a>
<span>
: mixed </span>
</dt>
<dd>Logs user out of system</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -public">
<a href="classes/Users.html#method_name">name()</a>
<span>
: string </span>
</dt>
<dd>getter for login name</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_addEdit">addEdit()</a>
<span>
: mixed </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_emptyWorkingOn">emptyWorkingOn()</a>
<span>
: array<string|int, string> </span>
</dt>
<dd>Creates a variable designed to replace $this->workingOn</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_getNextScript">getNextScript()</a>
<span>
: string </span>
</dt>
<dd>Simple helper script to calculate next script to call</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_initWorkingOn">initWorkingOn()</a>
<span>
: mixed </span>
</dt>
<dd></dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_logInScreen">logInScreen()</a>
<span>
: string </span>
</dt>
<dd>Creates the fields needed for a login screen</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_makeHTMLField">makeHTMLField()</a>
<span>
: string </span>
</dt>
<dd>Creates an HTML field for display</dd>
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
<a href="classes/Users.html#method_validate">validate()</a>
<span>
: mixed </span>
</dt>
<dd>Validates a connection and, on success, populates $data</dd>
</dl>
<section class="phpdocumentor-properties">
<h3 class="phpdocumentor-elements__header" id="properties">
Properties
<a href="classes/Users.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="
phpdocumentor-element
-property
-protected
"
>
<h4 class="phpdocumentor-element__name" id="property_configuration">
$configuration
<a href="classes/Users.html#property_configuration" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">64</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__type">array<string|int, string></span>
<span class="phpdocumentor-signature__name">$configuration</span>
= <span class="phpdocumentor-signature__default-value">array(
/*
* what to use for html input fields
* These are passed to sprintf, with label, fieldname, title, placeholder and current value, in that order
*/
'screens' => array('login form' => "<h1>Login</h1>
<form class='login_form' action='%s' method='post'>
%s
<input type='submit' value='Login'></form>
", 'edit form' => "<form class='login_form' action='%s' method='post'>
%s
<input type='submit' name='btnUpdate' value='Update'>
</form>", 'loginScreen' => "<div class='login_field'>
<input class='login_field' type='text' name='username' placeholder='Username' required autofocus>
</div>
<div class='login_field'>
<input class='login_field' type='password' name='password' placeholder='Password' required>
</div>", 'adminScreen' => "<input type='hidden' name='doAdmin' value='1'>
", 'validateScript' => ''),
'html input fields' => array('text' => "<div class='login_field'>
<label>%s
<input class='login_field' type='text' name='%s' title='%s' placeholder='%s' value='~~%s~~'>
</label>
</div>", 'password' => "<div class='login_field'>
<label>%s
<input class='login_field' type='password' name='%s' title='%s' placeholder='%s'>
</label>
</div>", 'boolean' => "<div class='login_field'>
<label>%s
<input class='login_field' type='checkbox' name='%s' title='%s' value='1' %s ~~%s~~>
</label>
</div>", 'textarea' => "<div class='login_field'>
<label>%s
<textarea class='login_field' name='%s' title='%s' placeholder='%s'>~~%s~~</textarea>
</label>
</div>"),
'input prefix' => 'admin_',
// prefix the name with this in a form
'tables' => array('users' => array(
'table' => '_users',
// table name for user records
'id' => '_user_id',
// ID column name
'display' => array(
// fields which are displayed to select
'login',
),
'form test' => 'login',
// field to test if form submitted
'fields' => array('login' => array(
'label' => 'Username',
// login name column name
'html type' => 'text',
'filter' => '/^[a-zA-Z0-9_]+$/',
'instructions' => 'Username can only contain alpha numerics and an underscore',
'hint' => 'Change User Name',
'unique' => rue,
), 'pass' => array(
'label' => 'Password',
// password column name
'html type' => 'password',
'instructions' => 'Leave blank to keep same password',
'hint' => 'Change Password',
), 'admin' => array('label' => 'isAdmin', 'html type' => 'boolean', 'restrict' => rue, 'instructions' => 'If checked, user w
ill be able to add/edit users'), 'enabled' => array('label' => 'Enabled', 'html type' => 'boolean', 'restrict' => rue, 'instructions' =>
'Uncheck to disable log in')),
)),
)</span></code>
<section class="phpdocumentor-description"><p>Contains the configuration for the class</p>
<p>May be modified by the calling program. Must be replicated in userDataSource class</p>
</section>
</article>
<article
class="
phpdocumentor-element
-property
-protected
"
>
<h4 class="phpdocumentor-element__name" id="property_data">
$data
<a href="classes/Users.html#property_data" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">124</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__type">array<string|int, string></span>
<span class="phpdocumentor-signature__name">$data</span>
= <span class="phpdocumentor-signature__default-value">array()</span></code>
<section class="phpdocumentor-description"><p>Contains the information for the current logged in user</p>
</section>
</article>
<article
class="
phpdocumentor-element
-property
-protected
"
>
<h4 class="phpdocumentor-element__name" id="property_errors">
$errors
<a href="classes/Users.html#property_errors" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">126</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__type">array<string|int, string></span>
<span class="phpdocumentor-signature__name">$errors</span>
= <span class="phpdocumentor-signature__default-value">array()</span></code>
<section class="phpdocumentor-description"><p>Contains errors that can occur</p>
</section>
</article>
<article
class="
phpdocumentor-element
-property
-protected
"
>
<h4 class="phpdocumentor-element__name" id="property_workingOn">
$workingOn
<a href="classes/Users.html#property_workingOn" class="headerlink"><i class="fas fa-link"></i></a>
<span class="phpdocumentor-element__modifiers">
</span>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">128</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__type">array<string|int, string></span>
<span class="phpdocumentor-signature__name">$workingOn</span>
= <span class="phpdocumentor-signature__default-value">array()</span></code>
<section class="phpdocumentor-description"><p>During administration, contains the record being modified</p>
</section>
</article>
</section>
<section class="phpdocumentor-methods">
<h3 class="phpdocumentor-elements__header" id="methods">
Methods
<a href="classes/Users.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method___construct">
__construct()
<a href="classes/Users.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">138</span>
</aside>
<p class="phpdocumentor-summary">constructor for an instance of the class</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">array<string|int, string> </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__respons
e_type">mixed</span></code>
<section class="phpdocumentor-description"><p>Anything in $customFields will be recursively merged with $configuration, overwriting
as necessary.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$customFields</span>
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
= <span class="phpdocumentor-signature__argument__default-value">array()</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>array to merge into $configuration</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
—
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_admin">
admin()
<a href="classes/Users.html#method_admin" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">502</span>
</aside>
<p class="phpdocumentor-summary">Sets up the admin function which allows users to edit themselves and, optionally, others</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<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">usersDataSou
rce</abbr></a> </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 </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>
<section class="phpdocumentor-description"><p>This should be called the first time, then repeatedly called until it is done
(it returns the string "Updated", "Failed" or "No changes".</p>
<p>The first iteration returns an edit screen displaying the users
information for them to edit. It will display an HTML INPUT for
each field that is not restricted. The user can then edit the
chosen entries and press the button, which will call the script
again, and update the record.</p>
<p>If the user has the admin right, the Edit screen also displays a
list of all users as an unsigned list of anchors. If the user
clicks on one of those, it will choose that user, load their data
and allow the user to edit that users record. NOTE: this is the
only way to edit fields with the restrict flag set.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>A connection to the data source</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$nextScript</span>
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"></section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>This may be an HTML table or a single screen</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_allUsersHTML">
allUsersHTML()
<a href="classes/Users.html#method_allUsersHTML" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">247</span>
</aside>
<p class="phpdocumentor-summary">Get all users from data source and put them in an HTML list</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<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">users
DataSource</abbr></a> </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 </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> : </s
pan><span class="phpdocumentor-signature__response_type">string</span></code>
<section class="phpdocumentor-description"><p>Will retrieve the ID and login name of all users, putting them
in a list of anchors to allow an admin to select one for editing</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>A connection to the data source</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$nextPage</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The URL of the page to be used in the link</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>an unordered list (UL) containing links with names</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_clearErrors">
clearErrors()
<a href="classes/Users.html#method_clearErrors" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">157</span>
</aside>
<p class="phpdocumentor-summary">clears the errors array</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">clearErrors</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
—
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_editScreen">
editScreen()
<a href="classes/Users.html#method_editScreen" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">379</span>
</aside>
<p class="phpdocumentor-summary">Creates an edit screen for display to user</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">editScreen</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$connection</span&g
t;</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
<section class="phpdocumentor-description"><p>This function will create an edit screen which, when displayed to
the user, allows them to edit a users record. The record is stored
in $this->workingOn</p>
<p>Function will go through each field in the users table and call makeHTMLField
for it, unless the field is restricted and the user is editing their own
entry. It will also create a hidden input field with the users ID</p>
<p>NOTE: this will not create the form; the form is created someplace else</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"></section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>HTML containing all of the INPUT records a user can edit</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_errors">
errors()
<a href="classes/Users.html#method_errors" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">149</span>
</aside>
<p class="phpdocumentor-summary">getter for $this->errors</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">errors</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>html div containing one paragraph for every error</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_HTML">
HTML()
<a href="classes/Users.html#method_HTML" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">191</span>
</aside>
<p class="phpdocumentor-summary">Main display function.</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<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">usersDataSour
ce</abbr></a> </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"><
/FONT>string </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>
<section class="phpdocumentor-description"><p>This function should be called to perform the login. It performs all functions
needed to log in and validate, but once logged in, will return an empty string.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>A connection to the data source</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$nextScript</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The url to be run when logged in</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>A (possibly empty) HTML div</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_isAdmin">
isAdmin()
<a href="classes/Users.html#method_isAdmin" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">166</span>
</aside>
<p class="phpdocumentor-summary">getter for isAdmin</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">isAdmin</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">bool</span>
—
<section class="phpdocumentor-description"><p>true if user is an admin, false if not</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_logOut">
logOut()
<a href="classes/Users.html#method_logOut" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">271</span>
</aside>
<p class="phpdocumentor-summary">Logs user out of system</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">logOut</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name"ONT>
>$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>
B></code>
<section class="phpdocumentor-description"><p>destroys itself ($_SESSION['user'], then session, then calls
$nextScript by doing a header call.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$nextScript</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>URL of next script to call</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
—
</article>
<article
class="phpdocumentor-element
-method
-public
"
>
<h4 class="phpdocumentor-element__name" id="method_name">
name()
<a href="classes/Users.html#method_name" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">175</span>
</aside>
<p class="phpdocumentor-summary">getter for login name</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">public</span>
<span class="phpdocumentor-signature__name">name</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>user name</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_addEdit">
addEdit()
<a href="classes/Users.html#method_addEdit" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">422</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">addEdit</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$connection</span><
/FONT></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<section class="phpdocumentor-description"></section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"></section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
—
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_emptyWorkingOn">
emptyWorkingOn()
<a href="classes/Users.html#method_emptyWorkingOn" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">401</span>
</aside>
<p class="phpdocumentor-summary">Creates a variable designed to replace $this->workingOn</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">emptyWorkingOn</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array<string|int, string></span></code>
<section class="phpdocumentor-description"><p>Initializes all fields to something non-null and sets id to -1</p>
</section>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">array<string|int, string></span>
—
<section class="phpdocumentor-description"><p>An array initialized with all records needed</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_getNextScript">
getNextScript()
<a href="classes/Users.html#method_getNextScript" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">289</span>
</aside>
<p class="phpdocumentor-summary">Simple helper script to calculate next script to call</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">getNextScript</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name&q
uot;>$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><
/FONT></code>
<section class="phpdocumentor-description"><p>Returns one of three URL strings, in order of precedence
$nextScript
$configuration['screens']['validateScript']
PHP_SELF</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$nextScript</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>URL to call</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>URL</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_initWorkingOn">
initWorkingOn()
<a href="classes/Users.html#method_initWorkingOn" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">467</span>
</aside>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">initWorkingOn</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$connection</spa
n></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$id</span></span><span>)</span>
<span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<section class="phpdocumentor-description"></section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"></section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$id</span>
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"></section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
—
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_logInScreen">
logInScreen()
<a href="classes/Users.html#method_logInScreen" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">307</span>
</aside>
<p class="phpdocumentor-summary">Creates the fields needed for a login screen</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">logInScreen</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name&quo
t;>$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>ONT>
</code>
<section class="phpdocumentor-description"><p>Populates %s's in 'login form' with values for $nextScript and
'loginScreen'</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$nextScript</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>URL to call form</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>HTML code for display</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_makeHTMLField">
makeHTMLField()
<a href="classes/Users.html#method_makeHTMLField" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">339</span>
</aside>
<p class="phpdocumentor-summary">Creates an HTML field for display</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">makeHTMLField</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </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<string|int, string> </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 </span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span>
<span class="phpdocumentor-signature__response_type">string</span></code>
<section class="phpdocumentor-description"><p>Retrieves the template for the record type, then populates it from
$record, $value and $field. The template MUST have %s's in the
following order for an HTML INPUT field
label=
name=
title=
placeholder=
value</p>
<p>Knows how to handle INPUT types TEXT, TEXTAREA, PASSWORD and
special html type boolean, which is checkboxes.</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$field</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>name of the field to populate</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$record</span>
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>Record from $configuration[...][fields]</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$value</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>the current value to put in INPUT</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">string</span>
—
<section class="phpdocumentor-description"><p>An HTML INPUT entity</p>
</section>
</article>
<article
class="phpdocumentor-element
-method
-protected
"
>
<h4 class="phpdocumentor-element__name" id="method_validate">
validate()
<a href="classes/Users.html#method_validate" class="headerlink"><i class="fas fa-link"></i></a>
</h4>
<aside class="phpdocumentor-element-found-in">
<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>
:
<span class="phpdocumentor-element-found-in__line">217</span>
</aside>
<p class="phpdocumentor-summary">Validates a connection and, on success, populates $data</p>
<code class="phpdocumentor-code phpdocumentor-signature ">
<span class="phpdocumentor-signature__visibility">protected</span>
<span class="phpdocumentor-signature__name">validate</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$username</span><
/FONT></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$password</span></span><span class="phpdocumentor-signature__argument"<
/FONT>><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a> </span><span class="phpdocumentor-signature__argument__name">
;$connection</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
<section class="phpdocumentor-description"><p>Function will validate the username and password passed in, using
data connection $connection. On success, populates class member $data
with the values from the database (only those listed in $configuration)</p>
<p>On Failure, appends $error with a failure string</p>
</section>
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
<dl class="phpdocumentor-argument-list">
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$username</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The username to be matched in database</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$password</span>
: <span class="phpdocumentor-signature__argument__return-type">string</span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>The password (unencrypted) the user entered</p>
</section>
</dd>
<dt class="phpdocumentor-argument-list__entry">
<span class="phpdocumentor-signature__argument__name">$connection</span>
: <span class="phpdocumentor-signature__argument__return-type"><a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a></span>
</dt>
<dd class="phpdocumentor-argument-list__definition">
<section class="phpdocumentor-description"><p>A connection to the data source</p>
</section>
</dd>
</dl>
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
<span class="phpdocumentor-signature__response_type">mixed</span>
—
</article>
</section>
<script type="text/javascript">
function loadExternalCodeSnippets(line) {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
var src = pre.getAttribute('data-src').replace( /\\/g, '/');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
pre.setAttribute('data-line', line)
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
}
}
};
xhr.send(null);
});
}
var modals = document.querySelectorAll("[data-modal]");
modals.forEach(function (trigger) {
trigger.addEventListener("click", function (event) {
//event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippets(trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
</script>
</article>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
<header class="phpdocumentor-search-results__header">
<h2 class="phpdocumentor-search-results__title">Search results</h2>
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
</header>
<section class="phpdocumentor-search-results__body">
<ul class="phpdocumentor-search-results__entries"></ul>
</section>
</section>
</section>
</div>
</div>
<a href="classes/Users.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
</main>
<script>
cssVars({});
</script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>
Generated by GNU Enscript 1.6.5.90.