Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla Integration: Insufficient Wordpress Capabilities
Hey guys I followed the Vanilla Integration guide here and all went great. However, I did notice that when one tried to register through Vanilla, things worked and a user was indeed created for Wordpress (I could see him in the user list in the administration page). However, he wasn't given a sufficient role of at least subscriber, so he wasn't able to login or anything. I think this is a problem similar to how Vanilla had to be given the proper RoleID, however it's more complicated.
I think that the proper capabilities value is stored in wp_usermeta, col umeta_id is auto-incrementing, col user_id = the user's ID, col meta_key = wp_capabilities, col meta_value = a:1:{s:10:"subscriber";b:1;} .
Then again, there's also the wp_user_level column. Which should look be as follows: wp_usermeta, col umeta_id is auto-incrementing, col user_id = the user's ID, col meta_key = wp_user_level, col meta_value = 0 . Based on the information I found here.
I'm just wondering which is necessary to change, or if both. I would try it myself but I don't know where I would do this. Should I do it in the “WordpressIntegration†script? Should I add my own raw connection to the database and query? Maybe something at the end of UserManager_AddWordpressFieldsToCreateUser that does this:
I'm no PHP/MySQL programmer apparently. I don't know if both would be required, or just one. I would like to know what you guys think and if you could help me out, thanks!
I think that the proper capabilities value is stored in wp_usermeta, col umeta_id is auto-incrementing, col user_id = the user's ID, col meta_key = wp_capabilities, col meta_value = a:1:{s:10:"subscriber";b:1;} .
Then again, there's also the wp_user_level column. Which should look be as follows: wp_usermeta, col umeta_id is auto-incrementing, col user_id = the user's ID, col meta_key = wp_user_level, col meta_value = 0 . Based on the information I found here.
I'm just wondering which is necessary to change, or if both. I would try it myself but I don't know where I would do this. Should I do it in the “WordpressIntegration†script? Should I add my own raw connection to the database and query? Maybe something at the end of UserManager_AddWordpressFieldsToCreateUser that does this:
$link = mysql_connect("mysql.mysite.com", "admin", "mypass");
if (!$link) {
die("Could not connect: " . mysql_error());
}
mysql_select_db("wp_usermeta") or die(mysql_error());
$query = "INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES(" . $SafeUser->UserID . ", 'wp_user_level', 0)";
mysql_query($query) or die(mysql_error());
$query = "INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES(" . $SafeUser->UserID . ", 'wp_capabilities', 'a:1:{s:10:\"subscriber\";b:1;}')";
mysql_query() or die(mysql_error());
mysql_close($link);
I'm no PHP/MySQL programmer apparently. I don't know if both would be required, or just one. I would like to know what you guys think and if you could help me out, thanks!
0
This discussion has been closed.