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 |
usersPermissionsDataSourceMySQLi
|
|
|
86 |
|
|
|
87 |
<span class="phpdocumentor-element__extends">
|
|
|
88 |
extends <a href="classes/usersDataSourceMySQLi.html"><abbr title="\usersDataSourceMySQLi">usersDataSourceMySQLi</abbr></a>
|
|
|
89 |
</span>
|
|
|
90 |
|
|
|
91 |
<div class="phpdocumentor-element__package">
|
|
|
92 |
in package
|
|
|
93 |
<ul class="phpdocumentor-breadcrumbs">
|
|
|
94 |
<li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
|
|
|
95 |
</ul>
|
|
|
96 |
</div>
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
</h2>
|
|
|
100 |
|
|
|
101 |
<aside class="phpdocumentor-element-found-in">
|
|
|
102 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
103 |
:
|
|
|
104 |
<span class="phpdocumentor-element-found-in__line">67</span>
|
|
|
105 |
|
|
|
106 |
</aside>
|
|
|
107 |
|
|
|
108 |
<p class="phpdocumentor-summary">usersDataSource class</p>
|
|
|
109 |
|
|
|
110 |
<section class="phpdocumentor-description"><p>usersDataSource provides the data access capabilities for the Users
|
|
|
111 |
class.</p>
|
|
|
112 |
<p>To build a data access class for Users, the following 5 methods must
|
|
|
113 |
exist.
|
|
|
114 |
getPassword(username)
|
|
|
115 |
getAllUsers()
|
|
|
116 |
getARecord
|
|
|
117 |
update</p>
|
|
|
118 |
<p>Additionally, where appropriate, the following function is useful
|
|
|
119 |
buildTable()</p>
|
|
|
120 |
<p>This particular instance provides an interface to MySQL using
|
|
|
121 |
the mysqli libraries.</p>
|
|
|
122 |
<p>Create an instance of this, then pass the variable to several Users
|
|
|
123 |
calls.</p>
|
|
|
124 |
</section>
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
<h3 id="toc">
|
|
|
134 |
Table of Contents
|
|
|
135 |
<a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
136 |
</h3>
|
|
|
137 |
|
|
|
138 |
<dl class="phpdocumentor-table-of-contents">
|
|
|
139 |
<dt class="phpdocumentor-table-of-contents__entry -property -protected">
|
|
|
140 |
<a href="classes/usersDataSource.html#property_configuration">$configuration</a>
|
|
|
141 |
<span>
|
|
|
142 |
: array<string|int, string> </span>
|
|
|
143 |
</dt>
|
|
|
144 |
<dd></dd>
|
|
|
145 |
|
|
|
146 |
<dt class="phpdocumentor-table-of-contents__entry -property -protected">
|
|
|
147 |
<a href="classes/usersDataSourceMySQLi.html#property_dbConnection">$dbConnection</a>
|
|
|
148 |
<span>
|
|
|
149 |
: <abbr title="\mysqli">mysqli</abbr> </span>
|
|
|
150 |
</dt>
|
|
|
151 |
<dd></dd>
|
|
|
152 |
|
|
|
153 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
154 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method___construct">__construct()</a>
|
|
|
155 |
<span>
|
|
|
156 |
: null </span>
|
|
|
157 |
</dt>
|
|
|
158 |
<dd>extends usersDataSource</dd>
|
|
|
159 |
|
|
|
160 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
161 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_addPermission">addPermission()</a>
|
|
|
162 |
<span>
|
|
|
163 |
: mixed </span>
|
|
|
164 |
</dt>
|
|
|
165 |
<dd>Adds a permission to the permissions table</dd>
|
|
|
166 |
|
|
|
167 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
168 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_buildTable">buildTable()</a>
|
|
|
169 |
<span>
|
|
|
170 |
: mixed </span>
|
|
|
171 |
</dt>
|
|
|
172 |
<dd>Function will build tables when called</dd>
|
|
|
173 |
|
|
|
174 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
175 |
<a href="classes/usersDataSource.html#method_getAllUsers">getAllUsers()</a>
|
|
|
176 |
<span>
|
|
|
177 |
: array<string|int, string> </span>
|
|
|
178 |
</dt>
|
|
|
179 |
<dd>retrieves all users from the database</dd>
|
|
|
180 |
|
|
|
181 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
182 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_getARecord">getARecord()</a>
|
|
|
183 |
<span>
|
|
|
184 |
: array<string|int, string> </span>
|
|
|
185 |
</dt>
|
|
|
186 |
<dd>Get a record from the database</dd>
|
|
|
187 |
|
|
|
188 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
189 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_getFullPermissions">getFullPermissions()</a>
|
|
|
190 |
<span>
|
|
|
191 |
: mixed </span>
|
|
|
192 |
</dt>
|
|
|
193 |
<dd>Gets all permissions with names, group names, etc... from database</dd>
|
|
|
194 |
|
|
|
195 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
196 |
<a href="classes/usersDataSource.html#method_getPassword">getPassword()</a>
|
|
|
197 |
<span>
|
|
|
198 |
: array<string|int, string> </span>
|
|
|
199 |
</dt>
|
|
|
200 |
<dd>Retrieves the password field from table</dd>
|
|
|
201 |
|
|
|
202 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
203 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_getPermissions">getPermissions()</a>
|
|
|
204 |
<span>
|
|
|
205 |
: mixed </span>
|
|
|
206 |
</dt>
|
|
|
207 |
<dd>Gets permissions for one user</dd>
|
|
|
208 |
|
|
|
209 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
210 |
<a href="classes/usersDataSourceMySQLi.html#method_getUserID">getUserID()</a>
|
|
|
211 |
<span>
|
|
|
212 |
: int </span>
|
|
|
213 |
</dt>
|
|
|
214 |
<dd>retrieves the userID from the table</dd>
|
|
|
215 |
|
|
|
216 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
217 |
<a href="classes/usersDataSourceMySQLi.html#method_initTables">initTables()</a>
|
|
|
218 |
<span>
|
|
|
219 |
: mixed </span>
|
|
|
220 |
</dt>
|
|
|
221 |
<dd>Convenience function to initialize tables to values</dd>
|
|
|
222 |
|
|
|
223 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
224 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_setUsersPermissions">setUsersPermissions()</a>
|
|
|
225 |
<span>
|
|
|
226 |
: mixed </span>
|
|
|
227 |
</dt>
|
|
|
228 |
<dd>Sets any unset user permissions</dd>
|
|
|
229 |
|
|
|
230 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
231 |
<a href="classes/usersDataSourceMySQLi.html#method_test">test()</a>
|
|
|
232 |
<span>
|
|
|
233 |
: bool </span>
|
|
|
234 |
</dt>
|
|
|
235 |
<dd>Tests that the database connection works and the table is built</dd>
|
|
|
236 |
|
|
|
237 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
238 |
<a href="classes/usersDataSource.html#method_update">update()</a>
|
|
|
239 |
<span>
|
|
|
240 |
: <abbr title="\mysqli_result">mysqli_result</abbr>|bool </span>
|
|
|
241 |
</dt>
|
|
|
242 |
<dd>updates row in database with $newData</dd>
|
|
|
243 |
|
|
|
244 |
<dt class="phpdocumentor-table-of-contents__entry -method -public">
|
|
|
245 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_updatePermissions">updatePermissions()</a>
|
|
|
246 |
<span>
|
|
|
247 |
: mixed </span>
|
|
|
248 |
</dt>
|
|
|
249 |
<dd>Adds/Updates a group of permissions for a user</dd>
|
|
|
250 |
|
|
|
251 |
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
|
|
252 |
<a href="classes/usersDataSourceMySQLi.html#method_buildQuery">buildQuery()</a>
|
|
|
253 |
<span>
|
|
|
254 |
: string </span>
|
|
|
255 |
</dt>
|
|
|
256 |
<dd>Create a query to retrieve info from database</dd>
|
|
|
257 |
|
|
|
258 |
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
|
|
259 |
<a href="classes/usersDataSourceMySQLi.html#method_doSQL">doSQL()</a>
|
|
|
260 |
<span>
|
|
|
261 |
: mixed </span>
|
|
|
262 |
</dt>
|
|
|
263 |
<dd>Executes an SQL statement, returning the result</dd>
|
|
|
264 |
|
|
|
265 |
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
|
|
266 |
<a href="classes/usersDataSourceMySQLi.html#method_escapeString">escapeString()</a>
|
|
|
267 |
<span>
|
|
|
268 |
: string </span>
|
|
|
269 |
</dt>
|
|
|
270 |
<dd>Make string safe for MySQL</dd>
|
|
|
271 |
|
|
|
272 |
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
|
|
273 |
<a href="classes/usersDataSourceMySQLi.html#method_getAField">getAField()</a>
|
|
|
274 |
<span>
|
|
|
275 |
: mixed </span>
|
|
|
276 |
</dt>
|
|
|
277 |
<dd>Gets a single field from a table</dd>
|
|
|
278 |
|
|
|
279 |
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
|
|
280 |
<a href="classes/usersDataSourceMySQLi.html#method_setDBConnection">setDBConnection()</a>
|
|
|
281 |
<span>
|
|
|
282 |
: <abbr title="\mysqli">mysqli</abbr>|false </span>
|
|
|
283 |
</dt>
|
|
|
284 |
<dd>Make the database connection</dd>
|
|
|
285 |
|
|
|
286 |
<dt class="phpdocumentor-table-of-contents__entry -method -protected">
|
|
|
287 |
<a href="classes/usersDataSourceMySQLi.html#method_tableColumnName">tableColumnName()</a>
|
|
|
288 |
<span>
|
|
|
289 |
: string </span>
|
|
|
290 |
</dt>
|
|
|
291 |
<dd>Gets the actual database column name from the configuration file</dd>
|
|
|
292 |
|
|
|
293 |
</dl>
|
|
|
294 |
|
|
|
295 |
|
|
|
296 |
|
|
|
297 |
|
|
|
298 |
|
|
|
299 |
|
|
|
300 |
<section class="phpdocumentor-properties">
|
|
|
301 |
<h3 class="phpdocumentor-elements__header" id="properties">
|
|
|
302 |
Properties
|
|
|
303 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
304 |
</h3>
|
|
|
305 |
<article
|
|
|
306 |
class="
|
|
|
307 |
phpdocumentor-element
|
|
|
308 |
-property
|
|
|
309 |
-protected
|
|
|
310 |
"
|
|
|
311 |
>
|
|
|
312 |
<h4 class="phpdocumentor-element__name" id="property_configuration">
|
|
|
313 |
$configuration
|
|
|
314 |
<a href="classes/usersDataSource.html#property_configuration" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
315 |
<span class="phpdocumentor-element__modifiers">
|
|
|
316 |
</span>
|
|
|
317 |
</h4>
|
|
|
318 |
<aside class="phpdocumentor-element-found-in">
|
|
|
319 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSource.class.php"><a href="files/usersdatasource-class.html"><abbr title="UsersDataSource.class.php">UsersDataSource.class.php</abbr></a></abbr>
|
|
|
320 |
:
|
|
|
321 |
<span class="phpdocumentor-element-found-in__line">71</span>
|
|
|
322 |
|
|
|
323 |
</aside>
|
|
|
324 |
|
|
|
325 |
|
|
|
326 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
327 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
328 |
<span class="phpdocumentor-signature__type">array<string|int, string></span>
|
|
|
329 |
<span class="phpdocumentor-signature__name">$configuration</span>
|
|
|
330 |
= <span class="phpdocumentor-signature__default-value">array()</span></code>
|
|
|
331 |
|
|
|
332 |
|
|
|
333 |
<section class="phpdocumentor-description"><p>Contains the configuration for the class</p>
|
|
|
334 |
<p>May be modified by the calling program. Must be replicated in userDataSource class</p>
|
|
|
335 |
</section>
|
|
|
336 |
|
|
|
337 |
|
|
|
338 |
|
|
|
339 |
</article>
|
|
|
340 |
<article
|
|
|
341 |
class="
|
|
|
342 |
phpdocumentor-element
|
|
|
343 |
-property
|
|
|
344 |
-protected
|
|
|
345 |
"
|
|
|
346 |
>
|
|
|
347 |
<h4 class="phpdocumentor-element__name" id="property_dbConnection">
|
|
|
348 |
$dbConnection
|
|
|
349 |
<a href="classes/usersDataSourceMySQLi.html#property_dbConnection" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
350 |
<span class="phpdocumentor-element__modifiers">
|
|
|
351 |
</span>
|
|
|
352 |
</h4>
|
|
|
353 |
<aside class="phpdocumentor-element-found-in">
|
|
|
354 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
355 |
:
|
|
|
356 |
<span class="phpdocumentor-element-found-in__line">114</span>
|
|
|
357 |
|
|
|
358 |
</aside>
|
|
|
359 |
|
|
|
360 |
|
|
|
361 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
362 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
363 |
<span class="phpdocumentor-signature__type"><abbr title="\mysqli">mysqli</abbr></span>
|
|
|
364 |
<span class="phpdocumentor-signature__name">$dbConnection</span>
|
|
|
365 |
= <span class="phpdocumentor-signature__default-value">alse</span></code>
|
|
|
366 |
|
|
|
367 |
|
|
|
368 |
<section class="phpdocumentor-description"><p>Holds the mysqli database connection</p>
|
|
|
369 |
</section>
|
|
|
370 |
|
|
|
371 |
|
|
|
372 |
|
|
|
373 |
</article>
|
|
|
374 |
</section>
|
|
|
375 |
|
|
|
376 |
<section class="phpdocumentor-methods">
|
|
|
377 |
<h3 class="phpdocumentor-elements__header" id="methods">
|
|
|
378 |
Methods
|
|
|
379 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
380 |
</h3>
|
|
|
381 |
<article
|
|
|
382 |
class="phpdocumentor-element
|
|
|
383 |
-method
|
|
|
384 |
-public
|
|
|
385 |
"
|
|
|
386 |
>
|
|
|
387 |
<h4 class="phpdocumentor-element__name" id="method___construct">
|
|
|
388 |
__construct()
|
|
|
389 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
390 |
</h4>
|
|
|
391 |
<aside class="phpdocumentor-element-found-in">
|
|
|
392 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
393 |
:
|
|
|
394 |
<span class="phpdocumentor-element-found-in__line">85</span>
|
|
|
395 |
|
|
|
396 |
</aside>
|
|
|
397 |
|
|
|
398 |
<p class="phpdocumentor-summary">extends usersDataSource</p>
|
|
|
399 |
|
|
|
400 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
401 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
402 |
<span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><abbr title="\mysqli">mysqli</abbr> </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">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__response_type">null</span></code>
|
|
|
403 |
|
|
|
404 |
<section class="phpdocumentor-description"><p>Adds the new fields needed for permissions. First, creates array
|
|
|
405 |
$permissions, then does a recursive merge into
|
|
|
406 |
usersDataSource::$configuration.
|
|
|
407 |
NOTE: we must merge this before we merge in $dbDef so the
|
|
|
408 |
developer can modify permissions also</p>
|
|
|
409 |
</section>
|
|
|
410 |
|
|
|
411 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
412 |
<dl class="phpdocumentor-argument-list">
|
|
|
413 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
414 |
<span class="phpdocumentor-signature__argument__name">$connection</span>
|
|
|
415 |
: <span class="phpdocumentor-signature__argument__return-type"><abbr title="\mysqli">mysqli</abbr></span>
|
|
|
416 |
</dt>
|
|
|
417 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
418 |
<section class="phpdocumentor-description"><p>Existing mysqli database connection</p>
|
|
|
419 |
</section>
|
|
|
420 |
|
|
|
421 |
</dd>
|
|
|
422 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
423 |
<span class="phpdocumentor-signature__argument__name">$customFields</span>
|
|
|
424 |
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
|
|
|
425 |
= <span class="phpdocumentor-signature__argument__default-value">array()</span> </dt>
|
|
|
426 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
427 |
<section class="phpdocumentor-description"><p>Array to be merged with $configuration</p>
|
|
|
428 |
</section>
|
|
|
429 |
|
|
|
430 |
</dd>
|
|
|
431 |
</dl>
|
|
|
432 |
|
|
|
433 |
|
|
|
434 |
|
|
|
435 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
436 |
<span class="phpdocumentor-signature__response_type">null</span>
|
|
|
437 |
—
|
|
|
438 |
|
|
|
439 |
|
|
|
440 |
</article>
|
|
|
441 |
<article
|
|
|
442 |
class="phpdocumentor-element
|
|
|
443 |
-method
|
|
|
444 |
-public
|
|
|
445 |
"
|
|
|
446 |
>
|
|
|
447 |
<h4 class="phpdocumentor-element__name" id="method_addPermission">
|
|
|
448 |
addPermission()
|
|
|
449 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_addPermission" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
450 |
</h4>
|
|
|
451 |
<aside class="phpdocumentor-element-found-in">
|
|
|
452 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
453 |
:
|
|
|
454 |
<span class="phpdocumentor-element-found-in__line">243</span>
|
|
|
455 |
|
|
|
456 |
</aside>
|
|
|
457 |
|
|
|
458 |
<p class="phpdocumentor-summary">Adds a permission to the permissions table</p>
|
|
|
459 |
|
|
|
460 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
461 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
462 |
<span class="phpdocumentor-signature__name">addPermission</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$category</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$name</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$description</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$defaultValue</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
463 |
|
|
|
464 |
<section class="phpdocumentor-description"><p>This simply adds a permission to the permissions table, adding the
|
|
|
465 |
category if it doesn't exist already.</p>
|
|
|
466 |
</section>
|
|
|
467 |
|
|
|
468 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
469 |
<dl class="phpdocumentor-argument-list">
|
|
|
470 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
471 |
<span class="phpdocumentor-signature__argument__name">$category</span>
|
|
|
472 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
473 |
</dt>
|
|
|
474 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
475 |
<section class="phpdocumentor-description"></section>
|
|
|
476 |
|
|
|
477 |
</dd>
|
|
|
478 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
479 |
<span class="phpdocumentor-signature__argument__name">$name</span>
|
|
|
480 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
481 |
</dt>
|
|
|
482 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
483 |
<section class="phpdocumentor-description"></section>
|
|
|
484 |
|
|
|
485 |
</dd>
|
|
|
486 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
487 |
<span class="phpdocumentor-signature__argument__name">$description</span>
|
|
|
488 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
489 |
</dt>
|
|
|
490 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
491 |
<section class="phpdocumentor-description"></section>
|
|
|
492 |
|
|
|
493 |
</dd>
|
|
|
494 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
495 |
<span class="phpdocumentor-signature__argument__name">$defaultValue</span>
|
|
|
496 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
497 |
</dt>
|
|
|
498 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
499 |
<section class="phpdocumentor-description"></section>
|
|
|
500 |
|
|
|
501 |
</dd>
|
|
|
502 |
</dl>
|
|
|
503 |
|
|
|
504 |
|
|
|
505 |
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
|
|
506 |
Tags
|
|
|
507 |
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
508 |
</h5>
|
|
|
509 |
<dl class="phpdocumentor-tag-list">
|
|
|
510 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
511 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
512 |
</dt>
|
|
|
513 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
514 |
|
|
|
515 |
<section class="phpdocumentor-description"><p>string $category Category to place the permission into</p>
|
|
|
516 |
</section>
|
|
|
517 |
|
|
|
518 |
</dd>
|
|
|
519 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
520 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
521 |
</dt>
|
|
|
522 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
523 |
|
|
|
524 |
<section class="phpdocumentor-description"><p>string $name The short name of the permission</p>
|
|
|
525 |
</section>
|
|
|
526 |
|
|
|
527 |
</dd>
|
|
|
528 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
529 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
530 |
</dt>
|
|
|
531 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
532 |
|
|
|
533 |
<section class="phpdocumentor-description"><p>string $description The long (display) name for the permission</p>
|
|
|
534 |
</section>
|
|
|
535 |
|
|
|
536 |
</dd>
|
|
|
537 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
538 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
539 |
</dt>
|
|
|
540 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
541 |
|
|
|
542 |
<section class="phpdocumentor-description"><p>boolean $defaultValue The default value for the permission</p>
|
|
|
543 |
</section>
|
|
|
544 |
|
|
|
545 |
</dd>
|
|
|
546 |
</dl>
|
|
|
547 |
|
|
|
548 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
549 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
550 |
—
|
|
|
551 |
|
|
|
552 |
|
|
|
553 |
</article>
|
|
|
554 |
<article
|
|
|
555 |
class="phpdocumentor-element
|
|
|
556 |
-method
|
|
|
557 |
-public
|
|
|
558 |
"
|
|
|
559 |
>
|
|
|
560 |
<h4 class="phpdocumentor-element__name" id="method_buildTable">
|
|
|
561 |
buildTable()
|
|
|
562 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_buildTable" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
563 |
</h4>
|
|
|
564 |
<aside class="phpdocumentor-element-found-in">
|
|
|
565 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
566 |
:
|
|
|
567 |
<span class="phpdocumentor-element-found-in__line">180</span>
|
|
|
568 |
|
|
|
569 |
</aside>
|
|
|
570 |
|
|
|
571 |
<p class="phpdocumentor-summary">Function will build tables when called</p>
|
|
|
572 |
|
|
|
573 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
574 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
575 |
<span class="phpdocumentor-signature__name">buildTable</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
576 |
|
|
|
577 |
<section class="phpdocumentor-description"><p>Calls parent::buildTable first, then creates a view. The query
|
|
|
578 |
for the view is created using sprintf so we can allow the developers
|
|
|
579 |
to modify the table names, etc...</p>
|
|
|
580 |
</section>
|
|
|
581 |
|
|
|
582 |
|
|
|
583 |
|
|
|
584 |
|
|
|
585 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
586 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
587 |
—
|
|
|
588 |
|
|
|
589 |
|
|
|
590 |
</article>
|
|
|
591 |
<article
|
|
|
592 |
class="phpdocumentor-element
|
|
|
593 |
-method
|
|
|
594 |
-public
|
|
|
595 |
-abstract "
|
|
|
596 |
>
|
|
|
597 |
<h4 class="phpdocumentor-element__name" id="method_getAllUsers">
|
|
|
598 |
getAllUsers()
|
|
|
599 |
<a href="classes/usersDataSource.html#method_getAllUsers" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
600 |
</h4>
|
|
|
601 |
<aside class="phpdocumentor-element-found-in">
|
|
|
602 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSource.class.php"><a href="files/usersdatasource-class.html"><abbr title="UsersDataSource.class.php">UsersDataSource.class.php</abbr></a></abbr>
|
|
|
603 |
:
|
|
|
604 |
<span class="phpdocumentor-element-found-in__line">136</span>
|
|
|
605 |
|
|
|
606 |
</aside>
|
|
|
607 |
|
|
|
608 |
<p class="phpdocumentor-summary">retrieves all users from the database</p>
|
|
|
609 |
|
|
|
610 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
611 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
612 |
<span class="phpdocumentor-signature__abstract">abstract</span> <span class="phpdocumentor-signature__name">getAllUsers</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array<string|int, string></span></code>
|
|
|
613 |
|
|
|
614 |
<section class="phpdocumentor-description"><p>Retrieves all data for all users from table</p>
|
|
|
615 |
</section>
|
|
|
616 |
|
|
|
617 |
|
|
|
618 |
|
|
|
619 |
|
|
|
620 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
621 |
<span class="phpdocumentor-signature__response_type">array<string|int, string></span>
|
|
|
622 |
—
|
|
|
623 |
<section class="phpdocumentor-description"><p>array of array of rows/columns</p>
|
|
|
624 |
</section>
|
|
|
625 |
|
|
|
626 |
|
|
|
627 |
</article>
|
|
|
628 |
<article
|
|
|
629 |
class="phpdocumentor-element
|
|
|
630 |
-method
|
|
|
631 |
-public
|
|
|
632 |
"
|
|
|
633 |
>
|
|
|
634 |
<h4 class="phpdocumentor-element__name" id="method_getARecord">
|
|
|
635 |
getARecord()
|
|
|
636 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_getARecord" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
637 |
</h4>
|
|
|
638 |
<aside class="phpdocumentor-element-found-in">
|
|
|
639 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
640 |
:
|
|
|
641 |
<span class="phpdocumentor-element-found-in__line">340</span>
|
|
|
642 |
|
|
|
643 |
</aside>
|
|
|
644 |
|
|
|
645 |
<p class="phpdocumentor-summary">Get a record from the database</p>
|
|
|
646 |
|
|
|
647 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
648 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
649 |
<span class="phpdocumentor-signature__name">getARecord</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$whereFields</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">$fieldList</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">array<string|int, string></span></code>
|
|
|
650 |
|
|
|
651 |
<section class="phpdocumentor-description"><p>Gets a single record from the database which matches $field containing
|
|
|
652 |
$username. If more than one record is returned, will return the first
|
|
|
653 |
one</p>
|
|
|
654 |
</section>
|
|
|
655 |
|
|
|
656 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
657 |
<dl class="phpdocumentor-argument-list">
|
|
|
658 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
659 |
<span class="phpdocumentor-signature__argument__name">$whereFields</span>
|
|
|
660 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
661 |
</dt>
|
|
|
662 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
663 |
<section class="phpdocumentor-description"><p>column=>value pairs for where clause</p>
|
|
|
664 |
</section>
|
|
|
665 |
|
|
|
666 |
</dd>
|
|
|
667 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
668 |
<span class="phpdocumentor-signature__argument__name">$fieldList</span>
|
|
|
669 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
670 |
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
|
|
|
671 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
672 |
<section class="phpdocumentor-description"><p>a list of columns to return. If empty, returns all columns</p>
|
|
|
673 |
</section>
|
|
|
674 |
|
|
|
675 |
</dd>
|
|
|
676 |
</dl>
|
|
|
677 |
|
|
|
678 |
|
|
|
679 |
|
|
|
680 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
681 |
<span class="phpdocumentor-signature__response_type">array<string|int, string></span>
|
|
|
682 |
—
|
|
|
683 |
<section class="phpdocumentor-description"><p>a hash containing fieldname=>value pairs from fetch_assoc</p>
|
|
|
684 |
</section>
|
|
|
685 |
|
|
|
686 |
|
|
|
687 |
</article>
|
|
|
688 |
<article
|
|
|
689 |
class="phpdocumentor-element
|
|
|
690 |
-method
|
|
|
691 |
-public
|
|
|
692 |
"
|
|
|
693 |
>
|
|
|
694 |
<h4 class="phpdocumentor-element__name" id="method_getFullPermissions">
|
|
|
695 |
getFullPermissions()
|
|
|
696 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_getFullPermissions" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
697 |
</h4>
|
|
|
698 |
<aside class="phpdocumentor-element-found-in">
|
|
|
699 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
700 |
:
|
|
|
701 |
<span class="phpdocumentor-element-found-in__line">391</span>
|
|
|
702 |
|
|
|
703 |
</aside>
|
|
|
704 |
|
|
|
705 |
<p class="phpdocumentor-summary">Gets all permissions with names, group names, etc... from database</p>
|
|
|
706 |
|
|
|
707 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
708 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
709 |
<span class="phpdocumentor-signature__name">getFullPermissions</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int </span><span class="phpdocumentor-signature__argument__name">$id</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
710 |
|
|
|
711 |
<section class="phpdocumentor-description"><p>NOTE: if $id is -1, indicating a new user, simply retrieves all
|
|
|
712 |
permissions from the permissions table with the default value</p>
|
|
|
713 |
<p>WARNING: this uses the view, which is not as flexible as the
|
|
|
714 |
tables as far as modifying programmatically</p>
|
|
|
715 |
</section>
|
|
|
716 |
|
|
|
717 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
718 |
<dl class="phpdocumentor-argument-list">
|
|
|
719 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
720 |
<span class="phpdocumentor-signature__argument__name">$id</span>
|
|
|
721 |
: <span class="phpdocumentor-signature__argument__return-type">int</span>
|
|
|
722 |
</dt>
|
|
|
723 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
724 |
<section class="phpdocumentor-description"><p>the user id of the record we want.</p>
|
|
|
725 |
</section>
|
|
|
726 |
|
|
|
727 |
</dd>
|
|
|
728 |
</dl>
|
|
|
729 |
|
|
|
730 |
|
|
|
731 |
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
|
|
732 |
Tags
|
|
|
733 |
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
734 |
</h5>
|
|
|
735 |
<dl class="phpdocumentor-tag-list">
|
|
|
736 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
737 |
<span class="phpdocumentor-tag__name">returns</span>
|
|
|
738 |
</dt>
|
|
|
739 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
740 |
|
|
|
741 |
<section class="phpdocumentor-description"><p>string[] Array of associative arrays with all data</p>
|
|
|
742 |
</section>
|
|
|
743 |
|
|
|
744 |
</dd>
|
|
|
745 |
</dl>
|
|
|
746 |
|
|
|
747 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
748 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
749 |
—
|
|
|
750 |
|
|
|
751 |
|
|
|
752 |
</article>
|
|
|
753 |
<article
|
|
|
754 |
class="phpdocumentor-element
|
|
|
755 |
-method
|
|
|
756 |
-public
|
|
|
757 |
-abstract "
|
|
|
758 |
>
|
|
|
759 |
<h4 class="phpdocumentor-element__name" id="method_getPassword">
|
|
|
760 |
getPassword()
|
|
|
761 |
<a href="classes/usersDataSource.html#method_getPassword" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
762 |
</h4>
|
|
|
763 |
<aside class="phpdocumentor-element-found-in">
|
|
|
764 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSource.class.php"><a href="files/usersdatasource-class.html"><abbr title="UsersDataSource.class.php">UsersDataSource.class.php</abbr></a></abbr>
|
|
|
765 |
:
|
|
|
766 |
<span class="phpdocumentor-element-found-in__line">118</span>
|
|
|
767 |
|
|
|
768 |
</aside>
|
|
|
769 |
|
|
|
770 |
<p class="phpdocumentor-summary">Retrieves the password field from table</p>
|
|
|
771 |
|
|
|
772 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
773 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
774 |
<span class="phpdocumentor-signature__abstract">abstract</span> <span class="phpdocumentor-signature__name">getPassword</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></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array<string|int, string></span></code>
|
|
|
775 |
|
|
|
776 |
<section class="phpdocumentor-description"><p>Note that the password is stored as a hash in the table</p>
|
|
|
777 |
</section>
|
|
|
778 |
|
|
|
779 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
780 |
<dl class="phpdocumentor-argument-list">
|
|
|
781 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
782 |
<span class="phpdocumentor-signature__argument__name">$username</span>
|
|
|
783 |
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
|
|
784 |
</dt>
|
|
|
785 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
786 |
<section class="phpdocumentor-description"><p>username used to find record</p>
|
|
|
787 |
</section>
|
|
|
788 |
|
|
|
789 |
</dd>
|
|
|
790 |
</dl>
|
|
|
791 |
|
|
|
792 |
|
|
|
793 |
|
|
|
794 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
795 |
<span class="phpdocumentor-signature__response_type">array<string|int, string></span>
|
|
|
796 |
—
|
|
|
797 |
<section class="phpdocumentor-description"><p>an array of values key/value pairs</p>
|
|
|
798 |
</section>
|
|
|
799 |
|
|
|
800 |
|
|
|
801 |
</article>
|
|
|
802 |
<article
|
|
|
803 |
class="phpdocumentor-element
|
|
|
804 |
-method
|
|
|
805 |
-public
|
|
|
806 |
"
|
|
|
807 |
>
|
|
|
808 |
<h4 class="phpdocumentor-element__name" id="method_getPermissions">
|
|
|
809 |
getPermissions()
|
|
|
810 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_getPermissions" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
811 |
</h4>
|
|
|
812 |
<aside class="phpdocumentor-element-found-in">
|
|
|
813 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
814 |
:
|
|
|
815 |
<span class="phpdocumentor-element-found-in__line">367</span>
|
|
|
816 |
|
|
|
817 |
</aside>
|
|
|
818 |
|
|
|
819 |
<p class="phpdocumentor-summary">Gets permissions for one user</p>
|
|
|
820 |
|
|
|
821 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
822 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
823 |
<span class="phpdocumentor-signature__name">getPermissions</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int </span><span class="phpdocumentor-signature__argument__name">$id</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
824 |
|
|
|
825 |
<section class="phpdocumentor-description"><p>NOTE: if $id is -1, indicating a new user, simply retrieves all
|
|
|
826 |
permissions from the permissions table with the default value</p>
|
|
|
827 |
<p>WARNING: this uses the view, which is not as flexible as the
|
|
|
828 |
tables as far as modifying programmatically</p>
|
|
|
829 |
<p>The return value is an associative array, where the key is
|
|
|
830 |
the permission (short) name and the value is 0 or 1 (boolean
|
|
|
831 |
true/false)</p>
|
|
|
832 |
</section>
|
|
|
833 |
|
|
|
834 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
835 |
<dl class="phpdocumentor-argument-list">
|
|
|
836 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
837 |
<span class="phpdocumentor-signature__argument__name">$id</span>
|
|
|
838 |
: <span class="phpdocumentor-signature__argument__return-type">int</span>
|
|
|
839 |
</dt>
|
|
|
840 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
841 |
<section class="phpdocumentor-description"><p>the user id of the record we want.</p>
|
|
|
842 |
</section>
|
|
|
843 |
|
|
|
844 |
</dd>
|
|
|
845 |
</dl>
|
|
|
846 |
|
|
|
847 |
|
|
|
848 |
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
|
|
849 |
Tags
|
|
|
850 |
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
851 |
</h5>
|
|
|
852 |
<dl class="phpdocumentor-tag-list">
|
|
|
853 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
854 |
<span class="phpdocumentor-tag__name">returns</span>
|
|
|
855 |
</dt>
|
|
|
856 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
857 |
|
|
|
858 |
<section class="phpdocumentor-description"><p>string[] Array of associative arrays with all data</p>
|
|
|
859 |
</section>
|
|
|
860 |
|
|
|
861 |
</dd>
|
|
|
862 |
</dl>
|
|
|
863 |
|
|
|
864 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
865 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
866 |
—
|
|
|
867 |
|
|
|
868 |
|
|
|
869 |
</article>
|
|
|
870 |
<article
|
|
|
871 |
class="phpdocumentor-element
|
|
|
872 |
-method
|
|
|
873 |
-public
|
|
|
874 |
"
|
|
|
875 |
>
|
|
|
876 |
<h4 class="phpdocumentor-element__name" id="method_getUserID">
|
|
|
877 |
getUserID()
|
|
|
878 |
<a href="classes/usersDataSourceMySQLi.html#method_getUserID" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
879 |
</h4>
|
|
|
880 |
<aside class="phpdocumentor-element-found-in">
|
|
|
881 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
882 |
:
|
|
|
883 |
<span class="phpdocumentor-element-found-in__line">244</span>
|
|
|
884 |
|
|
|
885 |
</aside>
|
|
|
886 |
|
|
|
887 |
<p class="phpdocumentor-summary">retrieves the userID from the table</p>
|
|
|
888 |
|
|
|
889 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
890 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
891 |
<span class="phpdocumentor-signature__name">getUserID</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></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
|
|
|
892 |
|
|
|
893 |
|
|
|
894 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
895 |
<dl class="phpdocumentor-argument-list">
|
|
|
896 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
897 |
<span class="phpdocumentor-signature__argument__name">$username</span>
|
|
|
898 |
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
|
|
899 |
</dt>
|
|
|
900 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
901 |
|
|
|
902 |
</dd>
|
|
|
903 |
</dl>
|
|
|
904 |
|
|
|
905 |
|
|
|
906 |
|
|
|
907 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
908 |
<span class="phpdocumentor-signature__response_type">int</span>
|
|
|
909 |
—
|
|
|
910 |
<section class="phpdocumentor-description"><p>user id</p>
|
|
|
911 |
</section>
|
|
|
912 |
|
|
|
913 |
|
|
|
914 |
</article>
|
|
|
915 |
<article
|
|
|
916 |
class="phpdocumentor-element
|
|
|
917 |
-method
|
|
|
918 |
-public
|
|
|
919 |
"
|
|
|
920 |
>
|
|
|
921 |
<h4 class="phpdocumentor-element__name" id="method_initTables">
|
|
|
922 |
initTables()
|
|
|
923 |
<a href="classes/usersDataSourceMySQLi.html#method_initTables" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
924 |
</h4>
|
|
|
925 |
<aside class="phpdocumentor-element-found-in">
|
|
|
926 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
927 |
:
|
|
|
928 |
<span class="phpdocumentor-element-found-in__line">312</span>
|
|
|
929 |
|
|
|
930 |
</aside>
|
|
|
931 |
|
|
|
932 |
<p class="phpdocumentor-summary">Convenience function to initialize tables to values</p>
|
|
|
933 |
|
|
|
934 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
935 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
936 |
<span class="phpdocumentor-signature__name">initTables</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array<string|int, string> </span><span class="phpdocumentor-signature__argument__name">$initValues</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
937 |
|
|
|
938 |
|
|
|
939 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
940 |
<dl class="phpdocumentor-argument-list">
|
|
|
941 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
942 |
<span class="phpdocumentor-signature__argument__name">$initValues</span>
|
|
|
943 |
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
|
|
|
944 |
</dt>
|
|
|
945 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
946 |
<section class="phpdocumentor-description"><p>Array of tablenames, column names and values</p>
|
|
|
947 |
</section>
|
|
|
948 |
|
|
|
949 |
</dd>
|
|
|
950 |
</dl>
|
|
|
951 |
|
|
|
952 |
|
|
|
953 |
|
|
|
954 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
955 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
956 |
—
|
|
|
957 |
|
|
|
958 |
|
|
|
959 |
</article>
|
|
|
960 |
<article
|
|
|
961 |
class="phpdocumentor-element
|
|
|
962 |
-method
|
|
|
963 |
-public
|
|
|
964 |
"
|
|
|
965 |
>
|
|
|
966 |
<h4 class="phpdocumentor-element__name" id="method_setUsersPermissions">
|
|
|
967 |
setUsersPermissions()
|
|
|
968 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_setUsersPermissions" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
969 |
</h4>
|
|
|
970 |
<aside class="phpdocumentor-element-found-in">
|
|
|
971 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
972 |
:
|
|
|
973 |
<span class="phpdocumentor-element-found-in__line">293</span>
|
|
|
974 |
|
|
|
975 |
</aside>
|
|
|
976 |
|
|
|
977 |
<p class="phpdocumentor-summary">Sets any unset user permissions</p>
|
|
|
978 |
|
|
|
979 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
980 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
981 |
<span class="phpdocumentor-signature__name">setUsersPermissions</span><span>(</span><span class="phpdocumentor-signature__argument"><span>[</span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$user_id</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>
|
|
|
982 |
|
|
|
983 |
<section class="phpdocumentor-description"><p>This will set any missing permissions which have a true value in the
|
|
|
984 |
users permissions join table. This will NOT modify any existing records
|
|
|
985 |
but will add new records if they do not exist in the table.</p>
|
|
|
986 |
</section>
|
|
|
987 |
|
|
|
988 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
989 |
<dl class="phpdocumentor-argument-list">
|
|
|
990 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
991 |
<span class="phpdocumentor-signature__argument__name">$user_id</span>
|
|
|
992 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
993 |
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
|
|
|
994 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
995 |
<section class="phpdocumentor-description"></section>
|
|
|
996 |
|
|
|
997 |
</dd>
|
|
|
998 |
</dl>
|
|
|
999 |
|
|
|
1000 |
|
|
|
1001 |
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
|
|
1002 |
Tags
|
|
|
1003 |
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1004 |
</h5>
|
|
|
1005 |
<dl class="phpdocumentor-tag-list">
|
|
|
1006 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1007 |
<span class="phpdocumentor-tag__name">parameters</span>
|
|
|
1008 |
</dt>
|
|
|
1009 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1010 |
|
|
|
1011 |
<section class="phpdocumentor-description"><p>string $user_id If set, will limit to only one user (not implemented)</p>
|
|
|
1012 |
</section>
|
|
|
1013 |
|
|
|
1014 |
</dd>
|
|
|
1015 |
</dl>
|
|
|
1016 |
|
|
|
1017 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1018 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
1019 |
—
|
|
|
1020 |
|
|
|
1021 |
|
|
|
1022 |
</article>
|
|
|
1023 |
<article
|
|
|
1024 |
class="phpdocumentor-element
|
|
|
1025 |
-method
|
|
|
1026 |
-public
|
|
|
1027 |
"
|
|
|
1028 |
>
|
|
|
1029 |
<h4 class="phpdocumentor-element__name" id="method_test">
|
|
|
1030 |
test()
|
|
|
1031 |
<a href="classes/usersDataSourceMySQLi.html#method_test" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1032 |
</h4>
|
|
|
1033 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1034 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1035 |
:
|
|
|
1036 |
<span class="phpdocumentor-element-found-in__line">366</span>
|
|
|
1037 |
|
|
|
1038 |
</aside>
|
|
|
1039 |
|
|
|
1040 |
<p class="phpdocumentor-summary">Tests that the database connection works and the table is built</p>
|
|
|
1041 |
|
|
|
1042 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1043 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
1044 |
<span class="phpdocumentor-signature__name">test</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
|
|
|
1045 |
|
|
|
1046 |
|
|
|
1047 |
|
|
|
1048 |
|
|
|
1049 |
|
|
|
1050 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1051 |
<span class="phpdocumentor-signature__response_type">bool</span>
|
|
|
1052 |
—
|
|
|
1053 |
<section class="phpdocumentor-description"><p>True if table exists (does not verify columns)</p>
|
|
|
1054 |
</section>
|
|
|
1055 |
|
|
|
1056 |
|
|
|
1057 |
</article>
|
|
|
1058 |
<article
|
|
|
1059 |
class="phpdocumentor-element
|
|
|
1060 |
-method
|
|
|
1061 |
-public
|
|
|
1062 |
-abstract "
|
|
|
1063 |
>
|
|
|
1064 |
<h4 class="phpdocumentor-element__name" id="method_update">
|
|
|
1065 |
update()
|
|
|
1066 |
<a href="classes/usersDataSource.html#method_update" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1067 |
</h4>
|
|
|
1068 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1069 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSource.class.php"><a href="files/usersdatasource-class.html"><abbr title="UsersDataSource.class.php">UsersDataSource.class.php</abbr></a></abbr>
|
|
|
1070 |
:
|
|
|
1071 |
<span class="phpdocumentor-element-found-in__line">127</span>
|
|
|
1072 |
|
|
|
1073 |
</aside>
|
|
|
1074 |
|
|
|
1075 |
<p class="phpdocumentor-summary">updates row in database with $newData</p>
|
|
|
1076 |
|
|
|
1077 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1078 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
1079 |
<span class="phpdocumentor-signature__abstract">abstract</span> <span class="phpdocumentor-signature__name">update</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array<string|int, string> </span><span class="phpdocumentor-signature__argument__name">$newData</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\mysqli_result">mysqli_result</abbr>|bool</span></code>
|
|
|
1080 |
|
|
|
1081 |
|
|
|
1082 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1083 |
<dl class="phpdocumentor-argument-list">
|
|
|
1084 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1085 |
<span class="phpdocumentor-signature__argument__name">$newData</span>
|
|
|
1086 |
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
|
|
|
1087 |
</dt>
|
|
|
1088 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1089 |
<section class="phpdocumentor-description"><p>fieldname/value pairs to be updated in table</p>
|
|
|
1090 |
</section>
|
|
|
1091 |
|
|
|
1092 |
</dd>
|
|
|
1093 |
</dl>
|
|
|
1094 |
|
|
|
1095 |
|
|
|
1096 |
|
|
|
1097 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1098 |
<span class="phpdocumentor-signature__response_type"><abbr title="\mysqli_result">mysqli_result</abbr>|bool</span>
|
|
|
1099 |
—
|
|
|
1100 |
<section class="phpdocumentor-description"><p>The mysqli result from a query</p>
|
|
|
1101 |
</section>
|
|
|
1102 |
|
|
|
1103 |
|
|
|
1104 |
</article>
|
|
|
1105 |
<article
|
|
|
1106 |
class="phpdocumentor-element
|
|
|
1107 |
-method
|
|
|
1108 |
-public
|
|
|
1109 |
"
|
|
|
1110 |
>
|
|
|
1111 |
<h4 class="phpdocumentor-element__name" id="method_updatePermissions">
|
|
|
1112 |
updatePermissions()
|
|
|
1113 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#method_updatePermissions" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1114 |
</h4>
|
|
|
1115 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1116 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersPermissionsDataSourceMySQLi.class.php"><a href="files/userspermissionsdatasourcemysqli-class.html"><abbr title="UsersPermissionsDataSourceMySQLi.class.php">UsersPermissionsDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1117 |
:
|
|
|
1118 |
<span class="phpdocumentor-element-found-in__line">408</span>
|
|
|
1119 |
|
|
|
1120 |
</aside>
|
|
|
1121 |
|
|
|
1122 |
<p class="phpdocumentor-summary">Adds/Updates a group of permissions for a user</p>
|
|
|
1123 |
|
|
|
1124 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1125 |
<span class="phpdocumentor-signature__visibility">public</span>
|
|
|
1126 |
<span class="phpdocumentor-signature__name">updatePermissions</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int </span><span class="phpdocumentor-signature__argument__name">$userID</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">$newData</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
1127 |
|
|
|
1128 |
|
|
|
1129 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1130 |
<dl class="phpdocumentor-argument-list">
|
|
|
1131 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1132 |
<span class="phpdocumentor-signature__argument__name">$userID</span>
|
|
|
1133 |
: <span class="phpdocumentor-signature__argument__return-type">int</span>
|
|
|
1134 |
</dt>
|
|
|
1135 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1136 |
<section class="phpdocumentor-description"><p>The user ID to update</p>
|
|
|
1137 |
</section>
|
|
|
1138 |
|
|
|
1139 |
</dd>
|
|
|
1140 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1141 |
<span class="phpdocumentor-signature__argument__name">$newData</span>
|
|
|
1142 |
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
|
|
|
1143 |
</dt>
|
|
|
1144 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1145 |
<section class="phpdocumentor-description"><p>An array where the key is the field name and the value is the new value to use</p>
|
|
|
1146 |
</section>
|
|
|
1147 |
|
|
|
1148 |
</dd>
|
|
|
1149 |
</dl>
|
|
|
1150 |
|
|
|
1151 |
|
|
|
1152 |
|
|
|
1153 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1154 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
1155 |
—
|
|
|
1156 |
|
|
|
1157 |
|
|
|
1158 |
</article>
|
|
|
1159 |
<article
|
|
|
1160 |
class="phpdocumentor-element
|
|
|
1161 |
-method
|
|
|
1162 |
-protected
|
|
|
1163 |
"
|
|
|
1164 |
>
|
|
|
1165 |
<h4 class="phpdocumentor-element__name" id="method_buildQuery">
|
|
|
1166 |
buildQuery()
|
|
|
1167 |
<a href="classes/usersDataSourceMySQLi.html#method_buildQuery" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1168 |
</h4>
|
|
|
1169 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1170 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1171 |
:
|
|
|
1172 |
<span class="phpdocumentor-element-found-in__line">175</span>
|
|
|
1173 |
|
|
|
1174 |
</aside>
|
|
|
1175 |
|
|
|
1176 |
<p class="phpdocumentor-summary">Create a query to retrieve info from database</p>
|
|
|
1177 |
|
|
|
1178 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1179 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
1180 |
<span class="phpdocumentor-signature__name">buildQuery</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$whereFields</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">array<string|int, string> </span><span class="phpdocumentor-signature__argument__name">$fieldList</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>
|
|
|
1181 |
|
|
|
1182 |
<section class="phpdocumentor-description"><p>Builds a query to retrieve records from the database. With all
|
|
|
1183 |
parameters set to null, will retrieve all columns and records
|
|
|
1184 |
Setting $field and $toFind create a where clause, and setting
|
|
|
1185 |
$fieldList as a has (ie, 'fieldname' => 1) will limit the
|
|
|
1186 |
fields returned</p>
|
|
|
1187 |
</section>
|
|
|
1188 |
|
|
|
1189 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1190 |
<dl class="phpdocumentor-argument-list">
|
|
|
1191 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1192 |
<span class="phpdocumentor-signature__argument__name">$whereFields</span>
|
|
|
1193 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1194 |
</dt>
|
|
|
1195 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1196 |
<section class="phpdocumentor-description"></section>
|
|
|
1197 |
|
|
|
1198 |
</dd>
|
|
|
1199 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1200 |
<span class="phpdocumentor-signature__argument__name">$fieldList</span>
|
|
|
1201 |
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
|
|
|
1202 |
= <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
|
|
|
1203 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1204 |
<section class="phpdocumentor-description"><p>a hash where the keys make a list of columns to return. If empty, returns all columns</p>
|
|
|
1205 |
</section>
|
|
|
1206 |
|
|
|
1207 |
</dd>
|
|
|
1208 |
</dl>
|
|
|
1209 |
|
|
|
1210 |
|
|
|
1211 |
|
|
|
1212 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1213 |
<span class="phpdocumentor-signature__response_type">string</span>
|
|
|
1214 |
—
|
|
|
1215 |
<section class="phpdocumentor-description"><p>A cleaned and formatted SQL Query</p>
|
|
|
1216 |
</section>
|
|
|
1217 |
|
|
|
1218 |
|
|
|
1219 |
</article>
|
|
|
1220 |
<article
|
|
|
1221 |
class="phpdocumentor-element
|
|
|
1222 |
-method
|
|
|
1223 |
-protected
|
|
|
1224 |
"
|
|
|
1225 |
>
|
|
|
1226 |
<h4 class="phpdocumentor-element__name" id="method_doSQL">
|
|
|
1227 |
doSQL()
|
|
|
1228 |
<a href="classes/usersDataSourceMySQLi.html#method_doSQL" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1229 |
</h4>
|
|
|
1230 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1231 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1232 |
:
|
|
|
1233 |
<span class="phpdocumentor-element-found-in__line">445</span>
|
|
|
1234 |
|
|
|
1235 |
</aside>
|
|
|
1236 |
|
|
|
1237 |
<p class="phpdocumentor-summary">Executes an SQL statement, returning the result</p>
|
|
|
1238 |
|
|
|
1239 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1240 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
1241 |
<span class="phpdocumentor-signature__name">doSQL</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$query</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">$comment</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">''</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
1242 |
|
|
|
1243 |
<section class="phpdocumentor-description"><p>This simply runs mysqli::query, and returns the value of that</p>
|
|
|
1244 |
<p>Created for testing and debugging, if the second parameter is
|
|
|
1245 |
true, will NOT execute the query, but will instead display the
|
|
|
1246 |
query passed.</p>
|
|
|
1247 |
</section>
|
|
|
1248 |
|
|
|
1249 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1250 |
<dl class="phpdocumentor-argument-list">
|
|
|
1251 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1252 |
<span class="phpdocumentor-signature__argument__name">$query</span>
|
|
|
1253 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1254 |
</dt>
|
|
|
1255 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1256 |
<section class="phpdocumentor-description"></section>
|
|
|
1257 |
|
|
|
1258 |
</dd>
|
|
|
1259 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1260 |
<span class="phpdocumentor-signature__argument__name">$comment</span>
|
|
|
1261 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1262 |
= <span class="phpdocumentor-signature__argument__default-value">''</span> </dt>
|
|
|
1263 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1264 |
<section class="phpdocumentor-description"></section>
|
|
|
1265 |
|
|
|
1266 |
</dd>
|
|
|
1267 |
</dl>
|
|
|
1268 |
|
|
|
1269 |
|
|
|
1270 |
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
|
|
1271 |
Tags
|
|
|
1272 |
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1273 |
</h5>
|
|
|
1274 |
<dl class="phpdocumentor-tag-list">
|
|
|
1275 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1276 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
1277 |
</dt>
|
|
|
1278 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1279 |
|
|
|
1280 |
<section class="phpdocumentor-description"><p>string $query SQL Query to execute</p>
|
|
|
1281 |
</section>
|
|
|
1282 |
|
|
|
1283 |
</dd>
|
|
|
1284 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1285 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
1286 |
</dt>
|
|
|
1287 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1288 |
|
|
|
1289 |
<section class="phpdocumentor-description"><p>string $comment if not empty, writes comment and query to a file</p>
|
|
|
1290 |
</section>
|
|
|
1291 |
|
|
|
1292 |
</dd>
|
|
|
1293 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1294 |
<span class="phpdocumentor-tag__name">returns</span>
|
|
|
1295 |
</dt>
|
|
|
1296 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1297 |
|
|
|
1298 |
<section class="phpdocumentor-description"><p>mysqli_result</p>
|
|
|
1299 |
</section>
|
|
|
1300 |
|
|
|
1301 |
</dd>
|
|
|
1302 |
</dl>
|
|
|
1303 |
|
|
|
1304 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1305 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
1306 |
—
|
|
|
1307 |
|
|
|
1308 |
|
|
|
1309 |
</article>
|
|
|
1310 |
<article
|
|
|
1311 |
class="phpdocumentor-element
|
|
|
1312 |
-method
|
|
|
1313 |
-protected
|
|
|
1314 |
"
|
|
|
1315 |
>
|
|
|
1316 |
<h4 class="phpdocumentor-element__name" id="method_escapeString">
|
|
|
1317 |
escapeString()
|
|
|
1318 |
<a href="classes/usersDataSourceMySQLi.html#method_escapeString" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1319 |
</h4>
|
|
|
1320 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1321 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1322 |
:
|
|
|
1323 |
<span class="phpdocumentor-element-found-in__line">151</span>
|
|
|
1324 |
|
|
|
1325 |
</aside>
|
|
|
1326 |
|
|
|
1327 |
<p class="phpdocumentor-summary">Make string safe for MySQL</p>
|
|
|
1328 |
|
|
|
1329 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1330 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
1331 |
<span class="phpdocumentor-signature__name">escapeString</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
|
|
|
1332 |
|
|
|
1333 |
<section class="phpdocumentor-description"><p>If the string is completely numeric, returns it, otherwise
|
|
|
1334 |
puts single quotes around it</p>
|
|
|
1335 |
</section>
|
|
|
1336 |
|
|
|
1337 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1338 |
<dl class="phpdocumentor-argument-list">
|
|
|
1339 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1340 |
<span class="phpdocumentor-signature__argument__name">$string</span>
|
|
|
1341 |
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
|
|
1342 |
</dt>
|
|
|
1343 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1344 |
<section class="phpdocumentor-description"><p>The string to be fixed</p>
|
|
|
1345 |
</section>
|
|
|
1346 |
|
|
|
1347 |
</dd>
|
|
|
1348 |
</dl>
|
|
|
1349 |
|
|
|
1350 |
|
|
|
1351 |
|
|
|
1352 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1353 |
<span class="phpdocumentor-signature__response_type">string</span>
|
|
|
1354 |
—
|
|
|
1355 |
<section class="phpdocumentor-description"><p>A copy of the string, ready for SQL</p>
|
|
|
1356 |
</section>
|
|
|
1357 |
|
|
|
1358 |
|
|
|
1359 |
</article>
|
|
|
1360 |
<article
|
|
|
1361 |
class="phpdocumentor-element
|
|
|
1362 |
-method
|
|
|
1363 |
-protected
|
|
|
1364 |
"
|
|
|
1365 |
>
|
|
|
1366 |
<h4 class="phpdocumentor-element__name" id="method_getAField">
|
|
|
1367 |
getAField()
|
|
|
1368 |
<a href="classes/usersDataSourceMySQLi.html#method_getAField" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1369 |
</h4>
|
|
|
1370 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1371 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1372 |
:
|
|
|
1373 |
<span class="phpdocumentor-element-found-in__line">471</span>
|
|
|
1374 |
|
|
|
1375 |
</aside>
|
|
|
1376 |
|
|
|
1377 |
<p class="phpdocumentor-summary">Gets a single field from a table</p>
|
|
|
1378 |
|
|
|
1379 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1380 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
1381 |
<span class="phpdocumentor-signature__name">getAField</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$tableName</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$returnColumn</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$fieldName</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed </span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
|
|
|
1382 |
|
|
|
1383 |
<section class="phpdocumentor-description"><p>Builds a query similar to
|
|
|
1384 |
select $returnColumn from $tableName where $fieldName = $value
|
|
|
1385 |
executes it, and returns the first column of the first
|
|
|
1386 |
row returned, or null if it does not exist.</p>
|
|
|
1387 |
</section>
|
|
|
1388 |
|
|
|
1389 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1390 |
<dl class="phpdocumentor-argument-list">
|
|
|
1391 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1392 |
<span class="phpdocumentor-signature__argument__name">$tableName</span>
|
|
|
1393 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1394 |
</dt>
|
|
|
1395 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1396 |
<section class="phpdocumentor-description"></section>
|
|
|
1397 |
|
|
|
1398 |
</dd>
|
|
|
1399 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1400 |
<span class="phpdocumentor-signature__argument__name">$returnColumn</span>
|
|
|
1401 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1402 |
</dt>
|
|
|
1403 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1404 |
<section class="phpdocumentor-description"></section>
|
|
|
1405 |
|
|
|
1406 |
</dd>
|
|
|
1407 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1408 |
<span class="phpdocumentor-signature__argument__name">$fieldName</span>
|
|
|
1409 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1410 |
</dt>
|
|
|
1411 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1412 |
<section class="phpdocumentor-description"></section>
|
|
|
1413 |
|
|
|
1414 |
</dd>
|
|
|
1415 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1416 |
<span class="phpdocumentor-signature__argument__name">$value</span>
|
|
|
1417 |
: <span class="phpdocumentor-signature__argument__return-type">mixed</span>
|
|
|
1418 |
</dt>
|
|
|
1419 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1420 |
<section class="phpdocumentor-description"></section>
|
|
|
1421 |
|
|
|
1422 |
</dd>
|
|
|
1423 |
</dl>
|
|
|
1424 |
|
|
|
1425 |
|
|
|
1426 |
<h5 class="phpdocumentor-tag-list__heading" id="tags">
|
|
|
1427 |
Tags
|
|
|
1428 |
<a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1429 |
</h5>
|
|
|
1430 |
<dl class="phpdocumentor-tag-list">
|
|
|
1431 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1432 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
1433 |
</dt>
|
|
|
1434 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1435 |
|
|
|
1436 |
<section class="phpdocumentor-description"><p>string $tableName Name of database table</p>
|
|
|
1437 |
</section>
|
|
|
1438 |
|
|
|
1439 |
</dd>
|
|
|
1440 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1441 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
1442 |
</dt>
|
|
|
1443 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1444 |
|
|
|
1445 |
<section class="phpdocumentor-description"><p>string $returnColumn Column to return</p>
|
|
|
1446 |
</section>
|
|
|
1447 |
|
|
|
1448 |
</dd>
|
|
|
1449 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1450 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
1451 |
</dt>
|
|
|
1452 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1453 |
|
|
|
1454 |
<section class="phpdocumentor-description"><p>string $fieldName Name of column to search for value</p>
|
|
|
1455 |
</section>
|
|
|
1456 |
|
|
|
1457 |
</dd>
|
|
|
1458 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1459 |
<span class="phpdocumentor-tag__name">parameter</span>
|
|
|
1460 |
</dt>
|
|
|
1461 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1462 |
|
|
|
1463 |
<section class="phpdocumentor-description"><p>string $value The value to match</p>
|
|
|
1464 |
</section>
|
|
|
1465 |
|
|
|
1466 |
</dd>
|
|
|
1467 |
<dt class="phpdocumentor-tag-list__entry">
|
|
|
1468 |
<span class="phpdocumentor-tag__name">returns</span>
|
|
|
1469 |
</dt>
|
|
|
1470 |
<dd class="phpdocumentor-tag-list__definition">
|
|
|
1471 |
|
|
|
1472 |
<section class="phpdocumentor-description"><p>string $returnColumn of first row, or null if none</p>
|
|
|
1473 |
</section>
|
|
|
1474 |
|
|
|
1475 |
</dd>
|
|
|
1476 |
</dl>
|
|
|
1477 |
|
|
|
1478 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1479 |
<span class="phpdocumentor-signature__response_type">mixed</span>
|
|
|
1480 |
—
|
|
|
1481 |
|
|
|
1482 |
|
|
|
1483 |
</article>
|
|
|
1484 |
<article
|
|
|
1485 |
class="phpdocumentor-element
|
|
|
1486 |
-method
|
|
|
1487 |
-protected
|
|
|
1488 |
"
|
|
|
1489 |
>
|
|
|
1490 |
<h4 class="phpdocumentor-element__name" id="method_setDBConnection">
|
|
|
1491 |
setDBConnection()
|
|
|
1492 |
<a href="classes/usersDataSourceMySQLi.html#method_setDBConnection" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1493 |
</h4>
|
|
|
1494 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1495 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1496 |
:
|
|
|
1497 |
<span class="phpdocumentor-element-found-in__line">255</span>
|
|
|
1498 |
|
|
|
1499 |
</aside>
|
|
|
1500 |
|
|
|
1501 |
<p class="phpdocumentor-summary">Make the database connection</p>
|
|
|
1502 |
|
|
|
1503 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1504 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
1505 |
<span class="phpdocumentor-signature__name">setDBConnection</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array<string|int, string> </span><span class="phpdocumentor-signature__argument__name">$parameters</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\mysqli">mysqli</abbr>|false</span></code>
|
|
|
1506 |
|
|
|
1507 |
|
|
|
1508 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1509 |
<dl class="phpdocumentor-argument-list">
|
|
|
1510 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1511 |
<span class="phpdocumentor-signature__argument__name">$parameters</span>
|
|
|
1512 |
: <span class="phpdocumentor-signature__argument__return-type">array<string|int, string></span>
|
|
|
1513 |
</dt>
|
|
|
1514 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1515 |
<section class="phpdocumentor-description"><p>Parameters for makeing the connection</p>
|
|
|
1516 |
</section>
|
|
|
1517 |
|
|
|
1518 |
</dd>
|
|
|
1519 |
</dl>
|
|
|
1520 |
|
|
|
1521 |
|
|
|
1522 |
|
|
|
1523 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1524 |
<span class="phpdocumentor-signature__response_type"><abbr title="\mysqli">mysqli</abbr>|false</span>
|
|
|
1525 |
—
|
|
|
1526 |
|
|
|
1527 |
|
|
|
1528 |
</article>
|
|
|
1529 |
<article
|
|
|
1530 |
class="phpdocumentor-element
|
|
|
1531 |
-method
|
|
|
1532 |
-protected
|
|
|
1533 |
"
|
|
|
1534 |
>
|
|
|
1535 |
<h4 class="phpdocumentor-element__name" id="method_tableColumnName">
|
|
|
1536 |
tableColumnName()
|
|
|
1537 |
<a href="classes/usersDataSourceMySQLi.html#method_tableColumnName" class="headerlink"><i class="fas fa-link"></i></a>
|
|
|
1538 |
</h4>
|
|
|
1539 |
<aside class="phpdocumentor-element-found-in">
|
|
|
1540 |
<abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
|
|
|
1541 |
:
|
|
|
1542 |
<span class="phpdocumentor-element-found-in__line">347</span>
|
|
|
1543 |
|
|
|
1544 |
</aside>
|
|
|
1545 |
|
|
|
1546 |
<p class="phpdocumentor-summary">Gets the actual database column name from the configuration file</p>
|
|
|
1547 |
|
|
|
1548 |
<code class="phpdocumentor-code phpdocumentor-signature ">
|
|
|
1549 |
<span class="phpdocumentor-signature__visibility">protected</span>
|
|
|
1550 |
<span class="phpdocumentor-signature__name">tableColumnName</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string </span><span class="phpdocumentor-signature__argument__name">$table</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">$field</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">''</span><span> ]</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">bool </span><span class="phpdocumentor-signature__argument__name">$fullTableColumn</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">false</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
|
|
|
1551 |
|
|
|
1552 |
<section class="phpdocumentor-description"><p>Since we use a lot of indirection, this is a handy function which
|
|
|
1553 |
allows us to replace something like
|
|
|
1554 |
$this->configuration['tables']['users']['fields']['name']['dbColumn']
|
|
|
1555 |
with
|
|
|
1556 |
$this->tableColumnName( 'users', 'name' )</p>
|
|
|
1557 |
<p>If called with only one parameter (the table), will return the
|
|
|
1558 |
actual database table name</p>
|
|
|
1559 |
</section>
|
|
|
1560 |
|
|
|
1561 |
<h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
|
|
|
1562 |
<dl class="phpdocumentor-argument-list">
|
|
|
1563 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1564 |
<span class="phpdocumentor-signature__argument__name">$table</span>
|
|
|
1565 |
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
|
|
1566 |
</dt>
|
|
|
1567 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1568 |
<section class="phpdocumentor-description"><p>Name of Table</p>
|
|
|
1569 |
</section>
|
|
|
1570 |
|
|
|
1571 |
</dd>
|
|
|
1572 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1573 |
<span class="phpdocumentor-signature__argument__name">$field</span>
|
|
|
1574 |
: <span class="phpdocumentor-signature__argument__return-type">string</span>
|
|
|
1575 |
= <span class="phpdocumentor-signature__argument__default-value">''</span> </dt>
|
|
|
1576 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1577 |
<section class="phpdocumentor-description"><p>Name of field in $table</p>
|
|
|
1578 |
</section>
|
|
|
1579 |
|
|
|
1580 |
</dd>
|
|
|
1581 |
<dt class="phpdocumentor-argument-list__entry">
|
|
|
1582 |
<span class="phpdocumentor-signature__argument__name">$fullTableColumn</span>
|
|
|
1583 |
: <span class="phpdocumentor-signature__argument__return-type">bool</span>
|
|
|
1584 |
= <span class="phpdocumentor-signature__argument__default-value">false</span> </dt>
|
|
|
1585 |
<dd class="phpdocumentor-argument-list__definition">
|
|
|
1586 |
<section class="phpdocumentor-description"><p>If set to true, will return table.column format</p>
|
|
|
1587 |
</section>
|
|
|
1588 |
|
|
|
1589 |
</dd>
|
|
|
1590 |
</dl>
|
|
|
1591 |
|
|
|
1592 |
|
|
|
1593 |
|
|
|
1594 |
<h5 class="phpdocumentor-return-value__heading">Return values</h5>
|
|
|
1595 |
<span class="phpdocumentor-signature__response_type">string</span>
|
|
|
1596 |
—
|
|
|
1597 |
<section class="phpdocumentor-description"><p>The actual name of the dbColumn in the table</p>
|
|
|
1598 |
</section>
|
|
|
1599 |
|
|
|
1600 |
|
|
|
1601 |
</article>
|
|
|
1602 |
</section>
|
|
|
1603 |
|
|
|
1604 |
|
|
|
1605 |
<script type="text/javascript">
|
|
|
1606 |
function loadExternalCodeSnippets(line) {
|
|
|
1607 |
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
|
|
|
1608 |
var src = pre.getAttribute('data-src').replace( /\\/g, '/');
|
|
|
1609 |
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
|
|
|
1610 |
var language = 'php';
|
|
|
1611 |
|
|
|
1612 |
var code = document.createElement('code');
|
|
|
1613 |
code.className = 'language-' + language;
|
|
|
1614 |
|
|
|
1615 |
pre.textContent = '';
|
|
|
1616 |
|
|
|
1617 |
pre.setAttribute('data-line', line)
|
|
|
1618 |
code.textContent = 'Loading…';
|
|
|
1619 |
|
|
|
1620 |
pre.appendChild(code);
|
|
|
1621 |
|
|
|
1622 |
var xhr = new XMLHttpRequest();
|
|
|
1623 |
|
|
|
1624 |
xhr.open('GET', src, true);
|
|
|
1625 |
|
|
|
1626 |
xhr.onreadystatechange = function () {
|
|
|
1627 |
if (xhr.readyState == 4) {
|
|
|
1628 |
|
|
|
1629 |
if (xhr.status < 400 && xhr.responseText) {
|
|
|
1630 |
code.textContent = xhr.responseText;
|
|
|
1631 |
|
|
|
1632 |
Prism.highlightElement(code);
|
|
|
1633 |
}
|
|
|
1634 |
else if (xhr.status >= 400) {
|
|
|
1635 |
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
|
|
|
1636 |
}
|
|
|
1637 |
else {
|
|
|
1638 |
code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
|
|
|
1639 |
}
|
|
|
1640 |
}
|
|
|
1641 |
};
|
|
|
1642 |
|
|
|
1643 |
xhr.send(null);
|
|
|
1644 |
});
|
|
|
1645 |
}
|
|
|
1646 |
|
|
|
1647 |
var modals = document.querySelectorAll("[data-modal]");
|
|
|
1648 |
|
|
|
1649 |
modals.forEach(function (trigger) {
|
|
|
1650 |
trigger.addEventListener("click", function (event) {
|
|
|
1651 |
//event.preventDefault();
|
|
|
1652 |
const modal = document.getElementById(trigger.dataset.modal);
|
|
|
1653 |
modal.classList.add("phpdocumentor-modal__open");
|
|
|
1654 |
loadExternalCodeSnippets(trigger.dataset.line)
|
|
|
1655 |
const exits = modal.querySelectorAll("[data-exit-button]");
|
|
|
1656 |
exits.forEach(function (exit) {
|
|
|
1657 |
exit.addEventListener("click", function (event) {
|
|
|
1658 |
event.preventDefault();
|
|
|
1659 |
modal.classList.remove("phpdocumentor-modal__open");
|
|
|
1660 |
});
|
|
|
1661 |
});
|
|
|
1662 |
});
|
|
|
1663 |
});
|
|
|
1664 |
</script>
|
|
|
1665 |
|
|
|
1666 |
</article>
|
|
|
1667 |
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
|
|
|
1668 |
<section class="phpdocumentor-search-results__dialog">
|
|
|
1669 |
<header class="phpdocumentor-search-results__header">
|
|
|
1670 |
<h2 class="phpdocumentor-search-results__title">Search results</h2>
|
|
|
1671 |
<button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
|
|
|
1672 |
</header>
|
|
|
1673 |
<section class="phpdocumentor-search-results__body">
|
|
|
1674 |
<ul class="phpdocumentor-search-results__entries"></ul>
|
|
|
1675 |
</section>
|
|
|
1676 |
</section>
|
|
|
1677 |
</section>
|
|
|
1678 |
</div>
|
|
|
1679 |
</div>
|
|
|
1680 |
<a href="classes/usersPermissionsDataSourceMySQLi.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
|
|
|
1681 |
|
|
|
1682 |
</main>
|
|
|
1683 |
|
|
|
1684 |
<script>
|
|
|
1685 |
cssVars({});
|
|
|
1686 |
</script>
|
|
|
1687 |
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
|
|
|
1688 |
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
|
|
1689 |
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
|
|
|
1690 |
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
|
|
|
1691 |
</body>
|
|
|
1692 |
</html>
|