Password Protected Wordpress MU - wordpress

I have a MU site related to Doctors and they will be publishing information that I cannot let outside sources and robots view.
Is there a way that when you go to the main domain url, it shows a user/pass login for WP. I would set up the user/pass in the backend. Then they would login, then be able to view the website? I can't have it load up for anyone, I need the website to be password protected to even view the website in general.
I know I can use .htaccess to have a user/pass, but it would be ideal to use the user/pass generated by WP so I don't have to mess with code when I create a user.
Any help would be greatly appreciated.

This might be what you're looking for, although I've never actually used it.

If you're into programming and customizing WordPress themes (and want to create the solution yourself) add the following code to the top of your functions.php file:
function private_blog() {
if (!is_user_logged_in()) {
auth_redirect();
}
}
add_action('template_redirect','private_blog');
If you want a plugin solution, there are plenty. Just do a search for "wordpress private" and you'll find a ton. Private Only is one that I've used successfully.

Related

How to create end user login page in WordPress?

I am new to WordPress. Help me create end user login page. I have created and site with a theme. My requirement is to create a login page for the site not for the dashboard.
Only if they login, they should be able to access other pages
I need lo add an sign in page for the site, and then user should visit be able to visit these pages
If you are looking to have login form on front end then there are multiple plugins available out there. Checkout UserPro plugin.
Also Free plugin like 'Theme My Login (TML)' can be used to provide login functionality on front end. These are just examples, there are many others as well.
Let me know if this helps or feel free to discuss more in details.
This is very well possible. You can even do this without any advanced coding skills, but it requires some (very popular) plugins.
Use the 'sidebar login widget' to let people login on any part of your website and use 'login redirect' to send them to a specific private(!) page, based on their role.
I can recommend the 'TML plugin', Faisal suggests, to make the experience even more polished. Additionally you can use the 'User role editor' to customize your roles and/or create new ones.
Sidebar login: https://wordpress.org/plugins/sidebar-login/
Login redirect:
https://wordpress.org/plugins/peters-login-redirect/screenshots/
TML plugin: https://wordpress.org/plugins/theme-my-login/
User role editor: https://wordpress.org/plugins/user-role-editor/
Its Very Simple Just Search for Login box in Plugin > add New and Install the plugin.
after put the code where you want to show the login box.
you will find the code in plugin setting.
One of the best ways to quickly mod any theme is to get membership plugin or users add-on plugin. They usually have the basic stuff like login register customisation and my accaunt page.
Try https://wordpress.org/plugins/users-ultra/ but in your case maybe it will be an overkill.
you can also modify your plugin file name form-login.php in wp-conttent/plugin/templates
Similar to Theme My Login, ProfilePress is another great option. They even have an article on creating a custom login page. And it's a completely free plugin available in the WordPress plugin repo.
Since wordpress is an blogging framework we can use it for blogging purpose efficiently.. For building custom sites with javascript functionalities you have to edit index.php and header.php under your theme and then add your custom code.
To be short wordpress does not provide any end user login for site by default, only some of the paid theme supports that

Remove element from Wordpress plugin

I am currently using a social media login plugin for my website that allows users to login via their social media account.
Currently the flow of the plugin works in a way such that after ANY user authenticate themselves through Facebook, they will be brought back to my site with 2 options, link their Facebook account with their site's account, or to register an account.
How can I edit my code such that I am able to remove the "registration account" part without editing the plugin code directly as this might affect future updates of the plugin itself. One way that I know will definitely work is to comment that section away in the plugins itself but I do not wish to touch the plugin code.
After researching, a possible way that I think might work is to apply a filter that removes the element but I am not sure if that is the correct workaround for this situation.
Can anyone shed some light on this matter?
Thank you!
I don't see a way to filter executed php code on your Wordpress website.
I got two ways of dealing with this:
1: Disallow people to register an account on your site. The registration link will probably not be displayed anymore.
2: Or comment out the code within the plugin. Remember where you edited the lines. Whenever the plugin gets an update, comment out those lines again. Or contact the owner of the plugin to issue a feature request.

Access wordpress admin area without login

Currently I am developing a site in Opencart. For the blog, I am using Wordpress but my client does not want two different login sections for opencart and wordpress. Is it possible to redirect a user from the admin of wordpress to OpenCart and vice versa using a link without them having to enter a password each time?
Please advise. Your valuable suggestion will help me to sort out this problem.
This is possible by adding a simple plugin, which defines the needed (pluggable) login functions.
http://codex.wordpress.org/Pluggable_Functions
Basically, rather than logging into WP directly, you'd write the pluggable functions that authenticates the user using OpenCart's details. (Note that hooks allow you to make the login form redirect straight to the latter, too.)
Look for an existing plugin or module that does this. It would be surprising if none exist already.

wordpress restrict pulgin installation to those who have a unique code

i want to make an wordpress plugin, and to put it public, but i want that only the users that have a certain unique code to be able to activate it.
is there possible using the wordpress api to ask for a unique code at plugin activation (and to condition the plugin activation by this code)? I searched wordpress codex, but nothing found.
thanks a lot!
This sounds like the old akismet plugin which required users to register for an API token. You can as part of your plugin require users to enter settings and at this point prompt them to register for an API key.
See the WordPress codex for adding an options page.
Also see this example for a good example of hooking into the plugin activation:

How can I sign in a Wordpress (mu) user from outside of Wordpress?

I'm working for a company that is using Wordpress MU to supplement other functions on a member site. We have a user signup process that creates the appropriate Wordpress MU users and blogs on signup, but I'm having real trouble figuring out how to log someone in to a WP blog from outside of Wordpress itself. The documentation these methods seem to be non-existent or just too obtuse for me.
In the abstract I know how to do it: Take user info, set the same cookie that Wordpress would set itself. Done. It is, however, not this simple.
Has anyone done this successfully before?
I've been able to log people into Wordpress, however I'm was running inside Wordpress. (I was inside a theme)
Basically, the tough part is getting all the hashes correct, because Wordpress uses a set of defined security hashes in the config file to create the cookie. Ideally you should be able to copy and paste the functions that Wordpress uses.
Yes Wordpress documentation for security sucks, but that is what you get in a Open Source application, not stellar documentation.
What you are looking for is the wp_set_auth_cookie function in the /wp-includes/pluggable.php file. You should look into what the do_action()s actually do, but you should be able to simply replace all the constants with the correct values, and you'll have a function that can port anywhere on the domain.
Hey, it's not so tough task, once you are using correct instruments ;)
Try XML-RPC

Resources