Minor updates

This commit is contained in:
dignajar 2016-10-10 18:08:00 -03:00
parent 5f41782819
commit 365bb17ddf
2 changed files with 18 additions and 12 deletions

View File

@ -74,7 +74,7 @@ class pluginAPI extends Plugin {
// Get the authentication key
$authKey = $this->getDbField('authKey');
$url = 'https://api.bludit.com/ping?authKey='.$authKey.'&url='.DOMAIN;
$url = 'https://api.bludit.com/ping?authKey='.$authKey.'&url='.DOMAIN_BASE;
// Check if curl is installed
if( function_exists('curl_version') ) {

View File

@ -575,6 +575,15 @@ function checkPOST($args)
return true;
}
function redirect($url) {
if(!headers_sent()) {
header("Location:".$url, TRUE, 302);
exit;
}
exit('<meta http-equiv="refresh" content="0; url="'.$url.'">');
}
// ============================================================================
// MAIN
// ============================================================================
@ -585,19 +594,16 @@ if( alreadyInstalled() ) {
exit('Bludit already installed');
}
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$error = checkPOST($_POST);
if($error===true)
{
if(!headers_sent())
{
header("Location:".HTML_PATH_ROOT, TRUE, 302);
exit;
if( isset($_GET['demo']) ) {
install('demo123', '', 'UTC');
redirect(HTML_PATH_ROOT);
}
exit('<meta http-equiv="refresh" content="0; url="'.HTML_PATH_ROOT.'">');
if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
$error = checkPOST($_POST);
if($error===true) {
redirect(HTML_PATH_ROOT);
}
}