Ejemplo n.º 1
0
	/**
	 * @return Pap_Stats_Params
	 */
	private function getStatsParams() {
		$todayDate = $this->getDateArray(new Gpf_SqlBuilder_Filter(array("", "DP", "T")));

		$statsParams = new Pap_Stats_Params();

		$statsParams->setDateFrom(new Gpf_DateTime($todayDate["dateFrom"]));
		$statsParams->setDateTo(new Gpf_DateTime($todayDate["dateTo"]));

		if ($this->user->getType() == Pap_Application::ROLETYPE_AFFILIATE) {
			$statsParams->setAffiliateId($this->user->getId());
		}

		return $statsParams;
	}
Ejemplo n.º 2
0
 /**
  * @param Pap_Common_User $user
  * @return string
  */
 public function getDescription(Pap_Common_User $user) {
     if ($user->getType() == Pap_Application::ROLETYPE_MERCHANT) {
         $description = $this->get(Pap_Db_Table_Banners::DATA1);
     } else {
         $description = $this->get(Pap_Db_Table_Banners::DATA2);
     }
     
     $description = str_replace('$Affiliate_id', $user->getId(), $description);
     $description = str_replace('$Affiliate_refid', $user->getRefId(), $description);
     $description = str_replace('$Affiliate_name', $user->getName(), $description);
     $description = str_replace('$Affiliate_username', $user->getUserName(), $description);
     
     return $description;
 }
	private function loginFromCredentials($username, $password){
		$papAlertData = new Pap_Alert_Data();
		$userId = $papAlertData->findUserId($username, $password);

		$user = new Pap_Common_User();
		$user->setId($userId);
		$user->load();
		$roleType = $user->getType();

		Gpf_Session::create();

		$authInfo = new Gpf_Auth_InfoUsernamePassword($username, $password,
		Gpf_Db_Account::DEFAULT_ACCOUNT_ID, $roleType);
		$authUser = new Pap_AuthUser();
		$authUser->load($authInfo);
		Gpf_Session::getInstance()->save($authUser);

		$this->user = $user;
		$this->initializeApplication();
	}