Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

You can accomplish this with Page Manager. You basically create different variants for the "User profile template" under: admin/structure/pages/edit/user_view ( /user/%user ) and there you give the access permissions through "selection rules". For example: choose from the context drop down: "User: compare" and set it to "User being viewed is Logged in ...


0

In order to allow both username and email: first add validator function YOURMODULE_form_user_login_alter(&$form, &$form_state, $form_id) { $form['#validate'][1] = 'YOURMODULE_form_user_login_replace_email_validate'; $form['#validate'][2] = 'user_login_authenticate_validate'; $form['#validate'][3] = 'user_login_final_validate'; } then ...


0

Don't re-invent the wheel if these will solve your needs and hopefully wants. https://www.drupal.org/project/password_policy also worth looking into https://www.drupal.org/project/password_strength If those don't work, I think you're looking at a form alter related to validation. Drupal 8 is the wonderful world of Form Alters... so look into those even if ...


0

Welp, I probably should have gotten the idea to follow where the form action actually takes you and see what its controller does. I pulled the timestamp and hash from the form action with the explode function, loaded the user object from the currentUser id, and used Crypt::hashEquals($hash, user_pass_rehash($user, $timestamp));.


0

This is an issue with symfony/http-foundation v3.4.24. See https://www.drupal.org/project/drupal/issues/3045844 Source: Drupal 8 dropping session variables on password reset. Gives 403 Access Denied


1

It's better to use the route instead of the path, where you'll find the already loaded user entity: if (\Drupal::routeMatch()->getRouteName() == 'entity.user.canonical') { $user = \Drupal::routeMatch()->getParameter('user'); $username = $user->getUsername(); }


0

I looked at realname module, which autocompletes the real name. Since realname stores the user defined DisplayName equivalent in the database, it can issue % LIKE queries and autocomplete on both username and realname. I posted this question to see if there were other approaches, the realname module validates the proposed method as asked in the question.


1

You must call ->entity to get the file entity, then you can call ->id() like this, $userprofile->field_usr_avatar_img->entity->id().


2

Export/Importing user tables might work if you're doing some sort of crude one-and-done migration. The caveat is you're going to have to think through everything in the source userbase you want to migrate so you don't ruin DB referential integrity (e.g. any contrib modules that might be storing its own user-specific data). A better way to go about it, if ...


3

Core doesn't store revisions/changes for the User entity type (the functionality simply isn't available out of the box). So unless you have something like the User Revision module installed, or some custom functionality storing that data, you're unfortunately out of luck. If you take regular backups, you might be able to fudge something together using ...


0

There is a Relationship that introduces "backwards" Entity reference info into the Views. In Drupal 7 that is called something like this (you can find this in the list of Relationships in your Content Views under the Entity Reference Category): Entity Reference: Referencing entity A bridge to the User entity that is referencing Content via field_[...


Top 50 recent answers are included