How to disable Personal Contact Form display in User Registration - drupal-8

I am new to Drupal 8.
I am setting up a simple site and do not want to allow users to contact each other. However, I do want to use forms such as Register for an event.
I have updated the user registration form by adding additional fields, such as first name, address, phone, etc.
/user/register displays the Contact Settings box:
"Allow other users to contact you via a personal contact form which keeps your email address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature."
with Personal contact form check box unchecked.
How can hide the display of the Contact settings box completely?

That form is added by the contact module. You can either
Disable that module on /admin/modules
Disable the contact output on /admin/config/people/accounts/form-display
Create some overrides (so you can disable it for specific roles or other logic)
Overrides
If you want to override the
default behaviour, you need to create a new module and implement a hook_form_alter() as follows:
/**
* Implements hook_form_alter().
*/
function yourmodulename_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
{
if($form_id == 'user_form' || $form_id == 'user_register_form') {
// Do some checks (e.g. role, permission), and then:
unset($form['contact']);
}
}
The contact module adds the form via form_alter hook as well, so it could very well be that the order of hook execution messes things up (this was the case for me). You might have to implement hook_module_implements_alter() as well, as follows:
/**
* Implements hook_module_implements_alter().
*/
function yourmodulename_module_implements_alter(&$implementations, $hook)
{
if($hook == 'form_alter') {
$group = $implementations['yourmodulename'];
unset($implementations['yourmodulename']);
$implementations['yourmodulename'] = $group;
}
}

