Questions tagged [users]

One of the most important entities Drupal uses is the user entity.

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Is it possible to see which user has approved a new user?

When the 'Who can register accounts?' setting is 'Visitors, but administrator approval is required', is it possible to see which user approved the account? Is there a module that will show this ...
0
votes
1answer
17 views

Drupal 8 - Can a custom role (not admin) approve the user registration?

I have created a site that requires approval of new user registrations: /admin/config/people/accounts Visitors can create accounts but administrator approval is required I have the role "...
1
vote
0answers
14 views

Filter view based on current user's role and taxonomy terms in drupal 8

I have three content types Article Basic Page Custom Page All Content types consists a field "field_interests" that is referenced to a taxonomy_term "interests". Items of ...
-3
votes
0answers
31 views

How does a Developer consume the API [closed]

I'm using Drupal 8 based Apigee Developer Portal. I have setup many APIs for the developers to buy. My question is once a developer buys an API how does he use the API?. For time being I know the ...
0
votes
0answers
24 views

How can I get specific fields from user object in the REST API?

I have a question about retrieving fields from the user object using REST in Drupal 8. When i am logged in into Drupal i can use the following GET call too retrieve the user object: http://localhost:...
-2
votes
0answers
24 views

How can one user assign certain portions of permissions to other users, while the rest of the permissions are invisible to him [closed]

I'm using Drupal 9. I want to create an account for the website, which has the permission to create roles and accounts, but I hope that the permission list he can see when assigning role permissions ...
1
vote
0answers
29 views

Restrict users from creating administrators?

I want to give some users the ability to add and edit other users, but I don't want them to be able to add administrators (or for them to be able to give themselves or other users the "...
1
vote
1answer
23 views

Comments on user profile not working

I want to add comments to user profiles. I added the comments in user profile under Configuration > People > Account settings, but when I add the field, the option to select the comment type is ...
1
vote
1answer
143 views

How can I programmatically delete a user without deleting their content?

I want to delete a user with this code: $account = User::load(19920); $account->delete(); How can I do that without also deleting the user's content? I've been reviewing _user_cancel() hooks, but ...
1
vote
0answers
16 views

Create a user map with a results tables below it

I've been searching around for the past couple months, watched a lot of YouTube videos, and read a lot of tutorials, and I've made a lot of progress with an alumni directory our team is creating. But, ...
1
vote
1answer
49 views

How can I bulk delete users? [duplicate]

My site got hacked and I had an online service clean it out. However, it now has over 150,000 user accounts, the bulk of which have no role assignment. How do I delete these accounts and their content?...
0
votes
2answers
68 views

Map profile_id based on previously mapped uid when migrating user profiles from CSV file

I'm trying to migrate users and user profiles to site, where both entities might be already present. In this case I would like to overwrite specified fields and leave others in the original state. I'm ...
1
vote
1answer
76 views

How to determine which password hash is used?

We have migrated website from a vanilla coded PHP to Drupal, and I have also migrated all the users. The old website has been using the password_hash() function to encrypt the password. The website ...
-2
votes
1answer
48 views

Editing the "Send private message" link to include the username

I'm using the Private Message module version 8.x-2.0-beta16 and I want to change the message from 'Send private message' to 'Send private message to @username' which should display the username from ...
-1
votes
1answer
48 views

How do I get the (integer) uid from the User entity?

On the odd chance there was a "getUid()" method for the user entity, I tried it, but got: Call to undefined method Drupal\user\Entity\User::getUid() Is there a way to get the uid from the ...
0
votes
0answers
34 views

Cannot add user picture for administrator

I installed 2 servers with Drupal 9.1 and I updated to Drupal 9.2 I just noticed that there are problems with the modification of the administrator account "user 1". In the list of users, ...
0
votes
1answer
243 views

How to get current user jwt token?

In a custom module, I need to get the jwt token (access_token) related to the current user. Following this issue I've tried to get it, but without success, because get_jwt_key() and jwt_token_params() ...
1
vote
1answer
20 views

