Drupal 6 user token creation? - drupal

In one of my project,client requirement was to send an email to registered user. and user name should be first and last name.
user first/last name token is unavailable in user setting page.

Drupal 6
Install the content profile module.
This module allows you to add fields to the user profile. It also includes a registration module which allows you to add extra fields to the registration form.
Drupal 7
You can achieve this in one of two ways:
Go to admin/config/people/accounts/fields and add two fields, one for first name and the other for the last name
Install the Real Name module.

Related

Is it possible to get login history of user in Drupal 8

i have a user login panel in drupal 8 where i need to print a banner when user has been logged after 3 months, but when i access user last login iam getting current login, how is it possible in drupal 8?
You can check this module
https://www.drupal.org/project/login_history
This module adds a new table which stores information about individual user logins, including a timestamp, IP address, user agent information, and whether or not the login was via a reset password link.

How do I add field values to the `drush user-create` command?

I have been Googling this, read the drush documentation and searched StackOverflow, but I can't find an answer to this question.
I currently use drush user-create someone#example.com --password="somepassword" to create a user.
Then there are drush commands to add a role, block the user, etc. But nothing on adding/updating fields.
Does someone know how to set a custom user field to a created user, or immediately create a user with field values (for Drupal 7 that is)?
I need to do it without answering commandline questions.
You need a custom Drush command which accepts the arguments like UID and field values.
https://www.chapterthree.com/blog/how-to-create-custom-drush-commands
https://drupalize.me/videos/passing-arguments-drush-commands?p=1134
All commands in user: (user)
user-add-role (urol) Add a role to the specified user accounts.
user-block (ublk) Block the specified user(s).
user-cancel (ucan) Cancel a user account with the specified name.
user-create (ucrt) Create a user account with the specified name.
user-information Print information about the specified user(s).
(uinf)
user-login (uli) Display a one time login link for the given user account (defaults to uid 1).
user-password (upwd) (Re)Set the password for the user account with the specified name.
user-remove-role Remove a role from the specified user accounts.
(urrol)
user-unblock (uublk) Unblock the specified user(s).

Extending User information inside asp.net mvc 5 project

I have created a new asp.net MVC-5 web application , and I define individual user accounts as the authentication type.
Now when users register a new account they can enter email and password. Now I want to extend the users information when registering their account as follow:-
First name
Last name
Data of birth
Country
City
Address
Etc…
Now I am not sure what is the recommended way to extend the user info. Now I am trying to do the following 2 steps, as when the project was created a new database has been created automatically and it has a table named “ASPNETUSers”, which store the users info.
So I am thinking of adding the additional fields inside this table.
Then to modiy the “Account >> Register” view to render the additional fields.
So can anyone advice if my above 2 steps to store additional info about the users upon registration is valid ?or I should not modify the built-in database tables which include the ASPNETUSers ??

Drupal maintain rejected user list and authenticate from among

Im developing a drupal website with multistep approval of users ,after
registration the admin rejects a user an email is sent to the user and the user
is deleted from drupal user table .
I want to perform a action where in after a user is rejected he will be kept in
a new table with the username and email .
If the same user contacts admin,the admin will remove the user from the rejected
users list ,because during registration for second time it should also check for
the user in the rejected user list.
Is i t something that is possible in Drupal?
Any pointers?
Everything is possible except the wooden stove! Show some effort, try something on your own and when you get stuck ask.
There's no out of box solution for this (that I know about it), but what I would do is make custom content type for storing users and use hook functions to insert/check existence of rejected users.
hook that is called when user is deleted:
https://api.drupal.org/api/drupal/modules%21user%21user.api.php/function/hook_user_delete/7.x
hook that is called when node (rejected user) is deleted
https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_delete/7.x
But maybe your admin can just disable user instead of deleting it as first step - that way wouldn't need that extra table at all.

drupal how to allow logged in user to edit specific content node?

I have a Drupal 7 site with single SSO via the LDAP module, which allows us to run the site as n Intranet and users that hit the site with IE will get automatically authenticated using their active directory credentials.
I have a personnel directory content type that holds a list of all of our employees and some of their stats (photo, email, phone number, etc.).
The problem I want to allow the logged in user to be able to edit the node in the personnel directory page that represents them, but because there is no relation between the logged in user and the nodes under the personnel directory content type I am not sure how to go about allowing users to edit their own entries?
The personnel directory page is automatically populated/updated via feeds (it looks at our AD, and pulls down users and updates them if it detects updates in AD meta data).
Somehow I need to tie the logged in user to the specific node, any idea how I could automate this as there are over 300+ nodes/users.
Ultimately, I'd like to have a "edit personnel bio" link that they can link, that will link based on their [current logged in user ID] it will allow them to edit the correct node in the [personnel directory] content type.
I hope this was clear enough to point me to some direction.
Thank you.
basically you want to create a user "role". Then in your permissions page (the one with 1000 checkboxes) you can add edit access to your "personnel bio" content type (or fields) for just that user role.
Then in your template you provide the user a link to the same page with /edit in the url.
Make sure the user has permissions to edit the node of that type. Upon creation of the node via feeds, create a rule (use the Rules module https://drupal.org/project/RULES) to change the creator of the node to that user's uid.
Add another field in the user's account to match their AD username to tie them together. To do this, create a module as seen at https://drupal.stackexchange.com/questions/8253/how-to-add-extra-fields-to-user-profile

Resources