// ############################### EDIT OPTIONS ############################### // ############################################################################ if ($_REQUEST['do'] == 'editoptions') { require_once DIR . '/includes/functions_misc.php'; ($hook = vBulletinHook::fetch_hook('profile_editoptions_start')) ? eval($hook) : false; // check the appropriate checkboxes $checked = array(); foreach ($vbulletin->userinfo as $key => $val) { if ($val != 0) { $checked["{$key}"] = 'checked="checked"'; } else { $checked["{$key}"] = ''; } } // invisible option $show['invisibleoption'] = iif(bitwise($permissions['genericpermissions'], $vbulletin->bf_ugp_genericpermissions['caninvisible']), true, false); // Email members option $show['receiveemail'] = ($vbulletin->options['enableemail'] and $vbulletin->options['displayemails']) ? true : false; // reputation options if ($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canhiderep'] and $vbulletin->options['reputationenable']) { if ($vbulletin->userinfo['showreputation']) { $checked['showreputation'] = 'checked="checked"'; } $show['reputationoption'] = true; } else { $show['reputationoption'] = false; } // PM options $show['pmoptions'] = ($vbulletin->options['enablepms'] and $permissions['pmquota'] > 0) ? true : false; $show['friend_email_request'] = ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_friends'] and $vbulletin->userinfo['permissions']['genericpermissions2'] & $vbulletin->bf_ugp_genericpermissions2 ? true : false); // VM Options
if (!$userinfo) { print_stop_message('invalid_user_specified'); } $perms = cache_permissions($userinfo); print_form_header('', ''); print_table_header($userinfo['username'] . " <span class=\"normal\">(userid: $userinfo[userid])</span>"); foreach ($userinfo['forumpermissions'] AS $forumid => $forumperms) { print_table_header($vbulletin->forumcache["$forumid"]['title'] . " <span class=\"normal\">(forumid: $forumid)</span>"); foreach ($vbulletin->bf_ugp_forumpermissions AS $key => $val) { if (bitwise($userinfo['forumpermissions']["$forumid"], $val)) { print_label_row($bitfieldnames["$val"], '<b>' . $vbphrase['yes'] . '</b>'); } else { print_label_row($bitfieldnames["$val"], '<b>' . $vbphrase['no'] . '</b>'); } } } print_table_footer(); } print_cp_footer(); /*======================================================================*\ || ####################################################################
// which fields to display? $show['homepagecol'] = bitwise($vbulletin->options['memberlistfields'], 1); $show['searchcol'] = bitwise($vbulletin->options['memberlistfields'], 2); $show['datejoinedcol'] = bitwise($vbulletin->options['memberlistfields'], 4); $show['postscol'] = bitwise($vbulletin->options['memberlistfields'], 8); $show['usertitlecol'] = bitwise($vbulletin->options['memberlistfields'], 16); $show['lastvisitcol'] = bitwise($vbulletin->options['memberlistfields'], 32); $show['reputationcol'] = iif(bitwise($vbulletin->options['memberlistfields'], 64) AND $vbulletin->options['reputationenable'], 1, 0); $show['avatarcol'] = iif(bitwise($vbulletin->options['memberlistfields'], 128) AND $vbulletin->options['avatarenabled'], 1, 0); $show['birthdaycol'] = bitwise($vbulletin->options['memberlistfields'], 256); $show['agecol'] = bitwise($vbulletin->options['memberlistfields'], 512); $show['emailcol'] = (bitwise($vbulletin->options['memberlistfields'], 1024) AND ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canemailmember'] OR ($vbulletin->options['enablepms'] AND $vbulletin->userinfo['permissions']['pmquota']))); $show['customfields'] = bitwise($vbulletin->options['memberlistfields'], 2048); $show['imicons'] = bitwise($vbulletin->options['memberlistfields'], 4096); $show['profilepiccol'] = iif(bitwise($vbulletin->options['memberlistfields'], 8192) AND $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseeprofilepic'], 1, 0); $show['advancedlink'] = false; // work out total columns $totalcols = $show['emailcol'] + $show['homepagecol'] + $show['searchcol'] + $show['datejoinedcol'] + $show['postscol'] + $show['lastvisitcol'] + $show['reputationcol'] + $show['avatarcol'] + $show['birthdaycol'] + $show['agecol'] + $show['profilepiccol'] + $show['imicons']; $navpopup = array( 'id' => 'memberlist_navpopup', 'title' => $vbphrase['members_list'], 'link' => 'memberlist.php' . $vbulletin->session->vars['sessionurl_q'], ); construct_quick_nav($navpopup); // ############################################################################# // show results
vbsetcookie('coppaage', $month . '-' . $day . '-' . $year, 1); } $show['coppa'] = true; } } } } else { $show['coppa'] = false; } ($hook = vBulletinHook::fetch_hook('register_form_start')) ? eval($hook) : false; if ($errorlist) { $checkedoff['adminemail'] = iif($vbulletin->GPC['options']['adminemail'], 'checked="checked"'); $checkedoff['showemail'] = iif($vbulletin->GPC['options']['showemail'], 'checked="checked"'); } else { $checkedoff['adminemail'] = iif(bitwise($vbulletin->bf_misc_regoptions['adminemail'], $vbulletin->options['defaultregoptions']), 'checked="checked"'); $checkedoff['showemail'] = iif(bitwise($vbulletin->bf_misc_regoptions['receiveemail'], $vbulletin->options['defaultregoptions']), 'checked="checked"'); } if ($vbulletin->options['reqbirthday'] and !$vbulletin->options['usecoppa']) { $show['birthday'] = true; $monthselected[str_pad($vbulletin->GPC['month'], 2, '0', STR_PAD_LEFT)] = 'selected="selected"'; $dayselected[str_pad($vbulletin->GPC['day'], 2, '0', STR_PAD_LEFT)] = 'selected="selected"'; if ($year == 0) { $year = ''; } // Default Birthday Privacy option to show all if (empty($errorlist)) { $sbselected = array(2 => 'selected="selected"'); } $templater = vB_Template::create('modifyprofile_birthday'); $templater->register('birthdate', $birthdate); $templater->register('dayselected', $dayselected);
print_table_header($titlecache["{$vbulletin->GPC['nodeid']}"] . " <span class=\"normal\">(nodeid: " . $vbulletin->GPC['nodeid'] . ")</span>"); //nodeid was set so show permissions for all usergroups on that node foreach ($perms["{$vbulletin->GPC['nodeid']}"] as $_usergroupid => $usergroup) { print_table_header($usergrouptitlecache["{$_usergroupid}"] . " <span class=\"normal\">(usergroupid: {$_usergroupid})</span>"); foreach ($vbulletin->GPC['checkperm'] as $key => $val) { if (bitwise($usergroup, $val)) { print_label_row($bitfieldnames["{$val}"], '<b>' . $vbphrase['yes'] . '</b>'); } else { print_label_row($bitfieldnames["{$val}"], '<b>' . $vbphrase['no'] . '</b>'); } } } } else { print_table_header($usergrouptitlecache["{$vbulletin->GPC['usergroupid']}"] . ' / ' . $titlecache["{$vbulletin->GPC['nodeid']}"]); foreach ($vbulletin->GPC['checkperm'] as $key => $val) { if (bitwise($perms["{$vbulletin->GPC['nodeid']}"]["{$vbulletin->GPC['usergroupid']}"], $val)) { print_label_row($bitfieldnames["{$val}"], '<b>' . $vbphrase['yes'] . '</b>'); } else { print_label_row($bitfieldnames["{$val}"], '<b>' . $vbphrase['no'] . '</b>'); } } } } print_table_footer(); } // ###################### Start viewing resources for specific user ######################## if ($_REQUEST['do'] == 'viewuser') { $userinfo = fetch_userinfo($vbulletin->GPC['userid']); $usercontext = vB::getUserContext($vbulletin->GPC['userid']); if (!$userinfo) { print_stop_message2('invalid_user_specified');
$vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids,\n username, password, salt FROM " . TABLE_PREFIX . "user\n WHERE userid = " . $userid); require_once DIR . '/includes/functions_login.php'; vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true); vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true); process_new_login('', 1, $vbulletin->GPC['cssprefs']); cache_permissions($vbulletin->userinfo, true); $vbulletin->session->save(); if ($vbulletin->options['welcomemail']) { eval(fetch_email_phrases('welcomemail')); vbmail($email, $subject, $message); } $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); $userinfo_welcome = fetch_userinfo($userid); $userdata->set_existing($userinfo_welcome); if ($newusergroupid == 2) { if (bitwise($vbulletin->bf_misc_regoptions['receivepm'], $vbulletin->options['defaultregoptions'])) { $userdata->send_welcomepm(); } } } $userinfo = fetch_userinfo($userid); $userdata_save->set_existing($userinfo); $userdata_save->save(); } $arr = array("valid_entries" => $valid_entries, "error_type" => $error_type, "messages" => $messages, "url" => $url); json_headers($arr); break; case "linkaccount": $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); $valid_entries = TRUE; $message = "OK";