How to display 'Welcome [first_name] [last_name]' in a custom views block? D8

I would like to create a custom block / view to display a welcome message to the currently logged in user in Drupal 8. I followed this answer but it isn't working for me. Maybe things changed in D8. ...
1
vote
0answers
17 views

What is the specific security implication with the permission "Select method for cancelling account"

Below the permission "Select method for cancelling account" there is the following hint: Warning: Give to trusted roles only; this permission has security implications. I understand that ...
0
votes
1answer
23 views

How do I let users cancel their account with JWT / JSON:API?

I am making an Ionic app with Drupal as the backend. Users log in via JWT. I'm using JSON:API to send data to Ionic. Now I want to allow users to cancel their accounts in the app (by JSON:API) ...
0
votes
0answers
17 views

Account Settings: "Access Denied" on emails translation

I'm having issues for accessing the "Email Notifications" from user configuration in Brazilian Portuguese. All Developer Portal "User Email Notifications" are being sended in this ...
0
votes
0answers
40 views

How can I sync just roles/permission config across multi-site instances?

On a Drupal 8 multi site, we need to have unified ROLES/permission config in all sites. Then we'll assign these roles to users via interface or Drush. How could I export / import? Or even better sync ...
0
votes
1answer
61 views

Does the login-link users receive upon registration actually expire?

I'm trying to expand the duration for the expiration of the one-time-login for the initial registration process: the user clicks on "create new account" after filling name and email and ...
1
vote
1answer
49 views

how to set a node to anonymous author?

Change node author works : $node = \Drupal\node\Entity\Node::load($nid); $node->set('uid','45'); $node->save(); But i don't know how to set it to anonymous user ? or unset it ? $node = \Drupal\...
0
votes
1answer
38 views

How to get the contents created by a User?

How to get all contents from which the current user is author? $currentUser = \Drupal::currentUser(); $user = User::load($currentUser->id()); //get the contents from which $user is author?
0
votes
0answers
203 views

How can I programmatically create an user account and trigger an activation email?

I developed custom module to create users. And I setup config account setting "Require email verification" to "Require a verification email, but let users set their password directly on ...
1
vote
0answers
75 views

Can I cast a generic type reference (EntityInterface) of an object, to a more specific, AccountInterface, if I know the object is a user?

Here is my code // implements hook_node_presave function mymodule_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { if ( $entity->getEntityTypeId() === 'user' ) { so now I know the $...
0
votes
0answers
77 views

Error message for duplicate email for user registration

On my site, users sign up by submitting their email and name to a user registration form. They will get an email with a link that will allow them to complete the rest of the sign up process, like ...
0
votes
0answers
15 views

How do I automatically add a user to a group when a user role is added to the account?

What I would like is that when a Drupal user has a User Role added to their user, then this also adds them to a specific Drupal Group. When I talk about User Role, I mean the standard User Roles ...
0
votes
1answer
33 views

Headers already sent

I found this error repeated several times for two of the pages on my website. Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/mydomain....
1
vote
2answers
159 views

How do I get group to which the node belongs and redirect anonymous users to the login page if they land on it?

I'm using the Drupal Group module and I've added content to a Drupal group I've created. I've also added users to this Group. Works well: Drupal users have to login to see this content in that group. ...
2
votes
2answers
117 views

PostCreate/Hook on User Registration

I want to hook into user registration but there doesn't seem to be any hook for it anymore. This is what I see from Drupal 8.8: hook_user_cancel hook_user_cancel_methods_alter ...
1
vote
1answer
92 views

Migrating user accounts to Okta

I'm trying to migrate users exported from Drupal into Okta using the /api/v1/users API (specifically [creating users with import hash][1]), and am stuck, and desperate for help as I'm late on a ...
0
votes
0answers
35 views

How to redirect logged in user to different page rather than what is configured in basic site setting? [duplicate]

