All Questions
2,153 questions
1
vote
2
answers
81
views
Permissions to edit user field data, but not fields itself
How to allow a role to edit/manage user accounts e.g. click Edit and change email, username, password etc., but do not edit the fields itself, e.g. cannot just go to Manage fields and delete/create/...
0
votes
1
answer
507
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
1
answer
204
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 ...
1
vote
2
answers
435
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
1
answer
187
views
SMS password recovery
I'm currently using D7. When my users attempt to request a password reset, 95% of the time, these reset emails land in their spam, or are blocked by whomever their email provider is. That being said, ...
0
votes
1
answer
41
views
Can't log in as admin
Someone let us know about an error on our site. I logged in (as an admin). I was able to move the site to maintenance mode and then went through the steps to clear the cache on the site. Once I did ...
0
votes
1
answer
129
views
How can I programmatically flag a user?
I am creating a new user programmatically in drupal7. At the time of user creation is there any way to flag the user automatically.
I am using flags module.
I tried in the hook_user_presave
function ...
0
votes
1
answer
29
views
Delegate user administration to a limited set of users
We are currently using the excellent domain module (allows segmenting users by domain) in and the user_import module (allows uploading users via CSV) in Drupal 7.
We've got a new requirement where we ...
0
votes
1
answer
60
views
How do I get the roles of the currently logged-in user?
In Drupal 8 I would use the following code.
$current_user = \Drupal::currentUser();
$roles = $current_user->getRoles();
What is the equivalent code I should use in Drupal 7?
0
votes
0
answers
36
views
Is there a way I can access the user profile picture filename?
I want to create a view in the Drupal 7, where I can show the User Profile picture name (the original which user uploaded) and the path its saved.
1
vote
0
answers
54
views
How to trigger a rule whenever users update their picture
Using Drupal 7 and the Rules module
I need to trigger a rule whenever users update their user-picture.
I tried using the event "After updating an existing user account" which does trigger the rule, ...
0
votes
1
answer
38
views
Changing field instance display settings for view_mode
Background
In the user.module file in user_build_content(), there is a line that adds fields for a given view_mode:
$account->content += field_attach_view('user', $account, $view_mode, $langcode);...
0
votes
1
answer
42
views
Show a block on the user registration form depending on destination parameter
How can I show a block, or a a mini panel, on the user registration form depending on the destination parameter?
Right now, I'm showing, in a view, a link that leads the users to user/register?...
-1
votes
1
answer
169
views
How can I programmatically create a Profile 2 profile?
I am taking a look in the Profile 2 API documentation:
http://api.drupalhelp.net/api/profile2/function
I guess profile_create() or profile2_save() are what I need. But I have read somewhere ...
1
vote
1
answer
113
views
How to modify the D7 user login page html to remove the register and new password options for non-admins?
So, I'm maintaining a Drupal 7 site for which we recently switched the users over to SSO through a third-party OAuth provider. The implementation isn't fancy, but added a login link to what I assume ...
0
votes
0
answers
46
views
Getting white screen in Login /user and the page content
I was recently editing a website with Drupal 7 installed, and was integrating twitter feed.
I created a block twitter_feed_block and assigned the block to the content section of the front page. It ...
0
votes
1
answer
41
views
Anonymous permissions with Nodeaccess
Content type: Webform
Allowed grants: View, Edit
Allowed roles: Anon, authorized, admin
Go to the webform node eg. node/20
Click Grants tab
Tick authenticated and admin users can View, anonymous is ...
0
votes
1
answer
21
views
Changing the html and order of system fields(pass/email/locale/etc) of user edit form
I have changed a number of forms accessible by users to fit a certain style. To do this I used an #after_build function that adds prefixes and suffixes to fields, as well as a bit of javascript. This ...
0
votes
1
answer
34
views
Prevent login except from Services
I would like to prevent my users to login except for those who login through my REST Service.
Is that possible?
0
votes
0
answers
46
views
Can't go anywhere from user edit page after login
Having an issue with a certain user that is not reflected on other users, when this particular user is logging in he isn't redirected to homepage or to
admin/dashboard
but to
user/edit
page, ...
0
votes
1
answer
40
views
hook_custom_theme() works except if a user submits a user form with mismatched passwords. Then they get served the admin theme
Title basically. My hook_custom_theme() has been working for ages and I only just realised the admin theme is being served for an error when saving a user form ie. mismatched passwords.
A snippet ...
0
votes
1
answer
58
views
Cannot assign roles creating User through REST endpoint
Sidenote, already seen this page, doesn't seem to help: How to create user with role(s) through REST service?
I've setup a new endpoint on my platform to try to allow a 3rd party to create users on ...
1
vote
1
answer
24
views
Are changes to the user status stored somewhere?
I've made a pretty serious error of judgement creating a view for a client that shows users created before a date AND still active. The error was adding a date filter.
This was meant to be used at ...
0
votes
1
answer
176
views
How to use view's relationships to pull user entity reference data?
I created 2 new user fields for the user (object/entity) on my D7 site. Using views, I can select 'content' or 'user' for querying data. When I use views to query the 'user', the 2 new fields come up ...
1
vote
0
answers
52
views
How to trigger Rules from Ajax-picture-uploader?
I'm using Rules with event "After updating an existing user account". It should trigger whenever a user uploads a new profile picture.
Now I've added an ajax uploader for user pictures, the Avatar ...
0
votes
1
answer
67
views
Add paragraphs item to user entity
I want to create a new paragraph item to a user bundle. This is the code:
$name = "Test";
$userdata = user_load($user->uid);
$paragraph = entity_create('paragraphs_item', array('field_name' => '...
-2
votes
1
answer
46
views
User role update report
Could you let me know how to check how many users converted from one role to another for a specific period of time (for example how many changed roles from user to superuser from 01/09/2017 to 01/02/...
0
votes
0
answers
139
views
Embed user edit form in a block
I am trying to embed current user edit form in block. Actually I want just to embed some of the newly added fields. I tried to follow this code:
Embed some user profile fields in a block form
But I ...
1
vote
1
answer
1k
views
How to programmatically update a user role name
I would like to update role name programmatically in Drupal 7. Does Drupal provide its own functions to do that, or do we need to query the database and update the name manually?
Please note that ...
0
votes
0
answers
276
views
Upload a folder full of files (static html and assets) to the private files folder when creating a node
I need to be able to upload a folder full of files (static html and assets) when creating a new node and then to output a link to the index.html file in the uploaded folder.
They files from a ...
0
votes
3
answers
1k
views
Adding field collections programmatically
I'm trying to add a field collection to my user account on an event, and it seems to be being created properly, the fields are updated as expected and it parents it to the user account, however, even ...
0
votes
1
answer
279
views
Drush upwd Changes Database Hash but Login Fails
I have a weird one. I have a site that was abandoned for a while and we need to get access to it again. So I tried to use drush to reset the admin password, but it's not working.
I'm using Drush 8.1....
0
votes
1
answer
409
views
Entity Reference - User reference field Hide "Restricted access" label instead of showing useless choices
i have an entity reference (7.x-1.5) select-list within a checkout pane which is being used to allow the user to attach a child to a product during a checkout process.
The user can add multiple "...
1
vote
1
answer
249
views
How to compare text input with a user password stored in the database?
I've been trying to compare password values using a custom form.
Actually I want to show a relogin form after a particular amount of time. So I have created a custom form with two fields – email and ...
0
votes
1
answer
126
views
Alter The User Login Form Into Multi Steps
I want to alter my default user login form into multi step. therefore I have wrote a code which I'm pasting below. but this code is not working, whenever I click on "Next" button it will return on the ...
1
vote
2
answers
46
views
How to prevent Profile2 fields from loading on user registration?
I have a profile2 Profile that's named Driver.
This profile has a Term reference to a vocabulary named Cities that contains over 30.000 terms.
I made a custom user-register.tpl.php by declaring it in ...
0
votes
0
answers
44
views
Cannot modify headers when adding a new user
I periodically get an error in my drupal log that I believe is generated when a user is modifying or creating an account.
Today, when adding an account as an admin, I finally saw it on the screen:
...
0
votes
1
answer
76
views
Update user profile picture using entity_metadata_wrapper
I am trying to update the user profile picture using entity_metadata_wrapper. But I am getting
"Unknown data property picture." error.
When I check the user property info, I cant see the ...
0
votes
1
answer
112
views
Why is Rules Action "Create Linked Drupal User Account" not working?
I’m using Drupal 7.56 and CiviCRM 4.6.31.
I’ve been using Rules in Drupal to create a Drupal User Account linked to the CiviCRM contact created.
But it's failing. I'm getting the following error:
...
0
votes
1
answer
128
views
How to associate the last image from gallery to user's profile picture
In Drupal 7 (Commons 7.x-3.46).
I've created a new content type, by which each user can upload images and build a personal picture-gallery.
How can I now associate the last-uploaded-image to the ...
0
votes
1
answer
14
views
Features installed with profile are overridden
We are using workbench with the subpermissions module. We have created two features which set custom permissions for workbench and for subpermissions. If we install the workbench feature and then ...
0
votes
0
answers
71
views
global $user uid = 0 while logged in
I'm migrating my website to a new server and I'm facing a problem since then.
Files are identical, so I have no clue.
I want to access the global user variable in a subfolder, which is a custom php ...
0
votes
1
answer
91
views
Rules to remove user from role on node publish
I have tried the following:
Event: updating an existing content
condition: NOT node-unchanged published
remove user role (I'm stuck here)
The last item is my problem. There is no user reference in ...
1
vote
0
answers
37
views
Is it possible to cancel the creation of user without triggering an error?
I have a problem with account creation spam, in which a bot or other bad actor tries to create accounts using somebody elses email address. The owner of the email address flags the verification email ...
1
vote
1
answer
141
views
How to migrate users and keep their IDs unchanged?
I'm trying to use migrate_d2d, via the UI, to migrate a site from D6 to D7. I need to preserve user UID's in the migration. I'm finding the documentation confusing..
Given this in the UI...
What ...
1
vote
1
answer
205
views
How can I set page specific user view access by user role?
I need to be able to restrict access to specific pages based on user role, I heard that nodeaccess could do that, but I haven't been able to figure out how to do that with it, can you set page ...
0
votes
1
answer
31
views
Change the location of Edit Profile
I am using Profile 2.
When the user clicks the 'Edit My Profile' tab, I would like its destination to be:
/user/175/edit/about-you
Where about-you is a Profile2 type.
How do I change the path of ...
2
votes
1
answer
40
views
How to stop users from flagging other users if they have a custom taxonomy term?
I'm working on a project where users vote other users using the Flag module. Each user has a department term reference field. I would like to stop a user from flagging another user if they have the ...
0
votes
1
answer
127
views
Migrating sha1 user passwords into drupal 7
I have an old zend 1.8 cms site and I wish to import users into a drupal 7 site so that a user can login with their sha1 password without having to changing it. Once verified convert the submitted ...
0
votes
1
answer
25
views
How to break up user roles checkboxes into groups?
When editing a user in Drupal 7 (/user/NID/edit), I'd like to break up the roles checkbox options. By default, it is just one list of roles. Instead, I would like to group different roles together to ...