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 [php]<?php echo $_SESSION['token'] ?>[/php] is not giving me a string. I mean, I'm getting:
[quote]
<script type="text/javascript">
/*
* Encrypt login password with sha1
*/
function encrypt_password() {
document.form1.form_password_hidden.value = hex_sha1(hex_sha1(document.form1.form_password.value) + "");
document.form1.form_password.value = "";
return true;
}
[/quote]
I have this code on my php:
[php]
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<script type="text/javascript">
/*
* Encrypt login password with sha1
*/
function encrypt_password() {
document.form1.form_password_hidden.value = hex_sha1(hex_sha1(document.form1.form_password.value) + "<?php echo modLoginNeoHelper::getSes(); ?>");
document.form1.form_password.value = "";
return true;
}
function encrypt_password2() {
document.form2.form_password_hidden.value = hex_sha1(hex_sha1(document.form2.form_password.value) + "<?php echo modLoginNeoHelper::getSes(); ?>");
document.form2.form_password.value = "";
return true;
}
</script>
<form action="/edu/login.php" method="post" name="form1">
<input type="hidden" name="form_login_action" value="true" />
<input type="hidden" name="form_course_id" value="0" />
<input type="hidden" name="form_password_hidden" value="" />
<label for="login">Usuario:</label><br />
<input type="text" name="form_login" size="50" style="max-width: 80%; width: 80%;" id="login" /><br />
<label for="pass">Contraseña:</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="Ingresar" class="button" onclick="return encrypt_password();" />
</form>
[/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