summaryrefslogtreecommitdiffstats
path: root/app (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-09-19globals: Remove single call assertions for setPage...() functionsMalf Furious1-12/+2
Removing these unnecessary checks. They are not protecting us from anything, only inconveniencing me in index.php.
2018-09-19settings: Implement user tab form submissionMalf Furious2-0/+103
2018-09-19Update all usage of saveFile()Malf Furious2-10/+9
Update all usage of saveFile() to use added saveIfFile() function, forwarding on the convenience to model code. Model code can pass in file field names, rather than $_FILES arrays directly.
2018-09-19globals: Add function saveIfFile()Malf Furious1-0/+15
This is an alternative function to globals' saveFile(), which allows model code to just pass in the name of the expected uploaded file, rather than requiring them to look up the file themselves. This is in line with my preference to encapsulate PHP superglobals access away from most of the codebase. Note that even if the user opts not to upload optional files, the associated file <input> field will still be present in $_FILES, with a special error code set (meaning 'no file uploaded') which setFile() ignores. It is only in the case of a malformed form submission that $_FILES will be missing the requested file field, prompting Scrott to throw an exception.
2018-09-19formctrl: Hidden field name should be in 'input' arrayMalf Furious1-1/+1
The input[ ] portion of the hidden field name had been left off. This commit fixes this bug.
2018-09-16Add settings modal and user settings tabMalf Furious2-3/+151
Updated old settings modal design, to incorporate added Scrott features. Reimplemented this modal in Scrott from archived code and have included it in the navbar.
2018-09-16Add hidden formctrlMalf Furious1-0/+5
2018-09-16Add object background preview widgetMalf Furious2-0/+46
Similar to objHeadCircle() but for displaying a bg img on page, rather than as the actual background.
2018-09-16Add function obj::hasHeadImg()Malf Furious1-0/+10
We can check for the existence of an object's background image by calling getBgImg(), since it returns NULL when there is no such image. But getHeadImg() behaves differently, returning a path to 'static/img/null.jpg' (via df.php) when there is no image, making it more difficult to tell. This function addresses this concern.
2018-09-15Add file formctrlMalf Furious1-0/+8
This ctrl is not POSTed as part of the input[] array, but as a standalone name.
2018-09-15Add checkbox formctrlMalf Furious1-0/+9
2018-09-15Add css class and help-block to text formctrlMalf Furious1-2/+6
2018-09-15Form ctrls should use the 'control-label' classMalf Furious1-2/+2
2018-09-15Add function oneStr()Malf Furious1-0/+15
The initial intended use case for this is applying the "active" and "in active" classes to the first tab to appear in the settings modal.
2018-09-15Add 'my pads' pageMalf Furious2-0/+60
2018-09-15Implement dm-pad-add form handlerMalf Furious1-0/+27
2018-09-12Add function agent::getAgentObj()Malf Furious1-0/+17
This is basically a constructor for agent. The actual type returned is a contrete agent.
2018-09-08Add 'New Pad' modalMalf Furious2-1/+61
2018-09-08Add owner dropdown to 'New Group' modalMalf Furious1-0/+14
2018-09-07Fix typoMalf Furious1-1/+1
2018-09-07Fix bug in function table->loadObj()Malf Furious1-1/+7
If a table query yeilds zero rows, we would still attempt to load the first (index zero) into $this, causing an error to be thrown by PHP. We are now checking the size of the results array first.
2018-09-07Include bootstrap-select from std pageMalf Furious1-0/+2
2018-07-27Track library Bootstrap-select v1.12.4Malf Furious2-0/+15
2018-07-26Remove TODO and placeholderMalf Furious1-3/+0
2018-07-26Add "My Groups" pageMalf Furious2-0/+60
2018-07-26Add group/pad list itemMalf Furious3-0/+186
UI module to use when listing out groups and pads. These will link to the group/pad page and display information about the object.
2018-07-26Update function obj::getMembers()Malf Furious1-2/+7
Added a $limit argument to specify a maximum number of results to return.
2018-07-24Add About Scrott modalMalf Furious1-0/+16
2018-07-24Move $user page object scopeMalf Furious1-1/+2
Since several routes will use the current $user as the PAGE_OBJECT, I'm just setting it once above most of the logic. Any route that needs something else can change it. There's a condition in the setPageObj() function that throws if we attempt to call it more than once. I'm thinking this can be removed it's not protecting from much.
2018-07-24Add call to setPageName()Malf Furious1-0/+1
2018-07-24Show PAGE_NAME in the navbar/pad selectMalf Furious1-1/+1
2018-07-24Add $_SCROTT['PAGE_NAME'] variable and getter/setterMalf Furious1-0/+30
The intention is for index.php to set this variable. This is the text (HTML) displayed on the button for the pad select dropdown in the nav bar. Basically the canonical name of the page we're on.
2018-07-22Fix bug with login handlerMalf Furious1-1/+1
Now reloading current path after successful login, instead of redirecting to app-root.
2018-07-22Update function location()Malf Furious1-3/+6
Passing no argument (or NULL) now causes this function to redirect to the 'app-path' (current request page). This is a way to reload the current page.
2018-07-22Add groups/pads page buttons to navbarMalf Furious1-0/+2
2018-07-22Fix bug in agent 'has permission' functionsMalf Furious1-0/+27
The check that this commit adds to each of these functions enables users with all permissions on themselves.
2018-07-22Fix bug in function agent::isOwner()Malf Furious1-1/+4
If the argument doesn't have an owner, then an access error is thrown when we try to do ->guid. Since there is no owner, just return false. Otherwise, do the comparision as usual.
2018-07-22Implement display of object page background imagesMalf Furious1-1/+12
2018-07-21Update index.php to set appropriate page objectsMalf Furious1-1/+2
2018-07-21Change errorlevel constantsMalf Furious1-3/+3
2018-07-21Add PAGE_OBJECT global mechanismMalf Furious1-0/+33
This addresses a problem with most views. They need an object context to display in. IE what pad, group, etc. are we viewing? This variable is intended to be set by index.php and referenced by page models.
2018-07-21Display new group modal in navMalf Furious1-3/+4
2018-07-21Add new group modal view/model codeMalf Furious2-0/+84
2018-07-20Add the notice modalMalf Furious2-0/+93
2018-07-19Fix bug in index.phpMalf Furious1-1/+2
Perform minor sanitization on the input $_SERVER['PATH_INFO']. This commit adds logic that strips empty strings from main's $argv array. The pass to array_values() is to discard original $tokens array keys and re-number them starting from zero.
2018-07-19Define /logout routeMalf Furious1-0/+9
2018-07-19Add basic dashboard pageMalf Furious2-0/+47
2018-02-11Add start of navbarMalf Furious1-0/+68
2018-02-11Fix icon center-spacing on dbconfig viewMalf Furious1-1/+1
2018-02-11Address issue with user functions getCurrent() and setCurrent()Malf Furious1-2/+2
Previously, these functions would always call session_start() before doing most of their work. However, I've found that calling that function two or more times within the lifetime of a program results in NOTICE messages output from the PHP interpreter. Therefore, I am now only calling session_start() if the session is not already active.