Changeset 3008850
- Timestamp:
- 12/12/2023 02:52:19 PM (2 years ago)
- Location:
- gleap/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
gleap.php (modified) (2 diffs)
-
public/class-gleap-public.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gleap/trunk/README.txt
r3008603 r3008850 4 4 Requires at least: 5.0.0 5 5 Tested up to: 6.4.2 6 Stable tag: 13.0. 06 Stable tag: 13.0.1 7 7 License: Commercial 8 8 License URI: https://github.com/Gleap/Wordpress/blob/main/README.txt … … 38 38 39 39 == Changelog == 40 41 = 13.0.1 = 42 * Added filter to inject custom user data. 43 44 function add_custom_data_to_gleap_identify($data) { 45 $user_group = \Groups_Helper::get_group_for_current_user(); 46 47 if($user_group) { 48 $data['customData']['mandat'] = $user_group->ap_mandant; 49 } 50 51 return $data; 52 } 53 add_filter('gleap_identify_data', 'add_custom_data_to_gleap_identify'); 40 54 41 55 = 13.0.0 = -
gleap/trunk/gleap.php
r3008603 r3008850 17 17 * Plugin Name: Gleap 18 18 * Description: Gleap helps developers build the best software faster. It is your affordable in-app bug reporting tool for apps, websites and industrial applications. 19 * Version: 13.0. 019 * Version: 13.0.1 20 20 * Author: Gleap 21 21 * Author URI: https://www.gleap.io … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'GLEAP_VERSION', '13.0. 0' );38 define( 'GLEAP_VERSION', '13.0.1' ); 39 39 40 40 /** -
gleap/trunk/public/class-gleap-public.php
r3008603 r3008850 77 77 } 78 78 79 /** 80 * Prepare the data for the Gleap.identify call. 81 * 82 * @since 1.0.0 83 */ 84 private function prepare_gleap_identify_data() { 85 if (!is_user_logged_in()) { 86 return ''; 87 } 88 89 $user_data = get_userdata(get_current_user_id()); 90 $login = $user_data->user_login; 91 $uname = $user_data->user_firstname . ' ' . $user_data->user_lastname; 92 $nickname = (strlen($user_data->nickname) > 1) ? $user_data->nickname : ''; 93 $name = (strlen($uname) > 1) ? $uname : $nickname; 94 $email = $user_data->user_email; 95 96 // Prepare the default data array. 97 $data = array( 98 'name' => $name, 99 'email' => $email, 100 ); 101 102 // Allow other plugins to add or modify data. 103 $data = apply_filters('gleap_identify_data', $data); 104 105 return $data; 106 } 107 79 108 /** 80 109 * Register the JavaScript for the public-facing side of the site. … … 106 135 107 136 $identify_script = ""; 108 $gleap_identity_token = carbon_get_theme_option('gleap_identity_token');109 137 if (is_user_logged_in()) { 110 $user_data = get_userdata(get_current_user_id()); 111 $login = $user_data->user_login; 112 $uname = $user_data->user_firstname . ' ' . $user_data->user_lastname; 113 $nickname = (strlen($user_data->nickname) > 1) ? $user_data->nickname : ''; 114 $name = (strlen($uname) > 1) ? $uname : $nickname; 115 $email = $user_data->user_email; 116 $signature = hash_hmac('sha256', $login, $gleap_identity_token); 117 $identify_script = ',Gleap.identify("' . $login . '", { name: "' . $name . '", email: "' . $email . '"}, "' . $signature . '");'; 138 $gleap_identity_token = carbon_get_theme_option('gleap_identity_token'); 139 $user_data = get_userdata(get_current_user_id()); 140 $login = $user_data->user_login; 141 $signature = hash_hmac('sha256', $login, $gleap_identity_token); 142 143 // Get the data for Gleap.identify. 144 $identify_data = $this->prepare_gleap_identify_data(); 145 $identify_json = json_encode($identify_data); 146 147 $identify_script = ',Gleap.identify("' . $login . '", ' . $identify_json . ', "' . $signature . '");'; 118 148 } 119 149
Note: See TracChangeset
for help on using the changeset viewer.