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
  #21  
Old 4th November 2014, 00:07
LKTechnik LKTechnik is offline
Junior Member
 
Join Date: Oct 2014
Posts: 6
Thanks: 0
Thanked 2 Times in 1 Post
 
Default

OK... to many pn's an support request

For place an login form on your Page you must use this code:

HTML 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>
Replace https://isp.tld:8080 with your ISPConfig URL (2 times)

For an Auto Login and redirect your user to the ISPConfig Page use this snipped

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

function weiterleitung() { 
    $.ajax({ 
    type: "post", 
    url: "https://isp.tld:8080/content.php", 
    data: "s_mod=login&s_pg=index&username=USERNAME&passwort=PASSWORD", 
    xhrFields: {withCredentials: true} 
    }).done(function(){location.href='https://isp.tld:8080/index.php'}); 

} 
window.setTimeout("weiterleitung()", 100); 


</script>
Replace https://isp.tld:8080 with your ISPConfig URL (2 times)
Replace USERNAME and PASSWORD with the Users data


for both snippes you must change the /usr/local/ispconfig/interface/lib/config.inc.local.php
and Add the folowing lines
HTML Code:
    header('Access-Control-Allow-Origin: http://www.yoururl.tld'); 
    header('Access-Control-Allow-Methods: POST'); 
    header('Access-Control-Allow-Credentials: true');
replace http://www.yoururl.tld with the url with the orgin of your request


and it sucks i dont can change my posts
Reply With Quote
Sponsored Links
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 11:37
Webmail problems with only one domain? compner Installation/Configuration 14 16th February 2010 17:59
Postfix can't received email from exterior astra2000 Server Operation 5 18th October 2009 00:26
Centos 5.2 + ISPConfig 3 tutorial - Problem with email tanakskool Server Operation 1 3rd June 2009 17:22
Unable to authenticate to SMTP server ashkev Installation/Configuration 15 6th February 2007 18:46


All times are GMT +2. The time now is 09:37.


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