Preliminary OAuth implementation. Whee!
Since I anticipate actually sharing this with other human beings, let’s start a real documentation folder.

Also: updated SQL definitions to include latest user-related changes.
Restricted user view
Users are now consistently associated with all of their data in the cache — and all queries are restricted to the current user’s cached data.
Finish docs move

Hrm. Seems that Coda's Git integration is even more flaky than previously observed.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Also export webcal feeds
The export script is now also OAuth-enabled (that is: use the API to get the ICS/webcal feed for a specific course, rather than your entire calendar).
More robust logging
I suppose that if I were a real grown-up, I would give this script its own log files… but, at least it’s writing to the server logs. Theoretically.
Redirect back to current page
Rejiggered OAuth so that a user who lands on a specific page is redirected back to it after logging in (if not already logged in).
Check for authentication
Check for an authenticated user before loading any page. (Sync is special and needs its own attention, since it’s not run as web page, but rather as a scheduled script. Coming soon.)
Revert "Check for authentication"

This reverts commit 2c7f7678f116c3617b9628e2f8f4298a181dd1d3.
Revert "Redirect back to current page"

This reverts commit ebac8140fb2588344171e85f0741cf4f250278d3.
Revert "More robust logging"

This reverts commit 9ef9d6a2a33011331ece89fa3d4e56b0d494dde1.
OAuth Do-over

Just redid OAuth per Kevin Hansen's recommendation (do both a User Info request (to get the "remember this app checkbox") and the token request (for API access).

I think I'm doing them in the wrong order right now, but want to have a commit in place to revert back to if I really break it.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Pretty Labeling

Updated the OAuth requests to give themselves prettier labels.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Removed debugFlags()

I think OAuth is working as desired (pending some clarification of the two keys issue).

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
No OAuth from CLI

We can't use OAuth when running from the command line (as we will as a scheduled cron job to sync), so we'll rely on cached credentials at that point.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Used cached user data from CLI

Rather than relying on the session data (which won't exist from the CLI), kick over to using cached user data when run from the CLI (as we will be when syncing as a cron job).

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
Prep for Submodules

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
PHP iCalendar Submodule

Structuring the repo in a more robust manner, with PHP iCalendar as its own (submodule) repository.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
SMCanvasLib Submodule

First pass. Doubtless there will be bugs to squash.

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>
SMCanvasLib Depdendencies

Signed-off-by: Seth Battis <SethBattis@stmarksschool.org>