Questions tagged [users]

Craft member accounts.

Filter by
Sorted by
Tagged with
1 vote
1 answer
23 views

Event on new user created

please can someone help me with this snippet of code I have written. I basically would like to check if a user is new. However, the below only triggers when an existing user is saved, not when a new ...
0 votes
1 answer
31 views

What is your strategy for users accounts when upgrading Craft?

I'm upgrading a site that has public registration from v3 to v4 (better late than never!) and it's going to take a few days to QA v4 locally to make sure everything works correctly… I'm wondering what'...
1 vote
1 answer
24 views

Saving custom fields of user with Ajax request

I am using an Ajax (POST) request to update the current user profile. So far I can successfully update the user fields (like fullName) but I cannot seem to update custom fields. I have tried adding ...
1 vote
1 answer
27 views

Craft 3 / 4 CP: Restrict users to specific user groups in Users view

I need to restrict access to users (not entries) of say AdminGroupA to be able to access and manage users of UserGroupA in the Control Panel. Right now, the user AdminGroupA can browse all of the ...
1 vote
1 answer
45 views

Find all Users with a Custom Field Value in a Plugin

Spent a good amount of time trying to return all Users that match a custom field value. Reading the docs here, it shows a findAll() command. However, when trying the code below, it's not working. use ...
1 vote
1 answer
38 views

How do i check for customers, not users, in a cart

Using craft commerce 3. I have an adjuster which applies a discount if a user of a certain usergroup. I check this with: $user = Craft::$app->getUser()->getIdentity(); if (($user && ($...
1 vote
1 answer
36 views

User activation mail not working after a while

Does anyone know how much time a user has to use the activation link in the user activation mail? Some clients report to us that that they see an error page after waiting a weekend to use the ...
1 vote
1 answer
621 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
64 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 ] ] ...
3 votes
1 answer
471 views

Displaying errors on frontend user forms

I'm trying to get some feedback for the user on registration when the username already exists but I don't know in which object the errors are. I use the form they provide in the docs: https://docs....
2 votes
1 answer
40 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
30 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
39 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
22 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
50 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 ...
8 votes
3 answers
1k views

Comprehensive logging of user actions with Craft Pro?

I am considering a purchase of Craft Pro in place of a new ExpressionEngine build for a client. One of the client's requirements is that there be a comprehensive set of logs like Audit Pro of what ...
1 vote
1 answer
112 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
68 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
93 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 ...
1 vote
1 answer
90 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
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
2 answers
160 views

Simple user query with orderBy not working

Craft 3.3.13 This query does not order users correctly. {% set users = craft.users.groupId(3).orderBy('lastName asc') %} Bug?
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 ...
5 votes
1 answer
2k views

How do I display the Image of an Author in a post?

This might be a stupid question... but I can't seem to figure it out. I'd like to show the photo of an author beside their entry. I thought the proper variable was... {{user.photoUrl}} ...until I ...
1 vote
1 answer
380 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 ...
3 votes
2 answers
545 views

How to activate a user in a plugin?

I'm trying to activate a user via a plugin so that when the user is returned to the login page they are re-directed to their profile page. I'm making use of the social logins beta plugin by dukt (I ...
0 votes
1 answer
36 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
103 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
33 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
97 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
89 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
141 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 ...
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 ...
3 votes
1 answer
176 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
2 answers
495 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
94 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
37 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
188 views

PHP Login & Sessions without Craft Commerce?

I'm trying to implement this tutorial in my Craft CMS site, I've created all the files and they currently reside in public_html, but twig and the .htaccess of Craft CMS is interfering with it. Does ...
1 vote
1 answer
154 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
172 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
216 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
228 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
258 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
200 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 ...
2 votes
1 answer
891 views

Is it possible to change the amount of time a user stays logged in for?

Our users are getting logged out after 1 day. Is there a setting that changes how long users’ sessions will last?
1 vote
1 answer
183 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
180 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
771 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
2 3 4 5
11