Beispiel #1
0
 public function __construct()
 {
     //Extending parent construction
     parent::__construct();
     //Init class memebers
     $this->data = array();
     //Init local configurations
     if (is_readable(FCPATH . 'application/config/config.local.php')) {
         $this->config->load('config.local');
     }
     set_locale();
     //Local settings override permanent settings always if found.
     if (!is_logged_in() && $this->uri->segment(1) != 'signin' && $this->uri->segment(2) != 'pdf') {
         $redirct = $this->uri->uri_string;
         if ($this->uri->uri_string == '') {
             redirect('/signin');
         } else {
             redirect('/signin?redirect=' . $redirct);
         }
     }
     flash_message();
 }
Beispiel #2
0
    $campaign_id = mysqli_real_escape_string($mysqli, $_POST['cid']);
    $app = mysqli_real_escape_string($mysqli, $_POST['uid']);
    $email_list = $_POST['email_list'];
    $paypal_email = $_POST['paypal'];
    $total = $_POST['grand_total_val'];
    $email_list_implode = implode(',', $email_list);
}
//Set language
$q = 'SELECT login.language FROM campaigns, login WHERE campaigns.id = ' . $campaign_id . ' AND login.app = campaigns.app';
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
    while ($row = mysqli_fetch_array($r)) {
        $language = $row['language'];
    }
}
set_locale($language);
//get currency
$q = 'SELECT currency FROM apps WHERE id = ' . $app;
$r = mysqli_query($mysqli, $q);
if ($r) {
    while ($row = mysqli_fetch_array($r)) {
        $currency = $row['currency'];
    }
}
//get campaign name
$q = 'SELECT title FROM campaigns WHERE id = ' . $campaign_id;
$r = mysqli_query($mysqli, $q);
if ($r) {
    while ($row = mysqli_fetch_array($r)) {
        $title = $row['title'];
    }
Beispiel #3
0
$config = Config::current();
# Prepare the SQL interface.
$sql = SQL::current();
# Set the timezone for date(), etc.
set_timezone($config->timezone);
# Initialize connection to SQL server.
$sql->connect();
# Sanitize all input depending on magic_quotes_gpc's enabled status.
sanitize_input($_GET);
sanitize_input($_POST);
sanitize_input($_COOKIE);
sanitize_input($_REQUEST);
# Begin the session.
session();
# Set the locale for gettext.
set_locale($config->locale);
# Load the translation engine.
load_translator("chyrp", INCLUDES_DIR . "/locale/" . $config->locale . ".mo");
# Constant: PREVIEWING
# Is the user previewing a theme?
define('PREVIEWING', !ADMIN and !empty($_SESSION['theme']));
# Constant: THEME_DIR
# Absolute path to /themes/(current/previewed theme)
define('THEME_DIR', MAIN_DIR . "/themes/" . (PREVIEWING ? $_SESSION['theme'] : $config->theme));
# Constant: THEME_URL
# URL to /themes/(current/previewed theme)
define('THEME_URL', $config->chyrp_url . "/themes/" . (PREVIEWING ? $_SESSION['theme'] : $config->theme));
# Initialize the theme.
$theme = Theme::current();
# Load the Visitor.
$visitor = Visitor::current();
Beispiel #4
0
$log_dateformat = 'd.m.y H:i:s';
//	$pit_file = '.'.$_SESSION["pitmaster"].'';
//	if (file_exists($pit_file)) {
//		include('.'.$_SESSION["pitmaster"].'');
//	}
//-------------------------------------------------------------------------------------------------------------------------------------
// SESSION-Variablen überprüfen #######################################################################################################
//-------------------------------------------------------------------------------------------------------------------------------------
checkSession();
//-------------------------------------------------------------------------------------------------------------------------------------
// Sprache setzen #####################################################################################################################
//-------------------------------------------------------------------------------------------------------------------------------------
if (isset($_SESSION["locale"])) {
    set_locale($_SESSION["locale"]);
} else {
    set_locale("de_DE.utf8");
}
//-------------------------------------------------------------------------------------------------------------------------------------
// Flag für Änderungen in der config ##################################################################################################
//-------------------------------------------------------------------------------------------------------------------------------------
if (file_exists(dirname(__FILE__) . '/tmp/flag')) {
    $message .= "Flag gesetzt - Config neu einlesen\n";
    session("./conf/WLANThermo.conf");
} else {
    $message .= "Flag nicht gesetzt \n";
}
if (file_exists(dirname(__FILE__) . '/tmp/update')) {
    $message .= "Update - update läuft gerade\n";
    session("./conf/WLANThermo.conf");
    if (file_exists(dirname(__FILE__) . '/tmp/update.log')) {
        $lines = file('tmp/update.log');
Beispiel #5
0
        if (defined('PROFILING') && PROFILING) {
            echo get_statistic(1, 1, 1, 0);
        }
        exit;
    }
}
define('DATE_FORMAT', get_settings('date_format'));
define('TIME_FORMAT', get_settings('time_format'));
define('PAGE_NOT_FOUND_ID', intval(get_settings('page_not_found_id')));
if (isset($_REQUEST['onlycontent']) && 1 == $_REQUEST['onlycontent']) {
    define('ONLYCONTENT', 1);
}
function set_locale()
{
    $acp_language = empty($_SESSION['admin_language']) ? $_SESSION['user_language'] : $_SESSION['admin_language'];
    $locale = strtolower(defined('ACP') ? $acp_language : $_SESSION['user_language']);
    switch ($locale) {
        case 'de':
            @setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
            break;
        case 'ru':
            @setlocale(LC_ALL, 'ru_RU.UTF-8', 'rus_RUS.UTF-8', 'russian');
            break;
        default:
            @setlocale(LC_ALL, $locale . '_' . strtoupper($locale), $locale, '');
            break;
    }
}
set_locale();
require BASE_DIR . '/class/class.template.php';
require BASE_DIR . '/functions/func.fields.php';
Beispiel #6
0
                break;
            }
        }
        if (function_exists('bind_textdomain_codeset')) {
            bind_textdomain_codeset($domain, $charset);
        }
    }
}
$_Config['include_path'] = '';
$_Config['charset'] = 'UTF-8';
if (empty($_GET['lang'])) {
    $lang = 'auto';
} else {
    $lang = $_GET['lang'];
}
$lang = set_locale($lang, $_Config['charset']);
initlocale($lang, $_Config['charset']);
if (function_exists('date_default_timezone_set')) {
    // suppress date() warnings for PHP5.x
    date_default_timezone_set(@date_default_timezone_get());
}
if (!empty($_GET['action']) and $_GET['action'] == 'pathinfo') {
    print $_SERVER['PATH_INFO'] . '****';
    return;
}
print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Moni Setup</title>
<meta http-equiv="Content-Type" content="text/html; charset={$_Config['charset']}" /> 
<meta name='viewport' content='width=device-width' />
 function init_php($charset = false)
 {
     if ($charset === false) {
         $charset = $this->language->code();
     }
     set_locale(LC_ALL, $charset);
 }
