function get_userlist()
{
    global $config, $ds;
    $userlist = array();
    $userhash = array();
    $ldap_groups = get_group_list();
    foreach ($ldap_groups as $ldap_group) {
        $group_cn = get_cn($ldap_group);
        $search = ldap_search($ds, $config['auth_ad_base_dn'], "(cn={$group_cn})", array('member'));
        $entries = ldap_get_entries($ds, $search);
        foreach ($entries[0]['member'] as $member) {
            $member_cn = get_cn($member);
            $search = ldap_search($ds, $config['auth_ad_base_dn'], "(cn={$member_cn})", array('sAMAccountname', 'displayName', 'objectSID', 'mail'));
            $results = ldap_get_entries($ds, $search);
            foreach ($results as $result) {
                if (isset($result['samaccountname'][0])) {
                    $userid = preg_replace('/.*-(\\d+)$/', '$1', sid_from_ldap($result['objectsid'][0]));
                    // don't make duplicates, user may be member of more than one group
                    $userhash[$result['samaccountname'][0]] = array('realname' => $result['displayName'][0], 'user_id' => $userid, 'email' => $result['mail'][0]);
                }
            }
        }
    }
    foreach (array_keys($userhash) as $key) {
        $userlist[] = array('username' => $key, 'realname' => $userhash[$key]['realname'], 'user_id' => $userhash[$key]['user_id'], 'email' => $userhash[$key]['email']);
    }
    return $userlist;
}
Beispiel #2
0
function get_userlist()
{
    global $config, $ldap_connection;
    $userlist = array();
    $filter = '(' . $config['auth_ldap_prefix'] . '*)';
    $search = ldap_search($ldap_connection, trim($config['auth_ldap_suffix'], ','), $filter);
    $entries = ldap_get_entries($ldap_connection, $search);
    if ($entries['count']) {
        foreach ($entries as $entry) {
            $username = $entry['uid'][0];
            $realname = $entry['cn'][0];
            $user_id = $entry['uidnumber'][0];
            $email = $entry[$config['auth_ldap_emailattr']][0];
            $ldap_groups = get_group_list();
            foreach ($ldap_groups as $ldap_group) {
                $ldap_comparison = ldap_compare($ldap_connection, $ldap_group, $config['auth_ldap_groupmemberattr'], get_membername($username));
                if (!isset($config['auth_ldap_group']) || $ldap_comparison === true) {
                    $userlist[] = array('username' => $username, 'realname' => $realname, 'user_id' => $user_id, 'email' => $email);
                }
            }
        }
    }
    return $userlist;
}
Beispiel #3
0
        try {
            $sql_update = 'UPDATE ' . $GLOBALS['ecs']->table('users_data') . ' SET visits=visits+1,handle_time=UNIX_TIMESTAMP(),' . "admin_id=0,user_type={$feed},{$feed_info[$feed]}={$feed_info[$feed]}+1 WHERE rec_id={$rec_id}";
            $GLOBALS['db']->query($sql_update);
            $res['message'] = '该顾客的资料状况已更新!';
        } catch (Exception $ex) {
            $res['message'] = $ex;
        }
    }
    $sql_insert = 'INSERT INTO ' . $GLOBALS['ecs']->table('users_data_stats') . '(data_id,admin_id,user_type,handle_time)VALUES(' . "{$rec_id},{$_SESSION['admin_id']},{$feed},UNIX_TIMESTAMP())";
    $GLOBALS['db']->query($sql_insert);
    die($json->encode($res));
} elseif ($_REQUEST['act'] == 'view_admin_cate') {
    // 权限控制
    if (!admin_priv('everyone_sales', '', false)) {
        $admin_list = get_admin_tmp_list($_SESSION['role_id']);
        $group_list = get_group_list($_SESSION['role_id']);
        $smarty->assign('group_list', $group_list);
    } else {
        $role_id = '1,9';
        $admin_list = get_admin_tmp_list($role_id);
    }
    // 部门列表
    $smarty->assign('role_list', get_role_list(' WHERE role_type IN (1,2) '));
    // 客服列表
    $smarty->assign('admin_list', $admin_list);
    $smarty->assign('curr_title', '查看自定义列表');
    $res['main'] = $smarty->fetch('view_admin_cate.htm');
    die($json->encode($res));
} elseif ($_REQUEST['act'] == 'view_user_list') {
    $admin_id = intval($_REQUEST['admin_id']);
    $smarty->assign('cat_list', user_cat_list(1, $admin_id));
Beispiel #4
0
     $smarty->assign('order_class', $_REQUEST['order_class']);
     $sch_condition .= '&order_class=' . $_REQUEST['order_class'];
 }
 $smarty->assign('sch_condition', $sch_condition);
 // 分页参数
 $smarty->assign('page_link', $order_list['condition']);
 $smarty->assign('page_set', $order_list['page_set']);
 $smarty->assign('record_count', $order_list['record_count']);
 $smarty->assign('page_size', $order_list['page_size']);
 $smarty->assign('page', $order_list['page']);
 $smarty->assign('page_count', $order_list['page_count']);
 $smarty->assign('page_start', $order_list['start']);
 $smarty->assign('page_end', $order_list['end']);
 $smarty->assign('filter', $order_list['filter']);
 if ($order_list['filter']['platform']) {
     $smarty->assign('group_list', get_group_list($order_list['filter']['platform']));
     $smarty->assign('admin_list', get_admin_tmp_list($order_list['filter']['platform']));
 }
 if ($order_list['filter']['group_id']) {
     $smarty->assign('admin_list', get_admin_list_by_group($order_list['filter']['group_id']));
 }
 if ($order_list['filter']['brand']) {
     $smarty->assign('goods_list', get_goods_by_brand($order_list['filter']['brand']));
 }
 if (admin_priv('order_print', '', false)) {
     $smarty->assign('access', 1);
 }
 $smarty->assign('curr_title', '每日订单核对');
 $smarty->assign('num', sprintf('(%d笔订单,共%.2f元)', $order_list['record_count'], $order_list['final_amount']));
 $res['main'] = $smarty->fetch('everyday_order_check.htm');
 if (isset($_REQUEST['day'])) {
function get_userlist()
{
    global $config, $ldap_connection;
    $userlist = array();
    $userhash = array();
    $ldap_groups = get_group_list();
    foreach ($ldap_groups as $ldap_group) {
        $search_filter = "(memberOf={$ldap_group})";
        if ($config['auth_ad_user_filter']) {
            $search_filter = "(&{$config['auth_ad_user_filter']}{$search_filter})";
        }
        $search = ldap_search($ldap_connection, $config['auth_ad_base_dn'], $search_filter, array('samaccountname', 'displayname', 'objectsid', 'mail'));
        $results = ldap_get_entries($ldap_connection, $search);
        foreach ($results as $result) {
            if (isset($result['samaccountname'][0])) {
                $userid = preg_replace('/.*-(\\d+)$/', '$1', sid_from_ldap($result['objectsid'][0]));
                // don't make duplicates, user may be member of more than one group
                $userhash[$result['samaccountname'][0]] = array('realname' => $result['displayName'][0], 'user_id' => $userid, 'email' => $result['mail'][0]);
            }
        }
    }
    foreach (array_keys($userhash) as $key) {
        $userlist[] = array('username' => $key, 'realname' => $userhash[$key]['realname'], 'user_id' => $userhash[$key]['user_id'], 'email' => $userhash[$key]['email']);
    }
    return $userlist;
}
     if ($discussionidcount == 0) {
         $subscribed = forum::NOT_SUBSCRIBED;
     } else {
         $subscribed = forum::PARTIALLY_SUBSCRIBED;
     }
 }
 if ($forum->can_change_subscription()) {
     if ($requestingsubscribe && $subscribed != forum::FULLY_SUBSCRIBED) {
         // If this is separate groups and user does not have access all groups,
         // then make a group list
         $group_list = -1;
         // if separate groups and not access all groups , set to list of groups
         $context = $forum->get_context();
         $aaguser = has_capability('moodle/site:accessallgroups', $context);
         if ($forum->get_group_mode() == SEPARATEGROUPS && !$aaguser) {
             $group_list = get_group_list($userid, $forumid);
         }
         if ($group_list == -1) {
             $forum->subscribe();
         } else {
             foreach ($group_list as $groupid) {
                 $forum->subscribe(0, $groupid);
             }
         }
         $confirmtext = get_string('subscribe_confirm', 'forumng');
     } else {
         if ($requestingunsubscribe && $subscribed != forum::NOT_SUBSCRIBED) {
             $forum->unsubscribe();
             $confirmtext = get_string('unsubscribe_confirm', 'forumng');
         }
     }