+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, Sherston - Crystal ICT (autologin) in Coding and Web Development; This is an AutoIT script for anyone who wants to automate their login to the Sherston ICT website content. Code: ...
  1. #1
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118

    Post Sherston - Crystal ICT (autologin)

    This is an AutoIT script for anyone who wants to automate their login to the Sherston ICT website content.

    Code:
    #include 
    
    $sURL = "http://www.sherston.com/Login/Default.aspx?RedirectPath=/Default.aspx"
    $sUserName = "USERNAME"
    $sPassword = "PASSWORD"
    $sForm = "aspnetForm"
    $sUserfield = 'ctl00$PageContent$Login1$txtUsername'
    $sPassfield = 'ctl00$PageContent$Login1$txtPassword'
    
    $oTimeout = 5000
    
    _IELoadWaitTimeout($oTimeOut)
    _IEErrorHandlerRegister()
    $oIE = _IECreate($sURL)
    _IELoadWait($oIE)
    
    $oForm = _IEFormGetObjByName($oIE, $sForm)
    $oUserName = _IEFormElementGetObjByName($oForm, $sUserfield)
    $oPassword = _IEFormElementGetObjByName($oForm, $sPassfield)
    _IEFormElementSetValue($oUserName, $sUserName)
    _IEFormElementSetValue($oPassword, $sPassword)
    
    _IELinkClickByIndex($oForm, 5)
    
    _IELoadWait($oIE, $oTimeout, $oTimeout)
    _IENavigate($oIE, "http://www.sherston.com/crystal/default.aspx")
    _IELoadWait($oIE, $oTimeout, $oTimeout)
    _IELinkClickByText($oIE, "Launch")

    Their website code is quite frankly showing every example of what NOT to do with HTML and code with truly awful accessibility fubars but at time of writing this code will write and I'll update as/when I notice any changes that require it.


    To use this simply edit the username/password variables to suit your school and then upload the resultant executable to a shared space on your server.. Create a shortcut to that and deploy to your users and it'll handle the login fine... (It even works if you are logged in already).

    Adjust the timeout to get it to wait longer or run quicker according to your system.

    Hope it helps...

  2. 3 Thanks to contink:

    conehead (11th May 2008), eean (11th May 2008), leco (12th May 2008)

  3. #2
    conehead's Avatar
    Join Date
    Jan 2008
    Posts
    189
    Thank Post
    30
    Thanked 13 Times in 10 Posts
    Rep Power
    16
    I'm sure this will come in handy now I have a school that have just bought in to this.

  4. #3
    eean's Avatar
    Join Date
    May 2006
    Location
    Kuala Lumpur
    Posts
    559
    Thank Post
    65
    Thanked 52 Times in 37 Posts
    Rep Power
    29
    Cool. We don't use it but I'm thinking the same concept might work with Living Library. Why they can't just let you specify the password in the URL I don't know!

  5. #4
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    How embarrassing... I'd totally forgotten I'd even written that...

    Let me know if anything changes won't you

  6. #5

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Quote Originally Posted by eean View Post
    Cool. We don't use it but I'm thinking the same concept might work with Living Library. Why they can't just let you specify the password in the URL I don't know!
    Because that would be even more insecure than doing a POST over HTTP (which to be fair, is pretty bad anyway).

SHARE:
+ Post New Thread

Similar Threads

  1. Sherston - Mission Control v2 locking up
    By contink in forum Educational Software
    Replies: 2
    Last Post: 28th January 2008, 03:58 PM
  2. Sherston Software
    By button_ripple in forum Educational Software
    Replies: 5
    Last Post: 6th December 2007, 05:09 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •