piwik: properly record the site id after creation

This commit is contained in:
Antoine Beaupr�� 2014-06-18 15:05:34 +00:00
parent 954ffc2ab0
commit fb9d6d8457
1 changed files with 2 additions and 1 deletions

View File

@ -292,9 +292,10 @@ class m_piwik {
// Ajoute un site à Piwik
// can't figure out how to pass multiple url through the API
function site_add($siteName, $urls, $ecommerce = FALSE) {
global $db, $cuid;
$urls = is_array($urls) ? implode(',', $urls) : $urls;
$api_data = $this->call_privileged_page('API', 'SitesManager.addSite', array('siteName' => $siteName, 'urls' => $urls));
printvar($api_data);
$db->query("INSERT INTO piwik_sites set uid='$cuid', piwik_id='{$api_data->value}'");
return TRUE;
}