Current time: 05-22-2013, 05:44 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Externel Login Box
09-06-2011, 09:07 AM
Post: #1
Externel Login Box
I am trying to integrate tht with my main site and would be cool to have an external login box.
Some thing like:
Quote:<form method="post" id="loginbox" action="https://xxx.xx/client" >
<div>
<input type="hidden" name="token" value="hhdsfhdskjhfdskhfdsjfhskjhfdsksjd" />
<input type="text" name="username" onclick="this.value = '';" value="Email" id="username" class="textbar" />
<input type="password" name="password" onclick="this.value = '';" value="Password" id="pass" class="textbar" />
<input type="image" src="images/signin.png" id="signin" value="signin" />
</div>
</form>

Now the thing is missing is
Quote:<input type="hidden" name="token" value="hhdsfhdskjhfdskhfdsjfhskjhfdsksjd" />
Any idea?
Find all posts by this user
Quote this message in a reply
09-06-2011, 12:48 PM
Post: #2
RE: Externel Login Box
Have a look at the tht login box just make sure you post to the URL.

Jonny H - THT Main Developer & Founder
Find all posts by this user
Quote this message in a reply
09-08-2011, 01:04 PM
Post: #3
RE: Externel Login Box
was looking there and could not find anything. any hint?
Find all posts by this user
Quote this message in a reply
09-08-2011, 01:41 PM
Post: #4
RE: Externel Login Box
You can copy the html code and just post it to the THT installation. Google something.

Jonny H - THT Main Developer & Founder
Find all posts by this user
Quote this message in a reply
09-09-2011, 11:53 AM
Post: #5
RE: Externel Login Box
Actually i was trying to put the login box separately like on the main page of the site. Not inside tht. And i believe it requires some sort of token
Find all posts by this user
Quote this message in a reply
09-11-2011, 01:36 AM (This post was last modified: 09-13-2011 10:33 PM by Kevin.)
Post: #6
RE: Externel Login Box
(09-09-2011 11:53 AM)seriesn Wrote:  Actually i was trying to put the login box separately like on the main page of the site. Not inside tht. And i believe it requires some sort of token

If you get a CSRF error when you try to submit the form elsewhere, you'll need to include some PHP code from THT.

Something like this should do the trick:
PHP Code:
<?php
define
("THT"1);
function 
csrf_startup() {
    
$GLOBALS['csrf']['rewrite'] = $GLOBALS['csrf']['rewrite-js'] = false;
}
require_once(
"tht/includes/csrf-magic.php");
?>

In your form place a hidden input field with the following PHP/HTML:
PHP Code:
<input type="hidden" name="<?php echo $GLOBALS['csrf']['input-name'] ?>" value="<?php echo csrf_get_tokens() ?>"

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
09-11-2011, 09:22 PM
Post: #7
RE: Externel Login Box
(09-11-2011 01:36 AM)Kevin Wrote:  
(09-09-2011 11:53 AM)seriesn Wrote:  Actually i was trying to put the login box separately like on the main page of the site. Not inside tht. And i believe it requires some sort of token

If you get a CSRF error when you try to submit the form elsewhere, you'll need to include some PHP code from THT.

Something like this should do the trick:
PHP Code:
<?php
define
("THT"1);
function 
csrf_startup() {
    
$GLOBALS['csrf']['rewrite'] = $GLOBALS['csrf']['rewrite-js'] = false;
}
require_once(
"tht/includes/csrf-magic.php"); 

In your form place a hidden input field with the following PHP/HTML:
May i know in which file i need to edit? Sorry as i have not seen any integration for tht like this as of yet so it is kinda hard to understand.
Find all posts by this user
Quote this message in a reply
09-13-2011, 10:34 PM
Post: #8
RE: Externel Login Box
That PHP code should go at the top of any page that has the login form.

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
09-15-2011, 03:05 PM
Post: #9
RE: Externel Login Box
kool thanks man! Big Grin
Find all posts by this user
Quote this message in a reply
09-15-2011, 10:09 PM
Post: #10
RE: Externel Login Box
No problem

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)