The above two queries inserting User data in piwik_xxxuser,piwik_xxxaccess two tables.
But when it automatically user login through my site to piwik , it shows error username and password failed.
I dont know that how to generate user “token_auth” in ‘piwik_xxxuser’ Table.
When Iam Entering user data in users of Admin Setting Section.Its giving authentication.
So Plz respond quikly,
Which method i have to use for User token_auth for giving access to multiple users with my code.
Thanks for your reply.I have studied API Developer Docs.But I did’n get solution for this issue.
I need to add multiple users with my code.
Iam getting all the correct except generating User “token auth” In Piwik_XXXuser table
.Iam not inserting manually.
I have already Executed Queries which are above, works fine.
Which Method i have to use for generating User “token_auth” In Piwik_XXXuser table.
can u send the links which will solve my problems.
I spend most of today developing a method to add all of my already established users into the piwik_users table. Beck is correct, try using the API already made to do this.
in a foreach loop of everyone with a siteId already, i told the API to do this:
$host = 'http://' . $_SERVER['HTTP_HOST'];
//Adds new user to piwik_users using piwik API
$httpClient = new Zend_Http_Client($host . '/piwik/index.php');
$httpClient->setParameterGet(array(
'module' => 'API',
'method' => 'UsersManager.addUser',
'format' => 'PHP',
'prettyDisplay' => 'true',
'userLogin' => $userSettings['username'], //username in the database
'password' => $userSettings['password'], //password from db
'email' => $dealerSettings['email_address'], //email adress from db
'alias' => 'Partner',
'token_auth' => 'ee93b283772be8fd9b4a6138ea1f336b' //admin token_auth for permission to do this API
));
$permResponse = $httpClient->request();
Then I did the same to set their permissions using the UsersManager.setUserAccess API.