Ejemplo n.º 1
0
 public function getSessionId()
 {
     $sessionId = $this->get(self::SESSION_ID);
     if ($sessionId === null || strlen(trim($sessionId)) == 0) {
         Gpf_Session::create(new Gpf_ApiModule());
     }
     return $sessionId;
 }
Ejemplo n.º 2
0
<?php
/**
 * Processes Eway request
 */

require_once '../../scripts/bootstrap.php';

Gpf_Session::create(new Pap_Tracking_ModuleBase());
	
$tracker = Eway_Tracker::getInstance();
$tracker->process();
?>
Ejemplo n.º 3
0
	public function authenticate($username, $password) {
		try {
			$userId = $this->findUserId($username, $password);
			$this->user = new Pap_Common_User();
			$this->user->setId($userId);
			$this->user->load();

			Gpf_Session::create(new Pap_Tracking_ModuleBase());
			$this->computeTimeOffset();

		} catch (Gpf_Exception $e) {
			Gpf_Log::warning($e->getMessage());
			$this->user = null;
		}
	}
Ejemplo n.º 4
0
<?php

require_once 'bootstrap.php';
Gpf_Session::create(new Pap_Tracking_ModuleBase(), null, false);

try {
    $replicator = new Pap_Features_SiteReplication_Replicator();
} catch (Gpf_Exception $e) {
    die('<h3 style="color: red;">Error: '.$e->getMessage().'</h3>');
}

if (!$replicator->shouldBeProcessed()) {
    $replicator->passthru();
    exit();
}

echo $replicator->getReplicatedContent();

?>
Ejemplo n.º 5
0
 protected function initSession()
 {
     $sessionId = null;
     if (array_key_exists('S', $_REQUEST) && $_REQUEST['S'] != '') {
         $sessionId = $_REQUEST['S'];
     }
     Gpf_Session::create($this, $sessionId);
     $this->checkApplication();
 }
Ejemplo n.º 6
0
<?php
/**
 * Upgrading from PAP3 database
 */

require_once '../../scripts/bootstrap.php';

$time1 = microtime();

$papsid = null; 
if (isset($_COOKIE['M_pap_sid'])) {
    $papsid = $_COOKIE['M_pap_sid'];
}
Gpf_Session::create(new Pap_Merchant(), $papsid);
$authuser = Gpf_Session::getAuthUser();
if (!$authuser->isLogged() || !$authuser->isExists()) {
    exit('For runnign migration, you need to be logged in your merchant panel.');
}
if (!$authuser->hasPrivilege(Pap_Privileges::TRANSACTION, Pap_Privileges::P_WRITE) ||
!$authuser->hasPrivilege(Pap_Privileges::TRANSACTION, Pap_Privileges::P_DELETE) ||
!$authuser->hasPrivilege(Pap_Privileges::AFFILIATE, Pap_Privileges::P_WRITE) ||
!$authuser->hasPrivilege(Pap_Privileges::AFFILIATE, Pap_Privileges::P_DELETE)) {
    exit('For runnign migration, you need to be logged as merchant with particular privileges.');
}

$migration = new Pap3Compatibility_Migration_UpgradeFromPap3();
$finished = false;

try {

	$migration->run();
	private function loginFromSession($session){
		Gpf_Session::create(null, $session);
		$papAlertData = new Pap_Alert_Data();
		$papAlertData->computeTimeOffset();

		$this->user = new Pap_Common_User();
		try {
			$this->user->setId(Gpf_Session::getAuthUser()->getPapUserId());
		} catch (Exception $e) {
			throw new Gpf_Rpc_SessionExpiredException();
		}
		$this->user->load();
		$this->initializeApplication();
	}
Ejemplo n.º 8
0
<?php
/**
 * Register sale/lead/action
 *
 * Sale tracking is made completely using plugins, every action is performed by a plugin
 */

require_once 'bootstrap.php';

Gpf_Session::create(new Pap_Merchant(), null, false);
	
$request = new Pap_Tracking_ActionRequest();
$tracker = Pap_Tracking_ActionTracker::getInstance();
$tracker->setAccountId($request->getAccountId());
$tracker->setRefererUrl($request->getRefererUrl());
$tracker->setVisitorId($request->getVisitorId());
$tracker->setTrackMethod(Pap_Common_Transaction::TRACKING_METHOD_3RDPARTY_COOKIE);

$action = $tracker->createAction($request->getRawActionCode());
$action->setTotalCost($request->getRawTotalCost());
$action->setOrderId($request->getRawOrderId());
$action->setProductId($request->getRawProductId());
for ($i=1; $i<=5; $i++) {
    $action->setData($i, $request->getRawExtraData($i));
}
$action->setAffiliateId($request->getRawAffiliateId());
$action->setCampaignId($request->getRawCampaignId());
$action->setCustomCommission($request->getRawCustomCommission());
$action->setStatus($request->getRawCustomStatus());
$action->setCouponCode($request->getRawCoupon());
$action->setChannelId($request->getChannelId());
Ejemplo n.º 9
0
<?php
/**
 * Perform quick task
 */

require_once 'bootstrap.php';
Gpf_Session::create();

$quickTaskRunner = new Gpf_Tasks_QuickTaskRunner();
$quickTaskRunner->executeTask();
?>