My autologin script stopped working after upgrading to 3.2

Discussion in 'ISPConfig 3 Priority Support' started by webguyz, Sep 5, 2021.

  1. webguyz

    webguyz Active Member HowtoForge Supporter

    Had a script that was working before to auto login a user and pw from a GET statement. But now does not work. Think its the this line

    src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js">
    Any thoughts on what changed? All I see is the text at the top of the screen "Connecting to Control panel"

    Code:
    <?php
    
    if($_GET['u']!=''){
    $username = $_GET['u'];
    $password = $_GET{'p'};
    }
    
    ?>
    
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
    <div class="borderbox" style="text-align:center;"><br />Connecting to Control Panel...<br />9/5/2021 11:04:26 AM<br />
    <br /><br />
    </div>
    
    
    <script type="text/javascript">
    
    function weiterleitung() {
        $.ajax({
        type: "post",
        url: "https://dotcp.xxxxxxxxx.com:8080/login/index.php",
        data: "s_mod=login&s_pg=index&username=<?php echo $username; ?>&password=<?php echo $password; ?>",
        xhrFields: {withCredentials: true}
        }).done(function(){location.href="https://dotcp.xxxxxxxxx.com:8080/index.php"});
    
    }
    window.setTimeout("weiterleitung()", 1);
    
    
    </script> 
     
    ahrasis likes this.
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    @Croydon do you know what has changed here?

    We have done a lot since 3.2 and above, we surely changed some things regarding the storage of passwords and probably the login script as well, but not sure why it would break this.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Might be that not we changed something but the browser vendors changed something. If it's related to ISPConfig changes, then my best guess on fixing this would be to edit the ispconfig vhost file and temporarily disable ass security headers that get set and restart the web server.
     
  4. webguyz

    webguyz Active Member HowtoForge Supporter

    [​IMG]
    I pulled this code from cwispy in his WHMCS integration code. Will download his latest and see if anything has changed. Its been a long time since I updated that code.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to update the jquery URL
    //ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js
    to use the latest jquery version.
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Ispconfig already ships with jQuery, doesn't it? Not the latest version, but if it sufficient for what you're doing, just load the local one.
     
    Th0m, ahrasis and webguyz like this.
  7. webguyz

    webguyz Active Member HowtoForge Supporter

    ahrasis likes this.

Share This Page