Skip to content

Commit

Permalink
Merge pull request #9405 from alikon/patch-60
Browse files Browse the repository at this point in the history
Regression: Unable to use Terms of Service with the core user plugin …
  • Loading branch information
wilsonge committed Mar 14, 2016
2 parents d9264d8 + 4d88da8 commit b9b7629
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions plugins/user/profile/profile.php
Expand Up @@ -363,6 +363,11 @@ public function onUserBeforeSave($user, $isnew, $data)
throw new InvalidArgumentException(JText::_('PLG_USER_PROFILE_ERROR_INVALID_DOB'));
}
}
// Check that the tos are valid.
if (!($data['profile']['tos']))
{
throw new InvalidArgumentException(JText::_('PLG_USER_PROFILE_FIELD_TOS_DESC_SITE'));
}

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/user/profile/profiles/profile.xml
Expand Up @@ -112,11 +112,11 @@
<field
name="tos"
type="tos"
default=""
default="0"
label="PLG_USER_PROFILE_FIELD_TOS_LABEL"
description="PLG_USER_PROFILE_FIELD_TOS_DESC">
<option value="1">PLG_USER_PROFILE_OPTION_AGREE</option>
<option value="">JNO</option>
<option value="0">JNO</option>
</field>
</fieldset>
</fields>
Expand Down

0 comments on commit b9b7629

Please sign in to comment.