function create_group(&$error, $group)
{
    if ($group == "") {
        $error = "Groupe nul";
        return;
    }
    if (in_array($group, get_groups($error))) {
        $error = sprintf(_("Group %s already exist"), $group);
        return;
    }
    $ret = xmlCall("base.createGroup", $group);
    if (in_array("samba", $_SESSION["supportModList"])) {
        // FIXME: should be a choice made by the user
        // Samba plugin is enabled, so we make this group a Samba group,
        // but only if we are a PDC.
        $pdc = xmlCall("samba.isPdc", null);
        if ($pdc) {
            xmlCall("samba.makeSambaGroup", array($group));
        }
    }
    if (!isXMLRPCError()) {
        return sprintf(_("Group %s created"), $group);
    } else {
        return;
    }
}
function armar_select_grupos()
{
    $codigo = "";
    $result = get_groups();
    while ($row = mysql_fetch_array($result)) {
        $codigo = $codigo . "<option value='" . $row[0] . (isset($id_grupo) && $row[0] == $id_grupo ? "' selected>" : "'>") . $row[1] . "</option>";
    }
    return $codigo;
}
Example #3
0
function admin_teams()
{
    global $db;
    $tpl = new smarty();
    $tpl->assign('lang', get_languages());
    $tpl->assign('groups', get_groups(@(int) $_POST['grID']));
    $bilder = '<option value="">' . NONE . '</option>';
    $pics = scan_dir('images/teams/', true);
    $endungen = array('jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'PNG', 'png');
    foreach ($pics as $value) {
        if (in_array(substr($value, strrpos($value, '.') + 1), $endungen)) {
            $bilder .= '<option value="' . $value . '">' . $value . '</option>';
        }
    }
    $tpl->assign('pics', $bilder);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/teams.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(TEAMS, $content, '', 1);
    get_teams();
}
Example #4
0
    // (you would want to change $post->ID to however you are getting the book order #,
    // but you can see how it works this way with global $post;)
    return 'GI Whiteboard | ';
}
add_filter('wp_title', 'giw_hdr_title');
function get_groups()
{
    global $mySQLi, $group_table;
    $sql = "SELECT * FROM `{$group_table}`;";
    $groups = $mySQLi->get_results($sql);
    foreach ($groups as $row) {
        $out[$row['name']] = $row['level'];
    }
    return $out;
}
$group_info = get_groups();
function get_providers()
{
    global $mySQLi, $user_meta, $users, $group_info;
    $sql = "SELECT * FROM `{$user_meta}` WHERE `meta_key`='groups';";
    $meta = $mySQLi->get_results($sql);
    $out = '';
    foreach ($meta as $row) {
        $user_groups = unserialize($row['meta_value']);
        if (in_array('Providers', $user_groups)) {
            $uid[] = $row['user_id'];
        }
    }
    // loop through each user_meta
    if (isset($uid)) {
        $ids = implode(',', $uid);
Example #5
0
// If some were fetched from memcached, get their artists
if(!empty($Results['matches'])) { // Fetch the artists for groups
	$GroupIDs = array_keys($Results['matches']);
	$Artists = get_artists($GroupIDs);
	
	foreach($Artists as $GroupID=>$Data) {
		if(!empty($Data[1])) {
			$Results['matches'][$GroupID]['Artists']=$Data[1]; // Only use main artists
		}
		ksort($Results['matches'][$GroupID]);
	}
}
*/
// These ones were not found in the cache, run SQL
if(!empty($Results['notfound'])) {
	$SQLResults = get_groups($Results['notfound']);
	
	if(is_array($SQLResults['notfound'])) { // Something wasn't found in the db, remove it from results
		reset($SQLResults['notfound']);
		foreach($SQLResults['notfound'] as $ID) {
			unset($SQLResults['matches'][$ID]);
			unset($Results['matches'][$ID]);
		}
	}
	
	// Merge SQL results with sphinx/memcached results
	foreach($SQLResults['matches'] as $ID=>$SQLResult) {
		$Results['matches'][$ID] = array_merge($Results['matches'][$ID], $SQLResult);
		ksort($Results['matches'][$ID]);
	}
}
Example #6
0
 }
 if ($_GET['page'] != "rules") {
     if ($row['sitemap']) {
         $allow_sitemap = "<br /><input type=\"checkbox\" name=\"allow_sitemap\" value=\"1\" checked> {$lang['allow_sitemap']}";
     } else {
         $allow_sitemap = "<br /><input type=\"checkbox\" name=\"allow_sitemap\" value=\"1\"> {$lang['allow_sitemap']}";
     }
     if ($row['disable_index']) {
         $disable_index = "<br /><input type=\"checkbox\" name=\"disable_index\" value=\"1\" checked> {$lang['add_disable_index']}";
     } else {
         $disable_index = "<br /><input type=\"checkbox\" name=\"disable_index\" value=\"1\"> {$lang['add_disable_index']}";
     }
 } else {
     $allow_sitemap = "";
 }
 $groups = get_groups(explode(',', $row['grouplevel']));
 if ($row['grouplevel'] == "all") {
     $check_all = "selected";
 } else {
     $check_all = "";
 }
 echo <<<HTML
t<tr><td>{$lang['static_type']}</td><td>{$fix_br}</td></tr>
t<tr><td colspan="2"><div class="hr_line"></div></td></tr>
   <tr>
       <td>&nbsp;</td>
       <td>{$lang['add_metatags']}<a href="#" class="hintanchor" onMouseover="showhint('{$lang['hint_metas']}', this, event, '220px')">[?]</a></td>
   </tr>
   <tr>
       <td height="29" style="padding-left:5px;">{$lang['meta_title']}</td>
       <td><input type="text" name="meta_title" style="width:388px;" class="edit bk" value="{$row['metatitle']}"></td>
Example #7
0
$grouplist = get_groups($uid);
//TODO CHECK GROUPS
if ($uid == $user->data['user_id']) {
    // only edit own profile
    $editprofile = true;
    $owngroupids = get_groupids($grouplist);
} else {
    // check if other user is part of your groups, if not exit
    $groupids = get_groupids($grouplist);
    $memberlist = get_groupmembers($groupids);
    $memberids = get_groupmember_ids($memberlist);
    //printr($memberlist);
    if (!in_array($uid, $memberids)) {
        fatal_error("No permission to view this profile");
    }
    $owngroupids = get_groupids(get_groups($user->data['user_id']));
}
// get message
if (isset($_GET['msg'])) {
    $message = get_msg($_GET['msg']);
}
switch ($mode) {
    case "show":
        $showprofile = true;
        $profile = get_user_profile($uid);
        $acList = get_user_achievements($uid, $owngroupids);
        if ($_SESSION['back'] != $_SERVER['PHP_SELF'] . "?mode=edit" && $_SESSION['back'] != $_SERVER['PHP_SELF'] && !strpos($_SESSION['back'], "expenses.php")) {
            $_SESSION['pshow_back'] = $_SESSION['back'];
            $backurl = $_SESSION['pshow_back'];
        } else {
            $backurl = $_SESSION['pshow_back'];
Example #8
0
        <div>
            <?php 
switch ($current_page) {
    // {{{ Dashboard
    case 'dashboard':
        ?>
                        <div>
                            <div style="float:left">
                                <div id="dashboard_chart_div"></div>
                            </div>

                            <div style="float:left; padding-top: 25px;"><strong>Recent Transactions</strong>
                                <div>
                                    Select group:
                                    <?php 
        $groups = get_groups($db);
        echo generate_select('groups', $groups, '', 'group_name', 'group_name');
        ?>
                                    from past:
                                    <select id='select_date_modifier' name='date_modifier'>
                                        <option value="-7 days">1 week</option>
                                        <option value="-14 days">2 weeks</option>
                                    </select>
                                    <input type="submit" id="dashboard_filter_transactions" value="Show" />
                                </div>
                                <table id='dashboard_transactions' class='yui-skin-sam'>
                                </table>
                            </div>
                        </div>
            <?php 
        break;
Example #9
0
function update_user_by_code($details, $user)
{
    $details['code'] = strip_codespaces($details['code']);
    $uid = get_userid_by_code($details['code']);
    $hash = $user->hash_pass($details['password']);
    $sql = "UPDATE users SET username = '******'username'] . "', realname = '" . $details['realname'] . "',\n          password = '******',  email = '" . $details['email'] . "', activated = '1', reg_date = '" . time() . "' \n          WHERE user_id = {$uid} LIMIT 1";
    $result = mysql_query($sql);
    if ($result) {
        cleanup_register($details['code']);
        $groups = get_groups($uid);
        return $groups;
    }
    return false;
}
Example #10
0
	FROM torrents AS t
	WHERE t.GroupID IN(".implode(',',$SnatchedGroupIDs).")
	GROUP BY t.GroupID");

//$DB->query('SELECT * FROM t');

$DB->query("SELECT GroupID FROM t 
		WHERE EncodingList NOT LIKE '%V0 (VBR)%' 
		OR EncodingList NOT LIKE '%V2 (VBR)%' 
		OR EncodingList NOT LIKE '%320%'");

$GroupIDs = $DB->collect('GroupID');

if(count($GroupIDs) == 0) { error('No results found'); }

$Results = get_groups($GroupIDs);

show_header('Transcode Snatches');
?>
<div class="thin">
	<table width="100%">
		<tr class="colhead">
			<td>Torrent</td>
			<td>V2</td>
			<td>V0</td>
			<td>320</td>
		</tr>
<?
$Results = $Results['matches'];
foreach ($Results as $GroupID=>$Group) {
	list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $Torrents, $Artists) = array_values($Group);
Example #11
0
    if (!is_capable($can_administrate, $operator)) {
        $errors[] = "You are not allowed to remove groups";
    }
    if (count($errors) == 0) {
        $link = connect();
        perform_query("delete from {$mysqlprefix}chatgroup where groupid = " . intval($groupid), $link);
        perform_query("delete from {$mysqlprefix}chatgroupoperator where groupid = " . intval($groupid), $link);
        perform_query("update {$mysqlprefix}chatthread set groupid = 0 where groupid = " . intval($groupid), $link);
        mysql_close($link);
        header("Location: {$mibewroot}/operator/groups.php");
        exit;
    }
}
function is_online($group)
{
    global $settings;
    return $group['ilastseen'] !== NULL && $group['ilastseen'] < $settings['online_timeout'] ? "1" : "";
}
function is_away($group)
{
    global $settings;
    return $group['ilastseenaway'] !== NULL && $group['ilastseenaway'] < $settings['online_timeout'] ? "1" : "";
}
$page = array();
$link = connect();
$page['groups'] = get_groups($link, true);
mysql_close($link);
$page['canmodify'] = is_capable($can_administrate, $operator);
prepare_menu($operator);
start_html_output();
require '../view/groups.php';
Example #12
0
        case 'book_entry':
            $myReturn = book_entry($_POST);
            break;
        case 'get_entry':
            $myReturn = get_entry($_POST);
            if (isset($myReturn['minutes_locked']) && $myReturn['minutes_locked'] > 31) {
                $data = array('user_id' => $myReturn['fields']['lock'], 'id' => $myReturn['fields']['id']);
                release_lock($data);
                $myReturn = get_entry($_POST);
            }
            break;
        case 'get_table_data':
            $myReturn = get_table_data($_POST['access_level'] * 1);
            break;
        case 'get_groups':
            $myReturn['groups'] = get_groups($_POST['nuid']);
            break;
        case 'release_lock':
            $myReturn = release_lock($_POST);
            break;
        case 'delete_revisions':
            $myReturn = delete_revisions($_POST);
            break;
        default:
            $myReturn['error'] = 'Not prepared to handle action "' . $_POST['action'] . '"';
            break;
    }
    // end switch
    $myReturn['action'] = $_POST['action'];
    $myReturn['last_accessed'] = log_user_access($_POST);
} else {
Example #13
0
     $photos = get_photos(array("user" => $u['userid'], "order" => " date_added DESC", "limit" => config('photo_channel_page')));
     if ($photos) {
         foreach ($photos as $photo) {
             assign('photo', $photo);
             assign('channelPhoto', true);
             $content['html'] .= Fetch("/blocks/photo.html");
         }
         $content['html'] .= '<div align="right" class="clearfix channelAjaxMoreLink photosMoreLink" style="clear:both; display:block;">';
         $content['html'] .= '<a href="' . cblink(array("name" => "user_photos")) . $u['username'] . '">' . lang('more') . '</a> | <a href="' . cblink(array("name" => "user_fav_photos")) . $u['username'] . '">' . lang('Favorites') . '</a>';
         $content['html'] .= '</div>';
     } else {
         $content['html'] = '<div align="center"><em>' . lang('User dont have any photos') . '</em></div>';
     }
     break;
 case "groups":
     $groups = get_groups(array("user" => $u['userid'], "order" => " date_added DESC", "limit" => config('photo_channel_page')));
     if ($groups) {
         foreach ($groups as $group) {
             assign('group', $group);
             assign('channelGroup', true);
             $content['html'] .= Fetch("/blocks/group.html");
         }
     } else {
         $content['html'] = '<div align="center"><em>' . lang('User dont have any groups.') . '</em></div>';
     }
     break;
 case "collections":
     $collections = get_collections(array("user" => $u['userid'], "order" => " date_added DESC", "limit" => config('collection_channel_page')));
     if ($collections) {
         foreach ($collections as $collection) {
             assign('collection', $collection);
Example #14
0
\t\t  <div class="col-lg-10">
\t\t\t<input type="button" onClick="send(); return false;" class="btn btn-green" value="{$lang['btn_send']}">&nbsp;
        <input onClick="preview()" type="button" class="btn btn-gray" value="{$lang['btn_preview']}">
\t\t  </div>
\t\t </div>\t
\t\t
\t</div>
\t
   </div>
</div>\t\t
</form>\t\t
HTML;
    echofooter();
} else {
    echoheader("<i class=\"icon-envelope\"></i>" . $lang['main_newsl'], $lang['header_ne_1']);
    $group_list = get_groups();
    echo <<<HTML
<form method="GET" action="" class="form-horizontal">
<input type="hidden" name="mod" value="newsletter">
<input type="hidden" name="action" value="message">
<div class="box">
  <div class="box-header">
    <div class="title">{$lang['nl_main']}</div>
  </div>
  <div class="box-content">

\t<div class="row box-section">
\t
\t\t<div class="form-group">
\t\t  <label class="control-label col-lg-2">{$lang['nl_type']}</label>
\t\t  <div class="col-lg-10">
Example #15
0
function backup_groups_info($bf, $preferences)
{
    global $CFG;
    $status = true;
    $status2 = true;
    //Get groups
    $groups = get_groups($preferences->backup_course);
    //TODO:check.
    //Pring groups header
    if ($groups) {
        //Pring groups header
        fwrite($bf, start_tag("GROUPS", 2, true));
        //Iterate
        foreach ($groups as $group) {
            //Begin group tag
            fwrite($bf, start_tag("GROUP", 3, true));
            //Output group contents
            fwrite($bf, full_tag("ID", 4, false, $group->id));
            ///fwrite ($bf,full_tag("COURSEID",4,false,$group->courseid));
            fwrite($bf, full_tag("NAME", 4, false, $group->name));
            fwrite($bf, full_tag("DESCRIPTION", 4, false, $group->description));
            fwrite($bf, full_tag("ENROLMENTKEY", 4, false, $group->enrolmentkey));
            //TODO:
            fwrite($bf, full_tag("LANG", 4, false, $group->lang));
            fwrite($bf, full_tag("THEME", 4, false, $group->theme));
            fwrite($bf, full_tag("PICTURE", 4, false, $group->picture));
            fwrite($bf, full_tag("HIDEPICTURE", 4, false, $group->hidepicture));
            fwrite($bf, full_tag("TIMECREATED", 4, false, $group->timecreated));
            fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $group->timemodified));
            //Now, backup groups_members, only if users are included
            if ($preferences->backup_users != 2) {
                $status2 = backup_groups_members_info($bf, $preferences, $group->id);
            }
            //End group tag
            fwrite($bf, end_tag("GROUP", 3, true));
        }
        //End groups tag
        $status = fwrite($bf, end_tag("GROUPS", 2, true));
        //Now save group_files
        if ($status && $status2) {
            $status2 = backup_copy_group_files($preferences);
        }
    }
    return $status && $status2;
}
Example #16
0
function get_list_members($course, &$nonmembers, &$listgroups)
{
    /// First, get everyone into the nonmembers array
    if ($students = get_course_students($course->id)) {
        foreach ($students as $student) {
            $nonmembers[$student->id] = fullname($student, true);
        }
        unset($students);
    }
    if ($teachers = get_course_teachers($course->id)) {
        foreach ($teachers as $teacher) {
            $prefix = '- ';
            if (isteacheredit($course->id, $teacher->id)) {
                $prefix = '# ';
            }
            $nonmembers[$teacher->id] = $prefix . fullname($teacher, true);
        }
        unset($teachers);
    }
    /// Pull out all the members into little arrays
    $groups = get_groups($course->id);
    if ($groups) {
        foreach ($groups as $group) {
            $countusers = 0;
            $listmembers[$group->id] = array();
            if ($groupusers = get_group_users($group->id)) {
                foreach ($groupusers as $groupuser) {
                    $listmembers[$group->id][$groupuser->id] = $nonmembers[$groupuser->id];
                    //unset($nonmembers[$groupuser->id]);
                    $countusers++;
                }
                natcasesort($listmembers[$group->id]);
            }
            $listgroups[$group->id] = $group->name . " ({$countusers})";
        }
        natcasesort($listgroups);
    }
    natcasesort($nonmembers);
    if (empty($selectedgroup)) {
        // Choose the first group by default
        if (!empty($listgroups) && ($selectedgroup = array_shift(array_keys($listgroups)))) {
            $members = $listmembers[$selectedgroup];
        }
    } else {
        $members = $listmembers[$selectedgroup];
    }
    return $listmembers;
}
Example #17
0
        <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
    </tr>
    <tr>
        <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
        <td style="padding:5px;" bgcolor="#FFFFFF">
<table width="100%">
    <tr>
        <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['massusers_head_2']}</div></td>
    </tr>
</table>
<div class="unterline"></div>
<table width="100%">
    <tr>
        <td style="padding:2px;" height="100" align="center">{$lang['massusers_confirm_4']}
HTML;
    echo " (<b>" . count($selected_users) . "</b>) {$lang['massusers_confirm_1']}<br><br>\r\n{$lang['user_acc']} <select name=\"editlevel\" class=\"edit\">" . get_groups() . "</select> {$lang['user_gtlimit']} <input size=\"17\" name=\"time_limit\" id=\"time_limit\" class=\"edit\" value=\"{$row['time_limit']}\"> <img src=\"engine/skins/images/img.gif\"  align=\"absmiddle\" id=\"t_trigger_ent\" style=\"cursor: pointer; border: 0\" title=\"{$lang['edit_ecal']}\"/><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('{$lang[hint_glhel]}', this, event, '250px')\">[?]</a>\r\n<br><br>\r\n<input class=\"btn btn-success\" type=submit value=\"   {$lang['mass_yes']}   \"> &nbsp; <input type=button class=\"btn btn-danger\" value=\"  {$lang['mass_no']}  \" onclick=\"javascript:document.location='{$PHP_SELF}?mod=editusers&amp;action=list'\">\r\n<input type=hidden name=action value=\"do_mass_move_to_group\">\r\n<input type=hidden name=user_hash value=\"{$dle_login_hash}\">\r\n<input type=hidden name=mod value=\"mass_user_actions\">";
    foreach ($selected_users as $userid) {
        $userid = intval($userid);
        echo "<input type=hidden name=selected_users[] value=\"{$userid}\">\n";
    }
    echo <<<HTML
    </tr>
</table>
</td>
        <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
    </tr>
    <tr>
        <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
        <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
        <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
    </tr>
Example #18
0
    $DB->query("SELECT\n\t\t\tr.ID,\n\t\t\tr.CategoryID,\n\t\t\tr.Title,\n\t\t\tr.Year,\n\t\t\tr.TimeAdded,\n\t\t\tCOUNT(rv.UserID) AS Votes,\n\t\t\tSUM(rv.Bounty) AS Bounty\n\t\tFROM requests AS r\n\t\t\tLEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID\n\t\t\tLEFT JOIN requests_artists AS ra ON r.ID=ra.RequestID \n\t\tWHERE ra.ArtistID = " . $ArtistID . "\n\t\t\tAND r.TorrentID = 0\n\t\tGROUP BY r.ID\n\t\tORDER BY Votes DESC");
    if ($DB->record_count() > 0) {
        $Requests = $DB->to_array();
    } else {
        $Requests = array();
    }
    $Cache->cache_value('artists_requests_' . $ArtistID, $Requests);
}
$NumRequests = count($Requests);
$LastReleaseType = 0;
if (empty($Importances) || empty($TorrentList)) {
    $DB->query("SELECT \n\t\t\tDISTINCT ta.GroupID, ta.Importance, tg.VanityHouse\n\t\t\tFROM torrents_artists AS ta\n\t\t\tJOIN torrents_group AS tg ON tg.ID=ta.GroupID\n\t\t\tWHERE ta.ArtistID='{$ArtistID}'\n\t\t\tORDER BY ta.Importance, tg.ReleaseType ASC, tg.Year DESC, tg.Name DESC");
    $GroupIDs = $DB->collect('GroupID');
    $Importances = $DB->to_array('GroupID', MYSQLI_BOTH, false);
    if (count($GroupIDs) > 0) {
        $TorrentList = get_groups($GroupIDs, true, true);
        $TorrentList = $TorrentList['matches'];
    } else {
        $TorrentList = array();
    }
}
$NumGroups = count($TorrentList);
//Get list of used release types
$UsedReleases = array();
foreach ($TorrentList as $GroupID => $Group) {
    if ($Importances[$GroupID]['Importance'] == '2') {
        $TorrentList[$GroupID]['ReleaseType'] = 1024;
        $GuestAlbums = true;
    }
    if ($Importances[$GroupID]['Importance'] == '3') {
        $TorrentList[$GroupID]['ReleaseType'] = 1023;
Example #19
0
function setup_redirect_links(UrlGeneratorInterface $url_generator, $threadid, $operator, $token)
{
    $result = array();

    $operator_in_isolation = in_isolation($operator);

    $list_options = $operator_in_isolation
        ? array('isolated_operator_id' => $operator['operatorid'])
        : array();
    $operators = get_operators_list($list_options);
    $operators_count = count($operators);

    $groups_count = 0;
    $groups = array();
    if (Settings::get('enablegroups') == "1") {
        $groupslist = $operator_in_isolation
            ? get_groups_for_operator($operator, true)
            : get_groups(true);
        foreach ($groupslist as $group) {
            if ($group['inumofagents'] == 0) {
                continue;
            }
            $groups[] = $group;
        }
        $groups_count = count($groups);
    }

    $p = pagination_info(max($operators_count, $groups_count), 8);
    $result['pagination'] = $p;

    $operators = array_slice($operators, $p['start'], $p['end'] - $p['start']);
    $groups = array_slice($groups, $p['start'], $p['end'] - $p['start']);

    $agent_list = "";
    $params = array('thread_id' => $threadid, 'token' => $token);
    foreach ($operators as $agent) {
        $params['nextAgent'] = $agent['operatorid'];
        $status = $agent['time'] < Settings::get('online_timeout')
            ? ($agent['istatus'] == 0
                ? getlocal("(online)")
                : getlocal("(away)"))
            : "";
        $agent_list .= "<li><a href=\"" . $url_generator->generate('chat_operator_redirect', $params)
            . "\" title=\"" . get_operator_name($agent) . "\">"
            . get_operator_name($agent)
            . "</a> $status</li>";
    }
    $result['redirectToAgent'] = $agent_list;

    $group_list = "";
    if (Settings::get('enablegroups') == "1") {
        $params = array('thread_id' => $threadid, 'token' => $token);
        foreach ($groups as $group) {
            $params['nextGroup'] = $group['groupid'];
            $status = group_is_online($group)
                ? getlocal("(online)")
                : (group_is_away($group) ? getlocal("(away)") : "");
            $group_list .= "<li><a href=\"" . $url_generator->generate('chat_operator_redirect', $params)
                . "\" title=\"" . get_group_name($group) . "\">"
                . get_group_name($group)
                . "</a> $status</li>";
        }
    }
    $result['redirectToGroup'] = $group_list;

    return $result;
}
Example #20
0
     $captcha_feedback_yes = "checked";
 } else {
     $captcha_feedback_no = "checked";
 }
 if ($user_group[$id]['feedback_question']) {
     $feedback_question_yes = "checked";
 } else {
     $feedback_question_no = "checked";
 }
 if ($id == 1) {
     $admingroup = "disabled";
 }
 if ($id == 5) {
     $gastgroup = "disabled";
 }
 $group_list = get_groups($user_group[$id]['rid']);
 if ($user_group[$id]['allow_cats'] == "all") {
     $allow_cats_value = "selected";
 }
 $categories_list = CategoryNewsSelection(explode(',', $user_group[$id]['allow_cats']), 0, false);
 if ($user_group[$id]['cat_add'] == "all") {
     $cat_add_value = "selected";
 }
 if ($user_group[$id]['cat_allow_addnews'] == "all") {
     $cat_allow_addnews_value = "selected";
 }
 $cat_add_list = CategoryNewsSelection(explode(',', $user_group[$id]['cat_add']), 0, false);
 $cat_allow_addnews_list = CategoryNewsSelection(explode(',', $user_group[$id]['cat_allow_addnews']), 0, false);
 $max_pm_value = $user_group[$id]['max_pm'];
 $max_foto_value = $user_group[$id]['max_foto'];
 $max_signature_value = $user_group[$id]['max_signature'];
Example #21
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Users panel.
 *
 * @package Admin\Admin
 */
if (!defined('txpinterface')) {
    die('txpinterface is undefined.');
}
$levels = get_groups();
if ($event == 'admin') {
    require_privs('admin');
    include_once txpath . '/lib/txplib_admin.php';
    $available_steps = array('admin_multi_edit' => true, 'admin_change_pageby' => true, 'author_list' => false, 'author_edit' => false, 'author_save' => true, 'author_save_new' => true, 'change_email' => true, 'change_email_form' => false, 'change_pass' => true, 'new_pass_form' => false);
    if ($step && bouncer($step, $available_steps)) {
        $step();
    } else {
        author_list();
    }
}
/**
 * Changes an email address.
 */
function change_email()
{
Example #22
0
function setup_redirect_links($threadid, $token)
{
    global $page, $mibewroot, $settings, $mysqlprefix;
    loadsettings();
    $link = connect();
    $operatorscount = db_rows_count("{$mysqlprefix}chatoperator", array(), "", $link);
    $groupscount = 0;
    $groups = array();
    if ($settings['enablegroups'] == "1") {
        foreach (get_groups($link, true) as $group) {
            if ($group['inumofagents'] == 0) {
                continue;
            }
            $groups[] = $group;
        }
        $groupscount = count($groups);
    }
    prepare_pagination(max($operatorscount, $groupscount), 8);
    $p = $page['pagination'];
    $limit = $p['limit'];
    $operators = select_multi_assoc(db_build_select("operatorid, vclogin, vclocalename, vccommonname, istatus, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time", "{$mysqlprefix}chatoperator", array(), "order by vclogin " . $limit), $link);
    $groups = array_slice($groups, $p['start'], $p['end'] - $p['start']);
    mysql_close($link);
    $agent_list = "";
    $params = array('thread' => $threadid, 'token' => $token);
    foreach ($operators as $agent) {
        $params['nextAgent'] = $agent['operatorid'];
        $status = $agent['time'] < $settings['online_timeout'] ? $agent['istatus'] == 0 ? getlocal("char.redirect.operator.online_suff") : getlocal("char.redirect.operator.away_suff") : "";
        $agent_list .= "<li><a href=\"" . add_params($mibewroot . "/operator/redirect.php", $params) . "\" title=\"" . safe_htmlspecialchars(topage(get_operator_name($agent))) . "\">" . safe_htmlspecialchars(topage(get_operator_name($agent))) . "</a> {$status}</li>";
    }
    $page['redirectToAgent'] = $agent_list;
    $group_list = "";
    if ($settings['enablegroups'] == "1") {
        $params = array('thread' => $threadid, 'token' => $token);
        foreach ($groups as $group) {
            $params['nextGroup'] = $group['groupid'];
            $status = $group['ilastseen'] !== NULL && $group['ilastseen'] < $settings['online_timeout'] ? getlocal("char.redirect.operator.online_suff") : ($group['ilastseenaway'] !== NULL && $group['ilastseenaway'] < $settings['online_timeout'] ? getlocal("char.redirect.operator.away_suff") : "");
            $group_list .= "<li><a href=\"" . add_params($mibewroot . "/operator/redirect.php", $params) . "\" title=\"" . safe_htmlspecialchars(topage(get_group_name($group))) . "\">" . safe_htmlspecialchars(topage(get_group_name($group))) . "</a> {$status}</li>";
        }
    }
    $page['redirectToGroup'] = $group_list;
}
Example #23
0
     }
     if ($row['start']) {
         $start_date = @date("Y-m-d H:i", $row['start']);
     }
     if ($row['end']) {
         $end_date = @date("Y-m-d H:i", $row['end']);
     }
     $groups = get_groups(explode(',', $row['grouplevel']));
     if ($row['grouplevel'] == "all") {
         $check_all = "selected";
     } else {
         $check_all = "";
     }
 } else {
     $canedit = false;
     $groups = get_groups();
     $check_all = "selected";
     $icategory = 0;
     $title = "";
     $body = "";
 }
 $opt_category = CategoryNewsSelection($icategory, 0, FALSE);
 if ($canedit == false) {
     echo "<form class=\"form-horizontal\" method=\"post\" action=\"?mod=editvote&action=doadd\" name=\"addvote\" onsubmit=\"if(document.addvote.title.value == '' || document.addvote.body.value == ''){DLEalert('{$lang['vote_alert']}', '{$lang['p_info']}');return false}\">";
     $button = "<input type=\"submit\" class=\"btn btn-green\" value=\"{$lang['vote_new']}\">";
 } else {
     echo "<form class=\"form-horizontal\" method=\"post\" action=\"?mod=editvote&action=update&id={$id}\" name=\"addvote\" onsubmit=\"if(document.addvote.title.value == '' || document.addvote.body.value == ''){DLEalert('{$lang['vote_alert']}', '{$lang['p_info']}');return false}\">";
     $button = "<input type=\"submit\" class=\"btn btn-green\" value=\"{$lang['vote_edit']}\">";
 }
 $user_group[$member_id['user_group']]['allow_image_upload'] = false;
 $user_group[$member_id['user_group']]['allow_file_upload'] = false;
Example #24
0
}
echo '<p>';
print_simple_box_start('center');
if (isteacher($course->id) || isadmin()) {
    echo '<div align="center">';
    echo '<form action="edit.php?id=' . $id . '" method="post">';
    echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
    echo '<input type="hidden" name="id" value="' . $id . '" />';
    echo '<button type="submit">' . get_string('edit_items', 'feedback') . '</button>';
    echo '</form>';
    echo '<br />';
    echo '</div>';
    //liste der Studenten anzeigen
    print_simple_box_start('center');
    //available group modes (NOGROUPS, SEPARATEGROUPS or VISIBLEGROUPS)
    $feedbackgroups = get_groups($course->id);
    if (is_array($feedbackgroups) && $groupmode != SEPARATEGROUPS) {
        //Dropdownliste zur Auswahl der Gruppe
        echo '<div align="center"><form action="' . me() . '" method="get">';
        echo '<select name="lstgroupid" onchange="this.form.submit()">';
        echo '<option value="-1">' . get_string('allgroups') . '</option>';
        foreach ($feedbackgroups as $group) {
            if ($group->id == $mygroupid) {
                $groupselect = ' selected="selected" ';
            } else {
                $groupselect = '';
            }
            echo '<option value="' . $group->id . '"' . $groupselect . '>' . $group->name . '</option>';
        }
        echo '</select>';
        echo '<input type="hidden" name="id" value="' . $cm->id . '" />';
Example #25
0
    <script type="text/javascript">

    <!--

        function auto<?php 
echo $autocomplete;
?>
() {
            this.select = document.getElementById('auto<?php 
echo $autocomplete;
?>
select');
            this.groups = new Array();
        <?php 
foreach (get_groups($error) as $group) {
    echo "this.groups.push('{$group['0']}');\n";
}
?>
        }

        auto<?php 
echo $autocomplete;
?>
.prototype.validOnEnter = function(field,event) {
            if (event.keyCode==13) {
                return false;
            }
            return true;
        }
Example #26
0
function setup_survey($name, $email, $groupid, $info, $referrer)
{
    global $settings, $page;
    $page['formname'] = topage($name);
    $page['formemail'] = topage($email);
    $page['formgroupid'] = $groupid;
    $page['forminfo'] = topage($info);
    $page['referrer'] = urlencode(topage($referrer));
    if ($settings['enablegroups'] == '1' && $settings["surveyaskgroup"] == "1") {
        $link = connect();
        $allgroups = get_groups($link, false);
        mysql_close($link);
        $val = "";
        foreach ($allgroups as $k) {
            $groupname = $k['vclocalname'];
            if ($k['inumofagents'] == 0) {
                continue;
            }
            if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) {
                if (!$groupid) {
                    $groupid = $k['groupid'];
                    // select first online group
                }
            } else {
                $groupname .= " (offline)";
            }
            $isselected = $k['groupid'] == $groupid;
            $val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">{$groupname}</option>";
        }
        $page['groups'] = $val;
    }
    $page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : "";
    $page['showmessage'] = $settings["surveyaskmessage"] == "1" ? "1" : "";
    $page['showname'] = $settings['usercanchangename'] == "1" ? "1" : "";
}
Example #27
0
            $indexes = $cbindex->count_index("user", $params);
            $fields = $cbindex->extract_fields("user", $params);
            $msg[] = $users[$i]['userid'] . ": Updating <strong><em>" . $users[$i]['username'] . "</em></strong>";
            $cbindex->update_index("user", array("fields" => $fields, "values" => $indexes, "user" => $users[$i]['userid']));
        }
        $i++;
    }
    e($start_index + 1 . " - " . $to . "  users have been reindexed successfully.", "m");
    assign("index_msgs", $msg);
    assign("indexing", "yes");
    assign('mode', 'index_usrs');
}
//Reindex Grous
if (isset($_GET['index_gps'])) {
    $groups = get_groups(array("active" => "yes"));
    $total_groups = get_groups(array("count_only" => true, "active" => "yes"));
    $percent = $cbindex->percent(50, $total_groups);
    $i = 0;
    assign('total', $total_groups);
    assign('from', $start_index + 1);
    $to = $start_index + $loop_size;
    if ($to > $total_groups) {
        $to = $total_groups;
        e($total_groups . " groups have been reindexed successfully.", "m");
        assign("stop_loop", "yes");
    }
    assign('to', $to);
    while ($i < $total_groups) {
        if ($groups[$i]['group_id']) {
            $params = array("group_id" => $groups[$i]['group_id'], "group_videos" => true, "group_topics" => true, "group_members" => true);
            $indexes = $cbindex->count_index("group", $params);
Example #28
0
    <tr>
        <td style="padding:4px;">{$lang['user_newlogin']}</td>
        <td colspan="2"><input size="20" name="editlogin" class="edit bk"></td>
    </tr>
    <tr>
        <td style="padding:4px;">{$lang['user_newpass']}</td>
        <td colspan="2"><input size="20" name="editpass" class="edit bk"></td>
    </tr>
    <tr>
        <td colspan="3"><hr></td>
    </tr>
    <tr>
        <td style="padding:4px;">{$lang['user_acc']}</td>
        <td colspan="2"><select name="editlevel">
HTML;
    echo get_groups($row[user_group]);
    if ($row['banned'] == "yes") {
        $ifch = "checked";
    }
    $row['days'] = intval($row['days']);
    if ($row['banned'] == "yes" and $row['days']) {
        $endban = $lang['ban_edate'] . " " . langdate("j F Y H:i", $row['banned_date']);
    } else {
        $endban = "";
    }
    $restricted_selected = array(0 => '', 1 => '', 2 => '', 3 => '');
    $restricted_selected[$row['restricted']] = 'selected';
    if ($row['restricted'] and $row['restricted_days']) {
        $end_restricted = $lang['edit_tdate'] . " " . langdate("j M Y H:i", $row['restricted_date']);
    } else {
        $end_restricted = "";
Example #29
0
if(!is_array($TorrentList)) {
	$DB->query("SELECT ct.GroupID,
			tg.WikiImage,
			tg.CategoryID,
			um.ID,
			um.Username
			FROM collages_torrents AS ct
			JOIN torrents_group AS tg ON tg.ID=ct.GroupID
			LEFT JOIN users_main AS um ON um.ID=ct.UserID
			WHERE ct.CollageID='$CollageID'
			ORDER BY ct.Sort");
	
	$GroupIDs = $DB->collect('GroupID');
	$CollageDataList=$DB->to_array('GroupID', MYSQLI_ASSOC);
	if(count($GroupIDs)>0) {
		$TorrentList = get_groups($GroupIDs);
		$TorrentList = $TorrentList['matches'];
	} else {
		$TorrentList = array();
	}
}

// Loop through the result set, building up $Collage and $TorrentTable
// Then we print them.
$Collage = array();
$TorrentTable = '';

$NumGroups = 0;
$Artists = array();
$Tags = array();
$Users = array();
Example #30
0
         $upt->track('enrolments', get_string('enrolledincourserole', '', $a));
     } else {
         $upt->track('enrolments', get_string('enrolledincoursenotrole', '', $a), 'error');
     }
 }
 // find group to add to
 if (!empty($user->{'group' . $i})) {
     // make sure user is enrolled into course before adding into groups
     if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
         $upt->track('enrolments', get_string('addedtogroupnotenrolled', '', $gname), 'error');
         continue;
     }
     //build group cache
     if (is_null($ccache[$shortname]->groups)) {
         $ccache[$shortname]->groups = array();
         if ($groups = get_groups($courseid)) {
             foreach ($groups as $gid => $group) {
                 $ccache[$shortname]->groups[$gid] = new object();
                 $ccache[$shortname]->groups[$gid]->id = $gid;
                 $ccache[$shortname]->groups[$gid]->name = $group->name;
                 if (!is_numeric($group->name)) {
                     // only non-numeric names are supported!!!
                     $ccache[$shortname]->groups[$group->name] = new object();
                     $ccache[$shortname]->groups[$group->name]->id = $gid;
                     $ccache[$shortname]->groups[$group->name]->name = $group->name;
                 }
             }
         }
     }
     // group exists?
     $addgroup = $user->{'group' . $i};