Beispiel #8
0
    } else {
        $text_dir = $Config['text_dir'];
    }
} else {
    $text_dir = $args['d'];
}
// Formatter options
$opts = array();
if (isset($args['n'])) {
    $opts = array('filters' => array('namumarkup'));
}
// set $text_dir
$DBInfo->text_dir = $text_dir;
$Config['text_dir'] = $text_dir;
// setup locale, $lang
$lang = set_locale('ko_KR', $Config['charset']);
init_locale($lang);
$Config['lang'] = $lang;
$DBInfo->lang = $lang;
// get remain $argv array
foreach ($args as $k => $v) {
    while ($i = array_search('-' . $k, $argv)) {
        if ($i) {
            unset($argv[$i]);
        }
        if (preg_match("/^.*" . $k . ":.*\$/i", $short_opts)) {
            unset($argv[$i + 1]);
        }
    }
}
$argv = array_merge($argv);
Beispiel #9
0
/**
 * @name       Weekly summary
 * @package    MeteoLive
 * @copyright  Copyright (c) 2011-2012 NETFLIE. (http://meteolive.netflie.es)
 * @license    http://www.gnu.org/licenses/     GNU GPLv3
 * @version    $Id: weekly-summ.php 2011-10-21 15:30
 * @author     Alejandro Albarca Martinez
 */
