* @version $Id$ * @access public * @license http://opensource.org/licenses/gpl-3.0.html */ //////////// Check Inclusion de pages //////////// if (!class_exists('auth')) { include_once ("../lib/lib_common.php"); ReloadIndex('admin'); } //////////// Check Droits utilisateur //////////// if (!$l21auth->isSuperAdmin()) ReloadIndex('admin'); //////////// if(isset($_POST['valider'])) { $a = array(); if(!empty($_POST['piwik-code']) && is_numeric($_POST['piwik-code'])) $a = array_merge($a, array('code' => $_POST['piwik-code'])); else $error = _t('matomo', 'provide-ID'); if(!empty($_POST['piwik-url'])) { // @todo - check if URL is valid $url = str_replace('https://', '', $_POST['piwik-url']); $url = str_replace('http://', '', $url); $url = rtrim($url, '/'); // remove trailing slah if present $a = array_merge($a, array('url' => $url)); } else { $error = _t('matomo', 'provide-url'); } if(isset($_POST['piwik-prefix'])) $a = array_merge($a, array('domain_prefix' => 1)); if(isset($_POST['piwik-exclude-admins'])) $a = array_merge($a, array('exclude_admins' => 1)); if(isset($_POST['piwik-display-widget'])) $a = array_merge($a, array('display_widget' => 1)); if(!empty($_POST['piwik-token-auth'])) $a = array_merge($a, array('token_auth' => $_POST['piwik-token-auth'])); $r =$plug->storeValues($a, $sql_object); if($r && !isset($error)) { $update_msg = _t('matomo', 'update-succesful'); } } $options = $plug->retrieveValues($sql_object); isset($options['code']) ? $code = $options['code'] : $code = ''; isset($options['url']) ? $url = $options['url'] : $url = ''; isset($options['domain_prefix']) ? $prefix_mask = 'checked' : $prefix_mask = ''; isset($options['exclude_admins']) ? $prefix_exclude = 'checked' : $prefix_exclude = ''; isset($options['display_widget']) ? $widget = 'checked' : $widget = ''; isset($options['token_auth']) ? $token = $options['token_auth'] : $token = ''; ?>