I have the following requirement: When an anonymous user visits the site, they will get /login page which is configured in Configuration -> Basic site setting -> Front page. After logging in ...
0
votes
1answer
27 views

How can I conditionally create a user account based on field in registration?

Here is the scenario: Prospective employees (PE) who need to access this Drupal site for onboarding resources will be sent an access code from someone in HR (to prevent random people from creating ...
3
votes
3answers
492 views

How to implement decoupled user registration with React / jsonapi?

I have built a React app that uses JSON:API to pull in data, but now I want to implement user registration. JSON:API doesn't do user registration because it isn't a CRUD operation. However, the links ...
0
votes
0answers
35 views

How can I migrate users?

I need to rebuild my website, actually built with Drupal 7, and install Drupal 8. I have some modules that don't exist in Drupal 8. So, I decided to install Drupal 8 and rebuild the website from ...
0
votes
0answers
20 views

Is there a way to ouput variables in a custom module?

I'm updating a custom module and I would like to output the $node and $user variable to see what is in it for a specific key. The value of this key can be one or multiple strings and I'd like to know ...
-1
votes
2answers
61 views

Updating user leads to sql integrity issue

Please help me find what I am doing wrong to update a user field. I am trying to update all existing users in my Drupal 8 instance. I could do the same thing easily in D7, but can't get it working ...
0
votes
0answers
32 views

I've placed blocks in hidden region, now no login to admin possible

I made a site in Drupal 9. I played a bit with blocks and I think I placed an important block in the hidden region. Now the login page doesn't show the login form anymore. The header, footer and some ...
0
votes
1answer
86 views

How to create Media entity and attach to user field

I'm trying to import user profile pictures from Drupal 7 to Drupal 8. So far I've managed to upload the picture from the url and save it to the file system, create Media entity and use the user id as ...
0
votes
0answers
25 views

Can't upload anonymously using webform

I am using varbase 9.0.0-rc1 distribution I have successfully uploaded files using the forms while I am logged in. But anonymously I get the following error: An error occurred while attempting to ...
5
votes
1answer
396 views

Locked myself out after enabling misconfigured Google Authenticator

I somehow managed to lock myself out of a Drupal 9 installation after setting up TFA with Google Authenticator login. So, i know my user1 name, my user 1 password, but TFA doesn't allow me backend ...
0
votes
0answers
40 views

User's Name, Roles and Mail not accessible throughout the CMS

I'm trying to access different properties of a Drupal user, such as name or mail, but they are not accessible, either from Drupal Rules module or from the emails sent when a new user has been created ...
3
votes
0answers
95 views

How can you require users to change their passwords on first login after migration?

We are planning to migrate users from another CMS to Drupal. We can migrate usernames, but not passwords as the encryption is different. So we shall have to assign passwords to them. Earlier versions ...
0
votes
1answer
120 views

How to migrate password with hash

I'm doing a user migration from Drupal 7 to Drupal 8 (the data is in json format) Most of the fields have been imported to the new website. Now, I'm in the process to migrate the password; this field ...
0
votes
1answer
142 views

How do I log in a user?

I want to log in Drupal 8 users from an external PHP file. I am trying the following code. use Drupal\Core\DrupalKernel; use Symfony\Component\HttpFoundation\Request; use Drupal\user\UserInterface; //$...
1
vote
2answers
47 views

Batch delete users and the content they created

When I received this Drupal 7 site to manage, it has had years of being open for people to make accounts and now I have ~ 300 PAGES of users with names like ismehacker1234568 and such, with under a ...
0
votes
0answers
12 views

How to add a password reset link in the "Administration Views"

The administration views on drupal 7 https://www.drupal.org/project/admin_views replaces user page with a new views. I would like add a password reset link which would send a password reset email to ...
0
votes
0answers
109 views

Multi-site user share with different databases

I am trying to setup multi-site on Drupal 9.1 using a shared codebase with separate databases. Working within each site separately has been fine, and I'm ready to start working on sharing users and ...

1
2 3 4 5
132