Jump to content

Auto Login


eisenberg
 Share

Recommended Posts

Is the web site also running in PW? If so, then PW won't show the login page. But your question makes me think the user is logged into some software other than ProcessWire. The question is, which software are we talking about? That may help us to determine how best to authenticate them with PW too.

Link to comment
Share on other sites

Hello, I'm eisenberg partner.

Thanks for your quick answer.

We are integrating PW into OpenCart an would like to run it from a menu option in OC admin.

What I'm thinking is to supply PW a user/password from the OC application.

Let me congratulate you for what I think is the best CMS for developers.

  • Like 1
Link to comment
Share on other sites

That's a tough question to answer, because usually we're trying to prevent this sort of thing from a security standpoint. So I think that the solution will involve creating your own template to perform the login. Something like this:

<?php
if($input->post->user && $input->post->pass) {
   $username = $sanitizer->username($input->post->user); 
   if($session->login($username, $input->post->pass)) {
       $session->redirect('/path/to/page/'); 
   } else echo "Login failed";
}

Then have your OpenCart page POST the 'user' and 'pass' to the page using that template, when they click a "go to ProcessWire" button, or something like that.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...