function getLevel() { global $xoopsModuleConfig, $forumUrl; $user =& $this->user; $level =& get_user_level($user); if ($xoopsModuleConfig['user_level'] == 2) { $table = "<table class='userlevel'><tr><td class='end'><img src='" . $forumUrl['images_set'] . "/rpg/img_left.gif' alt='' /></td><td class='center' background='" . $forumUrl['images_set'] . "/rpg/img_backing.gif'><img src='" . $forumUrl['images_set'] . "/rpg/%s.gif' width='%d' alt='' /></td><td><img src='" . $forumUrl['images_set'] . "/rpg/img_right.gif' alt='' /></td></tr></table>"; $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />" . sprintf($table, "orange", $level['hp_width']); $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />" . sprintf($table, "green", $level['mp_width']); $info .= _MD_EXP . " " . $level['exp'] . "<br />" . sprintf($table, "blue", $level['exp_width']); } else { $info = _MD_LEVEL . " " . $level['level'] . "; " . _MD_EXP . " " . $level['exp'] . "<br />"; $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; } return $info; }
function is_admin_for_domain($uid, $domain_id) { global $dbh; $user_level = get_user_level($uid); if ($user_level == "S") { return true; } else { $select = "SELECT maia_users.user_level " . "FROM maia_users, maia_domain_admins " . "WHERE maia_users.id = ? " . "AND maia_users.id = maia_domain_admins.admin_id " . "AND maia_domain_admins.domain_id = ?"; $sth = $dbh->query($select, array($uid, $domain_id)); if ($row = $sth->fetchrow()) { $result = $row["user_level"] == "A"; } else { $result = false; } $sth->free(); return $result; } }
function is_admin_for_domain($uid, $domain_id) { global $dbh; $user_level = get_user_level($uid); if ($user_level == "S") { return true; } else { $sth = $dbh->prepare("SELECT maia_users.user_level " . "FROM maia_users, maia_domain_admins " . "WHERE maia_users.id = ? " . "AND maia_users.id = maia_domain_admins.admin_id " . "AND maia_domain_admins.domain_id = ?"); $res = $sth->execute(array($uid, $domain_id)); if (PEAR::isError($sth)) { die($sth->getMessage()); } if ($row = $res->fetchrow()) { $result = $row["user_level"] == "A"; } else { $result = false; } $sth->free(); return $result; } }
/** * This function call when a post request send .If that request is a valid addTicket request, new ticket will added, * Else redirect user to not found page or echo error message; * @param WP_USER $user * @return string */ function post_request($user) { if (!isset($_POST["requestType"]) || $_POST["requestType"] != "addTicket" && $_POST["requestType"] != "addTicketAnswer") { header("Location: " . NOT_FOUND_URL); exit; } $const_array = array("applicant_id" => $user->ID, "status" => 0, "attachments" => $_POST["upfile"], "title" => $_POST["title"], "content" => $_POST["message"], "department" => $_POST["department"], "other" => "priority:" . $_POST["priority"] . "|", "related_order" => get_id($_POST["order"])); if (isset($_POST['relatedTicket'])) { $related_ticket = $_POST['relatedTicket']; $const_array = array_merge($const_array, array("related_ticket" => get_id($related_ticket))); } if ($_POST["requestType"] == "addTicket") { foreach ($const_array as $key => $value) { if (empty($value) && $value !== 0 && $key !== "attachments" && $key !== "order" && $key !== "related_ticket") { return "لطفا متنی تایپ کنید!" . "<br>"; } } } else { if (empty($_POST["message"])) { return "متن پاسخ نیم تواند خالی باشد"; } } $ticket = new Ticket($const_array); if ($ticket->create()) { if ($_POST["requestType"] == "addTicket") { echo "1|ticket.php?iti=" . $ticket->get_fake_id(); exit; } else { if (get_user_level($user->ID) == 10) { Ticket::change_ticket_status($ticket->get_related_ticket_id(), 1); } else { Ticket::change_ticket_status($ticket->get_related_ticket_id(), 0); } echo "پاسخ شما افزوده شد"; } } else { return "مشکلی در ایجاد تیکت وجود دارد.لطفا مجددا تلاش کنید"; } }
function get_user_level_class($user_level, $default = 'gen', $user = array()) { $ret = $default; if (!empty($user)) { $user_level = get_user_level($user); } switch ($user_level) { case ADMIN_FOUNDER: $ret = 'foundercolor'; break; case ADMIN: $ret = 'admincolor'; break; case MOD: $ret = 'modcolor'; break; default: $ret = 'usercolor'; break; } return $ret; }
$custom_title_activated = FALSE; if ($userdata['user_custom_title_status'] == CUSTOM_TITLE_ENABLED || $userdata['user_custom_title_status'] == CUSTOM_TITLE_REGDATE && $membertime >= $board_config['custom_title_days'] * 86400 && $userdata['user_posts'] >= $board_config['custom_title_posts']) { $custom_title_activated = TRUE; $lang['profilcp_signature_shortcut'] = $lang['Custom_title'] . '/Signature'; } // // Custom Title MOD End // if (!empty($setmodules)) { if ($board_config['allow_sig']) { pcp_set_sub_menu('profil', 'signature', 30, __FILE__, 'profilcp_signature_shortcut', 'profilcp_signature_pagetitle'); } return; } // check access if ($userdata['user_id'] != $view_userdata['user_id'] && (!is_admin($userdata) || $level_prior[get_user_level($userdata)] <= $level_prior[get_user_level($view_userdata)])) { return; } // // template file $template->set_filenames(array('body' => 'profilcp/profil_signature_body.tpl')); if ($submit || $preview) { // // Custom Title MOD // $custom_title = str_replace('<br />', "\n", trim(str_replace("\\'", "''", $HTTP_POST_VARS['custom_title']))); // new // Verify the user is allowed to alter their custom title. If not, replace it with their old one. if ($custom_title_activated == FALSE) { $custom_title = addslashes($view_userdata['user_custom_title']); }
<meta charset="UTF-8"> <link rel="stylesheet" href="../stylesheets/signin.css"> <!-- New Stylesheet --> <?php include '../template/ui.php'; ?> <script src="../assets/js/list/list.js"></script> <script src="../assets/js/list/list.pagination.js"></script> </head> <body> <?php $user_level = get_user_level($user->ID); if ($user_level == 10) { defined("FUNCTIONSOFADMIN") || define("FUNCTIONSOFADMIN", true); require_once "admin_funcs.php"; include '../template/header.php'; } else { require_once "../template/header-user.php"; } ?> <div id="tickets"> <div class="panel panel-default"> <div class="panel-heading"> <div class="row"> <div class="col-md-3"> <h4 class="yekan success-text">
// 服务记录 $smarty->assign('return', $return_list); // 退货记录 $smarty->assign('user_friends', $user_friends); $smarty->assign('contact_list', $contact_list); $smarty->assign('addr_list', $addr_list); $smarty->assign('role_id', $_SESSION['role_id'] ? $_SESSION['role_id'] : 0); // 营销方式优选 //$smarty->assign('marketing_list', marketing_list()); // 顾客喜欢的联系方式 //$smarty->assign('marketing_checked_list', marketing_checked_list($user_id, 'marketing_name')); $healthy_lifestyle = $smarty->fetch('healthy_file_part.htm'); $smarty->assign('healthy_lifestyle', $healthy_lifestyle); $smarty->assign('service_time', date('Y-m-d H:i')); $smarty->assign('deal_method', get_deal_method()); $smarty->assign('level_list', get_user_level()); $res['info'] = $smarty->fetch('users_detail.htm'); die($json->encode($res)); } elseif ($_REQUEST['act'] == 'add_users') { /* 检查权限 */ $user = array('rank_points' => $_CFG['register_points'], 'pay_points' => $_CFG['register_points'], 'sex' => 0, 'credit_line' => 0); // 取出注册扩展字段 $sql = 'SELECT * FROM ' . $ecs->table('reg_fields') . ' WHERE type<2 AND display=1 AND id<>6 ORDER BY dis_order, id'; $extend_info_list = $db->getAll($sql); //是否是添加家庭成员 if (isset($_REQUEST['family_id'])) { $family_id = intval($_REQUEST['family_id']); $user_id = intval($_REQUEST['user_id']); if ($family_id == 0) { $sql_insert = 'INSERT INTO ' . $GLOBALS['ecs']->table('user_family_member') . '(user_id,family_id,add_time)VALUES(' . "{$user_id},{$user_id}," . time() . ')'; $result = $GLOBALS['db']->query($sql_insert);
function is_superadmin($uid) { $user_level = get_user_level($uid); return $user_level == "S"; }
echo $user["mobile"]; ?> </td><td> <?php echo format_price($user["money"]); ?> </td><td> <?php echo format_score($user["score"]); ?> </td><td> <?php echo $user["point"]; ?> </td><td> <?php echo get_user_group($user["group_id"]); ?> </td><td> <?php echo get_user_level($user["level_id"]); ?> </td><td> <?php echo get_referrals_name($user["pid"]); ?> </td><td> <?php echo $user["login_ip"]; ?> </td><td> <?php echo to_date($user["login_time"]); ?> </td><td> <?php echo get_is_effect($user["is_effect"], $user['id']); ?> </td><td><a href="javascript:edit('<?php echo $user["id"];
if ($cur_subopt >= 0 && count($module['sub'][$curopt]['mode']) > 1) { $nb_opt = count($module['sub'][$curopt]['shortcut']); if ($nb_opt < 8) { $nb_opt = 8; } $width = intval(100 / $nb_opt) + 1; $filler_width = 100 - $width * count($module['sub'][$curopt]['shortcut']); if ($filler_width < 0) { $filler_width = 0; } $template->assign_block_vars('sub_menu', array('U_MODULE' => append_sid("./profile.{$phpEx}?mode=" . $module['mode'][$curopt] . "&sub={$sub}" . ($view_userdata['user_id'] != ANONYMOUS ? '&' . POST_USERS_URL . '=' . $view_userdata['user_id'] : '')), 'L_MODULE' => $module['sub'][$curopt]['page_title'][$cur_subopt], 'NBOPT' => $nb_opt, 'WIDTH' => $width, 'FILLER_WIDTH' => $filler_width)); if ($nb_opt > count($module['sub'][$curopt]['shortcut'])) { $template->assign_block_vars('sub_menu.filleropt', array()); } for ($i = 0; $i < count($module['sub'][$curopt]['shortcut']); $i++) { $switch = $cur_subopt == $i ? 'curopt' : ($userdata['session_logged_in'] && ($mode == 'viewprofile' || $userdata['user_id'] == $view_user_id || is_admin($userdata) && $level_prior[get_user_level($userdata)] > $level_prior[get_user_level($view_userdata)]) ? 'otheropt' : 'inactopt'); $template->assign_block_vars('sub_menu.opt', array()); if ($i < count($module['sub'][$curopt]['shortcut'])) { $template->assign_block_vars('sub_menu.opt.' . $switch, array('SHORTCUT' => $module['sub'][$curopt]['shortcut'][$i], 'U_SHORTCUT' => append_sid("./profile.{$phpEx}?mode=" . $module['mode'][$curopt] . "&sub=" . $module['sub'][$curopt]['mode'][$i] . ($view_userdata['user_id'] != ANONYMOUS ? '&' . POST_USERS_URL . '=' . $view_userdata['user_id'] : '')))); } } } // system info $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />'; $s_hidden_fields .= '<input type="hidden" name="' . POST_USERS_URL . '" value="' . $view_user_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; if ($cur_subopt >= 0) { $s_hidden_fields .= '<input type="hidden" name="sub" value="' . $sub . '" />'; } $s_pagination_fields = 'mode=' . $mode; if ($view_user_id != ANONYMOUS) {
<form method='post' action="user.php?action=login&redirect=user.php?action=delete"> <label for='username'>Username</label><br/> <input name='username' id='username' /><br/> <label for='password'>Password</label><br/> <input name='password' id='password' type='password'/><br/> <input type='hidden' name='id' value='<?php echo $cleaned['id']; ?> '> <input type='submit' value='Go!'/> </form> </body></html> <?php } else { if (get_user_level($_SESSION['gatekeeper'], 'users', 'isadmin', 'id', 'pgsql') != 1) { echo "Stop trying to delete other people's accounts!!!!!"; } else { $id = (int) $cleaned['id']; $result = pg_query("SELECT * FROM users WHERE id={$id}"); if ($row = pg_fetch_array($result, null, PGSQL_ASSOC)) { pg_query("DELETE FROM users WHERE id={$cleaned['id']}"); mail($row['email'], "Freemap account deleted", "Due to a suspicious looking email address and/or " . "attempted spamming, your account has been deleted - please " . "email me on nick_whitelegg@yahoo.co.uk if you think this " . "is an error."); } else { echo "Invalid user ID"; } } } break; case "activate": if (isset($_GET['userid']) && isset($_GET['key'])) {
function pcp_output_my_ignore($field_name, $view_userdata, $map_name = '') { global $board_config, $phpbb_root_path, $phpEx, $lang, $images, $userdata; global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields; // uses user_my_friend $txt = ''; $img = ''; if ($view_userdata['user_id'] != $userdata['user_id'] && $view_userdata['user_id'] != ANONYMOUS && $userdata['session_logged_in'] && $userdata['user_id'] != ANONYMOUS) { $from = '&from=profil'; $maps = explode('.', $map_name); if (empty($maps)) { $from = '&from=profil'; } if (in_array('viewprofile', $maps)) { $from = '&from=profil'; } else { if (in_array('viewtopic', $maps)) { $from = '&from=topic&' . POST_POST_URL . '=' . $view_userdata['post_id']; } else { if (in_array('privmsgs', $maps)) { $from = '&from=privmsg&' . POST_POST_URL . '=' . $view_userdata['privmsgs_id']; } } } if ($view_userdata['user_my_ignore']) { $temp_url = append_sid("./profile.{$phpEx}?mode=buddy&sub=ignore&b=" . $view_userdata['user_id'] . "&set=remove" . $from); $title = $lang['Remove_from_ignore_list']; $icon = $images['icon_ignore_remove']; $txt = '<a href="' . $temp_url . '">' . $title . '</a>'; $img = '<a href="' . $temp_url . '"><img src="' . $icon . '" alt="' . $title . '" title="' . $title . '" border="0" /></a>'; } else { if (!is_admin($userdata) && !is_admin($view_userdata) && get_user_level($userdata) != MOD && get_user_level($view_userdata) != MOD && !$view_userdata['user_my_friend']) { $temp_url = append_sid("./profile.{$phpEx}?mode=buddy&sub=ignore&b=" . $view_userdata['user_id'] . "&set=add" . $from); $title = $lang['Add_to_ignore_list']; $icon = $images['icon_ignore_add']; $txt = '<a href="' . $temp_url . '">' . $title . '</a>'; $img = '<a href="' . $temp_url . '"><img src="' . $icon . '" alt="' . $title . '" title="' . $title . '" border="0" /></a>'; } } // result return pcp_output_format($field_name, $txt, $img, $map_name); } return false; }
<?php if (!defined('IN_DISCUZ')) { exit('Access Denied'); } require_once DISCUZ_ROOT . 'source/plugin/milu_pick/config.inc.php'; pload('F:copyright'); $ac = $_GET['ac']; if (!empty($ac) && function_exists($ac)) { $info = $ac(); return; } $user_arr = get_user_level(); $evo_check_msg = evo_check(); $evo_config_arr = evo_server_config(); $pick_count_msg = pick_count(); function pick_count() { //clear_pick_cache(1);//缓存定期清理 //clear_search_index(1);//清除索引 clear_log(1); //清除日志 pload('C:cache'); $arr['search_index']['name'] = milu_lang('rules_search_index'); $arr['search_index']['msg'] = milu_lang('search_index_notice'); $arr['search_index']['show'] = '<span style=" width:120px; float:left">' . milu_lang('search_index_c') . '<hr>'; $type_arr = array('1' => milu_lang('fast_pick_rules'), '2' => milu_lang('dxc_system_rules'), '3' => milu_lang('fastpick_evo')); $type_arr2 = array('3' => milu_lang('server_'), '4' => milu_lang('local_')); foreach ($type_arr as $k => $v) { foreach ($type_arr2 as $k2 => $v2) { $type = $k . $k2;
} return; } // access to users admins and himself if ($userdata['user_id'] != $view_userdata['user_id'] && !is_admin($userdata)) { return; } // create entry if NULL : fix isset issue @reset($view_userdata); while (list($key, $data) = each($view_userdata)) { if ($view_userdata[$key] == NULL) { $view_userdata[$key] = ''; } } // levels $is_prior = $level_prior[get_user_level($userdata)] > $level_prior[get_user_level($view_userdata)] || get_user_level($userdata) == ADMIN_FOUNDER; $is_admin = is_admin($userdata) && $is_prior; $is_board_admin = $is_admin && $userdata['user_level'] == ADMIN; // // get all the mods settings // $mods = array(); $dir = @opendir($phpbb_root_path . 'includes/mods_settings'); while ($file = @readdir($dir)) { if (preg_match("/^mod_.*?\\." . $phpEx . "\$/", $file)) { include $phpbb_root_path . 'includes/mods_settings/' . $file; } } @closedir($dir); // main_menu $menu_name = $sub;
defined("DVALIDATIOR") || define("DVALIDATIOR", true); require_once "../common/data_validators.php"; defined("MYSQLCLASS") || define("MYSQLCLASS", true); require_once "../__Classes/class.MySQL.php"; defined("COMMONC") || define("COMMONC", true); require_once "../common/users_common.php"; defined("FAKE") || define("FAKE", true); require_once "../common/fake_handler.php"; require_once "../management/validator.php"; defined("USERGETTER") || define("USERGETTER", true); require_once "../common/get_user.php"; if (!($user = get_user_with_id(get_id($_POST["user"]))) && !($user = get_user_from_cookie())) { exit; } if (!($changer = get_user_from_cookie()) && (get_user_level($changer->ID) != 10 || $changer->ID != $user->ID)) { exit; } // TODO alert and deny inputs with bad chars; if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["requestType"])) { switch ($_POST["requestType"]) { case "userChangePro": if (!isset($_POST["user"])) { $user_id = $user->ID; } else { $user_id = get_id($_POST["user"]); var_dump($user_id); } if (isset($_POST["firstName"])) { $first_name = string_corrector($_POST["firstName"]); if (!$first_name) {
<?php include 'funzioni.php'; include "../mpdf60/mpdf.php"; global $_CONFIG; $utente = check_login(); if ($utente == -1) { die("LOGINPROBLEM"); } else { $user_level = get_user_level($utente); if ($user_level == 0) { die("LOGINPROBLEM"); } if ($user_level == 1) { die('LOGINPROBLEM'); } $ora = $_POST["ora"]; $db = database_connect(); $result = $db->query("SELECT utenti.nome, utenti.cognome from utenti where level = '0' and (SELECT COUNT(*) from iscrizioni where iscrizioni.idUtente = utenti.id and iscrizioni.ora = '{$ora}') = 0 ORDER by cognome, nome asc") or die($db->error); $file = array(); $code = "\n<style>td, th{border:1px solid; padding: 5px 30px;}</style> <h3 style='text-align:center; margin-bottom:0px;'>L. S. \"G. Galilei\" - \"Finestra tecnica\"</h3><h1 style='text-align:center;margin-bottom: 5px; margin-top:15px;'>" . getStringaOra($ora) . "</h1>"; $code .= "<table style='border-collapse:collapse; margin-top:20px;'><tbody><tr>\n <td style='width:230px;'><b>Cognome</b></td>\n <td style='width:230px;'><b>Nome</b> </td>\n <td style='width:250px; text-align:center;'><b>Firma</b> </td>\n</tr>"; while ($utente = $result->fetch_assoc()) { $code .= "<tr>\n <td>" . $utente["cognome"] . "</td>\n <td>" . $utente["nome"] . "</td>\n <td></td>\n </tr>"; } $code .= "</tbody></table>"; $mpdf = new mPDF('utf-8', "A4"); // , '' , '' , 50 , 1 , 1 , 1 , 1 , 1); $mpdf->SetDisplayMode('fullpage'); $mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
function is_manager() { return in_array('managers', get_user_level()); }