We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Manually Creating Users with Custom unique_id?

Development and Programming

Man With A Peg's avatar
Man With A Peg
124 posts
14 years ago
Man With A Peg's avatar Man With A Peg

Hey,

I am a “hacker” and have been playing with EE since January. Two of the projects that I have been involved in have required direct data insertion into the EE database.

Slight rant: For the record, I dislike the MIME64 encoding of exp_sites. There are legitimate, if rare, reasons for modifying that table. If one of the reasons is the creation of a cPAddon, the wonderful folks at cPanel Inc. don’t think you should modify database dumps (I did script in a requirement for the entry of a new license key 😛).

My current project involves a mass user import from another database. I have to maintain a sync between these user tables, and it seems like exp_members.unique_id could be used to store the user ID from the imported table. Are there any ill effects to setting exp_members.unique_id with my own unique key?

The wiki for EE 1.x seems to indicate that this would be fine: http://expressionengine.com/wiki/Import_Members/

Thanks!

       
Man With A Peg's avatar
Man With A Peg
124 posts
14 years ago
Man With A Peg's avatar Man With A Peg

In answer to my question, yes, it is very possible to use just about any unique_id that you want. You have to insert the user into the database manually (exp_members, exp_member_data) since the EE function do_import() forcefully sets unique_id.

Now, is this a good idea? It depends. The unique_id is used by ExpressionEngine for cookie handling, which means that a logged-in user can learn what his unique_id is. Don’t put any sensitive data into this field if you care about security.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.