Esempio n. 1
0
/** アカウント情報を得る。<br />
    int xnp_get_account( string sess_id, int uid, array account )
    @param sess_id   XOOPSのセッションID
    @param uid   xoops_users.uid
    @param account アカウント情報を受け取る連想配列
    @return RES_OK success
  */
function xnp_get_account($sess_id, $uid, &$account)
{
    $accounts = array();
    $account = array();
    $result = xnp_get_accounts($sess_id, array((int) $uid), array(), $accounts);
    if (isset($accounts[0])) {
        $account = $accounts[0];
    }
    return $result;
}
Esempio n. 2
0
{
    $u = new XoopsUser($su_uid);
    $groupids = $u->getGroups();
    $_SESSION['xoopsUserId'] = $su_uid;
    $_SESSION["xoopsUserGroups"] = $groupids;
}
if ($op == '') {
    if (isset($_SESSION['xoonips_old_uid'])) {
        redirect_header(XOOPS_URL . '/', 0, '');
        // already in su-mode
        exit;
    }
    $users = array();
    $uids = array();
    xnp_dump_uids($xnpsid, array(), $uids);
    xnp_get_accounts($xnpsid, $uids, array(), $users);
    // Sort by user account name
    foreach ($users as $key => $values) {
        $unameValues[$key] = $values['uname'];
    }
    $users_sort = $users;
    array_multisort($unameValues, SORT_ASC, $users_sort);
    $xoopsOption['template_main'] = 'xoonips_su.html';
    include XOOPS_ROOT_PATH . '/header.php';
    // Send variables to templete
    $xoopsTpl->assign('users', $users_sort);
    $xoopsTpl->assign('su_uid', $uids[0]);
    include XOOPS_ROOT_PATH . '/footer.php';
} else {
    if ($op == 'su') {
        $su_uid = $formdata->getValue('post', 'su_uid', 'i', true);