Exemplo n.º 1
0
$id = sanitize_text_field($_GET["id"]);
/* get all variables */
if ($act == 'vis') {
    //	$myFields       = array( "status" );
    //	$_ARR['id']     = $id;
    //	$_ARR['status'] = '1';
    //	$objMem->updRow( $table_name_message, $_ARR, $myFields );
    wpmg_redirectTo("wpmg_mailinggroup_messagelist&info=vis");
    exit;
} else {
    if ($act == 'hid') {
        //	$myFields       = array( "status" );
        //	$_ARR['id']     = $id;
        //	$_ARR['status'] = '0';
        //	$objMem->updRow( $table_name_message, $_ARR, $myFields );
        wpmg_redirectTo("wpmg_mailinggroup_messagelist&info=hid");
        exit;
    }
}
if ($info == "saved") {
    wpmg_showmessages("updated", __("Message has been added successfully.", 'mailing-group-module'));
} else {
    if ($info == "upd") {
        wpmg_showmessages("updated", __("Message has been updated successfully.", 'mailing-group-module'));
    } else {
        if ($info == "vis") {
            wpmg_showmessages("updated", __("Message has been set to visible successfully.", 'mailing-group-module'));
        } else {
            if ($info == "hid") {
                wpmg_showmessages("updated", __("Message has been  set to hidden successfully.", 'mailing-group-module'));
            } else {
Exemplo n.º 2
0
}
if ($info == "saved") {
    wpmg_showmessages("updated", __("Member has been added successfully.", 'mailing-group-module'));
} else {
    if ($info == "upd") {
        wpmg_showmessages("updated", __("Member has been updated successfully.", 'mailing-group-module'));
    }
}
if ($actreq == 'hold') {
    update_user_meta($id, "mg_user_status", '0', '1');
    wpmg_redirectTo("wpmg_mailinggroup_memberlist&gid=" . $gid);
    exit;
} else {
    if ($actreq == 'active') {
        update_user_meta($id, "mg_user_status", '1', '0');
        wpmg_redirectTo("wpmg_mailinggroup_memberlist&gid=" . $gid);
        exit;
    }
}
$args = array('meta_query' => array(array('key' => 'mg_user_group_sub_arr', 'value' => '"' . $gid . '"', 'compare' => 'LIKE')));
$user_in_group_query = new WP_User_Query($args);
$users_in_group = $user_in_group_query->get_results();
$totcount = $user_in_group_query->get_total();
?>
<div class="wrap">
	<h2><?php 
_e("Current Members", 'mailing-group-module');
?>
 <?php 
echo $groupName != '' ? "({$groupName}) <a class='backlink' href='admin.php?page=wpmg_mailinggroup_list'>" . __("Back", 'mailing-group-module') . "</a>" : "";
?>
Exemplo n.º 3
0
    if ($act == "uns" && $unsid != '') {
        $group_arr_old = unserialize(get_user_meta($recid, "mg_user_group_subscribed", true));
        unset($group_arr_old[$unsid]);
        $grpserial = serialize($group_arr_old);
        update_user_meta($recid, "mg_user_group_subscribed", $grpserial);
        $objMem->updUserGroupTaxonomy($table_name_user_taxonomy, $recid, $group_arr_old);
        wpmg_redirectTo("wpmg_mailinggroup_membergroups&info=uns");
        exit;
    }
}
if ($addme == 2) {
    $grpsArray = $objMem->getGroupSerialized($_POST);
    $grpserial = serialize($grpsArray);
    update_user_meta($recid, "mg_user_group_subscribed", $grpserial);
    $objMem->updUserGroupTaxonomy($table_name_user_taxonomy, $recid, $grpsArray);
    wpmg_redirectTo("wpmg_mailinggroup_membergroups&info=upd");
}
if ($info == "uns") {
    wpmg_showmessages("updated", __("Member has been unsubcribed from the group.", 'mailing-group-module'));
} else {
    if ($info == "upd") {
        wpmg_showmessages("updated", __("You have succesfully updated your groups settings.", 'mailing-group-module'));
    }
}
$email_format = "";
$result_groups = $objMem->selectRows($table_name_group, "", " order by id asc");
?>
<script type="text/javascript">
	/* <![CDATA[ */
	jQuery(document).ready(function() {
		/* Build the DataTable with third column using our custom sort functions */
Exemplo n.º 4
0
    $status = get_user_meta($user_id, "mg_user_status", true);
    $group_name_serial = get_user_meta($user_id, "mg_user_group_subscribed", true);
    if (empty($group_name_serial)) {
        $groups_subscribed = array();
    } else {
        $groups_subscribed = $group_name_serial;
    }
}
if ($status_change == 'hold') {
    update_user_meta($recid, "mg_user_status", '0', '1');
    wpmg_redirectTo("wpmg_mailinggroup_memberadd&id=" . $recid . "&gid=" . $gid);
    exit;
} else {
    if ($status_change == 'active') {
        update_user_meta($recid, "mg_user_status", '1', '0');
        wpmg_redirectTo("wpmg_mailinggroup_memberadd&id=" . $recid . "&gid=" . $gid);
        exit;
    }
}
?>

<div xmlns="http://www.w3.org/1999/xhtml" class="wrap nosubsub">
	<div class="icon32" id="icon-edit"></div>
	<h2><?php 
_e("Edit Member", 'mailing-group-module');
?>
		<a class="button add-new-h2" href="admin.php?page=wpmg_mailinggroup_memberlist&gid=<?php 
echo $gid;
?>
"><?php 
_e("Back to ", 'mailing-group-module');
Exemplo n.º 5
0
/* get all variables */
$submitted_fields = array('title', 'subject', 'message', 'visible');
if ($addme == 1) {
    if ($objMem->updateEmailOption($id, $_POST, $submitted_fields, $option_name)) {
        wpmg_redirectTo("wpmg_mailinggroup_messagelist&info=saved");
        exit;
    } else {
        wpmg_redirectTo("wpmg_mailinggroup_messageadd&act=upd&msg=same");
    }
} else {
    if ($addme == 2) {
        if ($objMem->updateEmailOption($id, $_POST, $submitted_fields, $option_name)) {
            wpmg_redirectTo("wpmg_mailinggroup_messagelist&info=upd");
            exit;
        } else {
            wpmg_redirectTo("wpmg_mailinggroup_messageadd&act=upd&msg=same&id=" . $id);
        }
    }
}
if ($act == "upd") {
    $custom_to_edit = $custom_emails[$id];
    $title = stripslashes($custom_to_edit['title']);
    $subject = stripslashes($custom_to_edit['subject']);
    $message = addslashes($custom_to_edit['message']);
    $visible = addslashes($custom_to_edit['visible']);
    $btn = __("Update Message", 'mailing-group-module');
    $hidval = 2;
} elseif ($act == "add") {
    $id = "";
    $title = $_POST['title'] != '' ? sanitize_text_field($_POST['title']) : "";
    $subject = $_POST['subject'] != '' ? sanitize_text_field($_POST['subject']) : "";
                if (!is_wp_error($user_id)) {
                    foreach ($new_groups_subscribed as $group_ID) {
                        $groups_subscribed[$group_ID] = $_POST['email_format_' . $group_ID];
                    }
                    foreach ($groups_subscribed as $group => $format) {
                        $groups_array[] = (string) $group;
                    }
                    update_user_meta($user_id, 'mg_user_group_subscribed', $groups_subscribed);
                    update_user_meta($user_id, 'mg_user_group_sub_arr', $groups_array);
                    update_user_meta($user_id, 'mg_user_status', $status);
                    if ($confirmation_email) {
                        wpmg_sendConfirmationtoMember($user_id, $groups_array);
                    } else {
                        wp_new_user_notification($user_id, $random_password);
                    }
                    wpmg_redirectTo("wpmg_mailinggroup_requestmanageradd&info=saved");
                } else {
                    wpmg_showmessages("error", __("There has been an error", 'mailing-group-module'));
                }
            }
        }
    } else {
        wpmg_showmessages("error", __("Please enter username or email to proceed.", 'mailing-group-module'));
    }
}
if ($info === "saved") {
    wpmg_showmessages("updated", __("User has been added successfully added to the group/s.", 'mailing-group-module'));
}
$email_format = "";
$args = array('post_type' => 'mg_groups', 'post_status' => array('publish', 'private'), 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1);
$query = new WP_Query($args);
function wpmg_check_user_activation_link($template)
{
    global $wpdb, $objMem, $table_name_user_taxonomy;
    /* wpmg_activation_url(98, "2013-08-29 13:14:31"); */
    extract($_GET);
    $error = new WP_Error();
    $verify = '';
    $activationkey = '';
    $nonce = '';
    $unsubscribe = '';
    $userid = '';
    $group = '';
    if ($verify == '1' && $activationkey != '' && $nonce != '') {
        $result = $objMem->selectRows($wpdb->users, "", " where MD5(ID) = '" . $activationkey . "' and MD5(user_registered) = '" . $nonce . "' order by id desc");
        if ($result[0] && is_array($result)) {
            $user_status = $result[0]->user_status;
            if ($user_status == '2') {
                $user_id = $result[0]->ID;
                $wpdb->query("UPDATE {$wpdb->users} SET user_status = 0 WHERE ID =" . $user_id);
                update_user_meta($user_id, "mg_user_status", 1);
                $random_password = wp_generate_password(12, false);
                wp_set_password($random_password, $user_id);
                wp_new_user_notification($user_id, $random_password);
                $gropArray = get_user_meta($user_id, "mg_user_group_subscribed", true);
                $arrayString = unserialize($gropArray);
                wpmg_sendGroupConfirmationtoMember($user_id, $arrayString);
                $error->add('verified_success', __("<div align='center'>Thank you for your subscription.<br>Please check your email for your account login credentials, so you can update your preferences and profile.</div>", 'mailing-group-module'));
                echo $error->get_error_message("verified_success");
                /*  sleep(5);
                				wpmg_redirectTo("wp-login.php","abs"); */
            } else {
                $error->add('already_verified', __("<div align='center'><strong>Verified</strong>: Account already verified, Please <a href='wp-login.php'>login here</a>.</div>", 'mailing-group-module'));
                echo $error->get_error_message("already_verified");
                wpmg_redirectTo("wp-login.php", "abs");
            }
        } else {
            $error->add('invalid_request', __("<div align='center'><strong>ERROR</strong>: Invalid verification request, Please contact administrator.</div>", 'mailing-group-module'));
            echo $error->get_error_message("invalid_request");
        }
    } else {
        if ($unsubscribe == '1' && $userid != '' && $group != '') {
            extract($_GET);
            $group_arr_old = unserialize(get_user_meta($userid, "mg_user_group_subscribed", true));
            unset($group_arr_old[$group]);
            $grpserial = serialize($group_arr_old);
            update_user_meta($userid, "mg_user_group_subscribed", $grpserial);
            $objMem->updUserGroupTaxonomy($table_name_user_taxonomy, $userid, $group_arr_old);
            $error->add('success_unsubscribe', __("<div align='center'><strong>Success</strong>: You are successfully unsubscribed from the selected group.</div>", 'mailing-group-module'));
            echo $error->get_error_message("success_unsubscribe");
        } else {
            return $template;
        }
    }
}