-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-register.php
267 lines (247 loc) · 8.77 KB
/
page-register.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?php get_header(); ?>
<style type="text/css">
/* tabbed list */
ul.tabs_login {
padding: 0; margin: 20px 0 0 0;
position: relative;
list-style: none;
font-size: 14px;
z-index: 1000;
float: left;
}
ul.tabs_login li {
border: 1px solid #E7E9F6;
-webkit-border-top-right-radius: 10px;
-khtml-border-radius-topright: 10px;
-moz-border-radius-topright: 10px;
border-top-right-radius: 10px;
-webkit-border-top-left-radius: 10px;
-khtml-border-radius-topleft: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;
line-height: 28px; /* = */ height: 28px;
padding: 0; margin: 0 5px 0 0;
position: relative;
background: #fff;
overflow: hidden;
float: left;
}
ul.tabs_login li a {
text-decoration: none;
padding: 0 10px;
display: block;
outline: none;
}
html ul.tabs_login li.active_login {
border-left: 1px solid #E7E9F6;
border-bottom: 1px solid #fff;
-webkit-border-top-right-radius: 10px;
-khtml-border-radius-topright: 10px;
-moz-border-radius-topright: 10px;
border-top-right-radius: 10px;
-webkit-border-top-left-radius: 10px;
-khtml-border-radius-topleft: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;
background: #fff;
color: #333;
}
html body ul.tabs_login li.active_login a { font-weight: bold; }
.tab_container_login {
background: #fff;
position: relative;
margin: 0 0 20px 0;
border: 1px solid #E7E9F6;
-webkit-border-bottom-left-radius: 10px;
-khtml-border-radius-bottomleft: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-left-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
-khtml-border-radius-bottomright: 10px;
-moz-border-radius-bottomright: 10px;
border-bottom-right-radius: 10px;
-webkit-border-top-right-radius: 10px;
-khtml-border-radius-topright: 10px;
-moz-border-radius-topright: 10px;
border-top-right-radius: 10px;
z-index: 999;
float: left;
width: 100%;
top: -1px;
}
.tab_content_login {
padding: 7px 15px 15px 15px;
padding-top: 10px;
}
.tab_content_login ul {
padding: 0; margin: 0 0 0 15px;
}
.tab_content_login li { margin: 5px 0; }
/* global styles */
#login-register-password {width: 500px}
#login-register-password h3 {
border: 0 none;
margin: 10px 0;
padding: 0;
}
#login-register-password p {
margin: 0 0 15px 0;
padding: 0;
}
/* form elements */
.wp-user-form {}
.username, .password, .login_fields {
margin: 7px 0 0 0;
overflow: hidden;
width: 100%;
}
.username label, .password label { float: left; clear: none; width: 25%; }
.username input, .password input {
font: 12px/1.5 "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
float: left; clear: none; width: 200px; padding: 2px 3px; color: #777;border: 1px solid;
}
.rememberme { overflow: hidden; width: 100%; margin-bottom: 7px; }
#rememberme { float: left; clear: none; margin: 4px 4px -4px 0; }
.user-submit { padding: 5px 10px; margin: 5px 0; }
.userinfo { float: left; clear: none; width: 75%; margin-bottom: 10px; }
.userinfo p {
margin-left: 10px;
}
.usericon { float: left; clear: none; width: 15%; margin: 0 0 10px 22px; }
.usericon img {
border: 1px solid #F4950E;
padding: 1px;
}
</style>
<section id="contato">
<div id="bg-intro"></div>
<!-- Custom Login/Register/Password Code @ http://digwp.com/2010/12/login-register-password-code/ -->
<!-- Theme Template Code -->
<div id="login-register-password">
<?php
global $user_ID, $user_identity;
get_currentuserinfo();
if ( !$user_ID ) {
?>
<ul class="tabs_login">
<li class="active_login"><a href="#tab1_login">Login</a></li>
<li><a href="#tab2_login">Register</a></li>
<li><a href="#tab3_login">Forgot?</a></li>
</ul>
<div class="tab_container_login">
<div id="tab1_login" class="tab_content_login">
<?php
$register = isset( $_GET['register'] ) ? $_GET['register'] : "";
$reset = isset( $_GET['reset'] ) ? $_GET['reset'] : "";
if ( $register == true ) {
?>
<h3>Success!</h3>
<p>Check your email for the password and then return to log in.</p>
<?php } elseif ( $reset == true ) { ?>
<h3>Success!</h3>
<p>Check your email to reset your password.</p>
<?php } else { ?>
<h3>Have an account?</h3>
<p>Log in or sign up! It’s fast & <em>free!</em></p>
<?php } ?>
<form method="post" action="<?php bloginfo( 'url' ) ?>/wp-login.php" class="wp-user-form">
<div class="username">
<label for="user_login"><?php _e( 'Username' ); ?>: </label>
<input type="text" name="log" value="<?php echo esc_attr( stripslashes( $user_login ) ); ?>" size="20" id="user_login" tabindex="11" />
</div>
<div class="password">
<label for="user_pass"><?php _e( 'Password' ); ?>: </label>
<input type="password" name="pwd" value="" size="20" id="user_pass" tabindex="12" />
</div>
<div class="login_fields">
<div class="rememberme">
<label for="rememberme">
<input type="checkbox" name="rememberme" value="forever" checked="checked" id="rememberme" tabindex="13" /> Remember me
</label>
</div>
<?php do_action( 'login_form' ); ?>
<input type="submit" name="user-submit" value="<?php _e( 'Login' ); ?>" tabindex="14" class="user-submit" />
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
<input type="hidden" name="user-cookie" value="1" />
</div>
</form>
</div>
<div id="tab2_login" class="tab_content_login" style="display:none;">
<h3>Register for this site!</h3>
<p>Sign up now for the good stuff.</p>
<form method="post" action="<?php echo site_url( 'wp-login.php?action=register', 'login_post' ) ?>" class="wp-user-form">
<div class="username">
<label for="user_login"><?php _e( 'Username' ); ?>: </label>
<input type="text" name="user_login" value="<?php echo esc_attr( stripslashes( $user_login ) ); ?>" size="20" id="user_login" tabindex="101" />
</div>
<div class="password">
<label for="user_email"><?php _e( 'Your Email' ); ?>: </label>
<input type="text" name="user_email" value="<?php echo esc_attr( stripslashes( $user_email ) ); ?>" size="25" id="user_email" tabindex="102" />
</div>
<div class="login_fields">
<?php do_action( 'register_form' ); ?>
<input type="submit" name="user-submit" value="<?php _e( 'Sign up!' ); ?>" class="user-submit" tabindex="103" />
<?php
// $register = $_GET['register'];
if ( $register == true ) {
echo '<p>Check your email for the password!</p>';
}
?>
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />
<input type="hidden" name="user-cookie" value="1" />
</div>
</form>
</div>
<div id="tab3_login" class="tab_content_login" style="display:none;">
<h3>Lose something?</h3>
<p>Enter your username or email to reset your password.</p>
<form method="post" action="<?php echo site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ?>" class="wp-user-form">
<div class="username">
<label for="user_login" class="hide"><?php _e( 'Username or Email' ); ?>: </label>
<input type="text" name="user_login" value="" size="20" id="user_login" tabindex="1001" />
</div>
<div class="login_fields">
<?php do_action( 'login_form', 'resetpass' ); ?>
<input type="submit" name="user-submit" value="<?php _e( 'Reset my password' ); ?>" class="user-submit" tabindex="1002" />
<?php
// $reset = isse$_GET['reset'];
if ( $reset == true ) {
echo '<p>A message will be sent to your email address.</p>';
}
?>
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?reset=true" />
<input type="hidden" name="user-cookie" value="1" />
</div>
</form>
</div>
</div>
<?php } else { // is logged in ?>
<div class="sidebox">
<h3>Welcome, <?php echo $user_identity; ?></h3>
<div class="usericon">
<?php
global $userdata;
get_currentuserinfo();
echo get_avatar( $userdata->ID, 60 );
?>
</div>
<div class="userinfo">
<p>You’re logged in as <strong><?php echo $user_identity; ?></strong></p>
<p>
<a href="<?php echo wp_logout_url( 'index.php' ); ?>">Log out</a> |
<?php
if ( current_user_can( 'manage_options' ) ) {
echo '<a href="' . admin_url() . '">' . __( 'Admin' ) . '</a>';
} else {
echo '<a href="' . admin_url() . 'profile.php">' . __( 'Profile' ) . '</a>';
}
?>
</p>
</div>
</div>
<?php } ?>
</div>
<!-- Custom Login/Register/Password Code @ http://digwp.com/2010/12/login-register-password-code/ -->
</section>
<?php
get_footer();