Exemplo n.º 1
0
        }
    } else {
        if (ga_dash_safe_get('ga_dash_hidden') == 'A') {
            $apikey = ga_dash_safe_get('ga_dash_apikey');
            if ($apikey) {
                update_option('ga_dash_apikey', sanitize_text_field($apikey));
            }
            $clientid = ga_dash_safe_get('ga_dash_clientid');
            if ($clientid) {
                update_option('ga_dash_clientid', sanitize_text_field($clientid));
            }
            $clientsecret = ga_dash_safe_get('ga_dash_clientsecret');
            if ($clientsecret) {
                update_option('ga_dash_clientsecret', sanitize_text_field($clientsecret));
            }
            $ga_dash_userapi = ga_dash_safe_get('ga_dash_userapi');
            update_option('ga_dash_userapi', $ga_dash_userapi);
        }
    }
}
if (isset($_REQUEST['Authorize'])) {
    $adminurl = admin_url("#ga-dash-widget");
    echo '<script> window.location="' . $adminurl . '"; </script> ';
}
if (!get_option('ga_dash_access')) {
    update_option('ga_dash_access', "manage_options");
}
if (!get_option('ga_dash_style')) {
    update_option('ga_dash_style', "blue");
}
$apikey = get_option('ga_dash_apikey');
Exemplo n.º 2
0
        if (!isset($_REQUEST['Clear']) and !isset($_REQUEST['Reset'])) {
            ?>
  
			<div class="updated"><p><strong><?php 
            _e('Options saved.', 'ga-dash');
            ?>
</strong></p></div>  
			<?php 
        }
    } else {
        if (ga_dash_safe_get('ga_dash_hidden') == 'A') {
            $apikey = ga_dash_safe_get('ga_dash_apikey');
            update_option('ga_dash_apikey', sanitize_text_field($apikey));
            $clientid = ga_dash_safe_get('ga_dash_clientid');
            update_option('ga_dash_clientid', sanitize_text_field($clientid));
            $clientsecret = ga_dash_safe_get('ga_dash_clientsecret');
            update_option('ga_dash_clientsecret', sanitize_text_field($clientsecret));
        }
    }
}
if (isset($_REQUEST['Authorize']) and get_option('ga_dash_apikey') and get_option('ga_dash_clientid') and get_option('ga_dash_clientsecret')) {
    $adminurl = admin_url("#ga-dash-widget");
    echo '<script> window.location="' . $adminurl . '"; </script> ';
} else {
    if (isset($_REQUEST['Authorize'])) {
        ?>
<div class="updated"><p><strong><?php 
        _e('API Key, Client ID or Client Secret is missing.', 'ga-dash');
        ?>
</strong></p></div>  
	<?php