コード例 #1
0
ファイル: invite.php プロジェクト: coldtrick/group_tools
if (!empty($emails) && !is_array($emails)) {
    $emails = array($emails);
}
$csv = get_uploaded_file('csv');
if (get_input('resend') == 'yes') {
    $resend = true;
} else {
    $resend = false;
}
elgg_entity_gatekeeper($group_guid, 'group');
$group = get_entity($group_guid);
if (empty($user_guids) && empty($emails) && empty($csv)) {
    register_error(elgg_echo('error:missing_data'));
    forward(REFERER);
}
if (!$group->canEdit() && !group_tools_allow_members_invite($group)) {
    register_error(elgg_echo('actionunauthorized'));
    forward(REFERER);
}
// show hidden (unvalidated) users
$hidden = access_get_show_hidden_status();
access_show_hidden_entities(true);
// counters
$already_invited = 0;
$invited = 0;
$member = 0;
$join = 0;
// invite existing users
if (!empty($user_guids)) {
    if (!$adding) {
        // invite users
コード例 #2
0
ファイル: invite.php プロジェクト: lorea/Hydra-dev
}
$group_guid = (int) get_input("group_guid");
$text = get_input("comment");
$emails = get_input("user_guid_email");
if (!empty($emails) && !is_array($emails)) {
    $emails = array($emails);
}
$csv = get_uploaded_file("csv");
if (get_input("resend") == "yes") {
    $resend = true;
} else {
    $resend = false;
}
$group = get_entity($group_guid);
if ((!empty($user_guids) || !empty($emails) || !empty($csv)) && !empty($group)) {
    if ($group instanceof ElggGroup && ($group->canEdit() || group_tools_allow_members_invite($group))) {
        // show hidden (unvalidated) users
        $hidden = access_get_show_hidden_status();
        access_show_hidden_entities(true);
        // counters
        $already_invited = 0;
        $invited = 0;
        $member = 0;
        $join = 0;
        // invite existing users
        if (!empty($user_guids)) {
            if (!$adding) {
                // invite users
                foreach ($user_guids as $u_id) {
                    $user = get_user($u_id);
                    if (!empty($user)) {
コード例 #3
0
ファイル: invite.php プロジェクト: socialweb/PiGo
<?php

/**
 * Invite users to groups
 *
 * @package ElggGroups
 */
gatekeeper();
$guid = (int) get_input("group_guid");
if (($group = get_entity($guid)) && $group instanceof ElggGroup) {
    if ($group->canEdit() || group_tools_allow_members_invite($group)) {
        elgg_set_page_owner_guid($guid);
        // get plugin settings
        $invite = elgg_get_plugin_setting("invite", "group_tools");
        $invite_email = elgg_get_plugin_setting("invite_email", "group_tools");
        $invite_csv = elgg_get_plugin_setting("invite_csv", "group_tools");
        if (in_array("yes", array($invite, $invite_csv, $invite_email))) {
            $title = elgg_echo("group_tools:groups:invite:title");
            $breadcrumb = elgg_echo("group_tools:groups:invite");
        } else {
            $title = elgg_echo("groups:invite:title");
            $breadcrumb = elgg_echo("groups:invite");
        }
        elgg_push_breadcrumb(elgg_echo("groups"), "groups/all");
        elgg_push_breadcrumb($group->name, $group->getURL());
        elgg_push_breadcrumb($breadcrumb);
        $content = elgg_view_form("groups/invite", array("id" => "invite_to_group", "class" => "elgg-form-alt mtm", "enctype" => "multipart/form-data"), array("entity" => $group, "invite" => $invite, "invite_email" => $invite_email, "invite_csv" => $invite_csv));
        $params = array("content" => $content, "title" => $title, "filter" => "");
        $body = elgg_view_layout("content", $params);
        echo elgg_view_page($title, $body);
    } else {