[CDB] Linked Accounts

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
nou nou
Registered User
Posts: 503
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Linked Accounts

Post by nou nou »

Ah, but that's a little different than saying the UCP tab shows when you have no permissions (when you said you can't confirm that doesn't happen).

Good question - it's clear now. :) I can't check into that right now but I'm happy to take a look a bit later.
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [3.2][RC] Linked Accounts

Post by Sniper_E »

Yes, sorry about that. I corrected myself on saying the UCP tab shows when you have no permissions.

I made a link in header navbar to the account links in ucp.
I will keep working on getting it to hide if you have no permission, and show if you do..

Thanks for your time nou nou.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
nou nou
Registered User
Posts: 503
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Linked Accounts

Post by nou nou »

No worries :)

An {% else %} seems to do the trick (if I understand you correctly this time...):

Try this for your navbar_header_profile_list_after.html:

Code: Select all

{% if switchable_account %}
{% INCLUDECSS '@flerex_linkedaccounts/linkedaccounts.css' %}
<li id="linked_accounts" class="bg1">
	<ul>
		{% for account in switchable_account %}
		<li><a href="{{ account.SWITCH_LINK }}">
			{% if account.AVATAR %}
				{{ account.AVATAR }}
			{% else %}
				<img src="{T_THEME_PATH}/images/no_avatar.gif" class="avatar" alt="">
			{% endif %}
			{{ account.NAME }}
		</a></li>
		{% endfor %}
	</ul>
</li>
{% else %}
{% INCLUDECSS '@flerex_linkedaccounts/linkedaccounts.css' %}
<li id="linked_accounts" class="bg1">
	<ul>
		<li><a href="https://www.phpbb.com/">
				<img src="{T_THEME_PATH}/images/no_avatar.gif" class="avatar" alt="">
			No linked accounts
		</a></li>
	</ul>
</li>
{% endif %}
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [3.2][RC] Linked Accounts

Post by Sniper_E »

Yes nou nou I have already tried that and it doesn't work. This is some similar codes that I tried before with my link.

Code: Select all

{% if switchable_account %}
{% INCLUDECSS '@flerex_linkedaccounts/linkedaccounts.css' %}
<li id="linked_accounts">
	<ul>
		{% for account in switchable_account %}
		<li><a href="{{ account.SWITCH_LINK }}">
			{% if account.AVATAR %}
				{{ account.AVATAR }}
			{% else %}
				<img src="{T_THEME_PATH}/images/no_avatar.gif" class="avatar" alt="">
			{% endif %}
			{{ account.NAME }}
		</a></li>
		{% endfor %}
	</ul>
</li>
{% else %}
<li>
	<a href="{{ U_PROFILE }}?i=-flerex-linkedaccounts-ucp-main_module&mode=link">
	<i class="icon fa-user-secret fa-fw" aria-hidden="true"></i><span>{{ lang('LINKING_ACCOUNT') }}</span></a>
</li>
{% endif %}
I pretty much tried the exact same codes as what you have in your post.

Link shows to my registered test user and it even shows to guests. But clicking the link gives an error: 'Module not accessible'
I'll go back and try to add 'S_USE_LINKACCOUNT' => $auth->acl_get('u_link_accounts'), in the main_listener.php again.

I do understand that {% if switchable_account %} means if you have an account link setup.
On a new install you want have a link account setup. So I'm just trying to get a direct link to 'Account linking' page for those who have permission.

I'll work at getting a {% if S_USER_HAS_PERMISSION_TO_USE_LINKED_ACCOUNTS %} working. <-- just playing with words there.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
Flerex
Registered User
Posts: 134
Joined: Sun Oct 14, 2012 8:35 pm
Location: Galicia, Spain
Name: Flerex
Contact:

Re: [3.2][RC] Linked Accounts

Post by Flerex »

Sniper_E wrote: Mon Apr 16, 2018 9:48 pmThen what good is permissions if it's set yes to all registered users.
Permissions are good because as the end user you're able to set them according to whatever you think it's ideal for your forum. However, permissions are set to yes for all users by default because it's the expected behavior when you install the extension. When you click the “install” button you, as the user of the extension, expect something to happen, which in my opinion is having it enabled for everybody.

Regarding to the problem where the switching menu is shown to everybody, even if they don't have permissions, that's a very deliberated move. It's all because of security reasons. If a user's account has been compromised and somebody accessed it and created a link to it, the attacker could log into the user's account without them never knowing.

However, it's true that it does not make any sense to have links on the switching menu when the user doesn't have permissions. Version 1.0.1 has been released with a fix for this. With this release you will also have a U_CAN_LINK_ACCOUNT variable, which is a boolean value that represents whether the user has linking permissions. This should be useful for what you are trying to accomplish.

I'll also take advantage of this post to announce that the extension is in process of approval for the Official Extension DB and this means that in the future this post might be deleted or closed. If this is the case and you need support for the extension, you'll have to go to the support section on the extension page in the Official Extensions DB.
nou nou
Registered User
Posts: 503
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Linked Accounts

Post by nou nou »

Sniper_E wrote: Tue Apr 17, 2018 8:15 am Yes nou nou I have already tried that and it doesn't work.
Hah. Turns out I tested it with an account that did have the permission already. My bad!

But it seems our ramblings helped spawn a new feature, so all good! Thanks flerex! :)
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [3.2][RC] Linked Accounts

Post by Sniper_E »

Good man Flerex. Thank you for setting that up for us. It works beautiful in my tests. But you probably already knew that. :D