The simplest approach for me to disabling the personal contact form was:
Following the instructions to set personal contact form off by default (from Drupal contact module documentation)
Navigate to the Account Settings page (Administration > Configuration > People > Accounts or http://example.com/admin/config/people/accounts)
In the Contact settings section specify whether the contact form is enabled for users by default.
Click "Save configuration."
Go to /admin/config/people/accounts/form-display (as instructed by Marcus above)
Move "Contact settings" to disabled.
Click save
So now the personal contact form is off by default for all future users and they don't have the ability to turn it on. Note that this does not change things for existing users on the site.

Related

I can't use alias email as user support email in Google consent auth [duplicate]

I created new Google Play game and would like to change the email displayed on Google Consent Screen. Google Developers Console screen has a dropdown to choose email, but just one - admin's email - is here. I've added another user as the owner, but it is not appeared on the consent screen.
If you want to change the email address that is displayed to the user you have to:
Add permission for the new email address to handle the project: Menu > IAM & Admin > IAM, then click on the Add button, enter the email address and select Role > Project > Owner
Accept the invitation from the new email address. Check your emails, click on the confirmation url and accept the terms and conditions.
Log in to the Google Developers Console using the NEW email address. Only the new email address can change the displayed email address. You don't have to log out or open an incognito window. You can simply add a new account by clicking on your account photo (upper-right corner) and then selecting the Add account option.
Tip: When you visit the page, you will be logged in with your primary account by default. If you want to be logged in with the second account you just created, simply append &authuser=1 to the end of the url. If you have more than 2 accounts, you can use the value authuser=2 or 3 and so on. (The default value for your primary account is 0.)
You need a second email address then add that person / email as admin of the project. Then you will be able to add that email in the consent screen.
The Console has changed a lot since 2014, You need to add another user as the admin then you must login to console with that email and connect it. Then you will be able to change it.
A new user can be added via the Iam for your project.
While the above solutions work, I didn't want to make my support#my-company.com a Project > Owner of my GCP project since multiple people can potentially access it.
The page (https://console.cloud.google.com/apis/credentials/consent/edit) says that the permission needed is clientauthconfig.clients.update
So I made a Custom Role containing every permission in that category:
clientauthconfig.brands.create
clientauthconfig.brands.delete
clientauthconfig.brands.get
clientauthconfig.brands.list
clientauthconfig.brands.update
clientauthconfig.clients.create
clientauthconfig.clients.createSecret
clientauthconfig.clients.delete
clientauthconfig.clients.get
clientauthconfig.clients.getWithSecret
clientauthconfig.clients.list
clientauthconfig.clients.listWithSecrets
clientauthconfig.clients.undelete
clientauthconfig.clients.update
and gave my support email that Custom Role + the role Project > Viewer
One note, these permissions are not finalized yet. The 'Create a Custom Role' page gives this warning:
Not recommended for production use
These permissions might be changed
in backward-incompatible ways and are not recommended for production
use. They are not subject to any SLA or deprecation policy.
You can go here https://groups.google.com/ and create a group. Then simply refresh the consent page and you'll be able to pick the group. It is not your custom domain but it does the job I think.
There is a way to choose email without creating a new Gmail account and giving it Owner permissions. You can create a Group in GSuite with public email and then configure the group's forwarding to the email you want.
For example, you want to use support#company.com. You can create a group support.google#company.com which will forward everything to support#company.com
Then, you will be able to pick up support.google#company.com in the dropdown.

Is there a way to use custom attributes for Amazon Cognito using the Hosted UI?

I'm trying to use the Hosted UI feature with AWS Cognito's User Pool to create a login / signup form for a web application.
I can select certain "standard attributes" for user registration, and those show up on the Hosted UI. For example these attributes...
Show up like this on the Hosted UI...
But if I were to add some custom attributes...
Nothing changes, and the Signup fields and form look exactly like they do in the middle picture. They are basically hidden attributes to that UI.
Is there any way to make those custom fields populate so that a user can fill them in?
Furthermore... These custom attributes don't even show up in the user's information from my User Pool 'Users and groups' area. As you can see, the only attributes showing up are those 'standard attributes'. The custom ones are nowhere to be found.
AWS says that at this moment, unfortunately, it is not possible to show the custom attributes on the Cognito hosted UI sign-up page. Also, the custom attributes cannot be marked as “required”.
As for the second Question. Custom attributes will not be reflected in the Users/Groups area until they are added to the user, which, again, cannot be done through the Hosted UI.

Auth0: unable to find ways to customize "new universal login pages"

General need
customize the MFA widget using the new universal login flow
this is not equal to classic flow (where we have Auth0MFAWidget with a range of options as listed here)
Specific need (for the new universal login flow, not the classic universal login flow)
Is there a possibility to change the default country on the MFA-SMS enrollment prompt?
can we restrict the list of countries also?
below is the page that I am looking at, can be accessed here:
Note:
Asking these for the new universal login flow, not the classic universal login flow
I raised a support ticket (from a paid company account) and got a reply:
Is there a possibility to change the default country on the MFA-SMS enrollment prompt?
it is auto selected based on the ip of the user
Can we restrict the list of countries also?
not available
workaround is to use JavaScript on the universal-page-template which hides specific countries using the DOM
something like:
const allList = document.getElementsByTagName("ul")[0];
Object.keys(allList.children).map(ch => {
if (allList.children[ch].innerText.search('Japan') !== -1){
allList.children[ch].style.display = none;
}
});

How do I choose a different support email address when registering a Google OAuth app? [duplicate]

I created new Google Play game and would like to change the email displayed on Google Consent Screen. Google Developers Console screen has a dropdown to choose email, but just one - admin's email - is here. I've added another user as the owner, but it is not appeared on the consent screen.
If you want to change the email address that is displayed to the user you have to:
Add permission for the new email address to handle the project: Menu > IAM & Admin > IAM, then click on the Add button, enter the email address and select Role > Project > Owner
Accept the invitation from the new email address. Check your emails, click on the confirmation url and accept the terms and conditions.
Log in to the Google Developers Console using the NEW email address. Only the new email address can change the displayed email address. You don't have to log out or open an incognito window. You can simply add a new account by clicking on your account photo (upper-right corner) and then selecting the Add account option.
Tip: When you visit the page, you will be logged in with your primary account by default. If you want to be logged in with the second account you just created, simply append &authuser=1 to the end of the url. If you have more than 2 accounts, you can use the value authuser=2 or 3 and so on. (The default value for your primary account is 0.)
You need a second email address then add that person / email as admin of the project. Then you will be able to add that email in the consent screen.
The Console has changed a lot since 2014, You need to add another user as the admin then you must login to console with that email and connect it. Then you will be able to change it.
A new user can be added via the Iam for your project.
While the above solutions work, I didn't want to make my support#my-company.com a Project > Owner of my GCP project since multiple people can potentially access it.
The page (https://console.cloud.google.com/apis/credentials/consent/edit) says that the permission needed is clientauthconfig.clients.update
So I made a Custom Role containing every permission in that category:
clientauthconfig.brands.create
clientauthconfig.brands.delete
clientauthconfig.brands.get
clientauthconfig.brands.list
clientauthconfig.brands.update
clientauthconfig.clients.create
clientauthconfig.clients.createSecret
clientauthconfig.clients.delete
clientauthconfig.clients.get
clientauthconfig.clients.getWithSecret
clientauthconfig.clients.list
clientauthconfig.clients.listWithSecrets
clientauthconfig.clients.undelete
clientauthconfig.clients.update
and gave my support email that Custom Role + the role Project > Viewer
One note, these permissions are not finalized yet. The 'Create a Custom Role' page gives this warning:
Not recommended for production use
These permissions might be changed
in backward-incompatible ways and are not recommended for production
use. They are not subject to any SLA or deprecation policy.
You can go here https://groups.google.com/ and create a group. Then simply refresh the consent page and you'll be able to pick the group. It is not your custom domain but it does the job I think.
There is a way to choose email without creating a new Gmail account and giving it Owner permissions. You can create a Group in GSuite with public email and then configure the group's forwarding to the email you want.
For example, you want to use support#company.com. You can create a group support.google#company.com which will forward everything to support#company.com
Then, you will be able to pick up support.google#company.com in the dropdown.

Do we have to upload infopath2013 form in central admin to use centrally managed data connection

I am trying to use a dataconnection file that stored in central admin but when i am trying to publish the form it throw below arrow.
"This form template requires administrator approval. To publish the form template,
click the File tab, click the SharePoint Server button on the Publish tab, and select the Administrator-approved option in the publishing wizard."
any thoughts?
Please check whether your form is having Security level as Full Trust.
You can find this security level at File -> Form options-> Security and trust category