-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathadmin.php
executable file
·184 lines (167 loc) · 8.97 KB
/
admin.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
<?php
function sc_social_connect_admin_menu()
{
add_options_page('Social Connect Settings', 'Social Connect', 'manage_options', 'social-connect-id', 'sc_render_social_connect_settings');
add_action( 'admin_init', 'sc_register_social_connect_settings' );
}
add_action('admin_menu', 'sc_social_connect_admin_menu');
function sc_register_social_connect_settings()
{
register_setting( 'social-connect-settings-group', 'social_connect_facebook_enabled');
register_setting( 'social-connect-settings-group', 'social_connect_facebook_api_key' );
register_setting( 'social-connect-settings-group', 'social_connect_facebook_secret_key' );
register_setting( 'social-connect-settings-group', 'social_connect_twitter_enabled');
register_setting( 'social-connect-settings-group', 'social_connect_twitter_consumer_key');
register_setting( 'social-connect-settings-group', 'social_connect_twitter_consumer_secret');
register_setting( 'social-connect-settings-group', 'social_connect_liveid_enabled');
register_setting( 'social-connect-settings-group', 'social_connect_liveid_appid_key' );
register_setting( 'social-connect-settings-group', 'social_connect_liveid_secret_key' );
register_setting( 'social-connect-settings-group', 'social_connect_liveid_security_algorithm' );
register_setting( 'social-connect-settings-group', 'social_connect_liveid_return_url' );
register_setting( 'social-connect-settings-group', 'social_connect_liveid_policy_url' );
register_setting( 'social-connect-settings-group', 'social_connect_google_enabled');
register_setting( 'social-connect-settings-group', 'social_connect_yahoo_enabled');
register_setting( 'social-connect-settings-group', 'social_connect_openid_enabled');
register_setting( 'social-connect-settings-group', 'social_connect_wordpress_enabled');
}
function sc_render_social_connect_settings()
{
?>
<div class="wrap">
<h2>Social Connect Settings</h2>
<form method="post" action="options.php">
<?php settings_fields( 'social-connect-settings-group' ); ?>
<h3>Facebook Settings</h3>
<p>To connect your site to Facebook, you need a Facebook Application. If you have already created one, please insert your API & Secret key below.</p>
<p>Already registered? Find your keys in your <a target="_blank" href="http://www.facebook.com/developers/apps.php">Facebook Application List</a></li>
<p>Need to register?</p>
<ol>
<li>Visit the <a target="_blank" href="http://www.facebook.com/developers/createapp.php">Facebook Application Setup</a> page</li>
<li>Get the API information from the <a target="_blank" href="http://www.facebook.com/developers/apps.php">Facebook Application List</a></li>
<li>Select the application you created, then copy and paste the API key & Application Secret from there.</li>
</ol>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_facebook_enabled" value="1" <?php checked(get_option('social_connect_facebook_enabled'), 1); ?> />
</td>
</tr>
<tr valign="top">
<th scope="row">API Key</th>
<td><input type="text" name="social_connect_facebook_api_key" value="<?php echo get_option('social_connect_facebook_api_key'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Secret Key</th>
<td><input type="text" name="social_connect_facebook_secret_key" value="<?php echo get_option('social_connect_facebook_secret_key'); ?>" /></td>
</tr>
</table>
<br />
<h3>Twitter Settings</h3>
<p>To offer login via Twitter, you need to register your site as a Twitter Application and get a <strong>Consumer Key</strong>, a <strong>Consumer Secret</strong>, an <strong>Access Token</strong> and an <strong>Access Token Secret</strong>.</p>
<p>Already registered? Find your keys in your <a href="http://dev.twitter.com/apps">Twitter Application List</a></p>
<p>Need to register? <a href="http://dev.twitter.com/apps/new">Register an Application</a> and fill the form with the details below:
<ol>
<li>Application Type: <strong>Browser</strong></li>
<li>Callback URL: <strong><?php echo plugins_url() . '/wp_social_connect/twitter/callback.php'; ?></strong></li>
<li>Default Access: <strong>Read & Write</strong></li>
</ol>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_twitter_enabled" value="1" <?php checked(get_option('social_connect_twitter_enabled'), 1); ?> /><br/>
Twitter integration requires the generation of dummy email addresses for authenticating users. <br/>
Please check with your domain administrator as this may require changes to your mail server.
</td>
</tr>
<tr valign="top">
<th scope="row">Consumer Key</th>
<td><input type="text" name="social_connect_twitter_consumer_key" value="<?php echo get_option('social_connect_twitter_consumer_key'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Consumer Secret</th>
<td><input type="text" name="social_connect_twitter_consumer_secret" value="<?php echo get_option('social_connect_twitter_consumer_secret'); ?>" /></td>
</tr>
</table>
<br />
<h3>Windows Live Settings</h3>
<p>To offer login via Windows Live, you need to register your site as a Windows Live Application and get a <strong>Client ID</strong> and <strong>Secret</strong>.</p>
<p>Already registered? Find your keys in your <a href="https://manage.dev.live.com/default.aspx">Windows Live Application List</a></p>
<p>Need to register? <a href="https://manage.dev.live.com/AddApplication.aspx">Register an Application</a> and the fill the form with the details below.
<ol>
<li>Application Type: <strong>Web application</strong></li>
<li>Callback URL: <strong><?php echo plugins_url() . '/wp_social_connect/liveid/callback.php'; ?></strong></li>
<li>Security Algorithm: <strong>wsignin1.0</strong></li>
<li>From the application you created, copy and paste the following details. Note that all fields are required. </li>
</ol>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_liveid_enabled" value="1" <?php checked(get_option('social_connect_liveid_enabled'), 1); ?> />
</td>
</tr>
<tr valign="top">
<th scope="row">Client ID</th>
<td><input type="text" name="social_connect_liveid_appid_key" value="<?php echo get_option('social_connect_liveid_appid_key'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Secret Key</th>
<td><input type="text" name="social_connect_liveid_secret_key" value="<?php echo get_option('social_connect_liveid_secret_key'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Security Algorithm</th>
<td><input type="text" name="social_connect_liveid_security_algorithm" value="<?php echo get_option('social_connect_liveid_security_algorithm'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Return URL</th>
<td><input type="text" name="social_connect_liveid_return_url" value="<?php echo get_option('social_connect_liveid_return_url'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Policy URL</th>
<td><input type="text" name="social_connect_liveid_policy_url" value="<?php echo get_option('social_connect_liveid_policy_url'); ?>" /></td>
</tr>
</table>
<br />
<h3>Google Settings</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_google_enabled" value="1" <?php checked(get_option('social_connect_google_enabled'), 1); ?> />
</td>
</table>
<br />
<h3>Yahoo Settings</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_yahoo_enabled" value="1" <?php checked(get_option('social_connect_yahoo_enabled'), 1); ?> />
</td>
</table>
<br />
<h3>OpenID Settings</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_openid_enabled" value="1" <?php checked(get_option('social_connect_openid_enabled'), 1); ?> />
</td>
</table>
<br />
<h3>WordPress.com Settings</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">Enable?</th>
<td>
<input type="checkbox" name="social_connect_wordpress_enabled" value="1" <?php checked(get_option('social_connect_wordpress_enabled'), 1); ?> />
</td>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div> <?php
}