Age | Commit message (Collapse) | Author | Files | Lines |
|
This is not meant to be a user (admin) configurable key. Rather, this
is a mechanism for success/failure results from interactions with
PHPMailer to make their way back to the UI. Down the road, email
sending functions should publish their true/false return value to this
configuration key. The initial default value of "NULL" means no mail
send attempts have taken place.
|
|
In cases where the pad had no stages beneath it, `new
stage($this->stage)` would construct an invalid object. As it turns
out, calling ->getArray() on an uninitialized stage object yeilds bad
results.
Instead of patching the stage::getArray() function, I add a check to
harden pad::getStages(). My reasoning for this is as follows: The bug
in getArray() manifests from a domain error, ie. it's only because we
are calling it on an uninitialized object. The object is already in a
bad state prior to caling getArray(). Rather, I opt to patch
getStages() so that we never create a bad object in the first place.
Now, for no-stage pads, getStages() will return early an empty array.
|
|
This particular flaw was dampening (and could popentially be hiding) the
effects of other bugs.
For instance, in this case, a GUID of "" was invalidly being used to
construct an object. This should obviously be considered an error, but
since "" evaluates to false, the construction was treated as default (no
GUID) construction and succedded. It wasn't until later when missing
properties were accessed that random PHP error messages clued me into what
was happening.
Now, when any sort of explicit value is used to construct an object (not
NULL), an object load will be attempted, giving bad input more chances
to fail outright and trigger an exception. In addition, the 'no such
guid' exception message is updated to place quotes ('') around the GUID
string to make it more obvious when "" is used in the future.
|
|
These two functions, 'getCurrentTimestamp()' and 'isGUID()' are updated
to be public. There is actually no good reason for them to be private;
I originally just never antisipated their use outside this class.
I need isGUID() in index.php to help with page routing. Neither of
these two functions have side effects of any kind nor any unexpected
behavior, so there is no harm in going public.
|
|
Removing these unnecessary checks. They are not protecting us from
anything, only inconveniencing me in index.php.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
This is basically a constructor for agent. The actual type returned is
a contrete agent.
|
|
|
|
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.
|
|
Added a $limit argument to specify a maximum number of results to
return.
|
|
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.
|
|
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.
|
|
The check that this commit adds to each of these functions enables users
with all permissions on themselves.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
If the session is set to an invalid (eg: deleted) user GUID, an
exception is (correctly) thrown. This commit catches that and enables
getCurrent() to close the bad session and return NULL.
|
|
|
|
|
|
Since 'object' is now a reserved word (as of PHP 7.2), I have to rename
this class. I really preferred the name object, but obj will have to
do.
|
|
|
|
|
|
|
|
|
|
Now setting the name for email FROM field using system config
'smtpFrom'.
|
|
This is the name to give on FROM headers to generated email messages.
|
|
Fixed a bug and fine-tuned some of the behavior of this function.
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit 45889e98e7a12b22cbaaceedd5531d4158888530.
This reverts commit 6b643d4bbb469d35c6664176bc1aa641d130d99f.
This reverts commit 7872377be7a0fc97316fc20d28a4bcfec15c6111.
This feature was moved to another file.
|
|
|
|
Adding this as an abstract function to class agent. Since we will only
be sending emails to stored users (and groups) this makes more sense and
allows us to remove this function from the global namespace as well.
|
|
Changing the $rcpt argument from an email address string to a user
object. This allows us to ensure the address has been confirmed, to not
send mail to a blank address, and to include the user's display name in
the TO mail headers.
Also, added support for mail attachments via PHPMailer. This can be
used to forward any attachments added to Scrott message objects to email
users as well.
|
|
Function should be only sending to one recipient at a time.
|
|
Helper routine to spin up a PHPMailer object, set all its options
(mostly from the database) and send off the message.
|
|
|
|
|
|
|
|
This function is needed in the scope of issue, mesgs, and pads alike.
It would also make sense to use this to retrive users' private messages.
For these reasons, this function is now being defined higher up in the
object hierarchy.
|
|
This feature allows a pad-level discussion to be promoted to an issue.
A new object is created, but all content is preserved. However, if the
thread OP message had an attachment, that attachment cannot be retained.
|
|
Now saving the original name of the attachment file in the message
object.
|
|
Value set to 512 megabytes.
|
|
|