Change the way we see if a web server is running on a host.
Fetch http://host, and check for 2xx or 4xx status.
With this change, new server_status.php works on SETI@home.
remote_server_status.php (script for seeing if remote daemons are running)
did this by ps -C command,
and seeing if the last line of the output contained the command.
This didn't work for SETI@home, because the daemons are symbolic links in bin/.
The command that ps knows about is the file name after resolving the link.
This generally doesn't contain the original command name,
so it would look like no remote daemons are running.
Fix: look up the PID (in pid_host/xxx.pid) and use "ps PID".
This also correctly distinguishes between daemons
that use the same program on the same host.
There were a couple of issues:
- the server status page is served from a web server, say X.
A daemon is "remote" if it runs on a machine other than X.
This is not the same as having a <host> element in the daemon's
config.xml entry.
Add logic to correctly classify daemons as remote or not.
- get rid of the <uldl_host> stuff.
There can be separate upload and download servers,
and they are identified by <upload_url> and <download_url>.
They may or not be remote;
to decide this, compare the host part of the URL
with the host part of the project's master URL.
- Hosts are specified with the machine name (e.g. isaac)
or domain name (isaac.ssl.berkeley.edu).
Keep track of this distinction.
The server status page was one of the oldest and cruftiest parts of BOINC.
It flew in the face of the model/view/controller paradigm,
and had the kind of convoluted structure that beginning programmers
often produce.
Plus it didn't work with remote daemons.
Also:
- use "admin_error_page()" instead of "error_page()" in admin pages
- add footer w/ Main Page link to admin pages
- code cleanup in delete user function
When deleting a user (from the delete_spammers.php script),
remove records that refer to that user in
private_messages, notify, credit_user, badge_user, and friend tables.
Notes:
- This change eliminates some dangling references,
but in general a BOINC DB doesn't have referential integrity.
The code should check for dangling references.
- Functions like BoincUser::delete() should delete a user record,
not try to remove things that refer to it.
The function delete_user() (in user.inc) does this.
I seemed to be playing whack-a-mole with problems related to
recursive inclusions of project.inc.
Solve this by changing how the use of mysqli can be inhibited:
instead of defining NO_MYSQL in project, put <no_mysqli/> in config.xml
Change all the PHP code to use _mysql_query() instead of mysql_query()
(and similar for other functions).
_mysql_query() uses the mysqli API if available, else the old API.
Going forward, all PHP code should the DB abstration layer if possible;
else it should use the _mysql_* functions.
See http://boinc.berkeley.edu/trac/wiki/PerAppCredit
If enabled (by the <credit_by_app> config flag)
validators will maintain on a per-(app, user, credit type) basis,
and same for teams,
in new DB tables credit_user and credit_team.
This info is displayed in the web site, on user and team pages,
using project-supplied functions to generate the HTML.
Note: update_stats doesn't decay the recent-average values
for per-app credit; I'll add this if needed.
When deleting a spammer, delete
- forum_logging
- private messages
- notifications
Also, when displaying private messages, check if sender
doesn't exist, and delete if so