Hi there, i have two open source scripts, one is net2ftp, a web based ftp programme written in php, and the other is a web hsoting sign up script, also written in php (mainly!). I have limited knowledge of php so i'm hoping someone here could give me some clues as to how to solve this problem: Net2ftp is used by many web hosting companies as a filemanager and does not require a database, though one can be used for logging purposes.
The other script creates a cpanel web hosting account, and the username, password and website created are also the log in details to cpanel and any type of ftp programme. I want to integrate net2ftp within the first script, so that when a user signs into their account creator programme, they click a link to bet2ftp and immediately be logged in, i.e no need to enter their details again.
This is common to all web hosting applications so i know it can be done, i'm just wondering how does net2ftp 'read' the details from the other script? In pther words, how do i do this? Your help and direction would be most appreciated, thanks in advance.
help needed to integrate a log in
Moderator: General Moderators
Re: help needed to integrate a log in
Hi zbd
Just had a very quick look at net2ftp. For logging in a user you can follow the flow of files being called... it's something like:
/index.php > /main.inc.php > /modules/login/login.inc.php
login.inc.php uses the global array $net2ftp_globals which holds indexes such as state, username, ftpserver, etc. You'd have to modify this script to expose the password index of the array so you could pass some value in to it as it's currently hidden.
Then, assuming you have the user's credentials from their login to the hosting script... maybe you could try writing an Ajax function which would post to net2ftp's login script when the user tried to access. Using MooTools this might look something like:
Let me know how you get on.
Just had a very quick look at net2ftp. For logging in a user you can follow the flow of files being called... it's something like:
/index.php > /main.inc.php > /modules/login/login.inc.php
login.inc.php uses the global array $net2ftp_globals which holds indexes such as state, username, ftpserver, etc. You'd have to modify this script to expose the password index of the array so you could pass some value in to it as it's currently hidden.
Then, assuming you have the user's credentials from their login to the hosting script... maybe you could try writing an Ajax function which would post to net2ftp's login script when the user tried to access. Using MooTools this might look something like:
Code: Select all
$('some_button').addEvent('click', function(e) {
e.stop();
new Request({
url: net2ftp_root + 'index.php',
data: {
state: 'login',
username: some_username,
password: some_password,
ftpserver: some_ftpserver
},
onSuccess: function() {
// Redirect user to net2ftp
}
}).post();
});
Let me know how you get on.
Re: help needed to integrate a log in
Thanks very much for that, i'm going to look at that now and will let you know how i get on. Thanks again.