First draft of site override functionality.

Signed-off-by: Shai Sachs <ssachs@ngpvan.com>
Refactor piwik interaction code to remove dependency on the structure of the Aegir task object, and to remove PiwikAPI concern from hook_pre_hosting_task.

Signed-off-by: Shai Sachs <ssachs@ngpvan.com>
Correct bugs in hook_form_FORMID_alter and ensure that schema allows negative site ids.

Signed-off-by: Shai Sachs <ssachs@ngpvan.com>
Correct bug in which Piwik site ID cannot be recorded after node is saved due to duplicate key.  Avoid registering new aliases if site has a non-positive Piwik site id.  Use more consistent key for piwik site id input on site edit form.  Use more robust method for determining piwik site id in order to register new alises and create sites.

Signed-off-by: Shai Sachs <ssachs@ngpvan.com>
Simplify logic for registering new aliases, so that when a site is installed with a positive ID, the aliases for that site get registered in Piwik against the specified ID.  Prevent duplicate aliases in site_alias table.  Allow legacy sites which were installed before hosting_piwik was enabled to override their Piwik site ID during node edit, if desired.

Signed-off-by: Shai Sachs <ssachs@ngpvan.com>
Merge branch 'feature-siteid_override' into 6.x-1.x