How to customise wordpress user authentication - wordpress

I have a old website, which allow people to register and do staff. Say it is www.example.com.
Now I added a subdomain, reviews.example.com and want my users to write reviews.
The reviews.example.com is done in wordpress which works perfectly.
However, as my users already registered with the old site, ideally I want my user to use their old username and password to login to the review website. Also I would like new users to continue register in the old site and I could just write another query to insert the new user's username and password into wordpress's user table.
To custom login process for wordpress, can I apply a callback somewhere, so when wordpress login failed, I will run my custom query and create and return a wp_User object?
Or it is better to change the login code in wordpress directly? I searched wordpress code and saw the code where I could hack to put my own login logic.

Then one solution can be done
i.e
I am assuming that you made the username field and the password field
of registering and the password is visible for you.
Now once you make the wordpress install at your blog.website.com and then you need to copy the sql query which have import for your previous_users and paste in your SQL query of phpmyadmin after that you just need to add the same feild in your database as the wp-users feilds are containing then after that make your users password as MD5 crypt for that you just need to change the password type feild to MD5 crypt and your all users will be able to sign-in there.
I hope i Am clear to you.
Any Doubt you can Comment.

Related

Wordpress login issue with Administrator

I have lose administrator password, due to multiple try the email got blocked. I have added new Administrator to the Database using SQL Queries and I am able to login but I am unable to see the dashboard.
See here
WordPress didn't show the option to visit dashboard, it show the username and logout option nothing else.
You can change password of your old admin. Go to wp_user table in database and change admin password there.

Wordpress password protect certain parts of my site and create logins

I'm a newbie to Wordpress and I need to password protect certain pages of my site. I also need to be able to have users request a password that I can then create and send them so they can log in and see the content that is password protected. Any plugins or suggestions would be appreciated.
Password protecting posts and pages is actually built in to WordPress.
On the left hand side of your page editor, you will see this:
If you change the visibility from public to password protected you can ensure that only logged in users can see that specific page/post.
If you want to approve user registrations, I would suggest having a look at the New User Approve plugin. Alternatively, you can try to write a function to do it yourself, and if you get stuck, post your progress here and we can help you adjust.

wordpress webstie restriction or blocking, only registred users can view the website

I am creating a website on top wordpress,
The reason to use wordpress is that,
We want to restrict or block the entire site,
Only registered people should be able to access the site that too after verification,
Can anybody help me choosing the right plugins to achieve this.
Note : the site will be similar to a membership website, but the users who are going to use this are not paying, We just want to allow only people whom we approve.
Example: The steps are the one we are looking,
Default page should be Registration page,
Once Registered, Email verification has to be done by clicking the link in the Email ID giving during registration,
Post verification, Email with log-in page link along with username & password goes to the user's registered Email ID,
User logs-in using the username and password,
User is able to view the entire site
I AM A NEWBIE IN WORDPRESS,
Thanks
Ashok
Check this plugin : https://fr.wordpress.org/plugins/wp-user-frontend/
It's the best to make membership / private page / registration page and etc.. and he is the most documented plugin on this.
Have fun and welcome on Wordpress :)

Accessing BigCommerce Logged In user from wordpress on subdomain

So I need a way to lock down both bigcommerce and wordpress if a user is not logged in. First suggestion was asking if when a user is created in bigcommerce create the same user account in WP... but that doesn't seem like a good approach to me since the user will not need any interaction as a user on WP just need to block access to pages if they are not logged in.
So my thought is to check if a user is logged into bigcommerce, then pass a variable to wp header file. If the variable does not exist then redirect them back to bigcommerce login. For this install BigCommerce is currently using the header from wp so they match and all works well so that is why I assume I should be able to pass a variable to check if a user is logged into bigcommerce or not. I have not been able to find any documentation in the API about accessing if a user is logged in or not.
Has anyone done anything like this and or know if this would be possible? Or know of a better solution for what I am trying to do. Maybe check for a cookie or session?
Recently I did a project where the client wanted to show custom content to bigcommerce loggedin users and block the rest. The best way I found was to check the value of %%GLOBAL_CurrentCustomerFirstName%%. It is "Guest" for non-loggedin users.
you can try this:
localStorage.setItem("user", %%GLOBAL_CurrentCustomerFirstName%% );
and then you can use on wordpress pages :
var user = localStorage.getItem("user");
if(user=="Guest"){
//redirect to login or block page
}
Obviously they can get around javascript so using ajax to store it somewhere and then retrieving it would be more secure but I hope this will help you proceed :)

How does wordpress check admin username and password

I am creating a site admin panel and wp blog and I want to login by using same username and password as that for WP blog like admin *admin* I searched wp folder, how does it encrypt the password and how does it check if the user is admin or not..
I just got that WP used some sort of hash and md5 for encryption but do not success to create copy of that function to use it for my new panel
It is in the wp_usermeta table > metakey column > wp_user_level
If wp_user_level for a user id is 10 then he is an admin
For the password, search for the function wp_password_hash
The function is wp_hash_password and it could be overridden as per your request (it is pluggable and some plugins change the encryption mechanism for security reasons).

Resources