This just seams reasonable enough.
Fix PHP notice
If we're not going to display the rank, don't bother to calculate it.

This shaves off some queries and calculations on the team page
during a scoreboard freeze.
Two optimisations in putTeamRow() query behaviour.

Do not query categories, we're not using them later.
Do not requery the same team totals in the calcTeamRow function
we just queried before calling it, just pass them in.
Move updating of last_login to do_login function.

Otherwise it would be called on every page load which has shown to
be problematic in the past. The drawback to this change is that it
now only updates this info for auth methods that actually perform
a login operation. There is no real way around that unless we keep
a session for any login type, which is planned.
Add option to import zip files to database.

These zip files can be used for compile, run, and compile
scripts/programs. Zip file must contain an executable file named 'build'
which is called prior to execution (once). Either another executable
file named 'run' already exists or it has to be created by running
'build'.
Add relation for new executable table.
Add API endpoint to download executable zip files.
Fetch compile scripts/programs from DB.

As a proof-of-concept, if a special compile script is specified, the
corresponding zip file is fetched from database and cached for further
use (only updated when md5sum changes).
Fix downloading of executables.
Add unit to the display of executable size.
Add page to view contents of zip file.
Uniformize/cleanup SQL and add upgrade snippet.