Current time: 05-07-2024, 05:04 AM Hello There, Guest! (LoginRegister)


Post Reply 
Login from website to ispCP
Author Message
davidxone Offline
Newbie
*

Posts: 5
Joined: Jan 2011
Reputation: 0
Post: #1
Login from website to ispCP
Hello,

I need for my website make new "external login".
User is loged in my own system and there he has his hosting accounts > my idea is - if user click on his hosting account from list, that automatically log him to choosed hosting ispCP account.

So I need PHP script to make this...
I tried it, but still a cant login into ispCP.

Now I´m using this sessions:
$_SESSION['user_logged'] = $name;
$_SESSION['user_pass'] = $pass;
$_SESSION['user_type'] = $type;
$_SESSION['user_id'] = $id;
$_SESSION['user_email'] = $email;
$_SESSION['user_created_by'] = $by;
$_SESSION['user_login_time'] = $cas;
$_SESSION['logged_from'] = $id;
$_SESSION['logged_from_id'] = Here i dont know value to asign.

Database insert:
INSERT INTO login(session_id,ipaddr,lastaccess,user_name) VALUES('".session_id()."','".$_SERVER["REMOTE_ADDR"]."','".$time."','".$name."')

AND

write_log($name." logged in.");

...
what i need more to make it happend? Thank you for your answers Smile
03-20-2011 02:05 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #2
RE: Login from website to ispCP
You can not create the session directly into the database, since the corresponding session file (located in /var/www/ispcp/gui/phptmp) will be missing.

What you should do is:

1. Login the user by submitting a proper POST request to the login page (as if it was a guy with a browser performing the login).
2. Update the "ipaddr" field in the "login" table of the ispcp database.
3. Redirect the user to ispcp.
03-20-2011 04:48 AM
Visit this user's website Find all posts by this user Quote this message in a reply
davidxone Offline
Newbie
*

Posts: 5
Joined: Jan 2011
Reputation: 0
Post: #3
RE: Login from website to ispCP
(03-20-2011 04:48 AM)kilburn Wrote:  You can not create the session directly into the database, since the corresponding session file (located in /var/www/ispcp/gui/phptmp) will be missing.

What you should do is:

1. Login the user by submitting a proper POST request to the login page (as if it was a guy with a browser performing the login).
2. Update the "ipaddr" field in the "login" table of the ispcp database.
3. Redirect the user to ispcp.

Thank you for answer.

But I have one problem - I can read user password from database only in hash - i dont have source(of password - non-hash) necessary for proper login.

Can you give advice, how I can solve this? Smile
(This post was last modified: 03-20-2011 10:09 AM by davidxone.)
03-20-2011 10:08 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)