Sign in to follow this  
Followers 0
russell

script login to forums

6 posts in this topic

#1 ·  Posted (edited)

im trying to find a way to put in my script to log onto my forums board and verify permission before executing the rest of the script. I can have it check for something on the page if that easier but how do i have it do that? All i find in help is about local databases and making tables. Nothing seems to lead me to knowledge of how to do the task i seek

Edited by russell

muppet hands are so soft :)

Share this post


Link to post
Share on other sites



I can have it check for something on the page if that easier but how do i have it do that?

Perhaps you should look at the _IE* functions in the help file if you are looking for a particular web page element to be present.

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

mmm that wouldn't actually login it would just check a page


muppet hands are so soft :)

Share this post


Link to post
Share on other sites

This is not the Psychic Hotline.

You said:

I can have it check for something on the page if that easier but how do i have it do that?

The _IE* functions would do that step easily. If that's not what you are asking, explain yourself more carefully and post what you tried.

First step first: Do you already have a script that logs in? If not, what issue is stopping you from getting that step done?

Second step: What does "verify permission" after the logon mean? How do you want to do that, and what issue is stopping you there?

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Ultimantly I want to use my forums board to verifiy that a user can use the program i have already made and how many instances they can run. I want to use the forums board becuase it can set premissions and hopefully return vaules to the program as the user changes groups. I guess im kind of lost as to the step to take. I have a php page that i pieced together that will log into the forums no mater where the script is deployed from

[code
]<form id="login" method="post" action="http://mywebsite.com/forum/ucp.php?mode=login">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>

<div class="content">
<h2>Login</h2>

<fieldset class="fields1">

<dl>
<dt><label for="username">Username:</label></dt>
<dd><input type="text" class="inputbox autowidth" value="" size="25" id="username" name="username" tabindex="1"></dd>
</dl>
<dl>
<dt><label for="password">Password:</label></dt>
<dd><input type="password" class="inputbox autowidth" size="25" name="password" id="password" tabindex="2"></dd>
<dd><a href="http://mywebsite.com/forum/ucp.php?mode=sendpassword">I forgot my password</a></dd>
</dl>

<dl>
<dd><label for="autologin"><input type="checkbox" tabindex="4" id="autologin" name="autologin"> Log me on automatically each visit</label></dd>
<dd><label for="viewonline"><input type="checkbox" tabindex="5" id="viewonline" name="viewonline"> Hide my online status this session</label></dd>
</dl>


<dl>
<dt>&nbsp;</dt>
<dd><input type="hidden" value="3d7e69a79ea7f1223d78effd20c49c6a" name="sid">
<input type="hidden" value="http://mywebsite.com/forum/viewforum.php?f=4" name="redirect">
<input type="submit" class="button1" value="Login" tabindex="6" name="login"></dd>
</dl>
<input type="hidden" value="http://mywebsite.com/forum/ucp.php?mode=login" name="redirect">

</fieldset>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>



<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>

<div class="content">
<h3>Register</h3>
<p>In order to login you must be registered. Registering takes only a few moments but gives you increased capabilities. The board administrator may also grant additional permissions to registered users. Before you register please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.</p>
<p><strong><a href="http://mywebsite.com/forum/ucp.php?mode=terms">Terms of use</a> | <a href="http://mywebsite.com/forum/ucp.php?mode=privacy">Privacy policy</a></strong></p>
<hr class="dashed">
<p><a class="button2" href="http://mywebsite.com/forum/ucp.php?mode=register">Register</a></p>
</div>

<span class="corners-bottom"><span></span></span></div>
</div>


</form>

That will take the user to the download section and each selection is only viewable by group your in. I.E. users in group1 can only view Downloads Group1. I guess i am trying to find a way to have my program require the user to login "maybe with the script i made" and return the vaule of the group number to the script. Also if the user cant log in then the value would tell the script that users isnt allowed. Im totally lost as to how to have autoit log into the forums and retrieve this number without the user knowing. Second i need the script to stay logged in so i know they didn't just give a copy to a friend and there using the same account. I know it complex. That is kind of why im lost. I have the GUI done for the user and pass, it will exit if it doesnt get the programed value and originally i had it connect to an ftp server and verify a file size for authentication. That didn't seem too secure to me

Edited by russell

muppet hands are so soft :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

by verify i mean execute the rest of the program and not close.

This is what i had for the ftp verification

[code
]$Good = "968"
Global $configfile = FileOpen("test.ini", 0)


#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("User Verification", 251, 134, -1, -1)
GUISetIcon("C:\Icons\_win\pooh win\M III.ico", -1)
$user = GUICtrlCreateInput("", 120, 40, 121, 21)
$Password = GUICtrlCreateInput("", 120, 72, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("&OK", 86, 104, 75, 25, $BS_NOTIFY)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 104, 75, 25, $BS_NOTIFY)
$PassLabel = GUICtrlCreateLabel("Password", 24, 76, 74, 18, 0)
GUICtrlSetFont($PassLabel, 8, 800, 2, "Blade Runner Movie Font")
$Label1 = GUICtrlCreateLabel("Username", 24, 40, 73, 18)
GUICtrlSetFont($Label1, 8, 800, 2, "Blade Runner Movie Font")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Form2
Case $user
Case $ButtonOk
#include <FTPEx.au3>
$server = 'my.ftp.com'
$username = GUICtrlRead($user)
$pass = GUICtrlRead($Password)
$aFile = "bit.txt"
$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
$FileSize = _FTP_FileGetSize($Conn, $aFile)
;$FileSize = $FileSize / "1024.585698070375"
$Ftpc = _FTP_Close($Open)
Exitloop
Case $ButtonCancel
Exit

EndSwitch
WEnd


If $FileSize = $Good Then
Sleep (200)
Else
Exit
Endif
MsgBox (0, "TITLE", "i would run the rest of the script")

For some reason my code wrap isnt working so i pressed return after the "e" in code to space it out to make it easier to read

Edited by russell

muppet hands are so soft :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0