header('Content-Type: text/html; charset=UTF-8');
header('Cache-Control: public');
header("Expires: " . date('D, j M Y H:i:s', time() + 3600 * 4) . " GMT");
header('Last-Modified: ' . date('D, j M Y H:i:s', getlastmod()) . ' GMT');
define('IN_WEB', true);
require_once 'common.php';
$xsl_filename = 'resumen-semanal.xsl';
$xml_filename = 'http://www.aemet.es/xml/municipios/localidad_' . AEMET_ID . '.xml';
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$doc->load($xsl_filename);
$xsl->importStyleSheet($doc);
set_locale($translate);
// This set_locale() function is not php built-in setlocale() function
@$xsl->setParameter('', 'hoy', utf8_encode(strftime('%a %d')));
@$xsl->setParameter('', 'manana', utf8_encode(strftime('%a %d', time() + 1 * 24 * 60 * 60)));
@$xsl->setParameter('', 'pasado', utf8_encode(strftime('%a %d', time() + 2 * 24 * 60 * 60)));
@$xsl->setParameter('', 'ppasado', utf8_encode(strftime('%a %d', time() + 3 * 24 * 60 * 60)));
@$xsl->setParameter('', 'pppasado', utf8_encode(strftime('%a %d', time() + 4 * 24 * 60 * 60)));
@$xsl->setParameter('', 'ppppasado', utf8_encode(strftime('%a %d', time() + 5 * 24 * 60 * 60)));
@$xsl->setParameter('', 'pppppasado', utf8_encode(strftime('%a %d', time() + 6 * 24 * 60 * 60)));
$doc->load($xml_filename);
echo $xsl->transformToXML($doc);
Beispiel #10
0
    $timing = new Timer();
    $options['timer'] =& $timing;
    $options['timer']->Check("load");
}
$ccache = new Cache_text('settings', array('depth' => 0));
if (!($conf = $ccache->fetch('config'))) {
    $Config = wikiConfig($Config);
    $ccache->update('config', $Config, 0, array('deps' => array('config.php', 'lib/wikiconfig.php')));
} else {
    $Config =& $conf;
}
$DBInfo = new WikiDB($Config);
if (isset($options['timer']) and is_object($options['timer'])) {
    $options['timer']->Check("load");
}
$lang = set_locale($DBInfo->lang, $DBInfo->charset);
init_locale($lang);
init_requests($options);
if (!isset($options['pagename'][0])) {
    $options['pagename'] = get_frontpage($lang);
}
$DBInfo->lang = $lang;
$DBInfo->query_prefix = '/';
if ($DBInfo->httpd_docs) {
    $httpd = new simple_server('localhost', 8080, $DBInfo->httpd_docs);
} else {
    $httpd = new simple_server('localhost', 8080, "c:\\htdocs");
}
$wiki_prefix = $httpd->wiki_prefix;
// Initialize Wiki
//$httpd->loop();
Beispiel #11
0
 if (file_exists($topdir . '/config/site.local.php')) {
     require_once $topdir . '/config/site.local.php';
 } else {
     if (isset($Config['site_local_php']) and file_exists($Config['site_local_php'])) {
         require_once $Config['site_local_php'];
     }
 }
 // load site specific config with default config variables.
 //$deps = array();
 //load_site_config(dirname(__FILE__), $_SERVER['HTTP_HOST'], $Config, $deps);
 load_cached_site_config(dirname(__FILE__), $_SERVER['HTTP_HOST'], $Config);
 $DBInfo = new WikiDB($Config);
 if (isset($options['timer']) and is_object($options['timer'])) {
     $options['timer']->Check("load");
 }
 $lang = set_locale($Config['lang'], $Config['charset'], $Config['default_lang']);
 init_locale($lang);
 init_requests($options);
 if (!isset($options['pagename'][0])) {
     $options['pagename'] = get_frontpage($lang);
 }
 $DBInfo->lang = $lang;
 $options['lang'] = $lang;
 // set the real IP address for proxy
 $remote = $_SERVER['REMOTE_ADDR'];
 $real = realIP();
 if ($remote != $real) {
     $_SERVER['OLD_REMOTE_ADDR'] = $remote;
     $_SERVER['REMOTE_ADDR'] = $real;
 }
 function _session_start($session_id = null, $id = null)
