Newer
Older
if (!$info['title'])
$info['title'] = 'Register: '.Format::htmlchars($user->getName());
if (!$_POST) {
$info['sendemail'] = true; // send email confirmation.
if (!isset($info['timezone_id']))
$info['timezone_id'] = $cfg->getDefaultTimezoneId();
if (!isset($info['dst']))
$info['dst'] = $cfg->observeDaylightSaving();
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
}
?>
<h3><?php echo $info['title']; ?></h3>
<b><a class="close" href="#"><i class="icon-remove-circle"></i></a></b>
<div class="clear"></div>
<hr/>
<?php
if ($info['error']) {
echo sprintf('<p id="msg_error">%s</p>', $info['error']);
} elseif ($info['msg']) {
echo sprintf('<p id="msg_notice">%s</p>', $info['msg']);
} ?>
<div><p id="msg_info"><i class="icon-info-sign"></i> Complete the form
below to create a user account for <b><?php echo
$user->getName()->getOriginal(); ?></b>.</p></div>
<div id="user-registration" style="display:block; margin:5px;">
<form method="post" class="user"
action="#users/<?php echo $user->getId(); ?>/register">
<input type="hidden" name="id" value="<?php echo $user->getId(); ?>" />
<table width="100%">
<tbody>
<tr>
<th colspan="2">
<em><strong>User Account Login</strong></em>
</th>
</tr>
<tr>
<td width="180">
Status:
</td>
<td>
<input type="checkbox" id="sendemail" name="sendemail" value="1"
<?php echo $info['sendemail'] ? 'checked="checked"' : ''; ?> >
Send account activation email to <?php echo $user->getEmail(); ?>.
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
</td>
</tr>
<tr>
<td width="180">
Username:
</td>
<td>
<input type="text" size="35" name="username" value="<?php echo $info['username'] ?: $user->getEmail(); ?>">
<span class="error"> <?php echo $errors['username']; ?></span>
</td>
</tr>
</tbody>
<tbody id="password"
style="<?php echo $info['sendemail'] ? 'display:none;' : ''; ?>"
>
<tr>
<td width="180">
Temp. Password:
</td>
<td>
<input type="password" size="35" name="passwd1" value="<?php echo $info['passwd1']; ?>">
<span class="error"> <?php echo
$errors['passwd1']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Confirm Password:
</td>
<td>
<input type="password" size="35" name="passwd2" value="<?php echo $info['passwd2']; ?>">
<span class="error"> <?php echo $errors['passwd2']; ?></span>
</td>
</tr>
<tr>
<td>
Password Change:
</td>
<td colspan=2>
<input type="checkbox" name="pwreset-flag" value="1" <?php
echo $info['pwreset-flag'] ? 'checked="checked"' : ''; ?>> Require password change on login
</td>
</tr>
</tbody>
<tbody>
<tr>
<th colspan="2"><em><strong>User Preferences</strong></em></th>
</tr>
<td>Time Zone:</td>
<td>
<select name="timezone_id" id="timezone_id">
<?php
$sql='SELECT id, offset, timezone FROM '.TIMEZONE_TABLE.' ORDER BY id';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id, $offset, $tz) = db_fetch_row($res)) {
$sel=($info['timezone_id']==$id) ? 'selected="selected"' : '';
echo sprintf('<option value="%d" %s>GMT %s - %s</option>',
$id, $sel, $offset, $tz);
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
}
}
?>
</select>
<span class="error"><?php echo $errors['timezone_id']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Daylight Saving:
</td>
<td>
<input type="checkbox" name="dst" value="1" <?php echo $info['dst'] ? 'checked="checked"' : ''; ?>>
Observe daylight saving
</td>
</tr>
</tbody>
</table>
<hr>
<p class="full-width">
<span class="buttons" style="float:left">
<input type="reset" value="Reset">
<input type="button" name="cancel" class="close" value="Cancel">
</span>
<span class="buttons" style="float:right">
<input type="submit" value="Create Account">
</span>
</p>
</form>
</div>
<div class="clear"></div>
<script type="text/javascript">
$(function() {
$(document).on('click', 'input#sendemail', function(e) {
if ($(this).prop('checked'))
$('tbody#password').hide();
else
$('tbody#password').show();
});
});
</script>