WordPress.org

Ready to get started?Download WordPress

Forums

Add Link to Facebook
[resolved] Use plugin as user that has NOT id=1 (15 posts)

  1. Electrosmog
    Member
    Posted 1 year ago #

    Hey there,

    due to security reasons, I changed the user ID of my admin account from 1 to a different ID, and I don't really want to change it back.

    Is there a possibility to allow the plugin to post with a different ID, and ESPECIALLY being able to change the settings in the admin backend with the other ID?

    http://wordpress.org/extend/plugins/add-link-to-facebook/

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    You can setup the plugin for another WordPress user (it is a multi user plugin), but it is not possible to change a user ID.
    See the FAQ if you had enabled 'Share with all users'.

  3. Electrosmog
    Member
    Posted 1 year ago #

    Sorry but of course it is possible to change the user ID of an existing user. You can change it in the SQL database of WP - and there are even security plugins which are able to change it via the admin backend. The problem is that many hackers try to hack admin accounts, and by default the id #1 is the very first user account: the admin account.

    So I think it would make sense to be able to allow certain users to be able to change the settings.

  4. Norbert
    Member
    Posted 1 year ago #

    I agree here.
    I also don't have a user with id=1, and as a consequence I cannot configure the plugin, thus it is broken.
    The plugin should check whether the currently logged in user is administrator, and be content. That is the only requirement.

    Can you please implement this

    Thanks a lot

    Norbert

  5. Electrosmog
    Member
    Posted 1 year ago #

    Well, I needed to create a new user, needed to give it id=1 via SQL, then needed to give him admin status via admin platform of my non-#1-ed account, then needed to reset the newly-created password, then needed to log in with that account, then needed to reinstall the plugin and of course re-authorize and reconfigure it, and after this I had the settings that I wanted. Then I could delete the #1 admin again (or degrade its rank to subscriber or author or s). But this can't be a way that makes sense.

    As Norbert says: Please implement that users which can alter settings can at least be specified.

    Thanks in advance.

  6. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    This plugin works with any users name and the user ID doesn't matter, even the permissions do not matter (although the admin can do some things more).

    If you change the user ID in the database manually, then it won't work, but how coulld it?
    If you manipulate the database yourself, you will have to manipulate the records of the plugin too.

    The same applies if you delete a user. If you deleted the admin user that enabled 'Share with all users' option, there is a solution for that in the FAQ.

    Again, this plugin works with any user name and any user ID as long as you use WordPress to manage users.

    For your next support question or follow up on this one, please go here:

    forum.faircode.eu

  7. Norbert
    Member
    Posted 1 year ago #

    Hi Marcel,

    yes, once the plugin is configured, then it works with any user id.

    But you missed that for *configuration* you need to have id=1, otherwise you get a warning and cannot configure.

    That is all we asked, that *configuration* can be done by any admin user instead of only id=1.

    Norbert

  8. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    There is no check in the plugin for user ID 1.
    Where did you get that warning/error?
    What was the exact text?
    Are you sure Add Link to Facebook issued the warning?

  9. Norbert
    Member
    Posted 1 year ago #

    I retried, it is repeatable:
    * activate plugin
    * go to Tools -> Add Link to Facebook
    What I get is in the right two boxes, one contains:

    Add Link to Facebook needs configuration

    and one contains

    Only this user can access the settings: (id=1)

    Looking at the source of the page I see:
    <div id="message" class="error fade al2fb_error"><p>Only this user can access the settings: (id=1)</p></div>
    so I guess that it is generated by your plugin, as there is the al2fb_error.

    Does this make the thing clearer?

    Norbert

  10. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    The user ID is not hardcoded, it could also be user ID 2, 3 or whatever.
    The message will appear only if you have configured the plugin before with the user ID stated in the message and checked the option 'Share with all users' from this user.

    This message will never appear if you didn't configure the plugin before.

    What I wrote before is still valid: if you manipulate the database yourself or delete a user you have configure the plugin with, you will need the change the records of the plugin too (user meta data).

  11. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    See the FAQ if you want to uncheck the 'Share with all users' option when you have no access to the user that checked the option anymore.

  12. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    One last remark: I see no way to fix this. If the user is gone, there is no reliable way to choose a new user that should have the 'Share with all users' option (and all other configuration and authorization data). This could even be a privacy violation, since the deleted user did setup the plugin with his/her Facebook account and the new user could be another person with another Facebook account.

  13. Marcel Bokhorst
    Member
    Plugin Author

    Posted 1 year ago #

    Before you ask: admin users could be different persons with different Facebook accounts too, that is why only one admin user has access to the 'Share with all users' option and why this message exists: to remind which user. If the user was not deleted, not only the user ID would be shown, but also the account name.

  14. Norbert
    Member
    Posted 1 year ago #

    Hi Marcel,

    wow, thanks a lot for the detailed explanation, yes, now I see your point, and I agree that this cannot be changed.

    But to make things better, maybe it is worth to provide a better warning message, something like

    The following user has been configured this plugin and selected "Share with all users", only this user can change settings. UID

    Thanks for your detailed analysis and explanation, it is clearer now.

    Norbert

  15. feelinfae
    Member
    Posted 1 year ago #

    I followed the instructions via the FAQ's because I have this issue as well and now my site is broken.

    I put the same page back to how it was prior to me adding the code provided and I still get the error.

    Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in /sitefolder/wp-content/plugins/add-link-to-facebook/add-link-to-facebook-class.php on line 2753

    Also it says that file is inactive

    Update: I re-uploaded the page via FTP and it fixed the issue. I then made changes to the page manually (not within my WP site) then uploaded the modified page via FTP and it worked. Initially I did it via the WP editor. So not sure why that didn't work vs. a manual override. FYI in case anyone else runs into that issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.