Changeset 3308520
- Timestamp:
- 06/09/2025 01:04:28 PM (10 months ago)
- Location:
- mlm-soft-integration/trunk
- Files:
-
- 9 edited
-
CHANGELOG.md (modified) (1 diff)
-
core/models/user/MLMSoftRemoteUser.php (modified) (4 diffs)
-
integrations/woocommerce/paymentGateways/eWallet/coupons/EWalletCouponFrontend.php (modified) (1 diff)
-
languages/mlmsoft-integration-en_US.mo (modified) (previous)
-
languages/mlmsoft-integration-en_US.po (modified) (2 diffs)
-
languages/mlmsoft-integration-ru_RU.mo (modified) (previous)
-
languages/mlmsoft-integration-ru_RU.po (modified) (2 diffs)
-
languages/mlmsoft-integration.pot (modified) (1 diff)
-
mlm-soft-integration.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mlm-soft-integration/trunk/CHANGELOG.md
r3308199 r3308520 2 2 3 3 ## Changelog ## 4 5 ## 2025-06-08 - version 3.9.4 6 * Updated `EWalletCouponFrontend` class. See an issue [MLM-3029] [EWalletCouponFrontend.php] 7 * Block login for user blocked in NRM [MLM-3033]. [MLMSoftRemoteUser.php] 8 * Updated translations. 4 9 5 10 ## 2025-06-04 - version 3.9.3 -
mlm-soft-integration/trunk/core/models/user/MLMSoftRemoteUser.php
r3114866 r3308520 11 11 class MLMSoftRemoteUser 12 12 { 13 /** 14 * @since 3.9.4 15 */ 16 const ACTIVE_ACCOUNT = 1; 17 const DISABLED_ACCOUNT = 2; 18 const DELETED_ACCOUNT = 3; 19 13 20 /** 14 21 * @var array … … 56 63 } 57 64 65 /** 66 * @since 3.9.4 67 */ 68 private static function getAccountStatusId($login, $mlmSoftPlugin = false): bool | int 69 { 70 global $wpdb; 71 72 if ( ! $mlmSoftPlugin ) { 73 $mlmSoftPlugin = MLMSoftPlugin::getInstance(); 74 } 75 76 $metaKey = MLMSoftLocalUser::ACCOUNT_ID_META_KEY; 77 78 $prefix = $wpdb->prefix; 79 $query = $wpdb->prepare("SELECT {$prefix}usermeta.meta_value FROM {$prefix}users 80 INNER JOIN {$prefix}usermeta ON ( {$prefix}users.ID = {$prefix}usermeta.user_id ) 81 WHERE 1=1 AND ( {$prefix}usermeta.meta_key = %s ) AND 82 (user_login LIKE %s OR user_email LIKE %s)", 83 $metaKey, 84 $login, 85 $login 86 ); 87 88 $accountId = $wpdb->get_col($query); 89 90 $accountStatusId = false; 91 if ( ! empty($accountId) && isset($accountId[0]) && (int) $accountId[0] > 0 ) { 92 93 $accountId = $accountId[0]; 94 $accountStatus = $mlmSoftPlugin->api3->get("account/$accountId/profile/account_status_id"); 95 if ( isset($accountStatus['value'], $accountStatus['value']['raw']) ) { 96 $accountStatusId = (int) $accountStatus['value']['raw']; 97 } 98 } 99 100 return $accountStatusId; 101 } 102 58 103 public static function loadByLoginAndPass($login, $password) 59 104 { 105 global $wpdb; 106 60 107 $mlmSoftPlugin = MLMSoftPlugin::getInstance(); 61 108 try { … … 66 113 ]); 67 114 } catch (Exception $e) { 115 116 /** 117 * @since 3.9.4 118 */ 119 $accountStatusId = self::getAccountStatusId($login, $mlmSoftPlugin); 120 if ($accountStatusId) { 121 if ( in_array($accountStatusId, [self::DISABLED_ACCOUNT, self::DELETED_ACCOUNT]) ) { 122 $message = MLMSoftPlugin::translate('Your account access is restricted. Please contact website administrator.'); 123 } 124 } 125 68 126 $errors = new WP_Error(); 69 127 … … 71 129 * @since 3.6.5 72 130 */ 73 $message = $ e->getMessage();131 $message = $message ?? $e->getMessage(); 74 132 if ( $message === 'Login or password is incorrect' ) { 75 133 /** -
mlm-soft-integration/trunk/integrations/woocommerce/paymentGateways/eWallet/coupons/EWalletCouponFrontend.php
r3308199 r3308520 51 51 */ 52 52 add_action('post_row_actions', [$this, 'manageCouponActions'], 10, 2); 53 54 /** 55 * @since 3.9.4 56 */ 57 add_action('admin_print_footer_scripts', [$this, 'printFooterScripts']); 53 58 54 59 $this->adminComponentLoader = new AdminComponentLoader(); 60 } 61 62 /** 63 * @since 3.9.4 64 */ 65 public function printFooterScripts() 66 { 67 global $post, $pagenow; 68 69 if ( ! in_array($pagenow, ['post.php']) ) { 70 return; 71 } 72 73 if ($post->post_type !== $this->couponPostType) { 74 return; 75 } 76 77 if ( ! EWalletCoupon::isEWalletCoupon($post->post_name) ) { 78 /** 79 * Coupon is not connected to the e-wallet. 80 */ 81 return; 82 } 83 84 $coupon = new WC_Coupon($post->post_name); 85 86 if ( $this->hasUserManageCouponRole() && $coupon->get_usage_count() < $coupon->get_usage_limit() ) { 87 return; 88 } 89 90 ?> 91 <script type='text/javascript'> 92 /* <![CDATA[ */ 93 if ('function' === typeof jQuery) { 94 let removeElems = ['#major-publishing-actions', '.edit-post-status', '.edit-visibility', '.edit-timestamp', '#free_shipping']; 95 removeElems.map((elem)=>{jQuery(elem).remove()}); 96 let disableElems = ['#title','#discount_type','#coupon_amount','#expiry_date']; 97 disableElems.map((elem)=>{jQuery(elem).attr('disabled',true).css({'color':'#000'})}); 98 } 99 /* ]]> */ 100 </script><?php 101 55 102 } 56 103 -
mlm-soft-integration/trunk/languages/mlmsoft-integration-en_US.po
r3257446 r3308520 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2022-05-28 10:52+0000\n" 6 "PO-Revision-Date: 2025-0 3-16 16:48+0700\n"6 "PO-Revision-Date: 2025-06-05 19:49+0700\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: English (United States)\n" … … 209 209 msgid "Discount" 210 210 msgstr "E-Wallet" 211 212 msgid "" 213 "Your account access is restricted. Please contact website administrator." 214 msgstr "" 215 "Your account access is restricted. Please contact website administrator." -
mlm-soft-integration/trunk/languages/mlmsoft-integration-ru_RU.po
r3257446 r3308520 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2022-05-28 10:52+0000\n" 6 "PO-Revision-Date: 2025-0 3-16 16:50+0700\n"6 "PO-Revision-Date: 2025-06-05 19:50+0700\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: Русский\n" … … 210 210 msgid "Discount" 211 211 msgstr "E-Wallet" 212 213 msgid "" 214 "Your account access is restricted. Please contact website administrator." 215 msgstr "Доступ к вашему аккаунту ограничен. Обратитесь к администратору сайта." -
mlm-soft-integration/trunk/languages/mlmsoft-integration.pot
r3257446 r3308520 207 207 msgid "Discount" 208 208 msgstr "" 209 210 msgid "Your account access is restricted. Please contact website administrator." 211 msgstr "" -
mlm-soft-integration/trunk/mlm-soft-integration.php
r3308199 r3308520 4 4 Plugin Name: MLM Soft Integration 5 5 Description: WP integration with mlm-soft.com cloud platform 6 Version: 3.9. 36 Version: 3.9.4 7 7 Author: MLM Soft Ltd. 8 8 Author URI: https://mlm-soft.com
Note: See TracChangeset
for help on using the changeset viewer.