
27th October 2009, 16:22
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 105
Thanks: 15
Thanked 9 Times in 8 Posts
|
|
embedd login form into website
hi, i am trying to include the login of ispconfig3 into a website. my guess was:
Quote:
<form method="post" action="https://my.domain.com:8080/index.php" target="_blank">
<input type="hidden" name ="_action" value="login" />
<fieldset>
<legend>
ispconfig Login
</legend>
<input class="input_user" type="text" name="_user" onblur="if(this.value=='')this.value='Benutzer';" onfocus="if(this.value=='Benutzer')this.value='';" value="Benutzer" /><br />
<input class="input_pass" type="password" name="_pass" onblur="if(this.value=='')this.value='Kennwort';" onfocus="if(this.value=='Kennwort')this.value='';" value="Kennwort" /><br />
<input class="input_submit" type="submit" name="input_submit" value="Login" />
</fieldset>
</form>
|
it did not work (obviously, otherwise i would not post it here  )
if someone has a working form, please post it here!
Thanks in advance, giftsnake
|

4th November 2009, 14:58
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 105
Thanks: 15
Thanked 9 Times in 8 Posts
|
|
hm, maybe i posted in the wrong forum :-/
|

5th November 2009, 14:32
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
What happens when you submit the form?
|

5th November 2009, 14:58
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 105
Thanks: 15
Thanked 9 Times in 8 Posts
|
|
same as if i call the interface in the browser. the username and the password does not do anything
Last edited by giftsnake; 5th November 2009 at 15:02.
|

9th November 2009, 12:10
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 105
Thanks: 15
Thanked 9 Times in 8 Posts
|
|
Quote:
//* Login Form was send
if(count($_POST) > 0) {
//** Check variables
if(!preg_match("/^[\w\.\-\_]{1,64}$/", $_POST['username'])) $error = $app->lng('user_regex_error');
if(!preg_match("/^.{1,64}$/i", $_POST['passwort'])) $error = $app->lng('pw_error_length');
//** iporting variables
$ip = $app->db->quote(ip2long($_SERVER['REMOTE_ADDR']));
$username = $app->db->quote($_POST['username']);
$passwort = $app->db->quote($_POST['passwort']);
|
-> changed the variables in the submit-form to 'username' and 'passwort'
what happens:
the login button calls the index.php page with:
Code:
https://domain.com:8080/index.php?username=myusername&passwort=mysecretpassword
i still get no login. any ideas?
|

9th November 2009, 13:00
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,248 Times in 3,260 Posts
|
|
The login form works with ajax, you can not use a external login form in ispconfig 3 withour rewriting the ispconfig login mechanism.
|

9th November 2009, 17:59
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 105
Thanks: 15
Thanked 9 Times in 8 Posts
|
|
why is the following code in the mechanism:
Code:
if(count($_POST) > 0)
is it just for "login as <user>" from inside the panel?
|

9th November 2009, 18:13
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,248 Times in 3,260 Posts
|
|
A ajax request is a post request.
|

9th November 2009, 18:18
|
|
Senior Member
|
|
Join Date: Jan 2009
Posts: 105
Thanks: 15
Thanked 9 Times in 8 Posts
|
|
maybe i dont get it right...
you implemented the 'post'login, but i still have to rewrite the mechanism?
looks to me that i just have write the correct form to submit the data to the loginscript, right?
|

9th November 2009, 18:38
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,248 Times in 3,260 Posts
|
|
Quote:
Originally Posted by giftsnake
looks to me that i just have write the correct form to submit the data to the loginscript, right?
|
No. Everything in ispconfig is loaded by ajax, so after the login, the ispconfig ajax scripts replace just some parts on the same html page that displays the login script and does not load the whole page again. So if your page is not the ispconfig outer html page, then nothing gets replaced and you dont get the ispconfig interface as the result.
Also be aware that browsers block all cross domain post requests, so if your login form does not run on the same port and under the same domain then the ispconfig interfcae, all modern browsers will block any post data.
|
|
The Following User Says Thank You to till For This Useful Post:
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 02:51.
|
Recent comments
1 day 4 hours ago
1 day 7 hours ago
1 day 19 hours ago
1 day 21 hours ago
2 days 1 hour ago
2 days 8 hours ago
2 days 17 hours ago
2 days 19 hours ago
3 days 3 hours ago
3 days 4 hours ago