Commit Graph

50 Commits

Author SHA1 Message Date
David Anderson 62f25e4016 Web: make some strings translatable 2020-08-18 23:57:42 -07:00
David Anderson ff91f05aa6 Tweaks to user URL/country flags
- Put flags in config.xml instead of project.inc
- Make them positive instead of negative
- make db_dump respect them.
2018-12-14 20:20:24 -08:00
David Anderson b45e89e9af web: add options for not collecting or showing URL and country
Add constants NO_USER_URL and NO_USER_COUNTRY.
If you set these to true (in project.inc)
there will be no query or display of user web site URL
and user country, respectively.
2018-12-10 16:58:56 -08:00
Shawn Kwang 90bdd9196a web: defined CONSENT_TYPE_ENROLL and replaced string 'ENROLL' with this define.
No changes to functionally, only a new define().
2018-09-17 12:55:55 -05:00
Shawn Kwang e4df047685 web: Misc small fixes.
Added tra() function.
2018-09-17 09:50:00 -05:00
Shawn Kwang cbce74df7c Merge branch 'master' into sak-useroptin-dbaddconsent
Prepare for merging this development branch into master.

Conflicts:
	html/ops/db_update.php
2018-09-12 11:48:25 -05:00
David Anderson c8aa75b5ef web: ensure that login token is valid for 24 hours 2018-07-13 19:35:20 -07:00
Shawn Kwang ffdc327509 web: Web code modified to work with new database table definitions.
Modified web code to use consent_type_id in place of consent_name in various places.
RPCs also modified to use the new definitions.
2018-06-15 15:38:39 -05:00
Shawn Kwang f7332ccdfb web: Add new constant for terms of use file.
Add new constant in project.inc, TERMSOFUSE_FILE, which is a path to the project's terms of use. This defaults to the previous location, a text file in the project's base directory.

get_project_config.php RPC modified to use this new constant, but if it is not defined, then the code will attempt to use the old path: this should be backwards-compatible for projects that do not update project.inc, but have a terms_of_use.txt file in their base directory.

HTML code modified to use this new constant.
2018-06-11 11:09:17 -05:00
Shawn Kwang 8944ba5ca7 web: minor changes found in review 2018-06-11 09:38:35 -05:00
Shawn Kwang f172822a94 web: Exiting users agree to terms of use when logging in.
Renamed 'optin consent' to 'agree to terms of use'. New config.xml variable name.
Decoupled new user agree to terms of use from existing users. If there is a ENROLL terms of use, and the project has enabled the 'enable_login_mustagree_termsofuse' boolean, then existing users must agree to the terms of use when the login, and this is recorded in the consent table.
2018-06-04 11:26:43 -05:00
Shawn Kwang a96ed6b4be web: modified RPCs to use new consent_type table definitions.
Added check consent type function for RPCs and Web forms.
2018-06-04 11:26:39 -05:00
Shawn Kwang 6482527bb5 web: refactored code to remove config option enable_record_optin_consent
Now the code uses the enabled flag for the consent_type ENROLL to detmerine if a terms of use
is showed to the user and whether or not consent is recorded for this general terms of use.
2018-06-04 11:26:38 -05:00
Shawn Kwang 6fa9a01ea6 web: Add an opt-in consent form to login workflow.
When a user logs in, and they have not yet consented, the user is presented with a form to consent to the Terms of Use. This adds or modifies records in the consent table.
Supported logins are: web form, authenticator, email_link, and ldap.
2018-05-08 14:36:05 -05:00
Shawn Kwang 0537feba0c web: Add functionality of consent to Web site and RPCs.
create_account RPC modified to record a user's consent.
am_set_info RPC modified to allow for modification of user's consent.
Account registration on Web site modified to show terms_of_use.txt file and record user's consent.
2018-05-04 18:42:05 -05:00
Kevin Reed e48bb4a7cd Merge branch 'master' into knr_passwd_hash 2018-03-22 12:55:13 -05:00
Kevin Reed 5f7cbdb2a7
Merge branch 'master' into dpa_passwd5 2018-03-22 09:28:01 -05:00
Kevin Reed cfa5cd6723 web: Fix autofocus and tab order for the login form 2018-03-09 13:51:41 -06:00
Kevin Reed 2253277c38 web: Remove the confirmation password field in locations where the "show
password" toggle has been added
2018-03-08 12:34:30 -06:00
Kevin Reed 0f9425c3ad Revert "web: provide defaults for user.login_token and user.login_token_time as"
This commit wasn't atomic, so reverting and redoing it as two seperate
commits

