Skip to main content

Questions tagged [users]

Use it for question about the user entity. Don't use it for a generic question about, for example, what users can do on a site.

Filter by
Sorted by
Tagged with
5 votes
3 answers
1k views

How to restrict access to a node via node/12 and allow access via a path like content/sometitle?

Problem: I want to restrict direct node access using node number www.example.com/node/12 and allow access using pathauto alias www.example.com/content/sometitle to anonymous user. This user should be ...
suneel's user avatar
  • 51
0 votes
1 answer
1k views

How to make the permissions of a module more granular?

Assume a (contributed) D7 module, say module ABC, comes with only a few permissions (which can be set on the typical /admin/people/permissions page). For example: Administer module ABC. Access (view) ...
Pierre.Vriens's user avatar
2 votes
1 answer
1k views

Rule to store user's last post date and scheduled rule based 30 day reminder

In this scenario, user's can post 1 node of a specific content type every 30 days (interval changes depending on user role). We are using node_limit to accomplish this; it's doesn't play with rules. ...
Sam Roy's user avatar
  • 53
2 votes
1 answer
335 views

Which user related token(s) can be used to create a Rule for setting up a message type?

I have created few activity logs using the Message module. All works ok, but when I try to create a message type for example "username started following you on github". When setting up the rules for ...
Umair's user avatar
  • 441
1 vote
1 answer
224 views

Which Rules condition can be used to email a user when an admin updates their profile?

I am trying to set up a rule (using the Rules module) that will email a user if their user record has been updated by an admin. It is easy to generate an email when their profile is updated, but I ...
James's user avatar
  • 1,191
51 votes
6 answers
43k views

Programmatically create a user and assign a role

I'm programmatically creating a user with the following code. $newUser = array( 'name' => $mail, 'pass' => 'password', // note: do not md5 the password 'mail' => $mail, 'status' =&...
Nicola Peluchetti's user avatar
3 votes
1 answer
4k views

Custom registration twig template

