diff --git a/html/process/settings/user.php b/html/process/settings/user.php index fb80de4..d43447c 100644 --- a/html/process/settings/user.php +++ b/html/process/settings/user.php @@ -19,7 +19,7 @@ $passwordConfirmed = $user->confirmPassword($_POST['currentPassword']); } if (isset($_POST['pronouns'])) { - $user->updatePronoun($_POST['pronouns']); + $user->updatePronoun(substr($_POST['pronouns'], 0, 20)); } if (isset($_POST['dashTheme'])) { $user->setTheme($_POST['dashTheme']); diff --git a/html/process/user/register.php b/html/process/user/register.php index 0a7ac84..f1849ee 100644 --- a/html/process/user/register.php +++ b/html/process/user/register.php @@ -7,7 +7,7 @@ // Force this to be a JSON return for a laugh if (isset($_POST['g-recaptcha-response'])) { $captcha = $_POST['g-recaptcha-response']; - $secretKey = $ENV['CAPTCHA_SECRETKEY']; + $secretKey = $_ENV['CAPTCHA_SECRETKEY']; $captchaIP = $_SERVER['REMOTE_ADDR']; $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha); $response = file_get_contents($url); diff --git a/html/register.php b/html/register.php index dbb6d37..4510b5b 100644 --- a/html/register.php +++ b/html/register.php @@ -129,7 +129,7 @@ function(response) {
-
+
diff --git a/html/settings/user.php b/html/settings/user.php index a8abbce..1302c23 100644 --- a/html/settings/user.php +++ b/html/settings/user.php @@ -195,13 +195,9 @@ function(response) {

If you like, you can select pronouns to display next to your blog name on the dashboard. Set them here, then turn them on in blog settings for each blog you want them on.

+

This field is for pronouns only. For example, she/her, they/them, etc.

- +
diff --git a/src/classes/User.class.php b/src/classes/User.class.php index a418db8..fd350d8 100644 --- a/src/classes/User.class.php +++ b/src/classes/User.class.php @@ -329,27 +329,8 @@ public function getByEmail(string $email) { } public function updatePronoun($option) { - if ($option == 'none') { - $values = array($this->ID); - $this->database->db_update("UPDATE users SET pronouns = null where id = $1", $values); - } else { - $pronoun = ''; - switch ($option) { - case 0: // they - $pronoun = 'they/them'; - break; - case 1: // she - $pronoun = 'she/her'; - break; - case 2: //he - $pronoun = 'he/him'; - break; - default: - $pronoun = 'they/them'; - } - $values = array($this->ID, $pronoun); - $this->database->db_update("UPDATE users SET pronouns = $2 where id = $1", $values); - } + $values = array($this->ID, $option); + $this->database->db_update("UPDATE users SET pronouns = $2 where id = $1", $values); } public function updateMissing($array) { diff --git a/tests/prep/wf.sql b/tests/prep/wf.sql index 3874621..c24e188 100644 --- a/tests/prep/wf.sql +++ b/tests/prep/wf.sql @@ -1369,7 +1369,7 @@ CREATE TABLE public.users ( account_type public.account_types, restrictions public.account_restrictions[] DEFAULT '{}'::public.account_restrictions[], flags public.account_flags[] DEFAULT '{}'::public.account_flags[], - pronouns public.pronoun_sets + pronouns text );