greg

Active Member
Sep 4, 2001
37
0
306
Hi

I would like to be able to give my customers the chance to log into their control panel via the front page of my site. All they would have to do is fill in a short form (username/password)..

Is this possible and if so how?

Thanks in advance...
 

feanor

Well-Known Member
Aug 13, 2001
835
0
316
Shot in the dark-
I KNOW I have done this before though.... it was in the form

http://username:[email protected]/cpanel
(or /controlpanel, or :2082, what have you)
At least I think.

I will play around with it............

:cool:
 

Daniel

Well-Known Member
PartnerNOC
Aug 13, 2001
164
0
316
The problem is what happends when you have 2 servers or more. Then you have to tell the username password and server. And most clients don\'t know what server they are on.
 

Craig

Well-Known Member
Aug 10, 2001
170
0
316
[quote:3d877613a7]

Shot in the dark-
I KNOW I have done this before though.... it was in the form

http://username:[email protected]/cpanel
(or /controlpanel, or :2082, what have you)
At least I think.

I will play around with it............

:cool: [/quote:3d877613a7]

Could you just not use \"customers_domain_name\" instead of server name. Although it would mean them filling in another box would get around the multi server problem..

Just a thought :]

C.
 

Mat

Well-Known Member
Sep 26, 2001
55
0
306
I tried this and it didn't work, I think cpanel checks if a person logs in this way, but I was using PHP and the header function so, not sure...


&?php
if (!isset($user)) {
?&
&title&Control Panel Login&/title&
&body bgcolor=\&#000000\& text=\&#999999\& link=\&#999999\& vlink=\&#999999\& alink=\&#666666\&&
&div align=\&center\&&
&form name=\&login\& method=\&post\& action=\&login.php\&&
&/form&
&form name=\&form1\& method=\&post\& action=\&\&&
User:
&input type=\&text\& name=\&user\&&&br&
Pass:
&input type=\&password\& name=\&pass\&&&Br&
&input type=\&hidden\& name=\&action\& value=\&login\&&
&input type=\&submit\& name=\&Submit\& value=\&Submit\&&
&/form&
&/div&
&?
}

if ($action == \&login\&) {
$url = \&http://\&.$user.\&:\&.$pass.\&@www.aphosting.com:2082\&;
header(\&Location: $url\&);
exit;
}
?&
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
Domenico, [quote:5ce51a596b]Hmm, this last one works perfect for me...
[/quote:5ce51a596b]Do you mean you don\'t get the pop-up screen and it lets you enter the cpanel straight on? Have you made any changes to the script?

I still get the pop-up screen for some reason. :(
 

Mat

Well-Known Member
Sep 26, 2001
55
0
306
I found a neomail login Javascript page, and adapted it to work with Cpanel... You could make a pull down box to choose to go into WHM or Cpanel, just make another var for the port number....

[quote:df70e31975]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<script language=\"javascript\">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var cplogin = \"http://\" + username + \":\" + password + \"@\" + server + \":2082/\";
window.location = cplogin;
}
else {
alert(\"Please enter a Username and password.\");
}
}
// End -->
</script>
</head>

<body bgcolor=\"#FFFFFF\">
<form name=login>
<div align=\"center\">
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2 align=\"center\">Cpanel4 Login</h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=username size=15 maxlength=\"26\">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type=password name=password size=15>
</td>
</tr>
<tr>
<td>Hostname:</td>
<td>
<input type=\"text\" value=\"aphosting.com\" name=\"server\" maxlength=\"65\" size=\"15\">
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value=\"Login!\" onClick=\"Login(this.form)\" name=\"button\">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
[/quote:df70e31975]
 

MrHits

Well-Known Member
Oct 31, 2001
92
0
306
Cpanel has a cvs file, that you can use to parse our the user/domain names from. Take this data daily, and dump it into a mysql database.

Then, on your main website, create a login function where the the user just types the username and password. The script can then look up the appropriate domain associated with that username, and redirect the user to:
https://user:[email protected]:2083

Please note, that this will work only if you have unique users. I DO NOT duplicate usernames, even across multiple servers.

This is probably an hour or two hour script. I\'d create it, but my admin duties right now for my job are consuming my time.

- Jeremy
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
Jeremy,
[quote:da568d7654]Cpanel has a cvs file, that you can use to parse our the user/domain names from. Take this data daily, and dump it into a mysql database.

[/quote:da568d7654]
Can you tell us where that .cvs file is located?
 

MrHits

Well-Known Member
Oct 31, 2001
92
0
306
/var/cpanel/acccts.db

comma delimited.

- Jeremy
 

Domenico

Well-Known Member
Aug 14, 2001
377
13
318
This works!
Thanks!


[quote:340e94b72b]I found a neomail login Javascript page, and adapted it to work with Cpanel... You could make a pull down box to choose to go into WHM or Cpanel, just make another var for the port number....

[quote:340e94b72b]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<script language=\"javascript\">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var cplogin = \"http://\" + username + \":\" + password + \"@\" + server + \":2082/\";
window.location = cplogin;
}
else {
alert(\"Please enter a Username and password.\");
}
}
// End -->
</script>
</head>

<body bgcolor=\"#FFFFFF\">
<form name=login>
<div align=\"center\">
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2 align=\"center\">Cpanel4 Login</h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=username size=15 maxlength=\"26\">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type=password name=password size=15>
</td>
</tr>
<tr>
<td>Hostname:</td>
<td>
<input type=\"text\" value=\"aphosting.com\" name=\"server\" maxlength=\"65\" size=\"15\">
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value=\"Login!\" onClick=\"Login(this.form)\" name=\"button\">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
[/quote:340e94b72b]


[/quote:340e94b72b]
 

Mat

Well-Known Member
Sep 26, 2001
55
0
306
You shouldn\'t use anything you want to keep secure from a cyber cafe.... You don\'t know if there might be key loggers installed on those machines..... No matter how you login, it gets the details....


Generally, if you want to access something securely, do it from your home box... No where else....
 

mIRCnet

Registered
May 25, 2002
1
0
301
Hello

Why dont you ask the customer to enter his account name in a form and submet it, the cpanel will give a box asking for the user name and password of the account.

All what you are going to do is to redirect the user to hes cpanel URL

;)