This reverts commit 855ff67e47.
2018-03-08 11:37:45 -06:00
Kevin Reed 855ff67e47 web: provide defaults for user.login_token and user.login_token_time as
the lack of them was preventing registration from working on (at least
on MariaDB 10.2)
2018-03-08 10:13:31 -06:00
Kevin Reed fd73f114d2 web: add 'show password' to login and change password pages. add label to text for show password to make it easier to select 2018-03-07 12:27:23 -06:00
Kevin Reed ce5d3ed79f
Merge pull request #2385 from BOINC/dpa_token
web: in download.php, use current login token if recent
2018-03-07 11:11:42 -06:00
David Anderson fb4a631fb4 web: improve - but not fix - password visibility checkbox
When you check the box it turns the input field type from "password" to "text".
If you navigate to another (say by clicking Submit)
and then return via the back button,
the checkbox is still checked but the input field type is back to "password"!
Further clicks toggle the type, so it's always wrong from that point.

I changed it so that clicking the checkbox sets the type
to the appropriate value rather than toggling it.
The type is still wrong after "back",
but it's right after further checkbox clicks.

Note: the example on w3schools.com
https://www.w3schools.com/howto/howto_js_toggle_password.asp
has the same bug.
2018-03-06 16:27:22 -08:00
David Anderson 3338fcdd19 web: in download.php, use current login token if recent
Generate a new login token only if the current one is older than a day.
That way if a user does several downloads in quick succession
(for whatever reason) autoattach will work with all of them.
2018-02-28 16:27:00 -08:00
David Anderson c6744a830c web: add "show password" checkbox to login form 2018-02-27 16:56:59 -08:00
David Anderson 889271a410 web: remove "forgot email?" link. "Login with authenticator" no longer exists.
Note: you can supply authenticator instead of password in regular login form.
Occasionally a project admin may need to do this to log in as another user.
2018-01-12 12:33:41 -08:00
David Anderson 5d37578ecc Add support for "visible password" checkbox
- make redundant password and country optional in create account.
- fix appearance of form items
- remove unused code
2018-01-08 00:35:53 -08:00
David Anderson 1ac3828563 web: change form_checkboxes() so you can specify the state of each one 2018-01-06 01:07:27 -08:00
David Anderson 76f94b66d7 web: improve password reset form
- call it "Reset password"
- move authenticator-based login to a new file, login_auth.php
  This is intended for admins, not users
- Use bootstrap forms
2017-11-21 15:32:42 -08:00
David Anderson 13f2cda704 Time out login tokens after 1 day
Also add user_id arg to login_token_lookup RPC,
so we don't need to index user.login_token.
Pass user_id to concierge.
2017-11-03 13:07:51 -07:00
David Anderson 328e53d677 Store login tokens in user records instead of separate table 2017-11-02 23:11:55 -07:00
David Anderson 15f28c96b6 Add server-side support for simplified register/download/attach
Add the server parts of the scheme described here:
https://boinc.berkeley.edu/trac/wiki/SimpleAttach

This includes:
- add login_token table and function for creating login tokens
- add Web RPC login_token_lookup.php for mapping token to auth
- change concierge protocol to take project ID and login token
- update download.php so that it gets client version info
    from versions.xml (from BOINC web site)
    and displays buttons with OS name, versions and file sizes
    like on the BOINC download page
- make "register.php" work

