Skip to content

Commit

Permalink
Merge pull request matomo-org#221 from crispygoth/SitesManager_setSit…
Browse files Browse the repository at this point in the history
…eAliasUrls

Added a setSiteAliasUrls method to the SitesManager API. Thanks for the Pull request!
  • Loading branch information
Matthieu Aubry committed Feb 6, 2014
2 parents efeff67 + 4b498be commit 277af28
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions plugins/SitesManager/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,28 @@ public function addSiteAliasUrls($idSite, $urls)
return count($toInsert);
}

/**
* Set the list of alias Urls for the given idSite
*
* Completely overwrites the current list of URLs with the provided list.
* The 'main_url' of the website won't be affected by this method.
*
* @return int the number of inserted URLs
*/
public function setSiteAliasUrls($idSite, $urls)
{
Piwik::checkUserHasAdminAccess($idSite);

$urls = $this->cleanParameterUrls($urls);
$this->checkUrls($urls);

$this->deleteSiteAliasUrls($idSite);
$this->insertSiteUrls($idSite, $urls);
$this->postUpdateWebsite($idSite);

return count($urls);
}

/**
* Get the start and end IP addresses for an IP address range
*
Expand Down

0 comments on commit 277af28

Please sign in to comment.