While setting up local environments for Drupal 8, everyone may find difficulty in login to the site, if the password is unknown
In Drupal core there is a script file that return the hashed password, which is core/scripts/password-hash.sh.
Run the following command to get the hashed string for '123' in the terminal.
./core/scripts/password-hash.sh 123
Update the returned string in the password field in the user's table for required users via command line or any MySQL (or any database systems like PostgreSQL, MariaDB, MongoDB) GUI tools.
User Profile
If you run into a Drupal 7 site with file system access and you would want to change the password of a user in the system programmatically, here is an easy way to do this.
This article focuses on how to add new members to Drupal commerce store. Usually, when a new user created with admin role tries to access the store, the action will be restricted with an "Access denied" message. For a user to access the commerce store, he should be a member of the store. Let's find out how to resolve this issue.
There are many ways to get delete the Anonymous user account from the Users table. A wrong query like 'uid != 0' or Views bulk operations may cause deleting the row.
A website will be having two kinds of users mainly, users with administrative privileges and simple users. Most of all a single root user. An administrator one of the main challenge will be in monitoring the site users and its contents. Admin should be notified regarding the new user registration and extra add-ons, etc. For a website with multiple users managing site contents and updates from user roles could become a nightmare.
User permissions are permissions that allows or restrict the user in accessing a feature. We can define our own permissions in our custom module using the hook_permission() function.
One of our Drupal clients had requested us to look into the innards of their website and see if the site can contain the influx of new users without breaking a sweat. We went into action swiftly and while we were gathering the details of the site, we realized that we need to get the count of all users having a particular role. We used a simple query to get the details of the users. Read on to know how to get the count of all users having a particular role in a Drupal 7 website.
A number of Drupal users using the Drupal Organic Gropus module reported that they could not see groups that they belong to and also the groups the administrator belonged to. If you are facing the same issue with Drupal Organic Groups in your Drupal site then read on to find out the fix.
We wanted to get the value of a field in a users profile in a Drupal site when they become a subscriber (when they got the subscriber role). Since we are very familiar with Drupal we intuitively searched for a hook that we would serve our purpose. Read on to know how to get the data of a user when the user has updated their profile
In Drupal we have got a module namely Registration with Profile , to bring an option to upload the profile picture. But here let us gather some information on how this can be brought programmatically.
So let's start up with Form API.
Following are the steps to get the profile picture uploading option in registration form.
Step 1 : In registration form alter :
There are certain cases were we need a copy of our database. In this case we need to export the database in the sql format. This is a simple process and can done in few steps. Certain cases we need full database for example if we need a backup copy of database we need to export the full database and in cases we need to export only certain table from the database. Both are possible. Both the exporting steps are given below
This article explains how to programmatically, save custom additions to the user object when a new user account is created in Drupal. We can understand this with an example. Say, we want to create a default album with every newly created user, then we can use the following to save the custom additions. Similarly any of your additions can be done after referring the following.
I had an issue with a Drupal site that files not getting loaded due which issue on website alignments. This files not getting loaded issues was noticed on reviewing the console log errors in browsers.
As Drupal sites are becoming increasingly flexible, it is obvious to list the nodes related to logged in user. This can be done with the help of PHP and MYSQL codes. However, we need not waste time if have the views module - the perfect icing on the cake !!! So, let's narrow down here.
Forgetting a password is a usual scenario. The first thing that may come to your mind when you forget the password of your site is resetting it. If it is a live site, then we can ask to send a new password by mail. But what is if it is your local site where no mails are configured? well, I know a trick or two to solve this programatically. If you too want to know, then read on.
Step 1 : Create a new file and copy the below script in that.
A number of Drupal users using the Drupal Organic Gropus module reported that they could not see groups that they belong to and also the groups the administrator belonged to. If you are facing the same issue with Drupal Organic Groups in your Drupal site then read on to find out the fix.
A few Drupal users using the Admin Menu module had realized that the Hello " link in the Menu contained the unformatted username. If you are encountering the same scenario in your Drupal site and would like to know about the fix then continue reading.
A Drupal user encountered a situation in a View in their Drupal site where some of the fields disappeared after enabling the "Use Aggregation" option in the View. To be more specific the User Roles disappeared after enabling "Use aggregation" in the View. If you are facing the same issue with Drupal Views in your Drupal site then read on to know the solution.
Many Drupal users have wished to know how to use customized fonts in Drupal themes. If you are facing the same question when creating or modifying or editing a Drupal theme and want to know how to use customized fonts in a Drupal theme then continue reading.
Many Drupal users wanted to know how to redirect a node-edit form to a custom page after submission in a Drupal 7 based website. If you want to know how to redirect a node-edit form in your Drupal site to a custom page after the form has been submitted then continue reading.