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.
Related
Ok so I'm trying to find out what determines a wordpress user becomes a subscriber or a customer. So my site has over 5000 subscribers but 1000 customers. Lately I have been getting hit by bots that will register 300 - 400 accounts in a day. So I'm trying to determine if its' the registration form itself that determines who becomes what role. Like if it's original wordpress form they become a subsriber but a woocommerce registration form they become a customer. As the bots are using a very specific link to automatically register and it's the default wordpress registration link. So I'm trying to figure out the best way to avoid this from happening while also being able to determine fake subscriber from real subsribers, as checking some of the subsribers have actually logged in. I figured then all customers should have logged in, assuming customers were created once they purchased something from the store but in fact thats not the case. So any real input on this would be very nice and helpful.
So talking to Wordpress and Woocommerce it is when the user uses the Woocommerce Registration Form is when a user is assigned the Customer Role over Subscriber Role.
I want to add to this now also, I'm unsure what update this occured but in Wordpress Settings->General Tab there is a box that asks for New User Default Role. So now you can make sure every user is a customer or a subscriber or whatever role you decide to choose.
hope you are well
I am trying to make an app where from the same app, you can either be a user or you can be a seller. In our case, the seller will be a restaurant and the User will be a restaurant-goer. My problem is that if I log in the "I am a restaurant login"-not a user login. On restart the app auto logs in and takes the user to the User homepage, not Seller homepage, as I am using the
auth.currentUser != null ?
Then add the home screen or login screen depending on auth state, but it is a general auth state. How would I make it show a different home screen based on the type of Logged in user. So I know why it takes me to the User homepage-I set it to do that, how would I make it takes me to one or the other
thank you
Firebase Authentication has no built-on concept of a type of user, so you will have to build that on top yourself.
You can store the user-type in the user's profile as a custom claim, or in a cloud-hosted database. In either case, you should do this from a secure environment so that user's can't change their type (unless your use-case specifically wants them to be able to).
So with that out of the way your app then takes these steps when started:
signs in the user, or restores their auth state.
determines their type.
redirects them to the correct screen.
Also see:
the links for How to create two types of users(Client , Freelancer. for example) while Auth using firebase in a flutter app?
How to create 2 different User group in Firebase AUTH with Flutter
many more results from searching for [firebase-authentication] two types of users
Please post the code you are using for this pathway.
I would advise you to create a property called userRole, and store this when the user is created.
When you send their name and image and email to Firebase after successful auth, store with that info their userRole.
In your widget tree, I'm assuming you have two widgets, CustomerHome() and RestarauntHome(). Now, after successful login, pass the user info to this widget, and check:
user.userRole == 'restaraunt' ? RestarauntHome() : CustomerHome();
This way, when they come back to the app, the page they are not allowed to see, will not be displayed.
Assuming you are using firestore database to manage your users' data, in the document of the users collection you can add a field of role whose value could be user or seller. Write to this field when a new user user/seller signs up. Then in the home page, return seller homepage when the value is seller otherwise return the user homepage. While the document is being fetched you can return the loading screen.
I have developed a system using Drupal 6. I have implemented user registration with content profile. Which means there is a functionality called company registration. It is creating a content profile with companies and a user account also after click register.
Once the profile and user account created both will be in pending status and I have implemented a functionality where the site admin can approve (using rules.) Once approved the content profile is accessible via front end.
But though the users status change rule is written (rule to change the pending user role to active member) the user is unable to login. Currently after approving the content profile the admin again need to go to the user account and activate it.
Can anybody help me to get this resolved please?
My advice would be to use Triggers with this, so that when a content profile is approved, the linked user profile will also be approved. You should be able to write an "Advanced" trigger for this.
https://drupal.org/documentation/modules/trigger
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
After registration the user is redirected to a welcome page . How to get display the respective user details in redirected(welcome) page?.
for ex: welcome username . how to get user name in redirected page
When a user is logged in, you always have the global $user object available. So all you really need to do, is to access it and insert the name.
I'm not sure what page your users are redirected to, you can change that, but to alter the output you only need the normal theme/template overwrites that you can do with Drupal.
We do this using the Profile, Blocks, and Views modules. A view could include only the logged in username as you require, but ours also includes several profile fields that logged in users may choose to complete. The view has a block display - we configure that block to display only on certain page paths through the block administration screens.
You can use actions, and triggers.
Using them, you can define an action (show message to the user) that is triggered when a user logs in. The action to show a message to the user allows you to use tokens; one of them is for the username.