Display the OAuth association only in "account" page.
Improved the template to show only when pertinent.
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
<hr>
|
<hr>
|
||||||
|
{unless isempty="$oauth_associated"}
|
||||||
<h4>Un-Associate Account with Oauth Consumer</h4>
|
<h4>Un-Associate Account with Oauth Consumer</h4>
|
||||||
<div>
|
<div>
|
||||||
{foreach item="consumer" from="$oauth_associated"}
|
{foreach item="consumer" from="$oauth_associated"}
|
||||||
<div>
|
<div>
|
||||||
<form method="post" action="{$site_url/}account/oauth-un-associate">
|
<form method="post" action="{$site_url/}account/oauth-un-associate">
|
||||||
<div>
|
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
||||||
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<button type="submit">Unlink {$consumer/}</button>
|
<button type="submit">Unlink {$consumer/}</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,14 +13,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
|
{/unless}
|
||||||
|
{unless isempty="$oauth_not_associated"}
|
||||||
<h4>Associate Account with Oauth Consumer</h4>
|
<h4>Associate Account with Oauth Consumer</h4>
|
||||||
<div>
|
<div>
|
||||||
{foreach item="consumer" from="$oauth_not_associated"}
|
{foreach item="consumer" from="$oauth_not_associated"}
|
||||||
<div>
|
<div>
|
||||||
<form method="post" action="{$site_url/}account/oauth-associate">
|
<form method="post" action="{$site_url/}account/oauth-associate">
|
||||||
<div>
|
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
||||||
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||||
<button type="submit">Link with {$consumer/}</button>
|
<button type="submit">Link with {$consumer/}</button>
|
||||||
@@ -30,3 +29,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
|
{/unless}
|
||||||
|
|||||||
@@ -266,10 +266,12 @@ feature -- Hooks
|
|||||||
a_response.location.starts_with ("account/roc-oauth-login")
|
a_response.location.starts_with ("account/roc-oauth-login")
|
||||||
then
|
then
|
||||||
get_block_view_login (a_block_id, a_response)
|
get_block_view_login (a_block_id, a_response)
|
||||||
elseif a_block_id.is_case_insensitive_equal_general ("account") then
|
elseif a_block_id.is_case_insensitive_equal_general ("account") and then
|
||||||
|
a_response.location.same_string ("account")
|
||||||
|
then
|
||||||
if
|
if
|
||||||
attached template_block ("account_info", a_response) as l_tpl_block and then
|
attached template_block ("account_info", a_response) as l_tpl_block and then
|
||||||
attached current_user (a_response.request) as l_user
|
attached a_response.user as l_user
|
||||||
then
|
then
|
||||||
associate_account (l_user, a_response.values)
|
associate_account (l_user, a_response.values)
|
||||||
a_response.add_block (l_tpl_block, "content")
|
a_response.add_block (l_tpl_block, "content")
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
<hr>
|
<hr>
|
||||||
|
{unless isempty="$oauth_associated"}
|
||||||
<h4>Un-Associate Account with Oauth Consumer</h4>
|
<h4>Un-Associate Account with Oauth Consumer</h4>
|
||||||
<div>
|
<div>
|
||||||
{foreach item="consumer" from="$oauth_associated"}
|
{foreach item="consumer" from="$oauth_associated"}
|
||||||
<div>
|
<div>
|
||||||
<form method="post" action="{$site_url/}account/oauth-un-associate">
|
<form method="post" action="{$site_url/}account/oauth-un-associate">
|
||||||
<div>
|
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
||||||
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<button type="submit">Unlink {$consumer/}</button>
|
<button type="submit">Unlink {$consumer/}</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,14 +13,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
|
{/unless}
|
||||||
|
{unless isempty="$oauth_not_associated"}
|
||||||
<h4>Associate Account with Oauth Consumer</h4>
|
<h4>Associate Account with Oauth Consumer</h4>
|
||||||
<div>
|
<div>
|
||||||
{foreach item="consumer" from="$oauth_not_associated"}
|
{foreach item="consumer" from="$oauth_not_associated"}
|
||||||
<div>
|
<div>
|
||||||
<form method="post" action="{$site_url/}account/oauth-associate">
|
<form method="post" action="{$site_url/}account/oauth-associate">
|
||||||
<div>
|
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
||||||
<input type="hidden" name="consumer" value="{$consumer/}"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||||
<button type="submit">Link with {$consumer/}</button>
|
<button type="submit">Link with {$consumer/}</button>
|
||||||
@@ -30,3 +29,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
|
{/unless}
|
||||||
|
|||||||
Reference in New Issue
Block a user