What would be the best way to make a custom registration twig template ? I have implemented the hook : function THEMENAME_theme_suggestions_form_alter(array &$suggestions, array $variables) { ...
Aporie's user avatar
  • 365
21 votes
3 answers
16k views

How do I create a multisite with shared users and nodes? [closed]

I want to create a multisite with Drupal 7: Every site works separately but users, and nodes must be shared among the sites. How do I achieve it?
user avatar
11 votes
10 answers
7k views

How do I enable comments for user profiles?

With users being entities in D7 I assumed the user type would would have built in "comment" option. That doesn't seem to be the case. I just want to allow users to leave comments on the user profile ...
uwe's user avatar
  • 12k
4 votes
1 answer
4k views

Views Search Ignoring Custom Node Access permissions

I have a hook_node_access function that denies users view access to a page node if the node has a certain tag and they are not an authenticated user. This is working fine for viewing the page ...
PigChicken's user avatar
4 votes
3 answers
682 views

How to prevent access to Views-only content?

When I'm developing sites in Drupal, I create various content types and taxonomy vocabularies that I use with Views to build displays. I might not ever want the nodes to be viewable in their own right ...
pushka's user avatar
  • 1,853
3 votes
1 answer
745 views

How to configure access to courses for teachers and students?

In my site I have teachers and students. The student can subscribe to max 3 courses. I created cTypes: Modules (which contains the actual information itself) and Course (which contains a reference ...
Justme's user avatar
  • 1,248
44 votes
7 answers
45k views

How do I programmatically log in a user?

I am looking for the API that will let me login a user by passing it the username and password. Does anyone have experience with this? To clarify, I am trying to make an AJAX login box that appears as ...
silkAdmin's user avatar
  • 2,814
38 votes
4 answers
8k views

How do I debug permissions?

How do I debug permissions in Drupal 7? I use core reporting, error logs, devel module error logs, backtrace and node access permission block but sometimes it is not enough. What else should I check ...
LLub's user avatar
  • 3,662
9 votes
2 answers
19k views

How can I display a change password form on its own?

I have a need to place a user's password reset form in areas outside the context of the user edit page. This Change Password module looked promising; however, it is only available for drupal 6 and ...
SMTF's user avatar
  • 946
3 votes
2 answers
2k views

Tagging a friend in a node

Is it possible to create the functionality where, on creating a node, the user can tag friends to associate their friend with the node. Such as in Facebook's tag a friend in a post. This would ...
Dylan Spencer James's user avatar
2 votes
1 answer
130 views

How to use Rules to send an E-mail after saving a new comment, to users who checked a boolean in their profile?

What I try to achieve with Rules: After saving a new comment, this comment has to be sent only to those users who've checked a corresponding boolean box on their profile page. Any suggestions?
DrupThai's user avatar
1 vote
2 answers
5k views

drupal /?q=user is working but /user not working

I have recently moved my files from dev server to test server. same setting and db of dev server were copied to test server. In dev server all is working fine but when I have am checking in test sever ...
Hitesh's user avatar
  • 576
1 vote
1 answer
3k views

How can I display a picture from a field as the user picture rather than the drupal default with user-picture.tpl.php?

Because my site requires user pictures to be approved, the default Drupal user picture is not suitable. Instead, I want to show a picture from a field in each user's profile as the user's profile ...
Patrick Kenny's user avatar
17 votes
6 answers
7k views

View of users flagged by a user, users flagging a user, and nodes from users flagged by a user

I have a user flag that is pretty much like a "follow" or "subscribe" function. Basically I want to create 3 views for my website's user profile pages: A list of users flagged by a user (e.g. a ...
Jamie Chang Liu's user avatar
10 votes
4 answers
3k views

Is there a way to avoid anonymous user can see a node of a specific content type?

Is there a way to avoid anonymous users can see nodes of a content type, like a block or a view? I can control the access with a view, but if I know the link for a node, I can see it without first ...
Frank Giesecke's user avatar
7 votes
3 answers
5k views

How do I redirect users to a predetermined url after login?

I have a view in Drupal 7 that lists PDF files. I want to keep track of the users that open that file; so I want that, if they are not logged in when they click, they are sent to the login/sign up ...
Lucrozade's user avatar
4 votes
2 answers
10k views

Adding more fields to the registration process

In Drupal 7, is there a way to add more fields to the registration process? I was thinking along the lines of birthday, fullname, gender, twitter, etc. Also how do I access this data once it's in, so ...
enchance's user avatar
  • 2,049
1 vote
1 answer
6k views

Field level permissions in Drupal 7

What is the best way to create a piece of content with multiple fields... allowing users to edit the content as a whole yet blocking the ability to edit. The setup I have is a piece of content that ...
WernerCD's user avatar
  • 784
48 votes
8 answers
75k views

Check if a user has a role

How can I check if a user has a certain role?
giorgio79's user avatar
  • 4,631
20 votes
4 answers
12k views

Send user's password in mail

I want to send a reminder email to the users to log in to my website with their username and password. My mail script is ready with the login ID, but I don't know how to decrypt the user's password. ...
Hacker's user avatar
  • 3,024
18 votes
2 answers
12k views

How to prevent user registration

I'm getting a couple of user registrations on my personal website (presumably from bots or people trying to hack my site). How do I disable new user registration entirely?
Mythical Fish's user avatar
12 votes
5 answers
19k views

How to redirect anonymous users to login page using Rules module?

I'm using rules module with drupal 7 in order to redirect anonymous users to the login page, so I created a rule with react on event "Drupal is initializing", condition "User has role" with anonymous ...
Aboodred1's user avatar
  • 2,806
9 votes
2 answers
1k views

"changed by" on nodes

mysql> select nid, uid, created, changed from node; +-----+-----+------------+------------+ | nid | uid | created | changed | +-----+-----+------------+------------+ | 1 | 8 | 1336040166 |...
cherouvim's user avatar
  • 1,937
8 votes
3 answers
5k views

How to display a flag to anonymous users?

I'm using the Flag module, but I have a problem in displaying a flag to anonymous users. I have 2 flags called "make feature" and "add to Favorites". I want to display this flag to anonymous users ...
Pranav Gandhi's user avatar
8 votes
1 answer
3k views

8 - How do i programmatically enable a user field under manage form display and manage display?

I've programmatically added a user field but i can't find a way to programmatically enable the field under 'manage form display' and 'manage display'. I tried exporting the 'entity view display' and '...
Callum's user avatar
  • 377
8 votes
4 answers
2k views

How can anonymous users be allowed to post while still maintaining content integrity?

A little background: As you see on http://charlotte.ebayclassifieds.com, if you click 'post an ad' and then choose a category, you can fill out the form and submit content without having to sign up. ...
blue928's user avatar
  • 3,804
8 votes
3 answers
5k views

In hook_user_login is there a way to know if this is the first time the user has logged in?

I'm overriding hook_user_login to redirect users to a specific page when they log in. The problem is I'm using the verification email setting on registration which requires the user to set their ...
SomethingOn's user avatar
  • 1,281
8 votes
9 answers
15k views

How to delete 'blocked' users in bulk?

There are a spammer(s) out there constantly creating accounts on my site. The accounts are 'blocked' by default so they do not pose a problem, nor does the spammer gain anything from them. Still, I ...
Jose M Vidal's user avatar
7 votes
3 answers
7k views

How to pre-populate fields on a node creation form based on fields from Profile2 module?

There is a content type ("Job Listing") that a business account can use to list job openings, and a Profile2 profile for each business that contains the business's address, organization name and ...
Adam S's user avatar
  • 5,031
5 votes
3 answers
3k views

How to deal with unverified users in Drupal?

What do you do with unverified emails in Drupal? I see some have been unverified for several months. Is it possible to resend the email or to auto delete them?
giorgio79's user avatar
  • 4,631
5 votes
2 answers
4k views

How do I migrate users passwords?

I want to migrate some users from my Drupal 7 installation to a new Drupal 8 installation. I do not want to migrate the whole site or any content. And I also do not want to migrate all users. The ...
Rainer Feike's user avatar
  • 2,576
5 votes
1 answer
13k views

How to Create twig template files in drupal 8 for customizing user login,profile edit and forget password forms?

Earlier we use the below code for creating custom template of user login ,user profile edit and forget password forms: function Yourtheme_theme($existing, $type, $theme, $path){ return array( '...
user avatar
4 votes
5 answers
15k views

How can i restrict /admin login page to a particular IP only? [closed]

I want to restrict the http://www.mysite.com/admin login page to a particular IP only. Do you have any suggestion?
Mohamed Saleem's user avatar
4 votes
4 answers
6k views

After logging off, a user is able to see the pages by pressing back button of the browser

I have a requirement in which the user should not be able to see the books in the site unless he is logged in. And the user is not able to see the content. The problem is when a user logs in, views a ...
AjitS's user avatar
  • 10.9k
3 votes
1 answer
2k views

Multi-user/role testing, best practices

Am loving using Drupal 6 for creating a site with more than one user "type", with different Content Profiles, different Roles with associated Permissions, different access to nodes etc. My current ...
Craig Moore's user avatar
3 votes
5 answers
3k views

How can I allow anonymous visitors to submit content?

I am working on a website that displays a list of historical events. Most of the events have been added by a small group of users that manage the site. However, I would also like to add the ability ...
William Mortada's user avatar
2 votes
2 answers
252 views

Custom Login form question

In my website have two types people login one is designer another is reader, i want people come to login my website by role. Mean designer go to design login form to login. Reader go to reader login ...
zeno's user avatar
  • 21
2 votes
1 answer
842 views

How to revoke edit access to the node's author after publishing a node?

I am trying to build a new rule on Drupal 7 with both the Rules and Content Access modules (and its sub module Content Access Rules integration). Thus, I get new actions like "grant or revoke an ...
Toki's user avatar
  • 424
27 votes
11 answers
13k views

How can I find out a list of available $string values for user_access($string) function?

user_access($string, $account = NULL) $string: The permission, such as "administer nodes", being checked for. How can I find out a list of available $string values for user_access() function?
gilzero's user avatar
  • 6,037
24 votes
3 answers
20k views

Access user fields?

$account = \Drupal::currentUser() loads the user object into $account, but how do I access custom fields I've created on the user object (via the admin UI)? With dpm($account) I can't see any of my ...
dbj44's user avatar
  • 4,764
23 votes
5 answers
39k views

How to add extra fields to user profile?

I'd like to add additional fields to the user profile. I'd like user to be able to edit almost all the information I store in the database about him. I have some ideas: maybe it's possible to do ...
Alexey's user avatar
  • 941
20 votes
2 answers
24k views

What's the difference between access arguments and access callback?

What's the difference between access arguments and access callback? Suppose I set the access callback to 'user_access', and array('custom permission') is the value for the access arguments. What ...
user1359's user avatar
  • 3,919
19 votes
7 answers
16k views

Disable register email notification

I have made a deep research over the web and I also tried a lot of alternative solutions, but I didn't find any solution to disable the email notification for new users. In my User Settings, I have ...
lnunesbr's user avatar
  • 401
18 votes
3 answers
27k views

How do I find the role id from role name?

On log in I want to check a third party data source (table in the db) for a user, and if found I want to add a role to that user. I don't want to guess the rid of the role, I want to get it from the ...
chim's user avatar
  • 1,117

1
2 3 4 5
14