Beispiel #12
0
function start_app()
{
    ${"GLOBALS"}["jpbtsovxvpc"] = "q";
    ${"GLOBALS"}["dvhmjr"] = "r";
    global $mysqli;
    ${${"GLOBALS"}["jpbtsovxvpc"]} = "SELECT * FROM login WHERE id = " . $_SESSION["userID"];
    ${"GLOBALS"}["unxwytcgxeb"] = "r";
    ${"GLOBALS"}["cikbqrwj"] = "q";
    ${"GLOBALS"}["jbvavtd"] = "r";
    $vxyxdcqyi = "q2";
    ${${"GLOBALS"}["dvhmjr"]} = mysqli_query(${${"GLOBALS"}["mikmhj"]}, ${${"GLOBALS"}["cikbqrwj"]});
    if (${${"GLOBALS"}["unxwytcgxeb"]} && mysqli_num_rows(${${"GLOBALS"}["jbvavtd"]}) > 0) {
        ${"GLOBALS"}["wsltvbfk"] = "row";
        ${"GLOBALS"}["fmxhsmo"] = "r";
        while (${${"GLOBALS"}["wsltvbfk"]} = mysqli_fetch_array(${${"GLOBALS"}["fmxhsmo"]})) {
            ${"GLOBALS"}["yhozwenc"] = "row";
            ${"GLOBALS"}["rbkckwdexp"] = "row";
            ${"GLOBALS"}["zbetsnb"] = "row";
            $itrjspjvr = "row";
            $_SESSION["name"] = stripslashes(${$itrjspjvr}["name"]);
            $_SESSION["company"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["company"]);
            $_SESSION["email"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["username"]);
            ${"GLOBALS"}["pfgusliwy"] = "row";
            $_SESSION["password"] = stripslashes(${${"GLOBALS"}["zbetsnb"]}["password"]);
            ${"GLOBALS"}["pblnhv"] = "row";
            $_SESSION["s3_key"] = stripslashes(${${"GLOBALS"}["pfgusliwy"]}["s3_key"]);
            $_SESSION["s3_secret"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["s3_secret"]);
            $_SESSION["license"] = stripslashes(trim(${${"GLOBALS"}["xmhovsplmpbk"]}["license"]));
            $_SESSION["tied_to"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["tied_to"]);
            $_SESSION["restricted_to_app"] = stripslashes(${${"GLOBALS"}["yhozwenc"]}["app"]);
            $_SESSION["timezone"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["timezone"]);
            $_SESSION["language"] = stripslashes(${${"GLOBALS"}["pblnhv"]}["language"]);
            $_SESSION["cron"] = stripslashes(${${"GLOBALS"}["rbkckwdexp"]}["cron"]);
            $_SESSION["send_rate"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["send_rate"]);
            ${"GLOBALS"}["bsttynvop"] = "row";
            $_SESSION["ses_endpoint"] = stripslashes(${${"GLOBALS"}["bsttynvop"]}["ses_endpoint"]);
            if ($_SESSION["timezone"] == "") {
                $_SESSION["timezone"] = date_default_timezone_get();
            }
            date_default_timezone_set($_SESSION["timezone"]);
            if ($_SESSION["language"] != "en_US") {
                set_locale($_SESSION["language"]);
            }
            if ($_SESSION["tied_to"] != "") {
                ${${"GLOBALS"}["fsywgryp"]} = "SELECT s3_key, s3_secret, license, ses_endpoint FROM login WHERE id = " . $_SESSION["tied_to"];
                ${${"GLOBALS"}["sfdgfhfkq"]} = mysqli_query(${${"GLOBALS"}["mikmhj"]}, ${${"GLOBALS"}["fsywgryp"]});
                if (${${"GLOBALS"}["sfdgfhfkq"]} && mysqli_num_rows(${${"GLOBALS"}["sfdgfhfkq"]}) > 0) {
                    while (${${"GLOBALS"}["xmhovsplmpbk"]} = mysqli_fetch_array(${${"GLOBALS"}["sfdgfhfkq"]})) {
                        $hkgkiow = "row";
                        $mmwuddtsm = "row";
                        $_SESSION["s3_key"] = stripslashes(${$mmwuddtsm}["s3_key"]);
                        ${"GLOBALS"}["mgkewgwspdm"] = "row";
                        $_SESSION["s3_secret"] = stripslashes(${${"GLOBALS"}["xmhovsplmpbk"]}["s3_secret"]);
                        $_SESSION["license"] = stripslashes(${$hkgkiow}["license"]);
                        $_SESSION["ses_endpoint"] = stripslashes(${${"GLOBALS"}["mgkewgwspdm"]}["ses_endpoint"]);
                    }
                }
                $_SESSION["is_sub_user"] = true;
            } else {
                $_SESSION["is_sub_user"] = false;
                $_SESSION["tied_to"] = $_SESSION["userID"];
            }
        }
    }
    $suahtbied = "q2";
    $rgynyxehkg = "r2";
    ${$vxyxdcqyi} = "SELECT api_key FROM login ORDER BY id ASC LIMIT 1";
    ${${"GLOBALS"}["qssdejigbr"]} = mysqli_query(${${"GLOBALS"}["mikmhj"]}, ${$suahtbied});
    if (${${"GLOBALS"}["qssdejigbr"]} && mysqli_num_rows(${$rgynyxehkg}) > 0) {
        $fphyvbzxlh = "row";
        $dljrqmmo = "row";
        while (${$fphyvbzxlh} = mysqli_fetch_array(${${"GLOBALS"}["qssdejigbr"]})) {
            $_SESSION["api_key"] = ${$dljrqmmo}["api_key"];
        }
    }
    if (!isset($_COOKIE["version"])) {
        $fjkodjnd = "version_latest";
        ${$fjkodjnd} = file_get_contents_curl("http://gateway.sendy.co/version-checker");
        if (setcookie("version", ${${"GLOBALS"}["gitgoead"]}, time() + 86400, "/", COOKIE_DOMAIN)) {
            ${"GLOBALS"}["pbepczt"] = "version_latest";
            $_SESSION["version_latest"] = ${${"GLOBALS"}["pbepczt"]};
        }
    } else {
        $_SESSION["version_latest"] = $_COOKIE["version"];
    }
    if (!defined("CURRENT_VERSION")) {
        define("CURRENT_VERSION", "2.0.7");
    }
    if (isset($_SESSION[$_SESSION["license"]])) {
        if ($_SESSION[$_SESSION["license"]] != hash("sha512", $_SESSION["license"] . "2ifQ9IppVwYdOgSJoQhKOHAUK/oPwKZy")) {
            echo "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/><link rel=\"Shortcut Icon\" type=\"image/ico\" href=\"img/favicon.png\"><title>Invalid license or domain</title></head><style type=\"text/css\">body{background: #ffffff;font-family: Helvetica, Arial;}#wrapper{background: #f2f2f2;width: 300px;height: 110px;margin: -140px 0 0 -150px;position: absolute;top: 50%;left: 50%;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}p{text-align: center;line-height: 18px;font-size: 12px;padding: 0 30px;}h2{font-weight: normal;text-align: center;font-size: 20px;}a{color: #000;}a:hover{text-decoration: none;}</style><body><div id=\"wrapper\"><p><h2>Invalid license or domain</h2></p><p>Are you running Sendy on the domain you purchased it for?</p></div></body></html>";
            unlog_session();
            exit;
        }
    } else {
        ${"GLOBALS"}["fohejunds"] = "license";
        ${"GLOBALS"}["ldkfhdzyqh"] = "license";
        ${${"GLOBALS"}["fohejunds"]} = file_get_contents_curl("http://gateway.sendy.co/gateway/" . $_SERVER["HTTP_HOST"] . "/" . $_SESSION["license"] . "/" . ipaddress() . "/" . str_replace("/", "|s|", APP_PATH) . "/" . CURRENT_VERSION . "/" . time() . "/");
        $bdxxpntfdjf = "license";
        if (${${"GLOBALS"}["ldkfhdzyqh"]} == "blocked") {
            echo "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/><link rel=\"Shortcut Icon\" type=\"image/ico\" href=\"/img/favicon.png\"><title>Outgoing connections is blocked</title></head><style type=\"text/css\">body{background: #ffffff;font-family: Helvetica, Arial;}#wrapper{background: #f2f2f2;width: 330px;height: 130px;margin: -140px 0 0 -165px;position: absolute;top: 50%;left: 50%;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}p{text-align: center;line-height: 18px;font-size: 12px;padding: 0 30px;}h2{font-weight: normal;text-align: center;font-size: 20px;}a{color: #000;}a:hover{text-decoration: none;}</style><body><div id=\"wrapper\"><p><h2>Outgoing connections blocked</h2></p><p>Your server has a firewall blocking outgoing connections. Please contact your host to whitelist 'sendy.co' & 'amazonaws.com'.</p></div></body></html>";
            exit;
        } else {
            if (${${"GLOBALS"}["kmedcvmgnt"]} == "version error") {
                echo "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/><link rel=\"Shortcut Icon\" type=\"image/ico\" href=\"/img/favicon.png\"><title>Upgrade your license to 2.0</title></head><style type=\"text/css\">body{background: #ffffff;font-family: Helvetica, Arial;}#wrapper{background: #f2f2f2;width: 330px;height: 130px;margin: -140px 0 0 -165px;position: absolute;top: 50%;left: 50%;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}p{text-align: center;line-height: 18px;font-size: 12px;padding: 0 30px;}h2{font-weight: normal;text-align: center;font-size: 20px;}a{color: #4572A6;text-decoration: underline;}a:hover{text-decoration: none;}</style><body><div id=\"wrapper\"><p><h2>Upgrade your license to 2.x</h2></p><p>Your Sendy license requires an upgrade to version 2.x. Please visit <a href=\"https://sendy.co/get-updated\" target=\"_blank\">https://sendy.co/get-updated</a> to purchase an upgrade in order to proceed.</p></div></body></html>";
                exit;
            } else {
                if (${$bdxxpntfdjf}) {
                    $_SESSION[$_SESSION["license"]] = hash("sha512", $_SESSION["license"] . "2ifQ9IppVwYdOgSJoQhKOHAUK/oPwKZy");
                } else {
                    $_SESSION[$_SESSION["license"]] = "";
                }
            }
        }
    }
    session_write_close();
}
function strip_currency( $Amount )
{
set_locale();

//03.06.2015 naj - replace this with a more efficient method, cause damn.
$result = preg_replace('/[^0-9-.]/', '', $Amount);

if (empty($result))
	return 0.00;
else
	return $result;
/*
$result = '';
for ( $i = 0; $i < strlen( $Amount ); $i++ )
	{		
	$s = substr( $Amount, $i, 1 );
	if ( $s == '0' 
		|| $s == '1' 
		|| $s == '2' 
		|| $s == '3' 
		|| $s == '4' 
		|| $s == '5' 
		|| $s == '6' 
		|| $s == '7' 
		|| $s == '8' 
		|| $s == '9' 
		|| $s == '.'
		|| $s == '-'
		) 
		$result = $result.$s;
	}	 
if ( $result == '' )
	$result = 0.00;
return trim( $result );
*/
}
Beispiel #14
0
 /**
  * @dataProvider provide_test_format_datetime
  */
 public function test_format_datetime($locale, $datetime, $pattern_or_width_or_skeleton, $expected)
 {
     set_locale($locale);
     $this->assertEquals($expected, format_datetime($datetime, $pattern_or_width_or_skeleton));
 }
