Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 27th October 2009, 16:22
giftsnake giftsnake is offline
Senior Member
 
Join Date: Jan 2009
Posts: 108
Thanks: 15
Thanked 9 Times in 8 Posts
Default 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
Reply With Quote
Sponsored Links
  #2  
Old 4th November 2009, 14:58
giftsnake giftsnake is offline
Senior Member
 
Join Date: Jan 2009
Posts: 108
Thanks: 15
Thanked 9 Times in 8 Posts
Default

hm, maybe i posted in the wrong forum :-/
Reply With Quote
  #3  
Old 5th November 2009, 14:32
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

What happens when you submit the form?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 5th November 2009, 14:58
giftsnake giftsnake is offline
Senior Member
 
Join Date: Jan 2009
Posts: 108
Thanks: 15
Thanked 9 Times in 8 Posts
Default

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.
Reply With Quote
  #5  
Old 9th November 2009, 12:10
giftsnake giftsnake is offline
Senior Member
 
Join Date: Jan 2009
Posts: 108
Thanks: 15
Thanked 9 Times in 8 Posts
Default

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?
Reply With Quote
  #6  
Old 9th November 2009, 13:00
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,381
Thanks: 833
Thanked 5,484 Times in 4,316 Posts
Default

The login form works with ajax, you can not use a external login form in ispconfig 3 withour rewriting the ispconfig login mechanism.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 9th November 2009, 17:59
giftsnake giftsnake is offline
Senior Member
 
Join Date: Jan 2009
Posts: 108
Thanks: 15
Thanked 9 Times in 8 Posts
Default

why is the following code in the mechanism:
Code:
if(count($_POST) > 0)
is it just for "login as <user>" from inside the panel?
Reply With Quote
  #8  
Old 9th November 2009, 18:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,381
Thanks: 833
Thanked 5,484 Times in 4,316 Posts
Default

A ajax request is a post request.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 9th November 2009, 18:18
giftsnake giftsnake is offline
Senior Member
 
Join Date: Jan 2009
Posts: 108
Thanks: 15
Thanked 9 Times in 8 Posts
Default

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?
Reply With Quote
  #10  
Old 9th November 2009, 18:38
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,381
Thanks: 833
Thanked 5,484 Times in 4,316 Posts
 
Default

Quote:
Originally Posted by giftsnake View Post
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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
giftsnake (9th November 2009)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ispconfig 3 cant receive emails lishaw1968 Installation/Configuration 25 19th August 2013 10:37
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 16:59
Postfix can't received email from exterior astra2000 Server Operation 5 17th October 2009 23:26
Centos 5.2 + ISPConfig 3 tutorial - Problem with email tanakskool Server Operation 1 3rd June 2009 16:22
Unable to authenticate to SMTP server ashkev Installation/Configuration 15 6th February 2007 17:46


All times are GMT +2. The time now is 05:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.