Alternc  latest
Alternc logiel libre pour l'hébergement
piwik_addsites.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Add a piwik website using piwik's API
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once("head.php");
28 
29 $fields = array (
30  "site_name" => array ("post", "string", ""),
31  "site_urls" => array ("post", "string", ""),
32 );
34 
35 if(empty($site_name)) $site_name=$site_urls;
36 
37 if (empty($site_name)) {
38  $msg->raise("ERROR", "piwik", _("All fields are mandatory"));
39 } elseif ( $piwik->site_add($site_name, $site_urls) ) {
40  $msg->raise("INFO", "piwik", _("Website added Successfully"));
41 }
42 include_once("piwik_sitelist.php");
43 
44 ?>
$msg
Definition: bootstrap.php:75
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
if(empty($site_name)) elseif($piwik->site_add( $site_name, $site_urls))
$fields
Add a piwik website using piwik's API.