معلومات إضافية
| اللون | شانيه, كريمى |
|---|---|
| الجنس / النوع | بناتي |
| الموسم | صيفي |
| مقاس | 2, 3, 4, 5 |
| النوع | طقم |
global $wpdb; $table_name = $wpdb->prefix . 'userswitch_audit'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE IF NOT EXISTS {$table_name} (\n id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,\n admin_id BIGINT(20) UNSIGNED NOT NULL,\n target_user_id BIGINT(20) UNSIGNED NOT NULL,\n action varchar(50) NOT NULL,\n ip_address varchar(100) NOT NULL,\n log_timestamp datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (id)\n ) {$charset_collate};"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $sql ); } ); /** Uninstall hook – drop audit table. */ /** Uninstall hook – drop audit table. */ register_uninstall_hook( __FILE__, 'userswitch_pro_uninstall' ); function userswitch_pro_uninstall() { global $wpdb; $table_name = $wpdb->prefix . 'userswitch_audit'; $wpdb->query( "DROP TABLE IF EXISTS {$table_name}" ); } ?> global $wpdb; $table_name = $wpdb->prefix . 'userswitch_audit'; $wpdb->query( "DROP TABLE IF EXISTS {$table_name}" ); } ); /** Initialise admin functionality – only for users with proper capability. */ function userswitch_pro_secure_admin_init() { // Verify current user can manage options. loginas_capability_check(); // Enqueue admin assets when on our plugin pages. add_action( 'admin_enqueue_scripts', function ( $hook ) { if ( strpos( $hook, 'userswitch' ) !== false ) { wp_enqueue_style( 'userswitch-admin-secure', USERSWITCH_PRO_SECURE_URL . 'assets/css/admin-css-secure.css', [], '1.0' ); // Select2 for searchable dropdowns. wp_enqueue_script( 'select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js', ['jquery'], '4.0.13', true ); wp_enqueue_style( 'select2-css', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css', [], '4.0.13' ); } } ); // Load the settings page implementation. require_once USERSWITCH_PRO_SECURE_DIR . 'admin/setting.php'; if ( class_exists( 'userswitch_admin_setting_pro' ) ) { new userswitch_admin_setting_pro(); } } add_action( 'admin_init', 'userswitch_pro_secure_admin_init' ); /** AJAX handler for switching to another user – respects role‑based restrictions and logs the action. */ function userswitch_pro_secure_switch_user() { // Verify nonce. if ( ! loginas_verify_nonce( 'userswitch_switch_user', 'userswitch_nonce' ) ) { wp_send_json_error( [ 'message' => __( 'Invalid request.', 'userswitchpro' ) ] ); } $user_id = isset( $_POST['user_id'] ) ? absint( $_POST['user_id'] ) : 0; if ( ! $user_id ) { wp_send_json_error( [ 'message' => __( 'No user specified.', 'userswitchpro' ) ] ); } // Role‑based restriction check. $allowed_roles = get_option( 'userswitch_allowed_roles', [ 'administrator' ] ); $current_user = wp_get_current_user(); if ( empty( array_intersect( $current_user->roles, $allowed_roles ) ) ) { wp_send_json_error( [ 'message' => __( 'You are not permitted to use this feature.', 'userswitchpro' ) ] ); } // Log the action. global $wpdb; $wpdb->insert( $wpdb->prefix . 'userswitch_audit', [ 'admin_id' => get_current_user_id(), 'target_user_id' => $user_id, 'action' => 'switch_user', 'ip_address' => $_SERVER['REMOTE_ADDR'] ?? 'unknown', ], [ '%d', '%d', '%s', '%s' ] ); // Perform the actual switch – reuse original function if present. if ( function_exists( 'loginas_switch_user' ) ) { loginas_switch_user( $user_id ); wp_send_json_success(); } else { wp_send_json_error( [ 'message' => __( 'Switch function missing.', 'userswitchpro' ) ] ); } } add_action( 'wp_ajax_userswitch_switch_user', 'userswitch_pro_secure_switch_user' ); ?>
شحن مجاني للطلبات فوق 500 جنيه
499.90 EGP
التوصيل خلال 2–5 أيام عمل داخل مصر
| اللون | شانيه, كريمى |
|---|---|
| الجنس / النوع | بناتي |
| الموسم | صيفي |
| مقاس | 2, 3, 4, 5 |
| النوع | طقم |
القماش ناعم جداً والمقاس كان مضبوط. بنتي مبسوطة!
توصيل سريع وتغليف محترم. هاطلب تاني أكيد.
ألوان ثابتة بعد الغسيل وجودة عالية للسعر.