Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options
How to set the Vanilla ID equal to the ForeignUserKey
![Outreach_News](http://a0.twimg.com/profile_images/3682412190/e221b60ea455cc25c8f9c3aaa5400f35_normal.png)
Hey, first, the plugin works great! I'm using it to connect to a Drupal installation, and everything is seamless so far. However, I'm having one small issue. I am not allowing any registrations on the forums themselves, all accounts are handled strictly through the Drupal site. For ease of use, I'd like to always set the user ID of the forum account to that of their Drupal user ID. I can't seem to find anything in the way of documentation on it, and was curious if that was something that was handled by jsConnect, or if that was in the core Vanilla systems.
Thanks!
0
Comments
With "User ID", do you mean the internal User ID (i.e. the Integer value) or the User Name?
My shop | About Me
I want to match integer values between Drupal and Vanilla.
I think it could be technically doable, but I'm afraid that it would be difficult to make it work reliably, as User IDs are auto-increment numbers (that's why they are mapped against
ForeignUserKey
field). If I User were added by mistake, the whole chain would be messed up.Perhaps somebody could come out with an idea of how to do this, but, personally, I would not recommend it.
My shop | About Me
Well theoretically, a user will never be added besides through the Drupal site, since local forum registration will be disabled. I'm guessing the most reliable/safe way to do it is to just write a module for Drupal that clones the Vanilla account creating process, disable auto-increment, and set it to the newly created Drupal ID (which also auto-increments). Was hoping there would be an easier/cleaner method since I have roughly 60 user accounts already created, but I can port those over by hand if need be.
In my opinion, "theoretically" is not good enough in the majority of cases. An Admin can always create a User manually, and that would be enough to cause a mess. As per Murphy's law, whether someone would do that or not depends on the amount of mess it would cause.
To be honest, I would not recommend hacking Vanilla's User registration logic either. Core could change and your modifications could break at any time.
Probably it's because I don't know the context, but I don't see much of a use in synchronising internal User IDs between Drupal and Vanilla. If you really need it, I would suggest to try adding a
DrupalUserID
field to User table and populate it via a plugin (although that would not make much of a difference, since you could always retrieve it with a very simple query).My shop | About Me
Mostly because the goal is to have a unified Drupal/Vanilla user page. Basically I am trying to integrate all of Vanilla's profile features (post count, badges, signatures, etc) into the Drupal page where I'm going to need to display other things (savable skill trees, a "hangar" for created Mechs that will be saved to the users, etc).
I mean, overall it isn't hard to work around. I was just trying to be as elegant as possible for future use while working within Vanilla itself, rather than running an end around to grab or edit user data.
Yes your solution isn't the elegant one though. The elegant one is as businessdad stated, to use a separate reference.
Don't mix up authentication, with user base. You are managing two different sessions, you are just making it look seamless.
Also the simplest way you could share features like profile is to use api. Force loading a framework over another has its pitfalls.
grep is your friend.
In such case, you can just use the User Name, instead of an ID, as it's just as unique and matches on both platforms. Using the API plugin, create some endpoints that provide the data you need, and you are sorted.
My shop | About Me
email is also a common way. Personally I think storting the id is best therefore no issues.
grep is your friend.