Questions tagged [users]
Craft member accounts.
502
questions
2
votes
1
answer
25
views
Get list of user logins
I would like to get a list of every login of a user. I know I can get a certain user with craft.users() but as far as I have seen, I get data for lastLoginDate only.
Is there a way to get a complete ...
0
votes
0
answers
28
views
Is there a way to expose User edit history in Control Panel (similar to Entries)?
"Users" version should work like "Entries" versioning work
0
votes
0
answers
30
views
How to export a list of customers per domain?
I got a Craft (-v 3.7.67) Commerce (-v 3.4.20) setup with 4 sites in two domains.
I need to export a list of customers (or users, in my case users are 99% customers) per domain (so users that have ...
0
votes
0
answers
21
views
Query user by code and id parameters found in set password path OR custom reset password path
Is there any way to query users using the parameters of set password URLs? I need to distinguish between the very first activation (welcome) email and reset password email because their corresponding ...
1
vote
1
answer
47
views
How to migrate a selection of users passwords from a Craft 3 to a separate Craft 4?
I'm trying to move a large batch of users from a Craft 3 to a separate Craft 4 websites (only some selected data should be migrated).
Element API + FeedMe looks like the right solution for that, as ...
1
vote
1
answer
84
views
Custom module controller: how to impersonate any user and start its session
From a custom module, I would like to impersonate and start any user session in the browser. This session will be based on a user query result got from a web controller.
Something in a way like when ...
1
vote
1
answer
65
views
Update user matrix field dropdown through module
Appreciate I may be asking for a lot here - I have an existing module that I use to fire events when a stripe order is completed.
I would like to iterate through some User matrix blocks and update a ...
1
vote
1
answer
74
views
User account activation via SMS
I would like to ask if there is a plugin or module that can activate/verify user account via SMS for Craft 4?
I found a plugin called Validateit but its not yet compatible with Craft 4.
I would like ...
0
votes
2
answers
54
views
How do I only display a list of users that have entries and hide the rest
I want to list users that have created entries in a specific channel.
I tried it the Ben Parisak way, but that didn't work out.
here's the code that doesn't work (example 1):
{% set entryIds = craft....
1
vote
1
answer
24
views
Editing users preferredLocale from a plugin controller
Recently upgrade from Craft 2 to Craft 3. Also had to update all the custom plugins. Once of them is to run a daily import of users from a file. In that file we try to set the preferredLocal of that ...
1
vote
1
answer
330
views
User profile in craft 4 - first name and last name fields are gone
I noticed that first name and last name fields in control panel user profile are gone. There is just full name field instead. Is there some kind of setting that would bring first name and last name ...
0
votes
1
answer
59
views
Multi-Site Craft 3 - How to set defaultTokenDuration to shorter duration for just 1 of the sites?
I currently have a multi-site Craft 3 install with this in the general.php config file (amongst other settings)
return [
'*' => [
'defaultTokenDuration' => 259200, //72 hours
]
]
...
1
vote
1
answer
78
views
Add entry to entry field via frontend form
I have a frontend form that updates a single entry and sets the users field to the current user:
<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
{{ ...
0
votes
1
answer
34
views
LastInvalidLoginDate returning NULL, or current date if formatted
I'm wanting to show a user's last invalid login date within the control panel. No matter the value in the database, it comes back as NULL, unless I try formatting it as a date, then the current date ...
0
votes
1
answer
76
views
Prevent concurrent user logins/sessions
Is there a way to prevent the same user having multiple concurrent active sessions? Specifically if a user has logged into Craft's CP in one browser, but logs in on other browser/device, can we ...
0
votes
0
answers
44
views
Query multiple users and inner join to assets field
How to query multiple users and join to assets field?
I want to query users with IDs [1,3,4] and inner join it to assets field with volumeId 5 and titles [1,3,4].
Tried this but this is probably wrong ...
0
votes
1
answer
31
views
Register form activating other forms
So I have a contact form which shows a popup when it is submitted. I also have a registration and login form. The issue is: sometimes when a user logs in or registers an account, and you go to the ...
0
votes
1
answer
84
views
How to query a user by username on controller level?
How to query a user by username on controller level?
In twig I can do:
{% set user = craft.users.username('username') %}
How to do that in controller?
Thank you for your help.
1
vote
1
answer
88
views
How do I allow a user to edit another users data via module?
I'm attempting to allow a user to edit other users via a front-end form. The "Edit users" permission has been checked in the admin but when I submit the form the data doesn't save. For this ...
2
votes
0
answers
133
views
Commerce 3 - Register user and save payment source after order complete for guest checkout
We register and send account activation emails to guest customers after checkout using registerUserOnOrderComplete. We also want the guest customer to be able to save their payment card during ...
3
votes
1
answer
165
views
Create a pending user from plugin
I'm trying to create a pending user account when an event occurs
$newUser = new User([
'firstName' => $submission->firstName->getValue(),
'lastName' => $submission->lastName->...
1
vote
1
answer
40
views
Password setup screen on mobiles doesn't work properly
I am running a multi user site on Craft 3. When a new user is trying to set up their password for the first time, the default craft password setup page is not working on mobiles.
It seems like the ...
1
vote
2
answers
438
views
How to get user info in a custom plugin task?
I've been trying to get the user id when running a task to save it on a table but cannot find a way to get it not even the user info.
Using Craft::$app->getUser() or Craft::$app->user I get:
[&...
1
vote
1
answer
83
views
Front-End user registration dynamic usernames - duplicate check
I have a front-end user registration form that generates a username automatically based on the first and last name inputs. This works as intended but on the off chance that two people have the same ...
1
vote
1
answer
35
views
Is there a way to trigger a user account creation from a different CMS?
I'm a junior web developer working with Craft CMS.
I was wondering if there was a way to trigger a controller I have for my Craft CMS from an outside CMS. We have more than one website that offers ...
1
vote
1
answer
146
views
Is there a way to change the author of an entry on the frontend?
So, I know that you can do this on the backend. But is there a way to change the author of an entry from a frontend form? I'm making a vacation request system and I'm wanting managers to be able to ...
2
votes
2
answers
152
views
Is there a way for a user to assign another user to a group on the frontend?
So, I'm trying to build a dashboard where the partner of the company I work for can edit users. And I want him to be able to have like a drop down to assign the user's group on the frontend. Is there ...
2
votes
1
answer
197
views
Can I change a user field with twig without using a form?
I basically just want to set the value of a users field to a different number if something happens, so that the user field is actually updated in the CMS. Can I do that without creating a form? So ...
2
votes
1
answer
196
views
Add user to group based on registration form field
I'm trying to add my users to a group based on the option they select in a dropdown field. I feel like I'm close but so far - at the moment, it's not adding the new user to a group and it's clearing ...
1
vote
1
answer
244
views
How do I get custom fields of User on graphQL?
I am wanting to fetch queries for custom fields of users, how would I go about doing that?
So if I did something like this:
query {
users {
id
firstName
lastName
email
photo {
...
2
votes
1
answer
169
views
Admin notification when user updates user profile
I have a client that wants to be notified by email whenever any user on the site updates their profile fields. Right now, users can update their profiles through a front end form.
Ideally, after any ...
1
vote
1
answer
177
views
How to Create an Author Page?
I'm trying to understand the best or most common approach to creating unique author/user pages that list that user's blog entries.
This question was helpful for how to process the results.
However, I'...
1
vote
1
answer
169
views
Backend Save user fields
I'm just trying to change a value of any field in the User Table in Craft 3.
Basically, say I retrieve a User by its ID and change the name and SAVE it...
$oneUser = Craft::$app->users->...
2
votes
1
answer
720
views
how to check if a user email exists before creating a new user on a frontend form?
I have a signup form on my site and I want to check if the entered input (email) is already used in my DB before submitting the form.
What's happening now is when I create a new user with a new email ...
2
votes
1
answer
35
views
Multi user setting in a multi language environment
I am building a multi-language site in a multi-users environment.
For each user I want to assign several text fields that should be translatable for each language, similarly like in entries/categories ...
1
vote
1
answer
43
views
Compare entry checkboxes with user groups to give access
I have a 3 levels of membership with a field on my entries matching those groups to restrict access.
I know I can get a user's groups with currentUser.getGroups(), but how can I compare that with my ...
2
votes
1
answer
362
views
user session for Multi Site
I have a multi-site and they are under 1 root domain and the default site is food.com and bread.food.com is the additional site. How can I share the user session data of food.com to bread.food.com. My ...
2
votes
1
answer
186
views
Is it possible to display the debug bar while NOT logged in?
I'm trying to solve some possible performance issues caused in the logic of my site which checks for whether a user is logged in or not, to display or not display certain pieces of content.
Is it ...
1
vote
2
answers
217
views
Send automated emails to users that haven't logged in for X amount of time
What would be the preferred method to send an automated email to users that haven't logged in for a set amount of time? Let's say for a month. Are there any plugins that have this feature, or will it ...
1
vote
1
answer
573
views
How to update a User's Entries custom field only once just after save?
From a custom module, I'm listening to EVENT_AFTER_SAVE_ELEMENT events, to be sure to get the Entry ID after save:
Event::on(
Elements::class,
Elements::EVENT_AFTER_SAVE_ELEMENT,
function (...
0
votes
1
answer
68
views
How to alter CP entry edit form
On an entry edit form I'd like to alter the options in a multiselect field to be user relative. Is there something like a form_alter hook?
1
vote
1
answer
176
views
User field names?
The online documentation states:
Each user has an email address and username by default, and optional fields for a name, photo, and password.
Excuse the dumb question, but where do I find the what ...
1
vote
1
answer
27
views
Change password messaging per site?
I have several sites running under one Craft install. Two of them are for our internal use, and one is public-facing. On the public-facing site, I need to provide a reset password function. When the ...
2
votes
3
answers
369
views
Deleting user data from the database
I'm using Craft 3.6.4.1 and I need to delete a whole tranche of users from the database (that has derived from another Craft instance).
I've been deleting by hand via the CMS but note that loads of ...
0
votes
0
answers
36
views
Updating user email does not update username when useEmailAsUsername is set
When the config setting useEmailAsUsername is set, I would expect updating a users' email address to also update the username field when saving the element. However, this does not occur unless you ...
1
vote
1
answer
63
views
Prevent adding users with same email addresses
I am adding new users inside of the Craft controller as part of the frontend user import script.
This is the code:
$user = new User();
$user->pending = true;
$user->username = $email;
$user->...
1
vote
1
answer
58
views
After signup action
I'm trying to add an action after user signup so that we can post the clients external system so we can retrieve a customer number that we require. My question is does
EVENT_BEFORE_VERIFY_EMAIL run as ...
2
votes
1
answer
333
views
Stay on the same page after logout
Is it possible to stay on the same page after logging out from the frontend, assuming that guests can still view that page?
By default, when logging out we are redirected to the homepage or some ...
1
vote
1
answer
74
views
Display user photo within a User field type
I'm making a staff page with a User field type, so you select all the users you want displayed. I'm having trouble showing each user's photo though. This works:
{% for user in block.staffList.all() %}
...
2
votes
1
answer
245
views
How to configure the system messages <link> url?
we have got a multisite environment and have imported users with different preferred languages (de and en). Therefore we made a module, cause the feedme plugin doens't set the preferred language https:...