I've tested this all the way through downloading the installer file
with the augmented name.
Changes to the installer and client are needed to complete the system.
2017-10-30 21:38:07 -07:00
David Anderson 5c3d3dbdbe Web: change account creation page to use tooltips for details 2017-09-25 22:08:40 -07:00
David Anderson dfe7261cda web: improve button colors and appearance
principles:
- primary action buttons are green (btn-success)
- secondary action buttons are blue (btn-primary)
- potentially risky action buttons are yellow (btn-warning)
- if there are a lot of buttons (e.g. forum posts) use btn-xs
2017-08-20 01:17:21 -07:00
David Anderson 4093be9579 web: fix PHP warning in sending "report post" emails 2017-06-24 14:41:07 -07:00
David Anderson e712c7af9a web: code shuffle, no functional changes
separate user-related code into:
    user.php (web display of accounts)
    user_util.php (creating/deleting accounts)
2017-06-22 01:07:25 -07:00
David Anderson 415ebacbd1 web: encapsulate PHP
In bootstrap.inc there are some functions for creating forms.
They conceal Bootstrap (and HTML itself) from the caller.
I changed a couple of forms (edit user into and create account) to use this API.
There are many other forms that we could change as well.
This is how I'd like the PHP code to evolve:
encapsulate HTML in utility functions.
We have this for tables, forms, and header/footer.

Also finish the NO_COMPUTING changes.
2017-06-20 00:38:11 -07:00
David Anderson 5afcdf0c3c Web: don't request postal code by default
We were asking for postal code (optional) on registration.
The purpose was to let projects study
the geographical distribution of their volunteers.
But AFAIK no one ever did this,
and some volunteers have said (understandably, I think)
that asking for postal code seems like an invasion of privacy.

So I conditioned the postal-code code on a boolean constant POSTAL_CODE.
If you put
define('POSTAL_CODE', true);
in your html/project/project.inc, you'll get the old behavior.
Otherwise users won't see postal-code related stuff any more.
2017-06-05 14:26:42 -07:00
David Anderson 853f8661b3 web: fix function name for country select 2017-02-16 10:59:56 -08:00
David Anderson c2350c7f57 web: try to get Recaptcha working on IE 2017-02-01 22:13:21 -08:00
David Anderson 9d673e1c93 web: appearance tweaks
- use form-control class for text inputs and selects.
    This makes them all full-width, but I guess that's OK.
- use success class (green) for action buttons
- right-align table headings where appropriate
- use <small> instead of text-muted.
- tweak custom CSS to fix link and navbar visited colors
2016-12-04 21:04:23 -08:00
David Anderson 91b4dcdc37 web: make some strings translatable
Also: on default home page, don't show the big green Join button
if the user is logged in; they're presumably running BOINC
on at least one computer.
However, in this case put a Join item in the Project menu
in case this is a new computer and they forgot where to download from.
2016-11-29 00:34:26 -08:00
David Anderson a22b1e3136 web: various tweaks
- make selects 240px wide (kludge)
- in navbar, link user name to home page
- add Project to navbar, more Your Account there
- add maximum-scale to <meta>
2016-11-24 18:01:41 -08:00
David Anderson 7463938995 web: more fixes for dark themes 2016-11-23 02:35:28 -08:00
David Anderson d5167aeec5 web: don't show "forgot email" link for non-compute projects 2015-11-04 11:54:38 -08:00
Christian Beer 72bec2388a Web: rename recaptcha_get_html() because of a conflict with Drupal
When also including an older recaptchalib.php this function gets redefined. Since it is only a wrapper function and only used within BOINC, renaming it is safe.
2015-10-14 12:10:06 +02:00
Nicolás Alvarez cfd1d52c80 Update recaptcha to latest version of the API.
This allows a new simplified captcha that in some cases only makes the user
have to tick a checkbox; no need to type garbled characters or anything.
More info at:
http://googleonlinesecurity.blogspot.com/2014/12/are-you-robot-introducing-no-captcha.html
2015-01-17 00:18:44 -03:00
David Anderson e470620acb web: preliminary support for simplified attach
See http://boinc.berkeley.edu/trac/wiki/SimpleAttach
2015-01-14 09:19:11 -08:00
David Anderson 037f1b3eb2 web: fix PHP errors on empty team search; when delete spam team, delete user too 2015-01-09 10:54:05 -08:00