made a copy
[atutor.git] / themes / default / registration.tmpl.php
1 <?php 
2 require(AT_INCLUDE_PATH.'header.inc.php'); 
3 ?>
4
5 <script language="JavaScript" src="sha-1factory.js" type="text/javascript"></script>
6
7 <script type="text/javascript">
8 function encrypt_password()
9 {
10         document.form.password_error.value = "";
11
12         err = verify_password(document.form.form_password1.value, document.form.form_password2.value);
13         
14         if (err.length > 0)
15         {
16                 document.form.password_error.value = err;
17         }
18         else
19         {
20                 document.form.form_password_hidden.value = hex_sha1(document.form.form_password1.value);
21                 document.form.form_password1.value = "";
22                 document.form.form_password2.value = "";
23         }
24 }
25 </script>
26
27 <form method="post" action="<?php if (isset($_REQUEST["en_id"]) && $_REQUEST["en_id"] <> "") $getvars = '?en_id='. $_REQUEST["en_id"]; echo $_SERVER['PHP_SELF'] . $getvars; ?>" name="form">
28 <?php global $languageManager, $_config, $moduleFactory; ?>
29 <input name="ml" type="hidden" value="<?php echo $this->ml; ?>" />
30 <input name="password_error" type="hidden" />
31 <input type="hidden" name="form_password_hidden" value="" />
32 <input type="hidden" name="registration_token" value="<?php echo sha1($_SESSION['token']); ?>" />
33
34 <div class="input-form">
35 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('required_information'); ?></legend>
36         <?php if (!$_POST['member_id'] && defined('AT_MASTER_LIST') && AT_MASTER_LIST && !admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE)): ?>
37                 <div class="row">
38                         <h3><?php echo _AT('account_authorization'); ?></h3>
39                 </div>
40
41                 <div class="row">
42                         <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="student_id"><?php echo _AT('student_id'); ?></label><br />
43                         <input id="student_id" name="student_id" type="text" size="15" maxlength="15" value="<?php echo stripslashes(htmlspecialchars($_POST['student_id'])); ?>" /><br />
44                 </div>
45
46                 <div class="row">
47                         <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="student_pin"><?php echo _AT('student_pin'); ?></label><br />
48                         <input id="student_pin" name="student_pin" type="password" size="15" maxlength="15" value="<?php echo stripslashes(htmlspecialchars($_POST['student_pin'])); ?>" /><br />
49                 </div>
50         <?php endif; ?>
51
52         <?php 
53                 $table_title="
54                 <div class=\"row\">
55                         <h3>" . _AT('course_to_auto_enroll'). "</h3>
56                         <small>&middot; " ._AT('auto_enroll_msg')."</small>
57                 </div>";
58                 
59                 require(AT_INCLUDE_PATH.'html/auto_enroll_list_courses.inc.php'); 
60         ?>
61         
62
63         <div class="row">
64                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="login"><?php echo _AT('login_name'); ?></label><br />
65                 <?php if ($_POST['member_id']) : ?>
66                                 <span id="login"><?php echo stripslashes(htmlspecialchars($_POST['login'])); ?></span>
67                                 <input name="member_id" type="hidden" value="<?php echo intval($_POST['member_id']); ?>" />
68                                 <input name="login" type="hidden" value="<?php echo stripslashes(htmlspecialchars($_POST['login'])); ?>" />
69                 <?php else: ?>
70                         <input id="login" name="login" type="text" maxlength="20" size="30" value="<?php echo stripslashes(htmlspecialchars($_POST['login'])); ?>" /><br />
71                         <small>&middot; <?php echo _AT('contain_only'); ?><br />
72                                    &middot; <?php echo _AT('20_max_chars'); ?></small>
73                 <?php endif; ?>
74         </div>
75
76         <?php if (!admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) || !$_POST['member_id']): ?>
77                 <div class="row">
78                         <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="form_password1"><?php echo _AT('password'); ?></label><br />
79                         <input id="form_password1" name="form_password1" type="password" size="15" maxlength="15" /><br />
80                         <small>&middot; <?php echo _AT('combination'); ?><br />
81                                    &middot; <?php echo _AT('15_max_chars'); ?></small>
82                 </div>
83
84                 <div class="row">
85                         <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="form_password2"><?php echo _AT('password_again'); ?></label><br />
86                         <input id="form_password2" name="form_password2" type="password" size="15" maxlength="15" />
87                 </div>
88         <?php endif; ?>
89
90         <?php if (isset($_config['use_captcha']) && $_config['use_captcha']==1): ?>
91         <div class="row">
92                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div>
93                 <label for="secret"><img src="<?php echo AT_INCLUDE_PATH; ?>securimage/securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>" id="simage" align="left" /></label>
94                 <a href="<?php echo AT_INCLUDE_PATH; ?>securimage/securimage_play.php" title="<?php echo _AT('audible_captcha'); ?>"><img src="<?php echo AT_INCLUDE_PATH; ?>securimage/images/audio_icon.gif" alt="<?php echo _AT('audible_captcha'); ?>" onclick="this.blur()" align="top" border="0"></a><br>
95                 <a href="#" title="<?php echo _AT('refresh_image'); ?>" onclick="document.getElementById('simage').src = '<?php echo AT_INCLUDE_PATH; ?>securimage/securimage_show.php?sid=' + Math.random(); return false"><img src="<?php echo AT_INCLUDE_PATH; ?>securimage/images/refresh.gif" alt="<?php echo _AT('refresh_image'); ?>" onclick="this.blur()" align="bottom" border="0"></a>
96
97                 <br />
98                 <p><?php echo _AT('image_validation_text'); ?><br />
99                 <input id="secret" name="secret" type="text" size="6" maxlength="6" value="" />
100                 <br />
101                 <small><?php echo _AT('image_validation_text2'); ?><br /></small>
102         </div>
103         <?php endif; ?>
104
105         <div class="row">
106                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="email"><?php echo _AT('email_address'); ?></label><br />
107                 <input id="email" name="email" type="text" size="50" maxlength="50" value="<?php echo stripslashes(htmlspecialchars($_POST['email'])); ?>" />
108                 <input type="checkbox" id="priv" name="private_email" value="1" <?php if ($_POST['private_email'] || !isset($_POST['submit'])) { echo 'checked="checked"'; } ?> /><label for="priv"><?php echo _AT('keep_email_private');?></label>
109         </div>
110
111         <div class="row">
112                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="email2"><?php echo _AT('email_again'); ?></label><br />
113                 <input id="email2" name="email2" type="text" size="50" maxlength="60" value="<?php echo stripslashes(htmlspecialchars($_POST['email2'])); ?>" />
114         </div>
115
116         <div class="row">
117                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="first_name"><?php echo _AT('first_name'); ?></label><br />
118                 <input id="first_name" name="first_name" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['first_name'])); ?>" />
119         </div>
120
121         <div class="row">
122                 <label for="second_name"><?php echo _AT('second_name'); ?></label><br />
123                 <input id="second_name" name="second_name" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['second_name'])); ?>" />
124         </div>
125
126         <div class="row">
127                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="last_name"><?php echo _AT('last_name'); ?></label><br />
128                 <input id="last_name" name="last_name" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['last_name'])); ?>" />
129         </div>
130         
131         <?php if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE)): 
132                         if ($_POST['status'] == AT_STATUS_INSTRUCTOR) {
133                                 $inst = ' checked="checked"';
134                         } else if ($_POST['status'] == AT_STATUS_STUDENT) {
135                                 $stud = ' checked="checked"';
136                         }  else if ($_POST['status'] == AT_STATUS_DISABLED) {
137                                 $disa = ' checked="checked"';
138                         } else {
139                                 $uncon = ' checked="checked"';
140                         }?>
141                         <input type="hidden" name="id" value="<?php echo $_POST['member_id']; ?>" >
142                         <div class="row">
143                                 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><?php echo _AT('account_status'); ?><br />
144
145                                 <input type="radio" name="status" value="0" id="disa" <?php echo $disa; ?> /><label for="disa"><?php echo _AT('disabled'); ?></label>
146                                 <?php if (defined('AT_EMAIL_CONFIRMATION') && AT_EMAIL_CONFIRMATION): ?>
147                                         <input type="radio" name="status" value="1" id="uncon" <?php echo $uncon; ?> /><label for="uncon"><?php echo _AT('unconfirmed'); ?></label>
148                                 <?php endif; ?>
149
150                                 <input type="radio" name="status" value="2" id="stud" <?php echo $stud; ?> /><label for="stud"><?php echo _AT('student'); ?></label>
151
152                                 <input type="radio" name="status" value="3" id="inst" <?php echo $inst; ?> /><label for="inst"><?php echo _AT('instructor'); ?></label>
153
154                                 <input type="hidden" name="old_status" value="<?php echo $_POST['old_status']; ?>" />
155                         </div>
156         <?php endif; ?>
157 </fieldset>
158 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('personal_information').' ('._AT('optional').')'; ?></legend>
159         <?php 
160         $mod = $moduleFactory->getModule('_standard/profile_pictures');
161         if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) && $_POST['member_id'] && $mod->isEnabled() === TRUE): ?>
162                 <div class="row">
163                         <?php echo _AT('picture'); ?><br/>
164                         <?php if (profile_image_exists($_POST['member_id'])): ?>
165                                 <a href="get_profile_img.php?id=<?php echo $_POST['member_id'].SEP.'size=o'; ?>"><?php print_profile_img($_POST['member_id']); ?></a>
166                                 <input type="checkbox" name="profile_pic_delete" value="1" id="profile_pic_delete" /><label for="profile_pic_delete"><?php echo _AT('delete'); ?></label>
167                         <?php else: ?>
168                                 <?php echo _AT('none'); ?> <a href="admin/profile_picture.php?member_id=<?php echo $_POST['member_id']; ?>"><?php echo _AT('add'); ?></a>
169                         <?php endif; ?>
170                 </div>
171         <?php endif; ?>
172
173         <?php if (admin_authenticate(AT_ADMIN_PRIV_USERS, TRUE) && defined('AT_MASTER_LIST') && AT_MASTER_LIST): ?>
174                 <input type="hidden" name="old_student_id" value="<?php echo $_POST['old_student_id']; ?>" />
175                 <div class="row">
176                         <label for="student_id"><?php echo _AT('student_id'); ?></label><br />
177                                 <input type="text" name="student_id" value="<?php echo $_POST['student_id']; ?>" size="20" /><br />
178                 </div>
179                 <div class="row">
180                         <input type="checkbox" id="overwrite" name="overwrite" value="1" <?php if ($_POST['overwrite']) { echo 'checked="checked"'; } ?> /><label for="overwrite"><?php echo _AT('overwrite_master');?></label>
181                 </div>
182
183         <?php endif; ?>
184
185         <div class="row">
186                 <?php echo _AT('date_of_birth'); ?><br />
187                 <label for="year"><?php echo _AT('year'); ?>: </label><input id="year" class="formfield" name="year" type="text" size="4" maxlength="4" value="<?php echo $_POST['year']; ?>" />  <label for="month"><?php echo _AT('month'); ?>: </label><input id="month" class="formfield" name="month" type="text" size="2" maxlength="2" value="<?php echo $_POST['month']; ?>" /> <label for="day"><?php echo _AT('day'); ?>: </label><input id="day" class="formfield" name="day" type="text" size="2" maxlength="2" value="<?php echo $_POST['day']; ?>" />
188         </div>
189
190         <div class="row">
191                 <?php echo _AT('gender'); ?><br />
192                 <input type="radio" name="gender" id="m" value="m" <?php if ($_POST['gender'] == 'm') { echo 'checked="checked"'; } ?> /><label for="m"><?php echo _AT('male'); ?></label> <input type="radio" value="f" name="gender" id="f" <?php if ($_POST['gender'] == 'f') { echo 'checked="checked"'; } ?> /><label for="f"><?php echo _AT('female'); ?></label>  <input type="radio" value="n" name="gender" id="ns" <?php if (($_POST['gender'] == 'n') || ($_POST['gender'] == '')) { echo 'checked="checked"'; } ?> /><label for="ns"><?php echo _AT('not_specified'); ?></label>
193         </div>
194
195         <div class="row">
196                 <label for="address"><?php echo _AT('street_address'); ?></label><br />
197                 <input id="address" name="address" size="40" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['address'])); ?>" />
198         </div>
199
200         <div class="row">
201                 <label for="postal"><?php echo _AT('postal_code'); ?></label><br />
202                 <input id="postal" name="postal" size="7" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['postal'])); ?>" />
203         </div>
204
205         <div class="row">
206                 <label for="city"><?php echo _AT('city'); ?></label><br />
207                 <input id="city" name="city" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['city'])); ?>" />
208         </div>
209
210         <div class="row">
211                 <label for="province"><?php echo _AT('province'); ?></label><br />
212                 <input id="province" name="province" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['province'])); ?>" />
213         </div>
214
215         <div class="row">
216                 <label for="country"><?php echo _AT('country'); ?></label><br />
217                 <input id="country" name="country" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['country'])); ?>" />
218         </div>
219
220         <div class="row">
221                 <label for="phone"><?php echo _AT('phone'); ?></label><br />
222                 <input size="11" name="phone" type="text" value="<?php echo stripslashes(htmlspecialchars($_POST['phone'])); ?>" id="phone" />
223         </div>
224
225         <div class="row">
226                 <label for="website"><?php echo _AT('web_site'); ?></label><br />
227                 <input id="website" name="website" size="40" type="text" value="<?php if ($_POST['website'] == '') { echo 'http://'; } else { echo stripslashes(htmlspecialchars($_POST['website'])); } ?>" />
228         </div>
229 </fieldset>
230         <div class="row buttons">
231                 <input type="submit" name="submit" value=" <?php echo _AT('save'); ?> " accesskey="s" onClick="encrypt_password()" class="button"/>
232                 <input type="submit" name="cancel" value=" <?php echo _AT('cancel'); ?> "  class="button" />
233         </div>
234 </div>
235 </form>
236
237 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>