Guest User

Untitled

a guest
Jul 14th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.33 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function ums_urls_form()
  15. {
  16. global $wp;
  17. $status_check = get_option('status_check');
  18. $option_arr = get_option('my_options');
  19. $login_path = $option_arr['login_path'];
  20. $register_path = $option_arr['register_path'];
  21. $current_url = home_url($wp->request);
  22. $frm = substr($current_url, strrpos($current_url, '/user') + 1);
  23. $frm_login = substr($current_url, strrpos($current_url, '/' . $login_path) + 1);
  24. $frm_register = substr($current_url, strrpos($current_url, '/' . $register_path) + 1);
  25. $frm_lost = substr($current_url, strrpos($current_url, '/user/lostpassword') + 1);
  26. $frm_reset = substr($current_url, strrpos($current_url, '/user/resetpassword') + 1);
  27.  
  28. if ($frm == 'user/check_login') {
  29. UMS_page_check_login();
  30. }
  31. else if ($frm == 'user/check_number') {
  32. UMS_checknumber_form();
  33. }
  34. else if ($frm == 'user/forget') {
  35. if (!$status_check['disable_loastpassword_form']) {
  36. UMS_checkforget_form();
  37. }
  38. }
  39. else if ($frm_reset == 'user/resetpassword') {
  40. if (!$status_check['disable_loastpassword_form']) {
  41. UMS_add_password_reset();
  42. }
  43. }
  44. else if ($frm == 'user/logout') {
  45. UMS_logout_form();
  46. }
  47. else if ($frm_login == $login_path) {
  48. UMS_login_form();
  49. }
  50. else if ($frm_register == $register_path) {
  51. if (get_option('users_can_register', true) == 1) {
  52. UMS_register_form();
  53. }
  54. else {
  55. wp_redirect(home_url('/'));
  56. }
  57. }
  58. else if ($frm_lost == 'user/lostpassword') {
  59. if (!$status_check['disable_loastpassword_form']) {
  60. UMS_lostpassword_form();
  61. }
  62. }
  63.  
  64. if (@$status_check['restriction_view_full_site']) {
  65. add_action('wp', 'ums_only_show_all_site_user_login');
  66. }
  67. }
  68.  
  69. function ums_register_url_check()
  70. {
  71. ums_urls_form();
  72. }
  73.  
  74. function ums_wc_template($template, $template_name, $template_path)
  75. {
  76. $template_directory = trailingslashit(UMS_TP_FRONT) . 'panel/woocommerce/';
  77. $path = $template_directory . $template_name;
  78. return file_exists($path) ? $path : $template;
  79. }
  80.  
  81. function UMS_check_Licensing_guard()
  82. {
  83. require_once 'ums-cpt.php';
  84.  
  85. if (UMS_Guard_SDK::is_activated() !== true) {
  86. if (is_admin()) {
  87. $black_list = ['lavin_user_plugin_manager', 'UMS_send_sms_user', 'UMS_wallet_user', 'UMS_show_product', 'UMS_page_user_panel', 'UMS_show_notification', 'UMS_reports_user', 'UMS_options'];
  88. if (isset($_GET['page']) && in_array($_GET['page'], $black_list)) {
  89. if (isset($_GET['page']) && ($_GET['page'] == 'ums_guard_register')) {
  90. return NULL;
  91. }
  92.  
  93. wp_die('لطفا کلید لایسنس <strong>افزونه سیستم مدیریت کاربران</strong> را وارد نمایید.');
  94. }
  95. }
  96. }
  97.  
  98. if (!class_exists('UMS_Guard_SDK')) {
  99. if (is_admin()) {
  100. $black_list = ['lavin_user_plugin_manager', 'UMS_send_sms_user', 'UMS_wallet_user', 'UMS_show_product', 'UMS_page_user_panel', 'UMS_show_notification', 'UMS_reports_user', 'UMS_options'];
  101. if (isset($_GET['page']) && in_array($_GET['page'], $black_list)) {
  102. if (isset($_GET['page']) && ($_GET['page'] == 'ums_guard_register')) {
  103. return NULL;
  104. }
  105.  
  106. wp_die('لطفا کلید لایسنس <strong>افزونه سیستم مدیریت کاربران</strong> را وارد نمایید.');
  107. }
  108. }
  109. }
  110. }
  111.  
  112. function ums_change_footer_admin()
  113. {
  114. if (isset($_GET['page']) && ($_GET['page'] == 'ums_options')) {
  115. echo '<span style="font-weight: 300;font-style: normal" id="footer-thankyou">اگر شما <b>افزونه سیستم مدیریت کاربران</b> را دوست دارید لطفا ما را با <b>5 ستاره</b> خوشحال کنید<span>';
  116. }
  117. else {
  118. echo '<span id="footer-thankyou">سپاسگزاریم از اینکه سایت خود را با <a href="https://wordpress.org/">وردپرس</a> ساخته&zwnj;اید.</span>';
  119. }
  120. }
  121.  
  122. function UMS_add_Plugin_Style()
  123. {
  124. if (ums_check_active_woocommerce()) {
  125. if (is_account_page()) {
  126. include_once ABSPATH . 'wp-admin/includes/plugin.php';
  127.  
  128. if (is_plugin_active('dashboard-style-ums/dashboard-style.php')) {
  129. $template = get_option('UMS_options_theme_panel');
  130.  
  131. switch ($template) {
  132. case 'dashboard-1':
  133. wp_enqueue_style('dashboard', get_stylesheet_uri());
  134. wp_enqueue_style('dashboard-ums', DSU_Assets . 'css/theme-1/black-dashboard.min.css', [], '1.1', 'all');
  135. break;
  136. case 'dashboard-2':
  137. wp_enqueue_style('dashboard', get_stylesheet_uri());
  138. wp_enqueue_style('dashboard-ums', UMS_ASSETES . '/css/dashboard.css', [], '1.1', 'all');
  139. break;
  140. case 'dashboard-3':
  141. wp_enqueue_style('dashboard', get_stylesheet_uri());
  142. wp_enqueue_style('dashboard-ums', DSU_Assets . 'css/theme-2/black-dashboard.css', [], '1.1', 'all');
  143. break;
  144. case 'dashboard-4':
  145. wp_enqueue_style('dashboard', get_stylesheet_uri());
  146. wp_enqueue_style('dashboard-ums', DSU_Assets . 'css/theme-3/argon-dashboard.css', [], '1.1', 'all');
  147. break;
  148. case 'dashboard-5':
  149. wp_enqueue_style('dashboard', get_stylesheet_uri());
  150. wp_enqueue_style('dashboard-ums', DSU_Assets . 'css/theme-4/dashboard-theme-five.css', [], '1.1', 'all');
  151. break;
  152. case 'dashboard-6':
  153. wp_enqueue_style('dashboard', get_stylesheet_uri());
  154. wp_enqueue_style('dashboard-ums', DSU_Assets . 'css/theme-5/dashboard-six.css', [], '1.1', 'all');
  155. break;
  156. default:
  157. wp_enqueue_style('dashboard', get_stylesheet_uri());
  158. wp_enqueue_style('dashboard-ums', UMS_ASSETES . '/css/dashboard.css', [], '1.1', 'all');
  159. }
  160. }
  161. else {
  162. wp_enqueue_style('dashboard', get_stylesheet_uri());
  163. wp_enqueue_style('dashboard-ums', UMS_ASSETES . '/css/dashboard.css', [], '1.1', 'all');
  164. }
  165. }
  166. }
  167. }
  168.  
  169. function UMS_default_field_register_form()
  170. {
  171. $field_data = [
  172. 'ums_reg_user_name' => ['type' => 'text', 'meta_key' => 'user_name', 'label' => 'نام کاربری', 'dec' => 'نام کاربری خود را وارد کنید', 'required' => 'yes', 'active' => 'yes', 'profile' => 'no', 'register' => 'yes'],
  173. 'ums_reg_full_name' => ['type' => 'text', 'meta_key' => 'user_full_name', 'label' => 'نام و نام خانوادگی', 'dec' => 'نام و نام خانوادگی خود را وارد کنید', 'required' => 'yes', 'active' => 'yes', 'profile' => 'yes', 'register' => 'yes'],
  174. 'ums_reg_email' => ['type' => 'email', 'meta_key' => 'user_email', 'label' => 'ایمیل', 'dec' => 'ایمیل خود را وارد کنید', 'required' => 'no', 'active' => 'no', 'profile' => 'yes', 'register' => 'yes'],
  175. 'ums_reg_mobile_number' => ['type' => 'text', 'meta_key' => 'mobile_user', 'label' => 'موبایل', 'dec' => 'موبایل خود را وارد کنید', 'required' => 'yes', 'active' => 'yes', 'profile' => 'yes', 'register' => 'yes'],
  176. 'ums_reg_password' => ['type' => 'password', 'meta_key' => 'user_password', 'label' => 'پسورد', 'dec' => 'پسورد خود را وارد کنید', 'required' => 'yes', 'active' => 'yes', 'profile' => 'yes', 'register' => 'yes']
  177. ];
  178. update_option('ums_register_form_field', $field_data);
  179. update_option('ums_register_form_field_run', '1');
  180. }
  181.  
  182. function ums_synchronization_plugin_digits($user_id)
  183. {
  184. include_once ABSPATH . 'wp-admin/includes/plugin.php';
  185.  
  186. if (is_plugin_active('digits/digit.php')) {
  187. $mobile_user = get_user_meta($user_id, 'mobile_user', true);
  188. $digits_phone = get_user_meta($user_id, 'digits_phone_no', true);
  189.  
  190. if (!$mobile_user) {
  191. update_user_meta($user_id, 'mobile_user', '0' . $digits_phone, true);
  192. update_user_meta($user_id, 'activation_key_user', '1');
  193. }
  194. }
  195. }
  196.  
  197. function ums_save_mobile_plugin_digits($user_id)
  198. {
  199. include_once ABSPATH . 'wp-admin/includes/plugin.php';
  200.  
  201. if (is_plugin_active('digits/digit.php')) {
  202. $mobile_user = get_user_meta($user_id, 'mobile_user', true);
  203.  
  204. if (isset($_COOKIE['digits_countrycode'])) {
  205. $digt_countrycode = '+' . $_COOKIE['digits_countrycode'];
  206. }
  207.  
  208. if ($mobile_user) {
  209. $phone = substr($mobile_user, 1);
  210. update_user_meta($user_id, 'digits_countrycode', $digt_countrycode);
  211. update_user_meta($user_id, 'digits_phone_no', $phone);
  212. ......................................................................
  213. ..........................................
  214. ..................
Add Comment
Please, Sign In to add comment