Beispiel #15
0
function start_app()
{
    global $mysqli;
    $wxqywuso = "r";
    $iddclumdtx = "q";
    ${${"GLOBALS"}["kypbtpqaite"]} = "SELECT * FROM login WHERE id = " . $_SESSION["userID"];
    ${$wxqywuso} = mysqli_query(${${"GLOBALS"}["zymgfktjwdk"]}, ${$iddclumdtx});
    if (${${"GLOBALS"}["lmhdiylgjh"]} && mysqli_num_rows(${${"GLOBALS"}["lmhdiylgjh"]}) > 0) {
        ${"GLOBALS"}["rwrgerkngpw"] = "r";
        ${"GLOBALS"}["loukcmxe"] = "row";
        while (${${"GLOBALS"}["loukcmxe"]} = mysqli_fetch_array(${${"GLOBALS"}["rwrgerkngpw"]})) {
            ${"GLOBALS"}["ovrlts"] = "row";
            $nkxcmgzbh = "row";
            $_SESSION["name"] = stripslashes(${${"GLOBALS"}["ovrlts"]}["name"]);
            $_SESSION["company"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["company"]);
            $_SESSION["email"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["username"]);
            $_SESSION["password"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["password"]);
            $_SESSION["s3_key"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["s3_key"]);
            $_SESSION["s3_secret"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["s3_secret"]);
            $_SESSION["api_key"] = stripslashes(${$nkxcmgzbh}["api_key"]);
            $_SESSION["license"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["license"]);
            $_SESSION["tied_to"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["tied_to"]);
            $_SESSION["restricted_to_app"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["app"]);
            ${"GLOBALS"}["mnciebhmo"] = "row";
            $_SESSION["timezone"] = stripslashes(${${"GLOBALS"}["mnciebhmo"]}["timezone"]);
            $_SESSION["language"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["language"]);
            $_SESSION["cron"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["cron"]);
            date_default_timezone_set($_SESSION["timezone"]);
            if ($_SESSION["language"] != "en_US") {
                set_locale($_SESSION["language"]);
            }
            if ($_SESSION["tied_to"] != "") {
                $gjnvssmsr = "q";
                ${"GLOBALS"}["zgihjqjiqcu"] = "mysqli";
                ${${"GLOBALS"}["kypbtpqaite"]} = "SELECT s3_key, s3_secret, license FROM login WHERE id = " . $_SESSION["tied_to"];
                ${"GLOBALS"}["zgcrosuud"] = "r";
                ${"GLOBALS"}["pkwapxhu"] = "r";
                ${${"GLOBALS"}["lmhdiylgjh"]} = mysqli_query(${${"GLOBALS"}["zgihjqjiqcu"]}, ${$gjnvssmsr});
                if (${${"GLOBALS"}["zgcrosuud"]} && mysqli_num_rows(${${"GLOBALS"}["pkwapxhu"]}) > 0) {
                    while (${${"GLOBALS"}["tkigemshnse"]} = mysqli_fetch_array(${${"GLOBALS"}["lmhdiylgjh"]})) {
                        $xdedkslgffqz = "row";
                        ${"GLOBALS"}["ekvrklvhgq"] = "row";
                        $_SESSION["s3_key"] = stripslashes(${${"GLOBALS"}["tkigemshnse"]}["s3_key"]);
                        $_SESSION["s3_secret"] = stripslashes(${${"GLOBALS"}["ekvrklvhgq"]}["s3_secret"]);
                        $_SESSION["license"] = stripslashes(${$xdedkslgffqz}["license"]);
                    }
                }
                $_SESSION["is_sub_user"] = true;
            } else {
                $_SESSION["is_sub_user"] = false;
                $_SESSION["tied_to"] = $_SESSION["userID"];
            }
        }
    }
    if (!isset($_COOKIE["version"])) {
        ${"GLOBALS"}["iepwdwkbk"] = "version_latest";
        ${${"GLOBALS"}["sdlczcc"]} = file_get_contents_curl("http://sendy.co/version-checker");
        if (setcookie("version", ${${"GLOBALS"}["iepwdwkbk"]}, time() + 86400, "/", COOKIE_DOMAIN)) {
            $_SESSION["version_latest"] = ${${"GLOBALS"}["sdlczcc"]};
        }
    } else {
        $_SESSION["version_latest"] = $_COOKIE["version"];
    }
    if (!defined("CURRENT_VERSION")) {
        define("CURRENT_VERSION", "1.1.6.3");
    }
    if (isset($_SESSION[$_SESSION["license"]])) {
        if ($_SESSION[$_SESSION["license"]] != hash("sha512", $_SESSION["license"] . "2ifQ9IppVwYdOgSJoQhKOHAUK/oPwKZy")) {
            echo "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/><link rel=\"Shortcut Icon\" type=\"image/ico\" href=\"img/favicon.png\"><title>Invalid license or domain</title></head><style type=\"text/css\">body{background: #ffffff;font-family: Helvetica, Arial;}#wrapper{background: #f2f2f2;width: 300px;height: 110px;margin: -140px 0 0 -150px;position: absolute;top: 50%;left: 50%;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}p{text-align: center;line-height: 18px;font-size: 12px;padding: 0 30px;}h2{font-weight: normal;text-align: center;font-size: 20px;}a{color: #000;}a:hover{text-decoration: none;}</style><body><div id=\"wrapper\"><p><h2>Invalid license or domain</h2></p><p>Are you running Sendy on the domain you purchased it for?</p></div></body></html>";
            unlog_session();
            exit;
        }
    } else {
        ${${"GLOBALS"}["pvlwcqd"]} = file_get_contents_curl("http://sendy.co/gateway/" . $_SERVER["HTTP_HOST"] . "/" . $_SESSION["license"] . "/" . ipaddress() . "/" . str_replace("/", "|s|", APP_PATH) . "/" . CURRENT_VERSION . "/" . time() . "/");
        $luwydjpttli = "license";
        if (${$luwydjpttli}) {
            $_SESSION[$_SESSION["license"]] = hash("sha512", $_SESSION["license"] . "2ifQ9IppVwYdOgSJoQhKOHAUK/oPwKZy");
        } else {
            $_SESSION[$_SESSION["license"]] = "";
        }
    }
    session_write_close();
}