Line 23... |
Line 23... |
23 |
With no modification, the system will store username, password and two booleans, isAdmin and enabled. The default table is created as
|
23 |
With no modification, the system will store username, password and two booleans, isAdmin and enabled. The default table is created as
|
24 |
|
24 |
|
25 |
<code sql>
|
25 |
<code sql>
|
26 |
create or replace table _users (
|
26 |
create or replace table _users (
|
27 |
_user_id int unsigned not null auto_increment,
|
27 |
_user_id int unsigned not null auto_increment,
|
28 |
login varchar(64),
|
28 |
login varchar(64), /* the login name */
|
29 |
password varchar(128),
|
29 |
password varchar(128), /* encrypted form of the password */
|
30 |
isAdmin boolean DEFAULT 1,
|
30 |
isAdmin boolean DEFAULT 1, /* if true, user has full admin rights */
|
31 |
enabled boolean DEFAULT 1,
|
31 |
enabled boolean DEFAULT 1, /* if false, user can not log in */
|
32 |
primary key (_user_id)
|
32 |
primary key (_user_id)
|
33 |
);
|
33 |
);
|
34 |
</code>
|
34 |
</code>
|
35 |
|
35 |
|
36 |
* login is filtered to alpha-numerics and the underscore character
|
36 |
* login is filtered to alpha-numerics and the underscore character
|
Line 223... |
Line 223... |
223 |
|
223 |
|
224 |
It is also nice is it can A) handle new columns and B) create and initialize the necessary storage
|
224 |
It is also nice is it can A) handle new columns and B) create and initialize the necessary storage
|
225 |
|
225 |
|
226 |
I separated this out from the Users class because not all programs need database access. For instance, the favorites_urls app uses file based storage, so by writing a new access class for it, we will hopefully be able to get the same functionality, but with a different storage back end.
|
226 |
I separated this out from the Users class because not all programs need database access. For instance, the favorites_urls app uses file based storage, so by writing a new access class for it, we will hopefully be able to get the same functionality, but with a different storage back end.
|
227 |
|
227 |
|
228 |
==== Future ====
|
- |
|
229 |
* I think I have a way of making it match things like INPUT TYPE='color' and INPUT TYPE='email'. I'm going to check that out.
|
- |
|
230 |
* This is only the initial part of this particular project. I now intend to extend both classes to allow boolean permissions which will be integrated into our new version of CAMP, giving very granular rights to users. It will be available as a second set of files in this repository and is planned for release by October 2021.
|
- |
|