-
Notifications
You must be signed in to change notification settings - Fork 767
/
registration.php
executable file
·160 lines (151 loc) · 6.4 KB
/
registration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
50
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
150
151
152
153
154
155
156
157
158
159
160
<?php if (!defined('APPLICATION')) exit(); ?>
<div class="Help Aside">
<?php
echo Wrap(T('Need More Help?'), 'h2');
echo '<ul>';
echo Wrap(Anchor(T("Video tutorial on user registration"), 'settings/tutorials/user-registration'), 'li');
echo '</ul>';
?>
</div>
<h1><?php echo T('User Registration Settings'); ?></h1>
<?php
echo $this->Form->Open();
echo $this->Form->Errors();
echo Gdn::Slice('/dashboard/role/defaultroleswarning');
?>
<ul>
<li id="RegistrationMethods">
<div class="Info"><?php echo T('Change the way that new users register with the site.'); ?></div>
<table class="Label AltColumns">
<thead>
<tr>
<th><?php echo T('Method'); ?></th>
<th class="Alt"><?php echo T('Description'); ?></th>
</tr>
</thead>
<tbody>
<?php
$Count = count($this->RegistrationMethods);
$i = 0;
$Alt = FALSE;
foreach ($this->RegistrationMethods as $Method => $Description) {
$Alt = $Alt ? FALSE : TRUE;
$CssClass = $Alt ? 'Alt' : '';
++$i;
if ($Count == $i)
$CssClass .= ' Last';
$CssClass = trim($CssClass);
?>
<tr<?php echo $CssClass != '' ? ' class="'.$CssClass.'"' : ''; ?>>
<th><?php
$MethodName = $Method;
if ($MethodName == 'Captcha')
$MethodName = 'Basic';
echo $this->Form->Radio('Garden.Registration.Method', $MethodName, array('value' => $Method));
?></th>
<td class="Alt"><?php echo T($Description); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</li>
<?php
/*
<li id="NewUserRoles">
<div class="Info"><?php echo T('Check all roles that should be applied to new/approved users:'); ?></div>
<?php echo $this->Form->CheckBoxList('Garden.Registration.DefaultRoles', $this->RoleData, $this->ExistingRoleData, array('TextField' => 'Name', 'ValueField' => 'RoleID')); ?>
</li>
*/
?>
<li id="CaptchaSettings">
<div class="Info"><?php echo T('Captcha Explanation', 'The basic registration form requires that new users copy text from a "Captcha" image to help prevent spam.', '<strong>The basic registration form requires</strong> that new users copy text from a "Captcha" image to keep spammers out of the site. You need an account at <a href="http://recaptcha.net/">recaptcha.net</a>. Signing up is FREE and easy. Once you have signed up, come back here and enter the following settings:'); ?></div>
<table class="Label AltColumns">
<thead>
<tr>
<th><?php echo T('Key Type'); ?></th>
<th class="Alt"><?php echo T('Key Value'); ?></th>
</tr>
</thead>
<tbody>
<tr class="Alt">
<th><?php echo T('Public Key'); ?></th>
<td class="Alt"><?php echo $this->Form->TextBox('Garden.Registration.CaptchaPublicKey'); ?></td>
</tr>
<tr>
<th><?php echo T('Private Key'); ?></th>
<td class="Alt"><?php echo $this->Form->TextBox('Garden.Registration.CaptchaPrivateKey'); ?></td>
</tr>
</tbody>
</table>
</li>
<li id="InvitationExpiration">
<?php
echo $this->Form->Label('Invitations will expire', 'Garden.Registration.InviteExpiration');
echo $this->Form->DropDown('Garden.Registration.InviteExpiration', $this->InviteExpirationOptions, array('value' => $this->InviteExpiration));
?>
</li>
<li id="InvitationSettings">
<div class="Info">
<?php
echo sprintf(T('Invitations can be sent from users\' profile pages.',
'When you use registration by invitation users will have a link called <a href="%s" class="Popup">My Invitations</a> on their profile pages.'),
Url('/dashboard/profile/invitations')),
'<br /><br />';
echo T('Choose who can send out invitations to new members:');
?>
</div>
<table class="Label AltColumns">
<thead>
<tr>
<th><?php echo T('Role'); ?></th>
<th class="Alt"><?php echo T('Invitations per month'); ?></th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
$Count = $this->RoleData->NumRows();
$Alt = FALSE;
foreach ($this->RoleData->Result() as $Role) {
$Alt = $Alt ? FALSE : TRUE;
$CssClass = $Alt ? 'Alt' : '';
++$i;
if ($Count == $i)
$CssClass .= ' Last';
$CssClass = trim($CssClass);
$CurrentValue = ArrayValue($Role['RoleID'], $this->ExistingRoleInvitations, FALSE);
?>
<tr<?php echo $CssClass != '' ? ' class="'.$CssClass.'"' : ''; ?>>
<th><?php echo $Role['Name']; ?></th>
<td class="Alt">
<?php
echo $this->Form->DropDown('InvitationCount[]', $this->InvitationOptions, array('value' => $CurrentValue));
echo $this->Form->Hidden('InvitationRoleID[]', array('value' => $Role['RoleID']));
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</li>
<li>
<div class="Info">
<?php
if (UserModel::NoEmail()) {
echo '<div class="Warning">',
T('Email addresses are disabled.', 'Email addresses are disabled. You can only add an email address if you are an administrator.'),
'</div>';
}
echo $this->Form->CheckBox('Garden.Registration.ConfirmEmail', '@'.T('Confirm email addresses', 'Require users to confirm their email addresses (recommended)'));
echo $this->Form->Label('Email Confirmation Role', 'Garden.Registration.ConfirmEmailRole'),
$this->Form->DropDown('Garden.Registration.ConfirmEmailRole', $this->Data('_Roles'), array('IncludeNull' => TRUE));
echo ' ', T('Users will be assigned to this role until they\'ve confirmed their email addresses.');
?>
</div>
</li>
</ul>
<?php echo $this->Form->Close('Save');