Support Forums
ATutor Support
Login from External Page
You must be signed-in to post.
| Author | Subject | |
|---|---|---|
| Page: 1 | 2 | ||
| adzzz | Subject: Login from External Page | |
| Hello, I am looking to add a login script from a page outside of atutor. So basically I have created the input fields to match what atutors input fields are and im POSTING it to the login php file. All it does though is takes me back to the login page after submitting the data. Am I missing something? Posted: 2009-07-15 16:18:59 | ||
greg![]() | Subject: Re: Login from External Page | |
| Have a look at the comments near the top of the login.php file atutorsvn.atrc.utoronto.ca/repos/atutor/trunk/docs/login.php and view the html source from the demo login page of atutor.ca and copy the HTML of the login form into your page. ...and edit as needed. www.atutor.ca/atutor/demo.php Posted: 2009-07-15 16:56:04 | ||
| adzzz | Subject: Re: Login from External Page | |
| Thank you for getting back so quickly. So I'm a little further along now, the actual values are being passed through. However, the login is being refused (but works when i enter it directly of course). I've added the onclick="return encrypt_password();" and added the javascript before the form as in the login screen, but still no joy. Posted: 2009-07-17 12:01:14 | ||
greg![]() | Subject: Re: Login from External Page | |
This is the part of the login.php file you need to change. Uncomment the first part, as it suggests, then comment out the second part. Posted: 2009-07-17 17:14:03 | ||
greg![]() | Subject: Re: Login from External Page | |
... and these scripts need to be included before the login form. There is a copy of sha-1factory.js with ATutor>.You can either copy it from there, or link to it. Posted: 2009-07-17 17:23:55 | ||
| rajatgoel | Subject: Re: Login from External Page | |
| i have created a separate php file test.php and inserted the code as suggested by greg, i also made necessary changes in login.php but login is not possible plz guys explain it step wise what to do, this will be a very big help to me thank you Posted: 2009-08-05 12:41:24 | ||
greg![]() | Subject: Re: Login from External Page | |
| Well... you can hire us to build it for you, or continue experimenting with the info already provided above. Everything you need is already described. We don't really have to time create a step by step for you. This type of activity is more for someone with Web development experience, and should be easily adapted from the info above. We don't have the resources to teach basic Web programming here. One last tip, make sure you have the sha-1factory.js script saved locally. Posted: 2009-08-05 13:04:28 | ||
| rajatgoel | Subject: Re: Login from External Page | |
| yeah i understand, i will post step by step procedure when i am done. Posted: 2009-08-05 13:18:13 | ||
| adzzz | Subject: Re: Login from External Page | |
| Hello, I am still having issues... My login.php is as follows: I have also created a simple external html page. What happens (depending on browser) is it either rejects the login, or doesn't attempt the login and goes straight to the login page. Here is the test page: <?php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Access Safety : Login</title> </head> <body onload="document.form.form_login.focus();"> <script language="JavaScript" src="pathto/overlib.js" type="text/javascript"></script> <script language="JavaScript" src="pathto/sha-1factory.js" type="text/javascript"></script> <script type="text/javascript"> /* * Encrypt login password with sha1 */ function encrypt_password() { document.form.form_password_hidden.value = hex_sha1(hex_sha1(document.form.form_password.value) + "8144688fcb53a53885d05872be936cc6830f3b27"); document.form.form_password.value = ""; return true; } </script> <div class="container"> <div class="column"> <form action="pathto/login.php" method="post" name="form"> <input type="hidden" name="form_login_action" value="true" /> <input type="hidden" name="form_course_id" value="" /> <input type="hidden" name="form_password_hidden" value="" /> <div class="input-form" style="background-color:white;"> <fieldset class="group_form"><legend class="group_form">Login</legend> <p>Enter the Login Name and Password you chose when you first registered with the system.</p> <label for="login">Login Name or Email</label><br /> <input type="text" name="form_login" size="50" style="max-width: 80%; width: 80%;" id="login" /><br /> <label for="pass">Password</label><br /> <input type="password" class="formfield" name="form_password" style="max-width: 80%; width: 80%;" id="pass" /> <br /><br /> <input type="submit" name="submit" value="Login" class="button" onclick="return encrypt_password();" /> </fieldset> </div> </form> </body> </html> ?> Posted: 2009-08-24 12:56:29 | ||
| adzzz | Subject: Re: Login from External Page | |
| This is a friendly bump. Any Thoughts / Suggestions? Posted: 2009-09-02 12:37:46 | ||
greg![]() | Subject: Re: Login from External Page | |
| You're missing the function: encrypt_password2() Ensure the paths to the sha-1factory.js are correct. Read the whole thread again. Posted: 2009-09-02 14:35:02 | ||
| Yaazkal | Subject: Re: Login from External Page | |
| Hi, I'm trying to make a Joomla module with a login form for ATutor. I guess that everything is ok except that the command is not giving me a string. I mean, I'm getting:
I have this code on my php: I'm gessing that I need to include maybe vitals.inc.php or some file in the /include directory of my ATutor, but when I made that I'm just getting a blank page in my Joomla (maybe Joomla has some variables with the same name and some error is trigged). So, do I have to include some php file? what can I do to get the $_SESSION['token'] generated ? I tried with copy/paste some code, but it works just for me in one browser (I know that the token is generated randomly). I will apreciate your support. PS: I've checked the login.php and it is modified as the documentation saids. Thanks !! My system: Operating system ATutor is installed on - Linux 2.6.18-028stab064.7-PAE ATutor version - 1.6.3 Patch #s applied - 1 and 2 PHP version - 5.2.11 MySQL version - 5.0.89-community Webserver & version - Apache 2 Posted: 2010-02-18 09:11:33 | ||
| cindy | Subject: Re: Login from External Page | |
| The token used in login.php must be the same as the one you use to encrypt password. So, send the token generated in your php to login.php as a post value. Try the code below. I modified a bit from your script. 2 places are added: 1. generate token at the beginning, use it in encrypt_password() 2. embed the token in "form1" as a hidden value. Posted: 2010-02-18 09:55:29 | ||
| Yaazkal | Subject: Re: Login from External Page | |
| Hi Cindy !! Thanks for your message. It is still not working. The $token is just empty as before. This is the code: If I uncomment the include line, I just get a blank page on my Joomla site. The Joomla site is on the /public_html and the ATutor is on /public_html/edu/ What can I do ? Posted: 2010-02-18 10:34:52 | ||
| cindy | Subject: Re: Login from External Page | |
Hi, you need to generate the token by yourself. I was assuming modLoginNeoHelper::getSes() returns a random token. If not, change the line: to Posted: 2010-02-18 11:20:25 | ||
| Page: 1 | 2 | ||
You must be signed-in to post.


