summaryrefslogtreecommitdiffstats
path: root/app/class (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-02-13Implement function database::getInstance()Malf Furious1-2/+30
2017-02-13Add app-root(), app-path(), and similar function to globals.phpMalf Furious1-0/+34
2017-02-07Add function expectType() to table classMalf Furious2-0/+16
protected function exceptType added for use by subclasses to assert that the database object loaded is the correct type and to protect against cases like EG: passing the GUID for a group to new user(...); If a problem is detected, throw an exception.
2017-02-06Update function signatures for table classMalf Furious1-10/+10
Various function (and their usages) in the table class have been updated to be static class function.
2017-02-06Update table class tree to use static database referencesMalf Furious3-31/+27
2017-02-06Update database APIMalf Furious2-8/+25
The abstract functions of database have been made protected and their names prefixed with '_'. The database class has been given new static functions query() and esc(), which call the _query() and _esc() function from the database instance object. This change was made to address the use of db routines from static contexes. Calls like `database::get()->query()` which mix static and instance function access operators, can now be `database::query()`, and all singleton is abstracted away; the instance's destructor continues to close the db connection.
2017-02-05Add redirect to forceful logoutMalf Furious1-0/+1
While forcing a logout, we need to also redirect to the app root.
2017-02-05Add global source code fileMalf Furious1-0/+22
2017-02-05Add user classMalf Furious1-0/+183
2017-02-05Fix bug in mysql query functionMalf Furious1-1/+1
Need to remove the NULL return value from fetch_assoc() to fix usages of count($res) for determining the number of results from a MySQL query. This NULL return value is returned from mysqli's fetch_assoc() function to signal no more result rows.
2017-02-05Remove custom exception 'databasekeyexception'Malf Furious1-9/+7
Just use a generic exception in these cases. I don't want to handle these any differently, and just fall back on the main Exception() error page once we get to a UI.
2017-02-04Add agent classMalf Furious1-0/+54
2017-02-04Fix to object class function signatureMalf Furious1-1/+1
The getOwner() function should have had a nullable return type.
2017-01-17Add helper functions to table classMalf Furious1-0/+39
2017-01-16Add object classMalf Furious1-0/+89
2017-01-15Add mysql classMalf Furious1-0/+68
2017-01-15Add table classMalf Furious1-0/+173
2017-01-14Add database classMalf Furious1-0/+58
2017-01-14Reset working directory for clean Scrott implementationMalf Furious2-147/+0
2017-01-14Partial commit of initObj function -- this class needs reworked again...Malf Furious1-0/+26
2016-10-23Add mysql classMalf Furious2-0/+75
2016-10-23Add database classMalf Furious1-0/+46
2016-10-22Deprecate application codeMalf Furious15-1871/+0
Setup to perform an iteration of development focused on a simpler implementation and eliminating redundancy in design.
2016-09-18Move function User::rmHeadImage() to Object classMalf Furious2-11/+11
2016-09-17Add function Object::getURL()Malf Furious1-0/+8
2016-09-13Move function User::getHeadImage() to Object classMalf Furious2-8/+8
Increase the scope of this function so it may be used by groups.
2016-09-13Changes to the handling of indirect variables, properties, and methodsMalf Furious1-6/+6
To maintain forward compatability with newer versions of PHP (and since my dev environment is now running PHP 7), this patch is made to address the following breaking change from PHP 5: PHP 7 now uses an abstract syntax tree when parsing source files. This has permitted many improvements to the language which were previously impossible due to limitations in the parser used in earlier versions of PHP, but has resulted in the removal of a few special cases for consistency reasons, which has resulted in backward compatibility breaks. Indirect access to variables, properties, and methods will now be evaluated strictly in left-to-right order, as opposed to the previous mix of special cases.
2016-06-11Add function User::getGroups()Malf Furious1-0/+25
This function returns all groups the user either owns or is a member of. This is not necessarily the same as all groups the user has access permission to. The *not-yet-implemented* object explorer feature should be used to browse those.
2016-06-10Fix typoMalf Furious1-1/+1
2016-06-10Add functions to Object class to determine user permissionsMalf Furious1-0/+313
Added a variety of functions to the Object base class for testing a user's access level to another object. Also added functions to test whether a given user or group is an owner or member of another object.
2016-06-08Add function Object::getOwner()Malf Furious1-0/+12
Added object function to get the owner of an object. This base-class function returns a User object, however a user might not always be the kind of owner (eg: a group can own a pad). In these situations, Object sub-classes should override this function and return the appropriate type of object.
2016-06-08Add function Object::getMembers()Malf Furious1-0/+16
Added object function to get an array of all its members. These will always be user objects, so this is always a safe function to call.
2016-06-01Add function Group::createNewGroup()Malf Furious2-0/+17
This function will initialize a new group object and write it to the database, with a given group name and owner user.
2016-05-26Add copyright notice to Scrott class filesMalf Furious15-0/+210
2016-05-22Define Scrott version number constant throughout appMalf Furious1-0/+3
2016-05-22Add function User::getNumAdmins()Malf Furious1-0/+10
Function to count the number of admin accounts that exist. This is used to make sure that while deleteing accounts, the number of administrators never drops to zero.
2016-05-01Add function User::rmHeadImage()Malf Furious1-0/+11
Function to delete the user image file for the given user object.
2016-05-01Fix to Form::saveFile()Malf Furious1-1/+3
Only log an error if we get an upload error besides err code 4 (No file uploaded)
2016-05-01Add function getHeadImage() to User classMalf Furious1-0/+8
This function will return the path to the head image (user image) for the user object. This path should be something like: <APP_ROOT>/file.php?d=img/heads&f=<GUID>
2016-04-27Add function Form::saveFile()Malf Furious1-0/+41
This is a rework of how the framework handles performing file uploads. Rather than attaching new fields to a form (of type file) and handling them during populate() then saving later, users can call what is essentially a static function and save files in isolation. Since each webform I can conceive using in Scrott at this time won't be uploading more than one file at a time, this model should work nicely moving forward; however can be easily adjusted if need be.
2016-04-27Revert "Add form field type 'file'"Malf Furious1-17/+0
This reverts commit 8ad6e8f9223bd3ee214478b3e1247f9c7d8e91ec. See parent commit message
2016-04-27Revert "Update function Form::populate() to initialize fields added with ↵Malf Furious1-35/+1
Form::field_file()" This reverts commit 1f8b53e426b8c0a1546e9d5c21573be9003cb556. See parent commit message.
2016-04-27Revert "Add function Form::saveUploadedFile()"Malf Furious1-8/+0
This reverts commit 3d493fc75dc6e3593001c2d9dfef26f4c1d79c2c. The way I was wanting to handle file uploads isn't going to fly with a semantic of PHP and POST var mgmt. -.- Rolling back relevant changes to write up something else.
2016-03-29Add function Form::saveUploadedFile()Malf Furious1-0/+8
Added function to form class to move tmp uploaded files to permanent storage
2016-03-27Update function Form::populate() to initialize fields added with ↵Malf Furious1-1/+35
Form::field_file() Set $form->[name] for each file field type setup on the form.
2016-03-27Add form field type 'file'Malf Furious1-0/+17
Add the Form::field_file() function to allow form handlers to specify they expect to receive file from the end-user. This adds data about the file field to the form, but does not yet handle it in the populate function
2016-03-27Add function User::getAddUsers_orderByAdminByName()Malf Furious1-0/+16
Added function to retrive all users in system presorted first by admin status (Admins first), then by username in alpha order
2016-03-27Move getUserGlyphicon function from common model into user classMalf Furious1-0/+11
2016-03-27Alter representation of form boolean valuesMalf Furious1-1/+1
Changed how Form() objects model true and false for boolean fields. Was "true" and "false", is now "1" and "0", respectivly. This is to address how Mysql handles these values as they are pushed to the db.
2016-03-27Add function User::confirmEmailKey()Malf Furious1-0/+12
Validates the users supposed email key. If correct, sets the users emailConf flag.