1 | {combine_css path=$OAUTH_PATH|cat:"admin/template/style.css"} |
---|
2 | {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'} |
---|
3 | |
---|
4 | {footer_script}{literal} |
---|
5 | jQuery("select.enable").change(function() { |
---|
6 | var $top = $(this).closest("div.provider"); |
---|
7 | var p = $top.data('p'); |
---|
8 | |
---|
9 | if ($(this).val()=='true') { |
---|
10 | $top.find("td.keys").show(); |
---|
11 | $top.removeClass('disabled'); |
---|
12 | $top.addClass('enabled'); |
---|
13 | } |
---|
14 | else { |
---|
15 | $top.find("td.keys").hide(); |
---|
16 | $top.removeClass('enabled'); |
---|
17 | $top.addClass('disabled'); |
---|
18 | } |
---|
19 | }); |
---|
20 | |
---|
21 | jQuery("#close_help").click(function() { |
---|
22 | jQuery("#help_container").animate({"margin-right": "-550px"}, 'fast'); |
---|
23 | return false; |
---|
24 | }); |
---|
25 | |
---|
26 | jQuery(".open-help").click(function() { |
---|
27 | var $top = $(this).closest("div.provider"); |
---|
28 | var p = $top.data('p'); |
---|
29 | |
---|
30 | $("#help_container h5").html($top.find("h4").html()); |
---|
31 | $("#help_container div").html($top.find("div.help").html()); |
---|
32 | $("#help_container").animate({"margin-right": "0px"}, 'fast'); |
---|
33 | return false; |
---|
34 | }); |
---|
35 | {/literal}{/footer_script} |
---|
36 | |
---|
37 | |
---|
38 | <div class="titrePage"> |
---|
39 | <h2>OAuth</h2> |
---|
40 | </div> |
---|
41 | |
---|
42 | <div id="help_container"> |
---|
43 | <a href="#" id="close_help" title="{'Close'|@translate}">×</a> |
---|
44 | <h5></h5> |
---|
45 | <div></div> |
---|
46 | </div> |
---|
47 | |
---|
48 | <form method="post" action="" class="properties"> |
---|
49 | <fieldset id="commentsConf"> |
---|
50 | |
---|
51 | {foreach from=$PROVIDERS item=provider key=p} |
---|
52 | <div data-p="{$p}" class="provider {$p} {if $CONFIG[$p].enabled}enabled{else}disabled{/if}"> |
---|
53 | <h4>{$provider.provider_name}</h4> |
---|
54 | |
---|
55 | <table><tr> |
---|
56 | <td> |
---|
57 | <span class="oauth_38px {$p|strtolower}"></span> |
---|
58 | </td> |
---|
59 | |
---|
60 | <td> |
---|
61 | <select name="providers[{$p}][enabled]" class="enable"> |
---|
62 | <option value="true" {if $CONFIG[$p].enabled}selected="selected"{/if}>{'Enabled'|@translate}</option> |
---|
63 | <option value="false" {if not $CONFIG[$p].enabled}selected="selected"{/if}>{'Disabled'|@translate}</option> |
---|
64 | </select> |
---|
65 | <br><a href="#" class="open-help">{'Help'|@translate}</a> |
---|
66 | </td> |
---|
67 | |
---|
68 | {if $provider.new_app_link} |
---|
69 | <td class="keys" {if not $CONFIG[$p].enabled}style="display:none;"{/if}> |
---|
70 | {if $provider.require_client_id} |
---|
71 | <label for="{$p}_app_id">Application ID</label> |
---|
72 | <input type="text" id="{$p}_app_id" name="providers[{$p}][keys][id]" value="{$CONFIG[$p].keys.id}"> |
---|
73 | {else} |
---|
74 | <label for="{$p}_key">Application Key</label> |
---|
75 | <input type="text" id="{$p}_key" name="providers[{$p}][keys][key]" value="{$CONFIG[$p].keys.key}"> |
---|
76 | {/if} |
---|
77 | <label for="{$p}_secret">Application Secret</label> |
---|
78 | <input type="text" id="{$p}_secret" name="providers[{$p}][keys][secret]" value="{$CONFIG[$p].keys.secret}"> |
---|
79 | <br> |
---|
80 | </td> |
---|
81 | {/if} |
---|
82 | </tr></table> |
---|
83 | |
---|
84 | <div class="help"> |
---|
85 | {if $provider.new_app_link} |
---|
86 | <ol> |
---|
87 | <li>{'Go to <a href="%s" target="_blank">%s</a> and create a new application'|@translate|sprintf:$provider.new_app_link:$provider.new_app_link}</li> |
---|
88 | |
---|
89 | {if $p=='Google'} |
---|
90 | <li>{'On the <b>API Access</b> tab, <b>create an OAuth 2.0 Client ID</b>'|@translate}</li> |
---|
91 | <li>{'Fill out any required fields such as the application name and description'|@translate}</li> |
---|
92 | <li>{'On the <b>Create Client ID</b> popup, switch to advanced settings by clicking on <b>(more options)</b>'|@translate}</li> |
---|
93 | {else} |
---|
94 | <li>{'Fill out any required fields such as the application name and description'|@translate}</li> |
---|
95 | {/if} |
---|
96 | |
---|
97 | {if $provider.callback} |
---|
98 | <li> |
---|
99 | {assign var=callback value=$OAUTH_CALLBACK|cat:$p} |
---|
100 | {'Provide this URL as the Callback/Redirect URL for your application: <em>%s</em>'|@translate|sprintf:$callback} |
---|
101 | </li> |
---|
102 | {/if} |
---|
103 | |
---|
104 | {if $p=='Live'} |
---|
105 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Redirect Domain</b>':$SERVERNAME}</li> |
---|
106 | {elseif $p=='Facebook'} |
---|
107 | <li>{'Set the <b>%s</b> to <em>%s</em>'|@translate|sprintf:'application type':'Website with facebook authentication'}</li> |
---|
108 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Site Url</b>, <b>App Domains</b>':$SERVERNAME}</li> |
---|
109 | {elseif $p=='LinkedIn'} |
---|
110 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Website URL</b>':$SERVERNAME}</li> |
---|
111 | <li>{'Set the <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Application Type':'Web Application'}</li> |
---|
112 | {elseif $p=='Yahoo'} |
---|
113 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application URL</b>, <b>Application Domain</b>':$SERVERNAME}</li> |
---|
114 | <li>{'Set the <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Kind of Application':'Web-based'}</li> |
---|
115 | <li>{'Set the <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Access Scopes':'This app will only access public...'}</li> |
---|
116 | <li>{'Once the application is registered update the permissions : set <b>Contacts</b> as <em>Read</em> and <b>Social Directory</b> as <em>Read Public</em>'|@translate}</li> |
---|
117 | {elseif $p=='Twitter'} |
---|
118 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application Website</b>, <b>Application Callback URL</b>':$SERVERNAME}</li> |
---|
119 | <li>{'Set the <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Default Access Type':'Read only'}</li> |
---|
120 | {elseif $p=='Tumblr'} |
---|
121 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application Website</b>, <b>Default Callback URL</b>':$SERVERNAME}</li> |
---|
122 | {elseif $p=='Instagram'} |
---|
123 | <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Website</b>':$SERVERNAME}</li> |
---|
124 | {/if} |
---|
125 | |
---|
126 | <li>{'Once you have registered, copy and past the created application credentials into this setup page'|@translate}</li> |
---|
127 | </ol> |
---|
128 | {else} |
---|
129 | <p>{'No registration required for OpenID based providers'|@translate}</p> |
---|
130 | {/if} |
---|
131 | </div> |
---|
132 | </div> |
---|
133 | {/foreach} |
---|
134 | |
---|
135 | </fieldset> |
---|
136 | |
---|
137 | <p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|@translate}"></p> |
---|
138 | |
---|
139 | </form> |
---|
140 | |
---|
141 | <div style="text-align:right;"> |
---|
142 | Icons from : <a href="http://www.wpzoom.com" target="_blank">WPZOOM</a> | |
---|
143 | Library : <a href="http://hybridauth.sourceforge.net" target="_blank">HybridAuth</a> |
---|
144 | </div> |
---|