Image
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][RC] Linked Accounts

Post by </Solidjeuh> »

I still have the unknown server error when switching account ..
Error log:

Code: Select all

Unknown Server Error
»/ Switchaccount / 93
nou nou
Registered User
Posts: 503
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][RC] Linked Accounts

Post by nou nou »

Maybe a conflict with another extension?
User avatar
Flerex
Registered User
Posts: 134
Joined: Sun Oct 14, 2012 8:35 pm
Location: Galicia, Spain
Name: Flerex
Contact:

Re: [3.2][RC] Linked Accounts

Post by Flerex »

Sniper_E wrote: Tue Apr 17, 2018 5:11 pm Good man Flerex. Thank you for setting that up for us. It works beautiful in my tests. But you probably already knew that. :D

Image
That actually looks quite nice. Gratz!
Froddelaar wrote: Tue Apr 17, 2018 5:46 pm I still have the unknown server error when switching account ..
Error log:

Code: Select all

Unknown Server Error
»/ Switchaccount / 93
Have you tried the extension on a brand new phpBB installation? I have never been able to replicate your problem. Maybe nou nou is right and there's another extension causing this problem. It could also be that you haven't set up the .htaccess file correctly and you have hidden app.php in custom URLs.
User avatar
Sniper_E
Registered User
Posts: 1134
Joined: Wed May 09, 2007 12:18 am
Location: Shreveport, Louisiana
Name: Ed Humphrey
Contact:

Re: [3.2][RC] Linked Accounts

Post by Sniper_E »

nou nou wrote: Tue Apr 17, 2018 2:04 am An {% else %} seems to do the trick (if I understand you correctly this time...):
Hey nou nou, I actually got rid of the {% else %} statement and have that ucp link showing under my linked accounts.

navbar_header_profile_list_after.html

Code: Select all

{% if switchable_account %}
{% INCLUDECSS '@flerex_linkedaccounts/linkedaccounts.css' %}
<li id="linked_accounts">
	<ul>
		{% for account in switchable_account %}
		<li><a href="{{ account.SWITCH_LINK }}">
			{% if account.AVATAR %}
				{{ account.AVATAR }}
			{% else %}
				<img src="{T_THEME_PATH}/images/no_avatar.gif" class="avatar" alt="">
			{% endif %}
			{{ account.NAME }}
		</a></li>
		{% endfor %}
	</ul>
</li>
{% endif %}
{% if U_CAN_LINK_ACCOUNT %}
<li>
	<a href="{{ U_PROFILE }}?i=-flerex-linkedaccounts-ucp-main_module&mode=link">
	<i class="icon fa-user-secret fa-fw" aria-hidden="true"></i><span>{{ lang('LINKING_ACCOUNT') }}</span></a>
</li>
{% endif %}
This is Great! I like having the link to go manage my linked accounts.
Image . -.. / .... ..- -- .--. .... .-. . -.--
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!

:!: Sniper_E Styles | phpbbmodders :!:
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][RC] Linked Accounts

Post by </Solidjeuh> »

Froddelaar wrote: Tue Apr 17, 2018 5:46 pm I still have the unknown server error when switching account ..
Error log:

Code: Select all

Unknown Server Error
»/ Switchaccount / 93
Yeah I'm quoting myself again. I'm just that stupid :lol:

I disabled this extension: https://github.com/ForumHulp/errorpages
And the problem seems to be solved now.
I now see the message: Accounts switched successfuly. instead of the error
Sir Scrambledeggs
Registered User
Posts: 9
Joined: Mon May 21, 2018 7:17 pm

Re: [3.2][RC] Linked Accounts

Post by Sir Scrambledeggs »

Hello!

First of all thanks for the great extension. Unfortunately I have a bug in the SQL:

SQL ERROR [ mysqli ]
Unknown column 'testuser' in 'where clause' [1054]


Can you help me?

Many thanks!
User avatar
Flerex
Registered User
Posts: 134
Joined: Sun Oct 14, 2012 8:35 pm
Location: Galicia, Spain
Name: Flerex
Contact:

Re: [3.2][RC] Linked Accounts

Post by Flerex »

Sir Scrambledeggs wrote: Mon May 21, 2018 7:23 pm Hello!

First of all thanks for the great extension. Unfortunately I have a bug in the SQL:

SQL ERROR [ mysqli ]
Unknown column 'testuser' in 'where clause' [1054]


Can you help me?

Many thanks!
Do you have any other extension installed? Doesn't look like it comes from Linked Accounts. Try disabling all extensions but Linked Accounts to see if it's still happening.
Sir Scrambledeggs
Registered User
Posts: 9
Joined: Mon May 21, 2018 7:17 pm

Re: [3.2][RC] Linked Accounts

Post by Sir Scrambledeggs »

The forum is a new installation, there is no other extension available.

I tested again and was able to get out a little more than error message.
SQL ERROR [ mysqli ]
Unknown column 'vagabund' in 'where clause' [1054]

SQL

SELECT user_id, username, username_clean, user_colour FROM phpbb_users WHERE username_clean = vagabund

BACKTRACE
I think the SQL syntax is wrong. Instead of:

SELECT user_id, username, username_clean, user_colour FROM phpbb_users WHERE username_clean = testuser

Should it read:

SELECT user_id, username, username_clean, user_colour FROM phpbb_users WHERE username_clean = 'testuser'

The single quotes in the error message are missing. Does this help us with troubleshooting?
Locked

Return to “Extensions in Development”