Embedd login form into website

Discussion in 'ISPConfig 3 Priority Support' started by tr909192, Aug 17, 2018.

  1. tr909192

    tr909192 Member HowtoForge Supporter

    Dear,

    we have managed, for years, to login into ispconfig from an external form, something like this:

    <code>
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js"></script>

    <form name="ajaxform" id="ajaxform" method="POST" >
    <input type="hidden" name="s_mod" value="login">
    <input type="hidden" name="s_pg" value="index">
    <input name="username" id="username" value="" size="30" maxlength="255" type="text">
    <input name="passwort" id="passwort" value="" size="30" maxlength="255" type="password">
    <button type="submit" class="button" value="" ><span>Anmelden</span></button>
    </form>

    <script type="text/javascript">
    //callback handler for form submit
    $("#ajaxform").submit(function()
    {
    var postData = $(this).serializeArray();
    $.ajax({
    url : 'https://isp.tld:8080/content.php',
    type: "POST",
    data : postData,
    xhrFields: {withCredentials: true},
    success:function(){
    window.location.replace("https://isp.tld:8080/index.php");
    }
    });
    return false;
    });
    </script>
    </code>

    Always worked great, but now are some days (or weeks maybe) that for a reason that we can't understand when we try
    to access to our ispconfig control panel, from the external form we receive a 500 internal server error.

    Something is changed on ispconfig login control, that block this kind of stuff?

    ty
     
  2. tr909192

    tr909192 Member HowtoForge Supporter

    Sorry, already solved. Please don't consider this thread.
     
  3. tr909192

    tr909192 Member HowtoForge Supporter

    I realized that if for some reason someone arrives here and needs this solution, he would have no answer. So, even if already present in the form, below the necessary variation to make it go:

    url become -> "https://isp.tld:8080/login/index.php"
    password now is -> "password=PASSWORD"
     
    till likes this.

Share This Page