AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / docs / themes / default / register.tmpl.php
1 <?php 
2 /************************************************************************/
3 /* AContent                                                             */
4 /************************************************************************/
5 /* Copyright (c) 2010                                                   */
6 /* Inclusive Design Institute                                           */
7 /*                                                                      */
8 /* This program is free software. You can redistribute it and/or        */
9 /* modify it under the terms of the GNU General Public License          */
10 /* as published by the Free Software Foundation.                        */
11 /************************************************************************/
12
13 /*
14  * Called by "register.php" and "user/user_create_edit.php
15  * 
16  * Accept parameters:
17  * 
18  * show_user_group: true/false. Indicates whether show section "User Group"
19  *                  Set to true when admin creates/edits user; set to false at new registration.
20  *                  The new user registered via registration form is automatically set into group "User" 
21  * show_password:  true/false. Indicates whether show section "Password" & "Password Again"
22  *                 Set to true when admin creates new user or new user registration; 
23  *                 Set to false when admin edits existing user.
24  * show_status: true/false. Indicates whether show section "status"
25  *              Set to true when admin creates/edits user; set to false at new registration.
26  * user_row: only need when edit existing user.
27  * all_user_groups: display selections in dropdown list box "User Group"
28  * title: page title
29  * submit_button_text: button text for submit button. "Register" at registration, "Save" at admin creating/editing user
30  */
31 $default_user_group_id = TR_USER_GROUP_USER;
32
33 // show or hide the author information based on the status of the checkbox "author content" 
34 global $onload;
35 $onload = "
36 document.form.login.focus(); 
37
38 if (jQuery('#is_author').attr('checked')) jQuery('#table_is_author').show(); 
39 else jQuery('#table_is_author').hide();
40 ";
41
42 require(TR_INCLUDE_PATH.'header.inc.php'); 
43 ?>
44
45 <script language="JavaScript" src="include/jscripts/sha-1factory.js" type="text/javascript"></script>
46
47 <script type="text/javascript">
48 function encrypt_password()
49 {
50         document.form.password_error.value = "";
51
52         err = verify_password(document.form.form_password1.value, document.form.form_password2.value);
53         
54         if (err.length > 0)
55         {
56                 document.form.password_error.value = err;
57         }
58         else
59         {
60                 document.form.form_password_hidden.value = hex_sha1(document.form.form_password1.value);
61                 document.form.form_password1.value = "";
62                 document.form.form_password2.value = "";
63         }
64 }
65 </script>
66
67 <form method="post" action="<?php $id_str = ''; if (isset($_GET['id'])) $id_str='?id='.$_GET['id']; echo $_SERVER['PHP_SELF'].$id_str; ?>" name="form">
68 <input name="password_error" type="hidden" />
69 <input type="hidden" name="form_password_hidden" value="" />
70
71 <div class="input-form">
72   <fieldset class="group_form"><legend class="group_form"><?php echo $this->title; ?></legend>
73     <div  style="width:75%; margin-left:auto; margin-right:auto;">
74     <p><?php echo _AT('required_field_text') ;?></p>
75           
76         <dl class="form_layout">
77           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="login"><?php echo _AT('login_name'); ?></label>:</dt>
78           <dd><input id="login" name="login" type="text" maxlength="20" size="30" value="<?php if (isset($_POST['login'])) echo stripslashes(htmlspecialchars($_POST['login'])); else echo stripslashes(htmlspecialchars($this->user_row['login'])); ?>" /></dd>
79                   <p><small>&middot; <?php echo _AT('contain_only'); ?><br />
80                   &middot; <?php echo _AT('20_max_chars'); ?></small></p>       
81
82 <?php if ($this->show_user_group) { ?>
83           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="user_group_id"><?php echo _AT('user_group'); ?>:</label>:</dt>
84           <dd><select name="user_group_id" id="user_group_id">
85                   <option value="-1">- <?php echo _AT('select'); ?> -</option>
86                   <?php foreach ($this->all_user_groups as $user_group) {?>
87                   <option value="<?php echo $user_group['user_group_id']; ?>" <?php if ((isset($_POST['user_group_id']) && $_POST['user_group_id']==$user_group['user_group_id']) || (!isset($_POST['user_group_id']) && !isset($this->user_row['user_group_id']) && $user_group['user_group_id'] == $default_user_group_id) || (!isset($_POST['user_group_id']) && isset($this->user_row['user_group_id']) && $this->user_row['user_group_id'] == $user_group['user_group_id'] )) echo 'selected="selected"'; ?>><?php echo $user_group['title']; ?></option>
88                   <?php } ?>
89           </select></dd><br />
90 <?php } ?>
91
92 <?php if ($this->show_password) { ?>
93           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="form_password1"><?php echo _AT('password'); ?></label>:</dt>
94           <dd><input id="form_password1" name="form_password1" type="password" size="15" maxlength="15" /></dd>
95           <p><small>&middot; <?php echo _AT('combination'); ?><br />
96           &middot; <?php echo _AT('15_max_chars'); ?></small></p>
97           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="form_password2"><?php echo _AT('password_again'); ?></label>:</dt>
98           <dd><input id="form_password2" name="form_password2" type="password" size="15" maxlength="15" /></dd>
99 <?php } ?>
100
101 <?php if ($this->use_captcha) { ?>
102
103           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="secret"><?php echo _AT('captcha'); ?></label></dt>
104           <dd><input id="secret" name="secret" type="text" size="6" maxlength="6" value="" /></dd>
105           <p><img src="<?php echo TR_INCLUDE_PATH; ?>securimage/securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>" id="simage" align="left" />
106               <a href="<?php echo TR_INCLUDE_PATH; ?>securimage/securimage_play.php" title="<?php echo _AT('audible_captcha'); ?>"><img src="<?php echo TR_INCLUDE_PATH; ?>securimage/images/audio_icon.gif" alt="<?php echo _AT('audible_captcha'); ?>" onclick="this.blur()" align="top" border="0"></a>
107               <a href="#" title="<?php echo _AT('refresh_image'); ?>" onclick="document.getElementById('simage').src = '<?php echo TR_INCLUDE_PATH; ?>securimage/securimage_show.php?sid=' + Math.random(); return false"><img src="<?php echo TR_INCLUDE_PATH; ?>securimage/images/refresh.gif" alt="<?php echo _AT('refresh_image'); ?>" onclick="this.blur()" align="bottom" border="0"></a></p>
108           <p><br /><small><?php echo _AT('image_validation_text'); ?> <?php echo _AT('image_validation_text2'); ?></small></p>
109
110 <?php } ?>
111
112           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="email"><?php echo _AT('email_address'); ?></label>:</dt>
113           <dd><input id="email" name="email" type="text" size="50" maxlength="50" value="<?php if (isset($_POST['email'])) echo stripslashes(htmlspecialchars($_POST['email'])); else echo stripslashes(htmlspecialchars($this->user_row['email'])); ?>" /></dt>
114           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="first_name"><?php echo _AT('first_name'); ?></label>:</dt>
115           <dd><input id="first_name" name="first_name" type="text" value="<?php if (isset($_POST['first_name'])) echo stripslashes(htmlspecialchars($_POST['first_name'])); else echo stripslashes(htmlspecialchars($this->user_row['first_name'])); ?>" /></dd>
116           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="last_name"><?php echo _AT('last_name'); ?></label>:</dt>
117           <dd><input id="last_name" name="last_name" type="text" value="<?php if (isset($_POST['last_name'])) echo stripslashes(htmlspecialchars($_POST['last_name'])); else echo stripslashes(htmlspecialchars($this->user_row['last_name'])); ?>" /></dt>
118
119
120
121 <?php if ($this->show_status) {?>
122           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><?php echo _AT('status'); ?>:</td>
123           <dd>
124                   <input type="radio" name="status" id="statusD" value="<?php echo TR_STATUS_DISABLED; ?>" <?php if ((isset($_POST['status']) && $_POST['status']==0) || (!isset($_POST['status']) && $this->user_row['status']==TR_STATUS_DISABLED)) echo 'checked="checked"'; ?> /><label for="statusD"><?php echo _AT('disabled'); ?></label> 
125                   <input type="radio" name="status" id="statusE" value="<?php echo TR_STATUS_ENABLED; ?>" <?php if ((isset($_POST['status']) && $_POST['status']==1) || (!isset($_POST['status']) && $this->user_row['status']==TR_STATUS_ENABLED)) echo 'checked="checked"'; ?> /><label for="statusE"><?php echo _AT('enabled'); ?></label>
126                   <?php if (defined('TR_EMAIL_CONFIRMATION') && TR_EMAIL_CONFIRMATION) {?>
127                   <input type="radio" name="status" id="statusU" value="<?php echo TR_STATUS_UNCONFIRMED; ?>" <?php if ((isset($_POST['status']) && $_POST['status']==1) || (!isset($_POST['status']) && $this->user_row['status']==TR_STATUS_UNCONFIRMED)) echo 'checked="checked"'; ?> /><label for="statusU"><?php echo _AT('enabled'); ?></label>
128                   <?php }?>
129           </dd>
130 <?php }?>
131
132                 
133 <?php if (isset($this->user_row['web_service_id'])) {?>
134           <dt align="left"><?php echo _AT('web_service_id'); ?>:</dt>
135           <dd><?php echo $this->user_row['web_service_id']; ?></dd><br />
136 <?php }?>
137
138           <p style="margin-left:5em;"><input type="checkbox" name="is_author" id="is_author" <?php if (isset($_POST['is_author']) || (!isset($_POST['is_author']) && $this->user_row['is_author']==1)) echo 'checked="checked"'; ?> onclick="if (this.checked) jQuery('#table_is_author').show('slow'); else jQuery('#table_is_author').hide('slow');" /> 
139           <label for="is_author"><?php echo _AT('is_author'); ?></label></p>
140     </dl>
141
142     <dl id="table_is_author" class="form_layout">
143           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="organization"><?php echo _AT('organization'); ?></label>:</dt>
144           <dd><input id="organization" name="organization" type="text" size="50" maxlength="100" value="<?php if (isset($_POST['organization'])) echo stripslashes(htmlspecialchars($_POST['organization'])); else echo stripslashes(htmlspecialchars($this->user_row['organization'])); ?>" /></dd>
145
146           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="phone"><?php echo _AT('phone'); ?></label>:</dt>
147           <dd><input id="phone" name="phone" type="text" size="30" maxlength="30" value="<?php if (isset($_POST['phone'])) echo stripslashes(htmlspecialchars($_POST['phone'])); else echo stripslashes(htmlspecialchars($this->user_row['phone'])); ?>" /></dd>
148   
149
150   
151           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="address"><?php echo _AT('address'); ?></label>:</dt>
152           <dd><input id="address" name="address" type="text" size="50" maxlength="100" value="<?php if (isset($_POST['address'])) echo stripslashes(htmlspecialchars($_POST['address'])); else echo stripslashes(htmlspecialchars($this->user_row['address'])); ?>" /></dd>
153   
154
155   
156           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="city"><?php echo _AT('city'); ?></label>:</dt>
157           <dd><input id="city" name="city" type="text" size="30" maxlength="30" value="<?php if (isset($_POST['city'])) echo stripslashes(htmlspecialchars($_POST['city'])); else echo stripslashes(htmlspecialchars($this->user_row['city'])); ?>" /></dd>
158   
159
160   
161           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="province"><?php echo _AT('province'); ?></label>:</dt>
162           <dd><input id="province" name="province" type="text" size="30" maxlength="30" value="<?php if (isset($_POST['province'])) echo stripslashes(htmlspecialchars($_POST['province'])); else echo stripslashes(htmlspecialchars($this->user_row['province'])); ?>" /></dd>
163   
164
165   
166           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="country"><?php echo _AT('country'); ?></label>:</dt>
167           <dd><input id="country" name="country" type="text" size="30" maxlength="30" value="<?php if (isset($_POST['country'])) echo stripslashes(htmlspecialchars($_POST['country'])); else echo stripslashes(htmlspecialchars($this->user_row['country'])); ?>" /></dd>
168   
169
170   
171           <dt><span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="postal_code"><?php echo _AT('postal_code'); ?></label>:</dt>
172           <dd><input id="postal_code" name="postal_code" type="text" size="10" maxlength="10" value="<?php if (isset($_POST['postal_code'])) echo stripslashes(htmlspecialchars($_POST['postal_code'])); else echo stripslashes(htmlspecialchars($this->user_row['postal_code'])); ?>" /></dd>
173     </dl>
174         <p class="submit_buttons">
175       <input type="submit" name="submit" value="<?php echo $this->submit_button_text; ?>" class="submit" onclick="return encrypt_password();" /> 
176       <input type="submit" name="cancel" value=" <?php echo _AT('cancel'); ?> "  class="submit" />
177         </p>
178   </div>
179   </fieldset>
180 </div>
181 </form>
182
183 <?php require(TR_INCLUDE_PATH.'footer.inc.php'); ?>