This is for my own use in BOINC-wide teams.
It must work even if account/team creation are disabled
(as they are in the BOINC-wide teams site).
To do this, I moved the <disable_team_creation> check out of make_team()
and moved it to the existing places that call make_team().
The logic now matches that of make_user().
* Added still required code that was removed without apparent reason
* If in doubt about a code's purpose, please check the history first
* Original commit: 8be519a
There can be intermittent "simplexml_load_file(): I/O warning : failed to load external entity" errors when using simplexml_load_file(). According to http://stackoverflow.com/questions/20534866 the solution is to use file_get_contents() first. This seems to work in our case too.
The default for uotd_time in the profile table is NULL but new profiles created after commit 6543928 have uotd_time=0. This means they are not eligible for UOTD because the default candidate queries only check if uotd_time is null. This fixes that and considers NULL and 0 as 'profile has not been UOTD but can be a candidate'.
Specify a $fallback_mode that is used for read-only DB connections:
0: default, use db_user if no replica_db_user is specified,
first try replica_db_host (if specified) then db_host
1: only use replica_db_user, first try replica_db_host then db_host
2: only use replica_db_user, only try replica_db_host
can be set projectwide using <replica_fallback_mode> in config.xml
UOTD selection now uses the DB layer and outputs the different stages of candidate selection so they end up in the logfile. Selecting a new UOTD can now be enforced (so it always happens at the same time or the current UOTD's profile is not approved by the project).
The KWSN statistics site says that the service is retired. The other pages are not accessible or show other non-BOINC related content. allprojectstats.com is not updated so I disabled it for the time being.
The simplexml_load_file() call fails if allow_url_fopen is set to false and does not retrieve the statistics for the user. Curl is assumed to be available instead, if not, no information is shown to the user.
Modern Browser complain if there are non-https elements in https websites. This makes sure that if the user visits via https all elements of the page are also retrieved using SSL. Furthermore it uses https urls in emails that are send to the user, if SECURE_URL_BASE is set in project/project.inc.
The only remaining places where URL_BASE is used is when it is used as master_url where it is important that it is in sync with what the scheduler uses.
This version allows the use of alternative RequestMethods in case get_file_contents() is disabled for security reasons. Currently it uses fsockopen() but it can also use php-curl. Include inc/recaptchalib.php into the file where the reCaptcha is shown or validated. The function boinc_recaptcha_isValidated() is a convenient wrapper that can be updated for future versions or changes of the RequestMethod used.