BxAclModule.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup PaidLevels Paid Levels
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxDolAcl');
  12. define('BX_ACL_LICENSE_TYPE_SINGLE', 'single'); //--- one-time payment license
  13. define('BX_ACL_LICENSE_TYPE_RECURRING', 'recurring'); //--- recurring payment license
  14. class BxAclModule extends BxDolModule
  15. {
  16. /**
  17. * Constructor
  18. */
  19. function __construct($aModule)
  20. {
  21. parent::__construct($aModule);
  22. $this->_oConfig->init($this->_oDb);
  23. }
  24. /**
  25. * ACTION METHODS
  26. */
  27. public function actionCheckName()
  28. {
  29. $CNF = &$this->_oConfig->CNF;
  30. $sName = bx_process_input(bx_get('name'));
  31. if(empty($sName))
  32. return echoJson(array());
  33. $sResult = '';
  34. $iId = (int)bx_get('id');
  35. if(!empty($iId)) {
  36. $aPrice = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iId));
  37. if(strcmp($sName, $aPrice[$CNF['FIELD_NAME']]) == 0)
  38. $sResult = $sName;
  39. }
  40. echoJson(array(
  41. 'name' => !empty($sResult) ? $sResult : $this->_oConfig->getPriceName($sName)
  42. ));
  43. }
  44. /**
  45. * SERVICE METHODS
  46. */
  47. public function serviceGetSafeServices()
  48. {
  49. return array (
  50. 'GetViewUrl' => '',
  51. 'GetBlockView' => '',
  52. 'GetMembershipActions' => '',
  53. );
  54. }
  55. /**
  56. * @page service Service Calls
  57. * @section bx_acl Paid Levels
  58. * @subsection bx_acl-other Other
  59. * @subsubsection bx_acl-get_view_url get_view_url
  60. *
  61. * @code bx_srv('bx_acl', 'get_view_url', [...]); @endcode
  62. *
  63. * Get page URL with membership levels list.
  64. *
  65. * @return string with page URL.
  66. *
  67. * @see BxAclModule::serviceGetViewUrl
  68. */
  69. /**
  70. * @ref bx_acl-get_view_url "get_view_url"
  71. */
  72. public function serviceGetViewUrl()
  73. {
  74. $CNF = &$this->_oConfig->CNF;
  75. return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
  76. }
  77. /**
  78. * @page service Service Calls
  79. * @section bx_acl Paid Levels
  80. * @subsection bx_acl-page_blocks Page Blocks
  81. * @subsubsection bx_acl-get_block_view get_block_view
  82. *
  83. * @code bx_srv('bx_acl', 'get_block_view', [...]); @endcode
  84. *
  85. * Get page block with a list of available ACL levels to purchase or get for Free. List is represented as table.
  86. *
  87. * @return HTML string with a list of ACL levels to display on the site, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error empty string is returned.
  88. *
  89. * @see BxAclModule::serviceGetBlockView
  90. */
  91. /**
  92. * @ref bx_acl-get_block_view "get_block_view"
  93. */
  94. public function serviceGetBlockView()
  95. {
  96. bx_require_authentication(false, false, $this->serviceGetViewUrl());
  97. $sGrid = $this->_oConfig->getGridObject('view');
  98. $oGrid = BxDolGrid::getObjectInstance($sGrid);
  99. if(!$oGrid)
  100. return '';
  101. $this->_oTemplate->addCss(array('view.css'));
  102. return array(
  103. 'content' => $oGrid->getCode()
  104. );
  105. }
  106. /**
  107. * @page service Service Calls
  108. * @section bx_acl Paid Levels
  109. * @subsection bx_acl-page_blocks Page Blocks
  110. * @subsubsection bx_acl-get_membership_actions get_membership_actions
  111. *
  112. * @code bx_srv('bx_acl', 'get_membership_actions', [...]); @endcode
  113. *
  114. * Get page block with a list of current membership level's actions.
  115. *
  116. * @return HTML string with a list of actions to display on the site, all necessary CSS and JS files are automatically added to the HEAD section of the site HTML. On error empty string is returned.
  117. *
  118. * @see BxAclModule::serviceGetMembershipActions
  119. */
  120. /**
  121. * @ref bx_acl-get_membership_actions "get_membership_actions"
  122. */
  123. public function serviceGetMembershipActions($iProfileId)
  124. {
  125. if($iProfileId != $this->getUserId())
  126. return '';
  127. return $this->_oTemplate->displayMembershipActions($iProfileId);
  128. }
  129. /**
  130. * @page service Service Calls
  131. * @section bx_acl Paid Levels
  132. * @subsection bx_acl-payments Payments
  133. * @subsubsection bx_acl-get_payment_data get_payment_data
  134. *
  135. * @code bx_srv('bx_acl', 'get_payment_data', [...]); @endcode
  136. *
  137. * Get an array with module's description. Is needed for payments processing module.
  138. *
  139. * @return an array with module's description.
  140. *
  141. * @see BxAclModule::serviceGetPaymentData
  142. */
  143. /**
  144. * @ref bx_acl-get_payment_data "get_payment_data"
  145. */
  146. public function serviceGetPaymentData()
  147. {
  148. return $this->_aModule;
  149. }
  150. /**
  151. * @page service Service Calls
  152. * @section bx_acl Paid Levels
  153. * @subsection bx_acl-payments Payments
  154. * @subsubsection bx_acl-get_cart_item get_cart_item
  155. *
  156. * @code bx_srv('bx_acl', 'get_cart_item', [...]); @endcode
  157. *
  158. * Get an array with level's description. Is used in Shopping Cart in payments processing module.
  159. *
  160. * @param $mixedItemId level's ID or Unique Name.
  161. * @return an array with level's description. Empty array is returned if something is wrong.
  162. *
  163. * @see BxAclModule::serviceGetCartItem
  164. */
  165. /**
  166. * @ref bx_acl-get_cart_item "get_cart_item"
  167. */
  168. public function serviceGetCartItem($mixedItemId)
  169. {
  170. $CNF = &$this->_oConfig->CNF;
  171. if(!$mixedItemId)
  172. return array();
  173. if(is_numeric($mixedItemId))
  174. $aItem = $this->_oDb->getPrices(array('type' => 'by_id_full', 'value' => (int)$mixedItemId));
  175. else
  176. $aItem = $this->_oDb->getPrices(array('type' => 'by_name_full', 'value' => $mixedItemId));
  177. if(empty($aItem) || !is_array($aItem))
  178. return array();
  179. $sTitle = '';
  180. if((int)$aItem['period'] == 0)
  181. $sTitle = _t('_bx_acl_txt_cart_item_title_lifetime', _t($aItem['level_name']));
  182. else
  183. $sTitle = _t('_bx_acl_txt_cart_item_title', _t($aItem['level_name']), $aItem['period'], $aItem['period_unit']);
  184. return array (
  185. 'id' => $aItem['id'],
  186. 'author_id' => $this->_oConfig->getOwner(),
  187. 'name' => $aItem['name'],
  188. 'title' => $sTitle,
  189. 'description' => _t($aItem['level_description']),
  190. 'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']),
  191. 'price_single' => $aItem['price'],
  192. 'price_recurring' => $aItem['price'],
  193. 'period_recurring' => $aItem['period'],
  194. 'period_unit_recurring' => $aItem['period_unit'],
  195. 'trial_recurring' => $aItem['trial']
  196. );
  197. }
  198. /**
  199. * @page service Service Calls
  200. * @section bx_acl Paid Levels
  201. * @subsection bx_acl-payments Payments
  202. * @subsubsection bx_acl-get_cart_items get_cart_items
  203. *
  204. * @code bx_srv('bx_acl', 'get_cart_items', [...]); @endcode
  205. *
  206. * Get an array with levels' descriptions by seller. Is used in Manual Order Processing in payments processing module.
  207. *
  208. * @param $iSellerId seller ID.
  209. * @return an array with levels' descriptions. Empty array is returned if something is wrong or seller doesn't have any paid level.
  210. *
  211. * @see BxAclModule::serviceGetCartItems
  212. */
  213. /**
  214. * @ref bx_acl-get_cart_items "get_cart_items"
  215. */
  216. public function serviceGetCartItems($iSellerId)
  217. {
  218. $CNF = &$this->_oConfig->CNF;
  219. $iSellerIdSetting = $this->_oConfig->getOwner();
  220. if(empty($iSellerId) || ($iSellerId != $iSellerIdSetting && !isAdmin()))
  221. return array();
  222. $aItems = $this->_oDb->getPrices(array('type' => 'all_full'));
  223. $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
  224. $aResult = array();
  225. foreach($aItems as $aItem)
  226. $aResult[] = array(
  227. 'id' => $aItem['id'],
  228. 'author_id' => $iSellerIdSetting,
  229. 'name' => $aItem['name'],
  230. 'title' => _t('_bx_acl_txt_cart_item_title', _t($aItem['level_name']), $aItem['period'], $aItem['period_unit']),
  231. 'description' => _t($aItem['level_description']),
  232. 'url' => $sUrl,
  233. 'price_single' => $aItem['price'],
  234. 'price_recurring' => $aItem['price'],
  235. 'period_recurring' => $aItem['period'],
  236. 'period_unit_recurring' => $aItem['period_unit'],
  237. 'trial_recurring' => $aItem['trial']
  238. );
  239. return $aResult;
  240. }
  241. /**
  242. * @page service Service Calls
  243. * @section bx_acl Paid Levels
  244. * @subsection bx_acl-payments Payments
  245. * @subsubsection bx_acl-register_cart_item register_cart_item
  246. *
  247. * @code bx_srv('bx_acl', 'register_cart_item', [...]); @endcode
  248. *
  249. * Register a processed single time payment inside the Paid Levels module. Is called with payment processing module after the payment was registered there.
  250. *
  251. * @param $iClientId client ID.
  252. * @param $iSellerId seller ID
  253. * @param $iItemId item ID.
  254. * @param $iItemCount the number of purchased items.
  255. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  256. * @param $sLicense license number genereted with payment processing module for internal usage
  257. * @return an array with purchased prodict's description. Empty array is returned if something is wrong.
  258. *
  259. * @see BxAclModule::serviceRegisterCartItem
  260. */
  261. /**
  262. * @ref bx_acl-register_cart_item "register_cart_item"
  263. */
  264. public function serviceRegisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  265. {
  266. return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_SINGLE);
  267. }
  268. /**
  269. * @page service Service Calls
  270. * @section bx_acl Paid Levels
  271. * @subsection bx_acl-payments Payments
  272. * @subsubsection bx_acl-register_subscription_item register_subscription_item
  273. *
  274. * @code bx_srv('bx_acl', 'register_subscription_item', [...]); @endcode
  275. *
  276. * Register a processed subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was registered there.
  277. *
  278. * @param $iClientId client ID.
  279. * @param $iSellerId seller ID
  280. * @param $iItemId item ID.
  281. * @param $iItemCount the number of purchased items.
  282. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  283. * @param $sLicense license number genereted with payment processing module for internal usage
  284. * @return an array with subscribed prodict's description. Empty array is returned if something is wrong.
  285. *
  286. * @see BxAclModule::serviceRegisterSubscriptionItem
  287. */
  288. /**
  289. * @ref bx_acl-register_subscription_item "register_subscription_item"
  290. */
  291. public function serviceRegisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  292. {
  293. return $this->_serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_RECURRING);
  294. }
  295. /**
  296. * @page service Service Calls
  297. * @section bx_acl Paid Levels
  298. * @subsection bx_acl-payments Payments
  299. * @subsubsection bx_acl-reregister_cart_item reregister_cart_item
  300. *
  301. * @code bx_srv('bx_acl', 'reregister_cart_item', [...]); @endcode
  302. *
  303. * Reregister a single time payment inside the Paid Levels module. Is called with payment processing module after the payment was reregistered there.
  304. *
  305. * @param $iClientId client ID.
  306. * @param $iSellerId seller ID
  307. * @param $iItemIdOld old item ID.
  308. * @param $iItemIdNew new item ID.
  309. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  310. * @return an array with purchased prodict's description. Empty array is returned if something is wrong.
  311. *
  312. * @see BxAclModule::serviceReregisterCartItem
  313. */
  314. /**
  315. * @ref bx_acl-reregister_cart_item "reregister_cart_item"
  316. */
  317. public function serviceReregisterCartItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder)
  318. {
  319. return $this->_serviceReregisterItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder, BX_ACL_LICENSE_TYPE_SINGLE);
  320. }
  321. /**
  322. * @page service Service Calls
  323. * @section bx_acl Paid Levels
  324. * @subsection bx_acl-payments Payments
  325. * @subsubsection bx_acl-reregister_subscription_item reregister_subscription_item
  326. *
  327. * @code bx_srv('bx_acl', 'reregister_subscription_item', [...]); @endcode
  328. *
  329. * Reregister a subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was reregistered there.
  330. *
  331. * @param $iClientId client ID.
  332. * @param $iSellerId seller ID
  333. * @param $iItemIdOld old item ID.
  334. * @param $iItemIdNew new item ID.
  335. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  336. * @return an array with subscribed prodict's description. Empty array is returned if something is wrong.
  337. *
  338. * @see BxAclModule::serviceReregisterSubscriptionItem
  339. */
  340. /**
  341. * @ref bx_acl-reregister_subscription_item "reregister_subscription_item"
  342. */
  343. public function serviceReregisterSubscriptionItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder)
  344. {
  345. return $this->_serviceReregisterItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder, BX_ACL_LICENSE_TYPE_RECURRING);
  346. }
  347. /**
  348. * @page service Service Calls
  349. * @section bx_acl Paid Levels
  350. * @subsection bx_acl-payments Payments
  351. * @subsubsection bx_acl-unregister_cart_item unregister_cart_item
  352. *
  353. * @code bx_srv('bx_acl', 'unregister_cart_item', [...]); @endcode
  354. *
  355. * Unregister an earlier processed single time payment inside the Paid Levels module. Is called with payment processing module after the payment was unregistered there.
  356. *
  357. * @param $iClientId client ID.
  358. * @param $iSellerId seller ID
  359. * @param $iItemId item ID.
  360. * @param $iItemCount the number of purchased items.
  361. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  362. * @param $sLicense license number genereted with payment processing module for internal usage
  363. * @return boolean value determining where the payment was unregistered or not.
  364. *
  365. * @see BxAclModule::serviceUnregisterCartItem
  366. */
  367. /**
  368. * @ref bx_acl-unregister_cart_item "unregister_cart_item"
  369. */
  370. public function serviceUnregisterCartItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  371. {
  372. return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_SINGLE);
  373. }
  374. /**
  375. * @page service Service Calls
  376. * @section bx_acl Paid Levels
  377. * @subsection bx_acl-payments Payments
  378. * @subsubsection bx_acl-unregister_subscription_item unregister_subscription_item
  379. *
  380. * @code bx_srv('bx_acl', 'unregister_subscription_item', [...]); @endcode
  381. *
  382. * Unregister an earlier processed subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was unregistered there.
  383. *
  384. * @param $iClientId client ID.
  385. * @param $iSellerId seller ID
  386. * @param $iItemId item ID.
  387. * @param $iItemCount the number of purchased items.
  388. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  389. * @param $sLicense license number genereted with payment processing module for internal usage
  390. * @return boolean value determining where the subscription was unregistered or not.
  391. *
  392. * @see BxAclModule::serviceUnregisterSubscriptionItem
  393. */
  394. /**
  395. * @ref bx_acl-unregister_subscription_item "unregister_subscription_item"
  396. */
  397. public function serviceUnregisterSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense)
  398. {
  399. return $this->_serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, BX_ACL_LICENSE_TYPE_RECURRING);
  400. }
  401. /**
  402. * @page service Service Calls
  403. * @section bx_acl Paid Levels
  404. * @subsection bx_acl-payments Payments
  405. * @subsubsection bx_acl-cancel_subscription_item cancel_subscription_item
  406. *
  407. * @code bx_srv('bx_acl', 'cancel_subscription_item', [...]); @endcode
  408. *
  409. * Cancel an earlier processed subscription (recurring payment) inside the Paid Levels module. Is called with payment processing module after the subscription was canceled there.
  410. *
  411. * @param $iClientId client ID.
  412. * @param $iSellerId seller ID
  413. * @param $iItemId item ID.
  414. * @param $iItemCount the number of purchased items.
  415. * @param $sOrder order number received from payment provider (PayPal, Stripe, etc)
  416. * @return boolean value determining where the subscription was canceled or not.
  417. *
  418. * @see BxAclModule::serviceCancelSubscriptionItem
  419. */
  420. /**
  421. * @ref bx_acl-cancel_subscription_item "cancel_subscription_item"
  422. */
  423. public function serviceCancelSubscriptionItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder)
  424. {
  425. //TODO: Do something if it's necessary.
  426. return true;
  427. }
  428. /**
  429. * @page service Service Calls
  430. * @section bx_acl Paid Levels
  431. * @subsection bx_acl-other Other
  432. * @subsubsection bx_acl-get_prices get_prices
  433. *
  434. * @code bx_srv('bx_acl', 'get_prices', [...]); @endcode
  435. *
  436. * Get array of available price options for membership levels
  437. *
  438. * @param $iLevelId membership level id
  439. * @param $bFreeUnlimitedOnly get unlimited free pricing options only
  440. * @return array of levels, or empty array of there are no any pricing options avaiulable
  441. *
  442. * @see BxAclModule::serviceGetPrices
  443. */
  444. /**
  445. * @ref bx_acl-get_prices "get_prices"
  446. */
  447. public function serviceGetPrices($iLevelId = 0, $bFreeUnlimitedOnly = false)
  448. {
  449. $aParams = array(
  450. 'type' => $iLevelId ? 'by_level_id' : 'all_full',
  451. 'value' => $iLevelId,
  452. );
  453. $aPrices = $this->_oDb->getPrices($aParams, false);
  454. return array_filter($aPrices, function ($r) use ($bFreeUnlimitedOnly) {
  455. return $bFreeUnlimitedOnly ? !$r['price'] && !$r['period'] : true;
  456. });
  457. }
  458. protected function _serviceRegisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
  459. {
  460. $CNF = &$this->_oConfig->CNF;
  461. $aItem = $this->serviceGetCartItem($iItemId);
  462. if(empty($aItem) || !is_array($aItem))
  463. return array();
  464. $oAcl = BxDolAcl::getInstance();
  465. $aItemInfo = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iItemId));
  466. $aMembershipInfo = $oAcl->getMemberMembershipInfo($iClientId);
  467. $aPeriod = array('period' => (int)$aItemInfo['period'], 'period_unit' => $aItemInfo['period_unit']);
  468. if($sType == BX_ACL_LICENSE_TYPE_RECURRING && (int)$aItemInfo['trial'] > 0 && (int)$aItemInfo['level_id'] != (int)$aMembershipInfo['id'])
  469. $aPeriod = array('period' => (int)$aItemInfo['trial'], 'period_unit' => 'day', 'period_trial' => true);
  470. $iReserve = (int)getParam($CNF['PARAM_RECURRING_RESERVE']);
  471. if(!empty($iReserve))
  472. $aPeriod['period_reserve'] = $iReserve;
  473. if(!$oAcl->setMembership($iClientId, $aItemInfo['level_id'], $aPeriod, true, $sLicense))
  474. return array();
  475. return $aItem;
  476. }
  477. protected function _serviceReregisterItem($iClientId, $iSellerId, $iItemIdOld, $iItemIdNew, $sOrder, $sType)
  478. {
  479. $aItemNew = $this->serviceGetCartItem($iItemIdNew);
  480. if(empty($aItemNew) || !is_array($aItemNew))
  481. return array();
  482. /*
  483. * Note. Membership level cannot be reregistered immediately.
  484. * it will be automatically changed in the end of current period.
  485. */
  486. return $aItemNew;
  487. }
  488. protected function _serviceUnregisterItem($iClientId, $iSellerId, $iItemId, $iItemCount, $sOrder, $sLicense, $sType)
  489. {
  490. $aItemInfo = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => $iItemId));
  491. if(empty($aItemInfo) || !is_array($aItemInfo))
  492. return false;
  493. return BxDolAcl::getInstance()->unsetMembership($iClientId, $aItemInfo['level_id'], $sLicense);
  494. }
  495. /**
  496. * COMMON METHODS
  497. */
  498. public function getUserId()
  499. {
  500. return isLogged() ? bx_get_logged_profile_id() : 0;
  501. }
  502. public function getUserInfo($iUserId = 0)
  503. {
  504. $oProfile = BxDolProfile::getInstance($iUserId);
  505. if (!$oProfile)
  506. $oProfile = BxDolProfileUndefined::getInstance();
  507. return array(
  508. $oProfile->getDisplayName(),
  509. $oProfile->getUrl(),
  510. $oProfile->getThumb(),
  511. $oProfile->getUnit()
  512. );
  513. }
  514. }
  515. /** @} */