本文整理汇总了PHP中OW::getLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP OW::getLogger方法的具体用法?PHP OW::getLogger怎么用?PHP OW::getLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OW
的用法示例。
在下文中一共展示了OW::getLogger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: albumsDeleteProcess
public function albumsDeleteProcess()
{
$config = OW::getConfig();
// check if uninstall is in progress
if (!$config->getValue('photo', 'uninstall_inprogress')) {
return;
}
// check if cron queue is not busy
if ($config->getValue('photo', 'uninstall_cron_busy')) {
return;
}
$config->saveConfig('photo', 'uninstall_cron_busy', 1);
$albumService = PHOTO_BOL_PhotoAlbumService::getInstance();
try {
$albumService->deleteAlbums(self::ALBUMS_DELETE_LIMIT);
} catch (Exception $e) {
OW::getLogger()->addEntry(json_encode($e));
}
$config->saveConfig('photo', 'uninstall_cron_busy', 0);
if (!$albumService->countAlbums()) {
BOL_PluginService::getInstance()->uninstall('photo');
$config->saveConfig('photo', 'uninstall_inprogress', 0);
PHOTO_BOL_PhotoService::getInstance()->setMaintenanceMode(false);
}
}
示例2: notify
public function notify()
{
$log = OW::getLogger('ocsbillingmoneybookers');
$log->addEntry(print_r($_REQUEST, true), 'notify.data');
$log->writeLog();
if (empty($_REQUEST['custom'])) {
exit;
}
$hash = trim($_REQUEST['custom']);
$transId = !empty($_REQUEST['rec_payment_id']) ? trim($_REQUEST['rec_payment_id']) : trim($_REQUEST['mb_transaction_id']);
$status = trim($_REQUEST['status']);
$amount = !empty($_REQUEST['amount']) ? $_REQUEST['amount'] : $_REQUEST['rec_amount'];
$sig = trim($_REQUEST['md5sig']);
$billingService = BOL_BillingService::getInstance();
$gwKey = OCSBILLINGMONEYBOOKERS_CLASS_MoneybookersAdapter::GATEWAY_KEY;
$merchantId = $billingService->getGatewayConfigValue($gwKey, 'merchantId');
$secret = $billingService->getGatewayConfigValue($gwKey, 'secret');
$slug = strtoupper(md5($merchantId . $_REQUEST['transaction_id'] . strtoupper(md5($secret)) . $_REQUEST['mb_amount'] . $_REQUEST['mb_currency'] . $status));
if ($slug !== $sig) {
exit("SIG_MISMATCH");
}
if ($status == '2') {
$sale = $billingService->getSaleByHash($hash);
if (!$sale || !mb_strlen($transId)) {
exit("NOT_FOUND");
}
$adapter = new OCSBILLINGMONEYBOOKERS_CLASS_MoneybookersAdapter();
if (empty($_REQUEST['rec_payment_id'])) {
if (!$billingService->saleDelivered($transId, $sale->gatewayId)) {
$sale->transactionUid = $transId;
if ($billingService->verifySale($adapter, $sale)) {
$sale = $billingService->getSaleById($sale->id);
$productAdapter = $billingService->getProductAdapter($sale->entityKey);
if ($productAdapter) {
$billingService->deliverSale($productAdapter, $sale);
}
}
}
} else {
$rebillTransId = $transId;
$gateway = $billingService->findGatewayByKey($gwKey);
if ($billingService->saleDelivered($rebillTransId, $gateway->id)) {
exit("DELIVERED");
}
$rebillSaleId = $billingService->registerRebillSale($adapter, $sale, $rebillTransId);
if ($rebillSaleId) {
$rebillSale = $billingService->getSaleById($rebillSaleId);
$productAdapter = $billingService->getProductAdapter($rebillSale->entityKey);
if ($productAdapter) {
$billingService->deliverSale($productAdapter, $rebillSale);
}
}
}
}
exit("REGISTERED");
}
示例3: postback
public function postback()
{
$logger = OW::getLogger('ocsbillingicepay');
$logger->addEntry(print_r($_REQUEST, true), 'postback.data-array');
if (empty($_REQUEST['Reference'])) {
$logger->addEntry("Empty reference", 'postback.reference');
$logger->writeLog();
exit;
}
require_once OW::getPluginManager()->getPlugin('ocsbillingicepay')->getClassesDir() . 'api' . DS . 'icepay_api_basic.php';
$gwKey = OCSBILLINGICEPAY_CLASS_IcepayAdapter::GATEWAY_KEY;
$billingService = BOL_BillingService::getInstance();
$merchantId = $billingService->getGatewayConfigValue($gwKey, 'merchantId');
$encryptionCode = $billingService->getGatewayConfigValue($gwKey, 'encryptionCode');
$icepay = new Icepay_Postback();
$icepay->setMerchantID($merchantId)->setSecretCode($encryptionCode)->doIPCheck();
try {
if ($icepay->validate()) {
$hash = trim($_REQUEST['Reference']);
$transId = trim($_REQUEST['TransactionID']);
$sale = $billingService->getSaleByHash($hash);
if (!$sale || !mb_strlen($transId)) {
$logger->addEntry("Sale not found", 'postback.sale');
$logger->writeLog();
exit;
}
$adapter = new OCSBILLINGICEPAY_CLASS_IcepayAdapter();
if (!$billingService->saleDelivered($transId, $sale->gatewayId)) {
$sale->transactionUid = $transId;
if ($billingService->verifySale($adapter, $sale)) {
$sale = $billingService->getSaleById($sale->id);
$productAdapter = $billingService->getProductAdapter($sale->entityKey);
if ($productAdapter) {
$billingService->deliverSale($productAdapter, $sale);
}
}
}
$logger->addEntry("Validated!", 'validate-status');
} else {
$logger->addEntry("Unable to validate postback data", 'validate-status');
}
} catch (Exception $e) {
$logger->addEntry($e->getMessage(), 'validate-exception');
}
$logger->writeLog();
exit;
}
示例4: postback
public function postback()
{
$logger = OW::getLogger('billingccbill');
$logger->addEntry(print_r($_POST, true), 'postback.data-array');
$logger->writeLog();
$clientAccnum = $_POST['clientAccnum'];
$clientSubacc = $_POST['clientSubacc'];
$amount = $_POST['initialPrice'] ? $_POST['initialPrice'] : $_POST['recurringPrice'];
$saleHash = $_POST['custom'];
$transId = $_POST['subscription_id'];
$digest = $_POST['responseDigest'];
if (!mb_strlen($saleHash) || !mb_strlen($transId)) {
exit;
}
$billingService = BOL_BillingService::getInstance();
$adapter = new BILLINGCCBILL_CLASS_CcbillAdapter();
$sale = $billingService->getSaleByHash($saleHash);
if (!$sale) {
exit;
}
if ($amount != $sale->totalAmount) {
$logger->addEntry("Wrong amount: " . $amount, 'postback.amount-mismatch');
$logger->writeLog();
exit;
}
if ($billingService->getGatewayConfigValue(BILLINGCCBILL_CLASS_CcbillAdapter::GATEWAY_KEY, 'clientAccnum') != $clientAccnum) {
$logger->addEntry("Wrong CCBill account: " . $clientAccnum, 'postback.account-mismatch');
$logger->writeLog();
exit;
}
if ($adapter->transactionApproved($clientAccnum, $clientSubacc, $transId, $digest)) {
if ($sale->status != BOL_BillingSaleDao::STATUS_DELIVERED) {
$sale->transactionUid = $transId;
if ($billingService->verifySale($adapter, $sale)) {
$sale = $billingService->getSaleById($sale->id);
$productAdapter = $billingService->getProductAdapter($sale->entityKey);
if ($productAdapter) {
$billingService->deliverSale($productAdapter, $sale);
}
}
}
}
exit;
}
示例5: uplaoder
public function uplaoder()
{
OW::getLogger()->addEntry("uploader: started");
OW::getLogger()->addEntry("uploader ( POST ): " . json_encode($_POST));
OW::getLogger()->addEntry("uploader ( FILES ): " . json_encode($_FILES));
OW::getLogger()->addEntry("uploader ( REQUEST ): " . json_encode($_REQUEST));
OW::getLogger()->addEntry("uploader ( SERVER ): " . json_encode($_SERVER));
$userFilesDir = OW::getPluginManager()->getPlugin("base")->getUserFilesDir();
$inputFile = fopen("php://input", "r");
@unlink($userFilesDir . "api-uploaded.jpg");
$outputFile = fopen($userFilesDir . "api-uploaded.jpg", "a");
while (!feof($inputFile)) {
$data = fread($inputFile, 1024);
fwrite($outputFile, $data, 1024);
}
fclose($inputFile);
fclose($outputFile);
$this->assign("uploaded", true);
}
示例6: verifySale
public function verifySale($params)
{
if (!SKANDROID_ABOL_Service::getInstance()->isBillingEnabled()) {
throw new ApiResponseErrorException();
}
if (empty($params['purchase'])) {
throw new ApiResponseErrorException();
}
if (empty($params['signature'])) {
throw new ApiResponseErrorException();
}
$logger = OW::getLogger('skadateandroid');
$logger->addEntry(print_r($params, true), ' purchase data');
$valid = $this->verifyMarketInApp($params['purchase'], $params['signature'], trim(OW::getConfig()->getValue('skandroid', 'public_key')));
$purchase = json_decode($params['purchase'], true);
if (empty($purchase['developerPayload'])) {
throw new ApiResponseErrorException();
}
$developerPayload = json_decode(base64_decode($purchase['developerPayload']), true);
$userId = !empty($developerPayload['userId']) ? $developerPayload['userId'] : null;
$purchaseProductId = !empty($purchase['productId']) ? $purchase['productId'] : null;
$payloadProductId = !empty($developerPayload['productId']) ? $developerPayload['productId'] : null;
$purchaseHash = $this->generateHash(OW::getUser()->getId(), $purchaseProductId);
$payloadHash = !empty($developerPayload['hash']) ? $developerPayload['hash'] : null;
$logger->addEntry(print_r($params['purchase'], true), 'purchase.validation');
$logger->writeLog();
$this->assign('error', null);
if (!isset($userId) || OW::getUser()->getId() != $userId) {
$this->assign('registered', false);
$this->assign('error', 'Undefined user id');
return;
}
if (!isset($valid)) {
$this->assign('registered', false);
$this->assign('error', 'Purchase validation failed');
return;
}
if (!isset($valid)) {
$this->assign('registered', false);
$this->assign('error', 'Purchase validation failed');
return;
}
if (!isset($purchaseProductId) || !isset($payloadProductId) || $payloadProductId != $purchaseProductId) {
$this->assign('registered', false);
$this->assign('error', 'Payload validation faild. Invalid product Id');
return;
}
if (!isset($purchaseHash) || !isset($payloadHash) || $payloadHash != $purchaseHash) {
$this->assign('registered', false);
$this->assign('error', 'Payload validation faild.');
return;
}
$billingService = BOL_BillingService::getInstance();
$service = SKANDROID_ABOL_Service::getInstance();
$orderId = isset($purchase['orderId']) ? $purchase['orderId'] : null;
$productId = isset($purchase['productId']) ? $purchase['productId'] : null;
$purchaseTime = isset($purchase['purchaseTime']) ? $purchase['purchaseTime'] : null;
$sale = $billingService->getSaleByGatewayTransactionId(SKANDROID_ACLASS_InAppPurchaseAdapter::GATEWAY_KEY, md5($orderId));
if ($sale) {
// sale already registered
$this->assign('registered', false);
$this->assign('error', 'Sale already registered');
return;
}
$product = $service->findProductByItunesProductId($productId);
if (!$product) {
$this->assign('registered', false);
$this->assign('error', 'Product not found');
} else {
// sale object
$sale = new BOL_BillingSale();
$sale->pluginKey = $product['pluginKey'];
$sale->entityDescription = $product['entityDescription'];
$sale->entityKey = $product['entityKey'];
$sale->entityId = $product['entityId'];
$sale->price = $product['price'];
$sale->period = $product['period'];
$sale->userId = $userId;
$sale->recurring = $product['recurring'];
$saleId = $billingService->initSale($sale, SKANDROID_ACLASS_InAppPurchaseAdapter::GATEWAY_KEY);
$sale = $billingService->getSaleById($saleId);
$sale->timeStamp = $purchaseTime / 1000;
$sale->transactionUid = md5($orderId);
$sale->extraData = json_encode(array('orderId' => $orderId, 'extra' => $purchase['developerPayload']));
BOL_BillingSaleDao::getInstance()->save($sale);
$productAdapter = null;
switch ($sale->pluginKey) {
case 'membership':
$productAdapter = new MEMBERSHIP_CLASS_MembershipPlanProductAdapter();
break;
case 'usercredits':
$productAdapter = new USERCREDITS_CLASS_UserCreditsPackProductAdapter();
break;
}
$billingService->deliverSale($productAdapter, $sale);
$this->assign('registered', true);
}
return;
}
示例7: getDataLinkServiceResponse
/**
* Sends request to DataLink Service
*
* @param array $transactionTypes
* @param boolean $testMode
* @return array
*/
public function getDataLinkServiceResponse(array $transactionTypes, $testMode = false)
{
$requestStr = self::DATALINK_URL . '?startTime=' . $this->getDateFormat(time() - 24 * 60 * 60) . '&endTime=' . $this->getDateFormat(time()) . '&transactionTypes=' . implode(',', $transactionTypes) . '&clientAccnum=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'clientAccnum') . '&clientSubacc=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'clientSubacc') . '&username=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'datalinkUsername') . '&password=' . $this->billingService->getGatewayConfigValue(self::GATEWAY_KEY, 'datalinkPassword') . ($testMode ? '&testMode=1' : '');
$logger = OW::getLogger('billingccbill');
$logger->addEntry($requestStr, 'datalink.request-string');
$handle = curl_init($requestStr);
ob_start();
curl_exec($handle);
$string = ob_get_contents();
ob_end_clean();
$logger->addEntry($string, 'datalink.response-string');
$responseArr = array();
if (!curl_errno($handle)) {
$responseArr = $this->parseDatalinkResponse($string);
$logger->addEntry(print_r($responseArr, true), 'datalink.response-array');
}
curl_close($handle);
$logger->writeLog();
return $responseArr;
}
示例8: getThemeXmlInfo
private function getThemeXmlInfo($themeXmlPath)
{
if (!file_exists($themeXmlPath)) {
OW::getLogger()->addEntry(__CLASS__ . "::" . __FUNCTION__ . " - `" . $themeXmlPath . "` not found");
return null;
}
//$propList = array("key", "developerKey", "name", "description", "license", "author", "build", "copyright", "licenseUrl");
$propList = array("key", "name", "description");
$xmlInfo = UTIL_String::xmlToArray(file_get_contents($themeXmlPath));
//TODO refactor
if (empty($xmlInfo["developerKey"])) {
$xmlInfo["developerKey"] = null;
}
if (empty($xmlInfo["build"])) {
$xmlInfo["build"] = 0;
}
if (!$xmlInfo) {
OW::getLogger()->addEntry(__CLASS__ . "::" . __FUNCTION__ . " - invalid `" . $themeXmlPath . "`");
return null;
}
foreach ($propList as $prop) {
if (empty($xmlInfo[$prop])) {
OW::getLogger()->addEntry(__CLASS__ . "::" . __FUNCTION__ . " - in `" . $themeXmlPath . "` property `" . $prop . "` not found");
return null;
}
}
$sidebarPositions = array(BOL_ThemeDao::VALUE_SIDEBAR_POSITION_LEFT, BOL_ThemeDao::VALUE_SIDEBAR_POSITION_RIGHT, BOL_ThemeDao::VALUE_SIDEBAR_POSITION_NONE);
if (empty($xmlInfo["sidebarPosition"]) || !in_array($xmlInfo["sidebarPosition"], $sidebarPositions)) {
$xmlInfo["sidebarPosition"] = BOL_ThemeDao::VALUE_SIDEBAR_POSITION_NONE;
}
$xmlInfo["build"] = (int) $xmlInfo["build"];
return $xmlInfo;
}
示例9: verifySale
public function verifySale($params)
{
if (empty($params['receipt'])) {
throw new ApiResponseErrorException();
}
$userId = !empty($params['userId']) ? $params['userId'] : null;
$receipt = trim($params['receipt']);
$logger = OW::getLogger('skadateios');
$logger->addEntry(print_r($params, true), 'receipt.data');
$configs = OW::getConfig()->getValues("skadateios");
$validator = new SKADATEIOS_ACLASS_ItunesReceiptValidator($configs["itunes_mode"], $configs["itunes_secret"]);
$data = $validator->validateReceipt($receipt);
$logger->addEntry(print_r($data, true), 'receipt.validation');
$logger->writeLog();
if (!isset($data['status'])) {
$this->assign('registered', false);
$this->assign('error', 'Receipt validation failed');
return;
}
if ($data['status'] == 0) {
$environment = $data['environment'];
$bundleId = $data['receipt']['bundle_id'];
$inAppData = $data['receipt']['in_app'];
foreach ($inAppData as $inApp) {
$productId = $inApp['product_id'];
$transactionId = $inApp['transaction_id'];
$billingService = BOL_BillingService::getInstance();
$service = SKADATEIOS_ABOL_Service::getInstance();
$sale = $billingService->getSaleByGatewayTransactionId(SKADATEIOS_ACLASS_InAppPurchaseAdapter::GATEWAY_KEY, $transactionId);
if ($sale) {
continue;
}
$originalTransactionId = isset($inApp['original_transaction_id']) ? $inApp['original_transaction_id'] : null;
if ($originalTransactionId) {
$originalSale = $billingService->getSaleByGatewayTransactionId(SKADATEIOS_ACLASS_InAppPurchaseAdapter::GATEWAY_KEY, $originalTransactionId);
if ($originalSale && !$userId) {
$userId = $originalSale->userId;
}
}
$purchaseTime = $inApp['purchase_date_ms'] / 1000;
$product = $service->findProductByItunesProductId($productId);
if (!$product) {
$this->assign('registered', false);
$this->assign('error', 'Product not found');
} else {
// sale object
$sale = new BOL_BillingSale();
$sale->pluginKey = $product['pluginKey'];
$sale->entityDescription = $product['entityDescription'];
$sale->entityKey = $product['entityKey'];
$sale->entityId = $product['entityId'];
$sale->price = $product['price'];
$sale->period = $product['period'];
$sale->userId = $userId;
$sale->recurring = $product['recurring'];
$saleId = $billingService->initSale($sale, SKADATEIOS_ACLASS_InAppPurchaseAdapter::GATEWAY_KEY);
$sale = $billingService->getSaleById($saleId);
$sale->timeStamp = $purchaseTime;
$sale->transactionUid = $transactionId;
BOL_BillingSaleDao::getInstance()->save($sale);
$productAdapter = null;
switch ($sale->pluginKey) {
case 'membership':
$productAdapter = new MEMBERSHIP_CLASS_MembershipPlanProductAdapter();
break;
case 'usercredits':
$productAdapter = new USERCREDITS_CLASS_UserCreditsPackProductAdapter();
break;
}
$billingService->deliverSale($productAdapter, $sale);
$this->assign('registered', true);
}
return;
}
}
$this->assign('registered', false);
$this->assign('error', 'Receipt validation failed');
}
示例10: catch
*
* - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
OW::getNavigation()->addMenuItem(OW_Navigation::MAIN, 'view_photo_list', 'photo', 'photo', OW_Navigation::VISIBLE_FOR_ALL);
OW::getNavigation()->addMenuItem(OW_Navigation::MOBILE_TOP, 'photo_list_index', 'photo', 'mobile_photo', OW_Navigation::VISIBLE_FOR_ALL);
$widgetService = BOL_ComponentAdminService::getInstance();
try {
$widget = $widgetService->addWidget('PHOTO_CMP_PhotoListWidget', false);
$placeWidget = $widgetService->addWidgetToPlace($widget, BOL_ComponentAdminService::PLACE_INDEX);
$widgetService->addWidgetToPosition($placeWidget, BOL_ComponentService::SECTION_LEFT);
} catch (Exception $e) {
OW::getLogger()->addEntry(json_encode($e));
}
try {
$widget = $widgetService->addWidget('PHOTO_CMP_UserPhotoAlbumsWidget', false);
$placeWidget = $widgetService->addWidgetToPlace($widget, BOL_ComponentAdminService::PLACE_PROFILE);
$widgetService->addWidgetToPosition($placeWidget, BOL_ComponentService::SECTION_LEFT);
} catch (Exception $e) {
OW::getLogger()->addEntry(json_encode($e));
}
require_once dirname(__FILE__) . DS . 'classes' . DS . 'credits.php';
$credits = new PHOTO_CLASS_Credits();
$credits->triggerCreditActionsAdd();
示例11: checkUpdates
/**
* Retrieves update information for all plugins and themes.
*
* @return bool
*/
public function checkUpdates()
{
$requestArray = array("platform" => array(self::URI_VAR_BUILD => OW::getConfig()->getValue("base", "soft_build")), "items" => array());
$plugins = $this->pluginService->findRegularPlugins();
/* @var $plugin BOL_Plugin */
foreach ($plugins as $plugin) {
$requestArray["items"][] = array(self::URI_VAR_KEY => $plugin->getKey(), self::URI_VAR_DEV_KEY => $plugin->getDeveloperKey(), self::URI_VAR_BUILD => $plugin->getBuild(), self::URI_VAR_LICENSE_KEY => $plugin->getLicenseKey(), self::URI_VAR_ITEM_TYPE => self::URI_VAR_ITEM_TYPE_VAL_PLUGIN);
}
//check all manual updates before reading builds in DB
$this->themeService->checkManualUpdates();
$themes = $this->themeService->findAllThemes();
/* @var $dto BOL_Theme */
foreach ($themes as $dto) {
$requestArray["items"][] = array(self::URI_VAR_KEY => $dto->getKey(), self::URI_VAR_DEV_KEY => $dto->getDeveloperKey(), self::URI_VAR_BUILD => $dto->getBuild(), self::URI_VAR_LICENSE_KEY => $dto->getLicenseKey(), self::URI_VAR_ITEM_TYPE => self::URI_VAR_ITEM_TYPE_VAL_THEME);
}
$data = $this->triggerEventBeforeRequest();
$data["info"] = json_encode($requestArray);
$params = new UTIL_HttpClientParams();
$params->addParams($data);
$response = UTIL_HttpClient::post($this->getStorageUrl(self::URI_CHECK_ITEMS_FOR_UPDATE), $params);
if (!$response || $response->getStatusCode() != UTIL_HttpClient::HTTP_STATUS_OK) {
OW::getLogger()->addEntry(__CLASS__ . "::" . __METHOD__ . "#" . __LINE__ . " storage request status is not OK", "core.update");
return false;
}
$resultArray = array();
if ($response->getBody()) {
$resultArray = json_decode($response->getBody(), true);
}
if (empty($resultArray) || !is_array($resultArray)) {
OW::getLogger()->addEntry(__CLASS__ . "::" . __METHOD__ . "#" . __LINE__ . " remote request returned empty result", "core.update");
return false;
}
if (!empty($resultArray["update"])) {
if (!empty($resultArray["update"]["platform"]) && (bool) $resultArray["update"]["platform"]) {
OW::getConfig()->saveConfig("base", "update_soft", 1);
}
if (!empty($resultArray["update"]["items"])) {
$this->updateItemsUpdateStatus($resultArray["update"]["items"]);
}
}
$items = !empty($resultArray["invalidLicense"]) ? $resultArray["invalidLicense"] : array();
$this->updateItemsLicenseStatus($items);
return true;
}
示例12: notify
public function notify()
{
$logger = OW::getLogger('billingpaypal');
$logger->addEntry(print_r($_POST, true), 'ipn.data-array');
$logger->writeLog();
if (empty($_POST['custom'])) {
exit;
}
$hash = trim($_POST['custom']);
$amount = !empty($_POST['mc_gross']) ? $_POST['mc_gross'] : $_POST['payment_gross'];
$transactionId = trim($_POST['txn_id']);
$status = mb_strtoupper(trim($_POST['payment_status']));
$currency = trim($_POST['mc_currency']);
$transactionType = trim($_POST['txn_type']);
$business = trim($_POST['business']);
$billingService = BOL_BillingService::getInstance();
$adapter = new BILLINGPAYPAL_CLASS_PaypalAdapter();
if ($adapter->isVerified($_POST)) {
$sale = $billingService->getSaleByHash($hash);
if (!$sale || !strlen($transactionId)) {
exit;
}
if ($amount != $sale->totalAmount) {
$logger->addEntry("Wrong amount: " . $amount, 'notify.amount-mismatch');
$logger->writeLog();
exit;
}
if ($billingService->getGatewayConfigValue(BILLINGPAYPAL_CLASS_PaypalAdapter::GATEWAY_KEY, 'business') != $business) {
$logger->addEntry("Wrong PayPal account: " . $business, 'notify.account-mismatch');
$logger->writeLog();
exit;
}
if ($status == 'COMPLETED') {
switch ($transactionType) {
case 'web_accept':
case 'subscr_payment':
if (!$billingService->saleDelivered($transactionId, $sale->gatewayId)) {
$sale->transactionUid = $transactionId;
if ($billingService->verifySale($adapter, $sale)) {
$sale = $billingService->getSaleById($sale->id);
$productAdapter = $billingService->getProductAdapter($sale->entityKey);
if ($productAdapter) {
$billingService->deliverSale($productAdapter, $sale);
}
}
}
break;
case 'recurring_payment':
$rebillTransId = $_REQUEST['recurring_payment_id'];
$gateway = $billingService->findGatewayByKey(BILLINGPAYPAL_CLASS_PaypalAdapter::GATEWAY_KEY);
if ($billingService->saleDelivered($rebillTransId, $gateway->id)) {
exit;
}
$rebillSaleId = $billingService->registerRebillSale($adapter, $sale, $rebillTransId);
if ($rebillSaleId) {
$rebillSale = $billingService->getSaleById($rebillSaleId);
$productAdapter = $billingService->getProductAdapter($rebillSale->entityKey);
if ($productAdapter) {
$billingService->deliverSale($productAdapter, $rebillSale);
}
}
break;
}
}
} else {
exit;
}
}
示例13: skadate_on_plugin_activate
function skadate_on_plugin_activate(OW_Event $event)
{
$params = $event->getParams();
if (in_array($params['pluginKey'], array('skadateios', 'skandroid'))) {
$widgetService = BOL_ComponentAdminService::getInstance();
$widget = $widgetService->addWidget('SKADATE_CMP_MobileExperience', false);
try {
$placeWidget = $widgetService->addWidgetToPlace($widget, BOL_ComponentAdminService::PLACE_INDEX);
$widgetService->addWidgetToPosition($placeWidget, BOL_ComponentService::SECTION_RIGHT);
$placeWidget = $widgetService->addWidgetToPlace($widget, BOL_ComponentAdminService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($placeWidget, BOL_ComponentService::SECTION_RIGHT);
} catch (Exception $e) {
OW::getLogger('skadate.activate_widget_mobile_experience')->addEntry(json_encode($e));
}
}
}
示例14: process
/**
* Updates user settings configuration
*
* @return boolean
*/
public function process()
{
$values = $this->getValues();
$config = OW::getConfig();
$config->saveConfig('base', 'avatar_size', $values['avatarSize']);
$config->saveConfig('base', 'avatar_big_size', $values['bigAvatarSize']);
$config->saveConfig('base', 'display_name_question', $values['displayName']);
$config->saveConfig('base', 'join_display_photo_upload', $values['join_display_photo_upload']);
$config->saveConfig('base', 'join_display_terms_of_use', $values['join_display_terms_of_use']);
$config->saveConfig('base', 'avatar_max_upload_size', round((double) $values['avatar_max_upload_size'], 2));
if (!defined('OW_PLUGIN_XP')) {
$config->saveConfig('base', 'confirm_email', $values['confirmEmail']);
}
$avatarService = BOL_AvatarService::getInstance();
if (isset($_FILES['avatar']['tmp_name'])) {
$avatarService->setCustomDefaultAvatar(1, $_FILES['avatar']);
}
if (isset($_FILES['bigAvatar']['tmp_name'])) {
$avatarService->setCustomDefaultAvatar(2, $_FILES['bigAvatar']);
}
// privacy
$config->saveConfig('base', 'who_can_join', (int) $values['who_can_join']);
$config->saveConfig('base', 'who_can_invite', (int) $values['who_can_invite']);
$config->saveConfig('base', 'mandatory_user_approve', (bool) $values['user_approve'] ? 1 : 0);
if ((int) $values['guests_can_view'] == 3) {
$adminEmail = OW::getUser()->getEmail();
$senderMail = $config->getValue('base', 'site_email');
$mail = OW::getMailer()->createMail();
$mail->addRecipientEmail($adminEmail);
$mail->setSender($senderMail);
$mail->setSenderSuffix(false);
$mail->setSubject(OW::getLanguage()->text('admin', 'site_password_letter_subject', array()));
$mail->setTextContent(OW::getLanguage()->text('admin', 'site_password_letter_template_text', array('password' => $values['password'])));
$mail->setHtmlContent(OW::getLanguage()->text('admin', 'site_password_letter_template_html', array('password' => $values['password'])));
try {
OW::getMailer()->send($mail);
} catch (Exception $e) {
$logger = OW::getLogger('admin.send_password_message');
$logger->addEntry($e->getMessage());
$logger->writeLog();
}
$values['password'] = crypt($values['password'], OW_PASSWORD_SALT);
$config->saveConfig('base', 'guests_can_view_password', $values['password']);
} else {
$config->saveConfig('base', 'guests_can_view_password', null);
}
$config->saveConfig('base', 'guests_can_view', (int) $values['guests_can_view']);
// profile questions
isset($_POST['user_view_presentation']) ? $config->saveConfig('base', 'user_view_presentation', 'tabs') : $config->saveConfig('base', 'user_view_presentation', 'table');
return array('result' => true);
}
示例15: sendWinkNotification
public function sendWinkNotification($userId, $partnerId)
{
if (empty($userId) || empty($partnerId) || ($user = BOL_UserService::getInstance()->findUserById($userId)) === null || ($partner = BOL_UserService::getInstance()->findUserById($partnerId)) === null) {
return;
}
$avatarUrls = BOL_AvatarService::getInstance()->getAvatarsUrlList(array($userId, $partnerId));
$displayNames = BOL_UserService::getInstance()->getDisplayNamesForList(array($userId, $partnerId));
$subjectKey = 'wink_back_email_subject';
$subjectArr = array('displayname' => $displayNames[$userId]);
$textContentKey = 'wink_back_email_text_content';
$htmlContentKey = 'wink_back_email_html_content';
$contentArr = array('src' => $avatarUrls[$userId], 'displayname' => $displayNames[$userId], 'url' => OW_URL_HOME . 'user/' . $user->getUsername(), 'conversation_url' => OW_URL_HOME . 'messages');
$language = OW::getLanguage();
$mail = OW::getMailer()->createMail();
$mail->addRecipientEmail($partner->getEmail());
$mail->setSubject($language->text('winks', $subjectKey, $subjectArr));
$mail->setTextContent($language->text('winks', $textContentKey, $contentArr));
$mail->setHtmlContent($language->text('winks', $htmlContentKey, $contentArr));
try {
OW::getMailer()->send($mail);
} catch (Exception $e) {
OW::getLogger('wink.send_notify')->addEntry(json_encode($e));
}
}