Jump to content


Photo

Auto Login

login

  • Please log in to reply
4 replies to this topic

#1 eisenberg

eisenberg

    Starter

  • Members
  • 1 posts
  • 0

Posted 11 May 2012 - 11:12 AM

Hello all.

I want to link to pw admin from a web page on my site, in wich a user is already logged in.

How can I pass the credentials to avoid pw firing the login page?

Thanks,

#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,771 posts
  • 3112

  • LocationAtlanta, GA

Posted 13 May 2012 - 10:32 AM

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.

#3 sambalette

sambalette

    Newbie

  • Members
  • Pip
  • 2 posts
  • 1

Posted 14 May 2012 - 01:34 PM

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.

#4 ryan

ryan

    Hero Member

  • Administrators
  • 5,771 posts
  • 3112

  • LocationAtlanta, GA

Posted 16 May 2012 - 11:39 AM

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.

#5 sambalette

sambalette

    Newbie

  • Members
  • Pip
  • 2 posts
  • 1

Posted 28 May 2012 - 10:28 AM

Thank you Ryan, we have implemented your solution and works like a charm.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users