move code up one directory
[atutor.git] / themes / mobile / login.tmpl.php
1 <?php require(AT_INCLUDE_PATH.'header.inc.php'); ?>
2 <?php if ($this->mobile_device_type != IPAD_DEVICE): ?>
3 <script language="JavaScript" src="sha-1factory.js" type="text/javascript"></script>
4
5 <script type="text/javascript">
6 /* 
7  * Encrypt login password with sha1
8  */
9 function encrypt_password() {
10         document.form.form_password_hidden.value = hex_sha1(hex_sha1(document.form.form_password.value) + "<?php echo $_SESSION['token']; ?>");
11         document.form.form_password.value = "";
12         return true;
13 }
14
15 </script>
16 <div class="container">
17         <div class="column-login">
18                 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
19                 <input type="hidden" name="form_login_action" value="true" />
20                 <input type="hidden" name="form_course_id" value="<?php echo $this->course_id; ?>" />
21                 <input type="hidden" name="form_password_hidden" value="" />
22                 <div class="input-form">
23                         <fieldset class="group_form"><legend class="group_form"><?php echo _AT('login') ;?></legend>
24                         
25                                 <?php if ($_GET['course']): ?>
26                                         <div class="row">
27                                                 <h3><?php echo _AT('login'). ' ' . $this->title; ?></h3>
28                                         </div>
29                                 <?php endif;?>
30
31                                 <label for="login"><?php echo _AT('login_name_or_email'); ?></label><br />
32                                 <input type="text" name="form_login" size="50" style="max-width: 80%; width: 80%;" id="login" /><br />
33
34                                 <label for="pass"><?php echo _AT('password'); ?></label><br />
35                                 <input type="password" class="formfield" name="form_password" style="max-width: 80%; width: 80%;" id="pass" />
36                                 <br /><br />
37                                 <input type="submit" name="submit" value="<?php echo _AT('login'); ?>" class="button" onclick="return encrypt_password();" /> 
38                                 <br /><br />
39                         </form>
40                         <?php
41                         if($_config['allow_registration'] ==1){
42                         ?>
43                         Don't have an account? 
44                         <form action="registration.php" method="get">
45                         <?php if (defined('AT_EMAIL_CONFIRMATION') && AT_EMAIL_CONFIRMATION): ?>
46                                 <p><?php echo _AT('confirm_account_text'); ?></p>
47                         <?php endif; ?>
48                         <input type="submit" name="register" value="<?php echo _AT('register'); ?>" class="button" />
49                         <br /><br />
50                         </form>
51                         <?php } ?>
52                         
53                         </fieldset>                     
54                 </div>
55                 
56         </div>
57 </div>
58 <?php endif; ?>
59 <?php if ($this->mobile_device_type == IPAD_DEVICE): ?>
60 <script language="JavaScript" src="sha-1factory.js" type="text/javascript"></script>
61
62 <script type="text/javascript">
63 /* 
64  * Encrypt login password with sha1
65  */
66 function encrypt_password() {
67         document.form.form_password_hidden.value = hex_sha1(hex_sha1(document.form.form_password.value) + "<?php echo $_SESSION['token']; ?>");
68         document.form.form_password.value = "";
69         return true;
70 }
71
72 </script>
73 <div class="container">
74         <div class="column-login">
75                 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
76                 <input type="hidden" name="form_login_action" value="true" />
77                 <input type="hidden" name="form_course_id" value="<?php echo $this->course_id; ?>" />
78                 <input type="hidden" name="form_password_hidden" value="" />
79                 <div class="input-form">
80                         <fieldset class="group_form"><legend class="group_form"><?php echo _AT('login') ;?></legend>
81                         
82                                 <?php if ($_GET['course']): ?>
83                                         <div class="row">
84                                                 <h3><?php echo _AT('login'). ' ' . $this->title; ?></h3>
85                                         </div>
86                                 <?php endif;?>
87
88                                 <label for="login"><?php echo _AT('login_name_or_email'); ?></label><br />
89                                 <input type="text" name="form_login" size="50" style="max-width: 80%; width: 80%;" id="login" /><br />
90
91                                 <label for="pass"><?php echo _AT('password'); ?></label><br />
92                                 <input type="password" class="formfield" name="form_password" style="max-width: 80%; width: 80%;" id="pass" />
93                                 <br /><br />
94                                 <input type="submit" name="submit" value="<?php echo _AT('login'); ?>" class="button" onclick="return encrypt_password();" /> 
95                                 <br /><br />
96                         </fieldset>     
97                         </div>
98                         </form>
99                         <?php
100                         if($_config['allow_registration'] ==1){
101                         ?>
102                         Don't have an account? 
103                         <form action="registration.php" method="get">
104                         <?php if (defined('AT_EMAIL_CONFIRMATION') && AT_EMAIL_CONFIRMATION): ?>
105                                 <p><?php echo _AT('confirm_account_text'); ?></p>
106                         <?php endif; ?>
107                         <input type="submit" name="register" value="<?php echo _AT('register'); ?>" class="button" />
108                         <br /><br />
109                         </form>
110                         
111                         <?php } ?>
112                         
113                         
114                 </div>
115                 
116         </div>
117 </div>
118 <?php endif; ?>
119 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>