New answers tagged

5

I post this as an answer, because someone might be as stupid as I am :) I browsed various old backups and found the settings.php line that grants admin permissions to anonymous user, and it worked. If you add: $config['user.role.anonymous']['is_admin'] = 'true'; in your settings.php, every anonymous user is admin. That way I could get back into admin panel ...


0

You can follow document. The $P$ is the so called hash type identifier which indicates that the hash is a portable Phpass hash. The string after that consists of salt and a hash. The portable Phpass hashes can be migrated to Drupal 8 as-is. When the user logs in to your Drupal 8 site for the first time, Drupal will re-hash the password. The salted hash used ...


0

The same functionality for Drupal 8.x+. The users' table is "users_field_data". drush sqlq "SELECT uid,name,mail FROM users_field_data ORDER BY login DESC LIMIT 10"


2

I'd say in this specific case the error message looks like saying that $user is NULL. You need to validate that User::load returns a valid UserInterface because if the $uid passed to the method is not found, it will return NULL, which is the value you are getting. Try with a valid uid like 1, see what happens and move ahead from there.


0

This doesnt allow dynamic information e.g. node title, node type - unless you use global functions for pulling the node from the url rather than as a parameter.


0

My suggestion is to prepare a text file with 1 username per line and use Drush in a shell script (assuming Drush 8), do this: IFS=" " for user in `cat users.txt` do echo "Cancelling user: $user" drush -y user-cancel ${user} done This way you will loop over your file and delete one user at a time. Another approach is to massive delete all ...


0

As stated in the comments, Views Bulk Operations provides helpful functionality. You can use the "select all" checkbox on the /admin/people page to select all the users, then deselect the few you want to keep. From the dropdown, you can then choose "Cancel user account". After submitting, you will select the method by which to cancel the ...


0

I modified this from another answer for my own use with Drupal 8. <?php use Drupal\Core\Session\AccountInterface; /** * Utility function that checks for single or multiple roles. * * @param string or array $roles * The role(s) to check. * * @param AccountInterface $account * The ...


0

I modified the top answer here for use with Drupal 8. <?php use Drupal\Core\Session\AccountInterface; /** * Utility function that checks for single or multiple roles. * * @param string or array $roles * The role(s) to check. * * @param AccountInterface $account * The ...


Top 50 recent answers are included