Example #1
0
<?php

declare (ticks=1);
define("NO_TEMPLATES", true);
define("NO_SESSIONS", true);
require_once dirname(__FILE__) . "/../src/prepend.inc.php";
CONTEXTS::$APPCONTEXT = APPCONTEXT::CRONJOB;
Core::Load("IO/PCNTL/interface.IProcess.php");
Core::Load("IO/PCNTL");
Core::Load("System/Independent/Shell/ShellFactory");
Core::Load("NET/SNMP");
$fname = basename($argv[0]);
$JobLauncher = new JobLauncher(dirname(__FILE__));
// DBQueueEvent - it is a daemon process so we must skepp this check
if ($JobLauncher->GetProcessName() != 'DBQueueEvent') {
    $Shell = ShellFactory::GetShellInstance();
    // Set terminal width
    putenv("COLUMNS=200");
    // Execute command
    $parent_pid = posix_getppid();
    $ps = $Shell->QueryRaw("ps x -o pid,command | grep -v {$parent_pid} |grep -v " . posix_getpid() . " | grep -v 'ps x' | grep '" . dirname(__FILE__) . "' | grep '\\-\\-{$JobLauncher->GetProcessName()}'");
    if ($ps) {
        $Logger->info("'{$fname} --{$JobLauncher->GetProcessName()}' already running. Exiting.");
        exit;
    }
}
$Logger->info(sprintf("Starting %s cronjob...", $JobLauncher->GetProcessName()));
//$JobLauncher->Launch(CONFIG::$CRON_PROCESSES_NUMBER, 180);
$JobLauncher->Launch(7, 180);
Example #2
0
		// Get license flags
		$lic_flags = @zend_loader_file_licensed();
		if (!$lic_flags)
			throw new LicensingException("Cannot retrieve license flags. Make sure that you have correct license installed.");
		else
		{
			CONTEXTS::$SECURITY_CONTEXT = SECURITY_CONTEXT::ZENDED;
			EnumFactory::CookEnumFromArray("LICENSE_FLAGS", $lic_flags);
			unset($lic_flags);
		}
	}
	else
	{
		// Include development version (all enabled).
		require_once("{$srcpath}/types/enum.LICENSE_FLAGS.php");
		CONTEXTS::$SECURITY_CONTEXT = SECURITY_CONTEXT::OPENSOURCE;
	}
	require_once("{$srcpath}/class.License.php");
	
	//			   
	// Initialize templates
	//
	if (!defined("NO_TEMPLATES"))
	{
		//
		// Initialize Smarty object
		//		
		$smarty = Core::GetSmartyInstance("SmartyExt");	

		//
		// Smarty cache
Example #3
0
<?
	session_start();
	require_once (dirname(__FILE__)."/../../../src/prepend.inc.php");
	CONTEXTS::$APPCONTEXT = APPCONTEXT::REGISTRANT_CP;
		
	// Attach notifications on registy events
	Registry::AttachClassObserver(new EmailToRegistrantObserver());
    Registry::AttachClassObserver(new OperationHistory());
    Registry::AttachClassObserver(new ManagedDNSRegistryObserver());   
    
	Core::load("Data/JSON/JSON.php");
	Core::load("UI/Paging/Paging");
	Core::load("UI/Paging/SQLPaging");
	Core::load("XMLNavigation", dirname(__FILE__));
	
	Log::Log(sprintf("Client requested: %s", $_SERVER['REQUEST_URI']), E_USER_NOTICE);
	
	define("NOW", "client/".str_replace("..","", substr(basename($_SERVER['PHP_SELF']),0, -4)));
	
	// Auth
	try
	{
		$Client = Client::Load($_SESSION['userid']);
	}
	catch(Exception $e)
	{
		
	}
	
	
	$newhash = $Crypto->Hash("{$Client->Login}:{$Client->Password}:{$_SESSION['sault']}");
Example #4
0
<?php

session_start();
include dirname(__FILE__) . "/../../src/prepend.inc.php";
// Set context
CONTEXTS::$APPCONTEXT = APPCONTEXT::ORDERWIZARD;