function getGroup($id) { global $db; $query_select = $db->query("SELECT * FROM catalog_groups WHERE `id`='{$id}'"); $res = $db->fetch_assoc($query_select); if ($res["parent"] == 0) { $result[$res['id']] = $res; } else { $result = getGroup($res["parent"]); } return $result; }
function createGroup($params) { if (is_array($error = secureRequest($params, TRUE))) { return $error; } global $groupEnforceGroupPerms, $requestingAgent, $uuidZero, $groupDBCon; $groupID = $params["GroupID"]; $name = addslashes($params["Name"]); $charter = addslashes($params["Charter"]); $insigniaID = $params["InsigniaID"]; $founderID = $params["FounderID"]; $membershipFee = $params["MembershipFee"]; $openEnrollment = $params["OpenEnrollment"]; $showInList = $params["ShowInList"]; $allowPublish = $params["AllowPublish"]; $maturePublish = $params["MaturePublish"]; $ownerRoleID = $params["OwnerRoleID"]; $everyonePowers = $params["EveryonePowers"]; $ownersPowers = $params["OwnersPowers"]; // Create group $sql = "INSERT INTO osgroup\n (GroupID, Name, Charter, InsigniaID, FounderID, MembershipFee, OpenEnrollment, ShowInList, AllowPublish, MaturePublish, OwnerRoleID)\n VALUES\n ('{$groupID}', '{$name}', '{$charter}', '{$insigniaID}', '{$founderID}', {$membershipFee}, {$openEnrollment}, {$showInList}, {$allowPublish}, {$maturePublish}, '{$ownerRoleID}')"; if (!mysql_query($sql, $groupDBCon)) { return array('error' => "Could not successfully run query ({$sql}) from DB: " . mysql_error(), 'params' => var_export($params, TRUE)); } // Create Everyone Role // NOTE: FIXME: This is a temp fix until the libomv enum for group powers is fixed in OpenSim $result = _addRoleToGroup(array('GroupID' => $groupID, 'RoleID' => $uuidZero, 'Name' => 'Everyone', 'Description' => 'Everyone in the group is in the everyone role.', 'Title' => "Member of {$name}", 'Powers' => $everyonePowers)); if (isset($result['error'])) { return $result; } // Create Owner Role $result = _addRoleToGroup(array('GroupID' => $groupID, 'RoleID' => $ownerRoleID, 'Name' => 'Owners', 'Description' => "Owners of {$name}", 'Title' => "Owner of {$name}", 'Powers' => $ownersPowers)); if (isset($result['error'])) { return $result; } // Add founder to group, will automatically place them in the Everyone Role, also places them in specified Owner Role $result = _addAgentToGroup(array('AgentID' => $founderID, 'GroupID' => $groupID, 'RoleID' => $ownerRoleID)); if (isset($result['error'])) { return $result; } // Select the owner's role for the founder $result = _setAgentGroupSelectedRole(array('AgentID' => $founderID, 'RoleID' => $ownerRoleID, 'GroupID' => $groupID)); if (isset($result['error'])) { return $result; } // Set the new group as the founder's active group $result = _setAgentActiveGroup(array('AgentID' => $founderID, 'GroupID' => $groupID)); if (isset($result['error'])) { return $result; } return getGroup(array("GroupID" => $groupID)); }
function isUserInRole($group) { $g = getGroup(); if ($group == 'admin') { return $g == 'admin'; } if ($group == 'user') { return $g == 'admin' || $g == 'user'; } if ($group == 'guest') { return $g == 'admin' || $g == 'user' || $g == 'guest'; } return false; }
function getUsersGroups($mysqli, $userId) { if (doesUserExist($mysqli, $userId)) { if ($stmt = $mysqli->prepare("SELECT group_id FROM members_groups WHERE member_id = ?")) { $stmt->bind_param("i", $userId); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($groupId); $result = array(); while ($stmt->fetch()) { $group = getGroup($mysqli, $groupId); if (is_array($group)) { array_push($result, $group); } } return $result; } else { return "Faulty MYSQLI Statement"; } } else { return "User does not exist"; } }
$user = getUser($R_user['user_id'], true); echo ' <tr>' . chr(10); echo ' <td>' . '<a href="user.php?user_id=' . $user['user_id'] . '">' . iconHTML('user') . ' ' . $user['user_name'] . '</a>' . '</td>' . chr(10); echo ' <td>' . $user['user_name_short'] . '</td>' . chr(10); echo ' <td>'; $area_user = getArea($user['user_area_default']); if (!count($area_user)) { $area_user['area_name'] = ''; } echo $area_user['area_name']; echo '</td>' . chr(10); echo ' </tr>' . chr(10) . chr(10); } echo '</table>' . chr(10); } else { $group = getGroup($_GET['gid']); if (count($group)) { echo '<b>Viser brukergruppen ' . $group['group_name'] . '</b><br />' . chr(10); echo '<a href="telefonliste.php?gid=' . $group['group_id'] . '">Vis som telefonliste</a><br />'; if (!count($group['users'])) { echo '<i>Ingen brukere på denne listen</i>'; } else { echo '<table class="prettytable">'; echo ' <tr>' . chr(10); echo ' <th>Navn</th>' . chr(10); echo ' <th>Telefon</th>' . chr(10); echo ' <th>Stilling</th>' . chr(10); echo ' </tr>' . chr(10); foreach ($group['users'] as $user) { $user = getUser($user); if (count($user) && !$user['deactivated']) {
?> <b class="caret"></b></a> <ul class="dropdown-menu"> <li> <a href="profile.php"><i class="fa fa-fw fa-user"></i> Profile</a> </li> <li class="divider"></li> <li> <a href="logout.php"><i class="fa fa-fw fa-power-off"></i> Log Out</a> </li> </ul> </li> </ul> <?php $data = getGroup($_SESSION["login_user"]); ?> <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav side-nav"> <li class="active"> <a href="dashboard.php"><i class="fa fa-fw fa-dashboard"></i> Dashboard</a> </li> <li> <a href="javascript:" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-arrows-v"></i> My Groups <i class="fa fa-fw fa-caret-down"></i></a> <ul id="demo" class="collapse"> <?php foreach ($data as $oneGroup) { //echo "<li><form action='grouppage.php' method='post'><input type='submit' name='groupname' value='$oneGroup[0]'/></form></li>";
/** * Usage: Look for a certain file (param filename) for all users of this group. * Return a list of users that have this file * 1. Get the group the user is a member of * 2a. User is in a group * - search all users if the have the file (param filename) * 2b. User is not in a group * - search for the file for this user only (param user) * @param type $user Example 'John' * @param type $excludeRequestingUser exclude the requesting user (example 'John') from the returned result * @param type $fileName Example: '2013-03-18.gpx' * @return string String containing all found user names separated by a newline char * (every line contains one user) */ function getUsersForDataFileName($user, $fileName, $excludeRequestingUser) { if (!writeAllGpxFromCsvForGroup($user)) { return ''; } $users = ''; $group = getGroup($user); if ($group == '') { if (!isNullOrEmptyString($excludeRequestingUser)) { if ($user == $excludeRequestingUser) { return $users; } } $dataFile = USER_DIR . DIRECTORY_SEPARATOR . $user . DIRECTORY_SEPARATOR . $fileName; if (is_file($dataFile)) { $users = $user; } } else { if ($handle = opendir(USER_DIR)) { while (false !== ($entry = readdir($handle))) { if ($entry == $excludeRequestingUser) { continue; } $userDir = USER_DIR . DIRECTORY_SEPARATOR . $entry; if (is_dir($userDir)) { $groupFile = $userDir . DIRECTORY_SEPARATOR . GROUP_FILE; if (is_file($groupFile)) { $foundGroup = file_get_contents($groupFile); if ($foundGroup == $group) { $userDataFile = $userDir . DIRECTORY_SEPARATOR . $fileName; if (is_file($userDataFile)) { if (!isNullOrEmptyString($users)) { $users .= PHP_EOL; } $users .= $entry; } } } } } closedir($handle); } } return $users; }
die('Direct access not permitted'); } ?> <body> <main> <?php include "header.inc"; ?> <div class="content"> <!-- make sure theyre in a group --> <?php if ($group == 0) { echo "<h2>You're not in a group yet!</h2>"; } else { $myGroup = getGroup($db, $group); ?> <h1><?php echo getGroupName($group, $db); ?> </h1> <h2 class="subtitle"> <?php echo getGroupDescription($group, $db) . "<br>" . getGroupType($group, $db) . "<br>" . sizeof($myGroup); ?> members</h2> <br> <?php if ($groupLeader == 1) { ?>
} else { adminmsg('operate_success', "{$basename}"); } /* 勋章管理-勋章编辑 */ } elseif ($type == 'edit') { S::gp(array('id')); $id = (int) $id; if ($id < 1) { adminmsg('operate_error', "{$basename}"); } $medal = $medalService->getMedal($id); //获取medal信息 if ($medal['type'] == 0) { adminmsg('medal_system_is_not_edit', "{$basename}"); } $creategroup = getGroup($medal['allow_group']); //获取用户组 $openMedal = $medalService->getAllOpenAutoMedals(); //获取所有开启的勋章 $openMedal = getMedalJson($openMedal); require_once PrintApp('admin_medal_add'); /* 勋章管理-勋章编辑操作 */ } elseif ($type == 'editdo') { S::gp(array('name', 'image', 'descrip', 'day', 'confine', 'allow_group', 'id')); $id = (int) $id; if ($id < 1) { adminmsg('operate_error', "{$basename}&type=add"); } if ($name == '') { adminmsg('勋章名称不得为空', "{$basename}&type=add"); }
/** * 初始化推广单元 */ $conn = new Table("local189"); $conn->query("TRUNCATE TABLE `tianyunzi`.`baidu_group`"); $id = 0; while (1) { $jihuaArr = $conn->findAll("select * from tianyunzi.baidu_jihua where id > '{$id}' order by id asc limit 100"); if (empty($jihuaArr)) { exit("所有计划已经过完\n"); } foreach ($jihuaArr as $value) { $id = $value["id"]; /* 获取当前计划下单元信息 */ $groupArr = getGroup($value["id"]); if (empty($groupArr) || !isset($groupArr["body"]["data"])) { echo "计划 " . $value["name"] . " 下没有获取到单元信息\n"; continue; } foreach ($groupArr["body"]["data"] as $value1) { echo "新增计划[" . $value["name"] . "],单元[" . $value1["adgroupName"] . "]\n"; $conn->insert(array("id" => $value1["adgroupId"], "groupname" => $value1["adgroupName"], "jihuaId" => $value1["campaignId"], "jihuaname" => $value["name"], "status" => 31), "tianyunzi.baidu_group"); continue; } } } function getGroup($jihuaId) { $data = array("header" => array("token" => "1f888ce6fb38730a14a6afe7437fc3b4", "username" => "郑州悉知", "password" => "GCWgcd7232275"), "body" => array("adgroupFields" => array("adgroupId", "campaignId", "adgroupName", "status"), "ids" => array($jihuaId), "idType" => 3)); $ch = curl_init();
if (!$statement->execute()) { print_r($statement->errorInfo()); return false; } else { $result = $statement->fetchAll(PDO::FETCH_ASSOC); } ?> <h2>Students</h2> <div class="scrollContainer"> <table> <tr> <th>Name</th> <th>Area of Expertise</th> <th>Actions</th> </tr> <?php // start looping through group members foreach (getGroup($db, $group) as $a) { ?> <tr> <td> <a href="/?page=viewProfile&id=<?php echo $a['id']; ?> "> <?php if ($a['displayName'] == "") { echo $a['name']; } else { echo $a['displayName']; } ?> </a>
/** * Return an object with the Debate viewing stats. * * @param nodeid the nodeid of the Issue node to get the viewing stats for. * @param style, the style of node to return - how much data it has (defaults to 'mini' can also be 'long' or 'short') * @return debateviewingstats class containing properties: groupmembercount, viewingmembercount. * or an Error. */ function getDebateViewingStats($nodeid, $groupid) { $group = getGroup($groupid); $userset = $group->members; $members = $userset->users; $memberscount = count($members); $node = getNode($nodeid, 'shortactivity'); $activitySet = $node->activity; $activities = $activitySet->activities; $count = count($activities); $userCheck = array(); for ($i = 0; $i < $count; $i++) { $next = $activities[$i]; if ($next->type == 'View') { if (isset($next->userid) && $next->userid != "" && !in_array($next->userid, $userCheck)) { array_push($userCheck, $next->userid); } } } class debateviewingstats { public $groupmembercount = 0; public $viewingmembercount = 0; } $stats = new debateviewingstats(); $stats->groupmembercount = $memberscount; $stats->viewingmembercount = count($userCheck); return $stats; }
<form method="post" action="#" enctype="multipart/form-data"> <?php $results = getGroup(); ?> <table> <tr> <td> Group: </td> <td> <select name="address_id"> <?php foreach ($results as $row) { ?> <option value="<?php echo $row['address_group_id']; ?> "> <?php echo $row['address_group']; ?> </option> <?php } ?> </select> </td> </tr> <tr> <td> First Name:
$servername = "104.236.200.134"; $d_username = "******"; $d_password = ""; $db_name = "studybuddyplus"; $db_handle = new PDO("mysql:host={$servername};dbname={$db_name}", "{$d_username}", "{$d_password}"); $search_stmt = $db_handle->prepare("SELECT * FROM login WHERE username=?;"); $search_stmt->bindParam(1, $user); $search_stmt->execute(); $userinfo = $search_stmt->fetchAll(); $firstname = $userinfo[0]['firstname']; $lastname = $userinfo[0]['lastname']; $count_stmt = $db_handle->prepare("SELECT COUNT(*) FROM posts WHERE student=?;"); $count_stmt->bindParam(1, $user); $count_stmt->execute(); $count = $count_stmt->fetchAll(); $groups = getGroup($user); ?> <div class="col-lg-4"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-info-circle fa-fw"></i>Your Information</h3> </div> <div class="panel-body"> <div class="list-group"> <a href="#" class="list-group-item"> <i class="fa fa-fw fa-user"></i> Username: <?php echo $userinfo[0]['username']; ?> </a> <a href="#" class="list-group-item"> <i class="fa fa-fw fa-male"></i> Your real name: <?php
<?php session_start(); include "conn/conn.php"; include "inc/func.php"; $sqlstr = "select id,u_name,u_depart,is_on from tb_users where u_user = '******' and u_pwd = '" . $_POST[pwd] . "'"; $result = mysql_query($sqlstr, $conn); $record = mysql_fetch_row($result); if ($record != "" and $record[3] == 1) { if (getGroup($conn, $record[1], $_POST[u_group])) { $_SESSION["id"] = $record[0]; $_SESSION["u_name"] = $_POST[username]; $_SESSION["u_depart"] = read_field($conn, "tb_depart", "d_name", $record[2]); $_SESSION["u_group"] = read_field($conn, "tb_group", "u_group", $_POST[u_group]); w_log($_POST[action]); echo "<script>alert('��ӭ����');location='pub_main.php';</script>"; } else { echo "<script>alert('�û������������');history.go(-1);</script>"; } } else { echo "<script>alert('�û������������');history.go(-1);</script>"; }
function loadAlerts() { global $ThisUsername; //gain access to the curent username global $ThisUsers; //gain access to the current user data global $ThisSchools; //gain access to the current school data global $ThisGroups; //gain access to the current group data global $ThisOrders; //gain access to the current order data global $ThisProjects; //gain access to the current project data global $alertHtml; //gain access to the alert html variable (end display html) global $alertRemovedA; //gain access to the array of removed alerts global $alertA; //gain access to the array of all alerts getUser($ThisUsername); //load the current user data based upon the user's username getSchool($ThisUsers['School Code']); //load the current school data for this user getGroup($ThisUsers['Group Code']); //load the current group data for this user getOrder($ThisGroups['Order Code']); //load the current order data for this group getProject($ThisOrders['Doc Code']); //load the current project data for this order $userDBAlertsA = explode("&&&", $ThisUsers['Alerts']); //split the user alert data string by &&& and store this array if (count($userDBAlertsA) == 2) { //if this array has two parts, (one &&& seperator) $alertRemovedA = explode(",,,", $userDBAlertsA[0]); //split the first part by ,,, and make these items the removed alerts (add the user removed alerts) addAlerts($userDBAlertsA[1]); //and process the other part using the addAlerts function (add the user alerts with respect to the removed alerts) } addAlerts($ThisSchools['Alerts']); //add the school alerts with respect to the removed alerts addAlerts($ThisGroups['Alerts']); //add the group alerts with respect to the removed alerts addAlerts($ThisOrders['Alerts']); //add the order alerts with respect to the removed alerts addAlerts($ThisProjects['Alerts']); //add the project alerts with respect to the removed alerts addAlerts("13,,,12,,,0,,,This is an alert! these can be sent to peeples' dashboards! They can be sent per group, school, individual, etc. ! This one should be blueish! Dale and Erik, you can make it look basicly however you want as long as it is stackable in this right pane!"); //example alert addAlerts("23,,,22,,,1,,,Alerts basicly go away forever when you dismiss them.. these are just for testing.. This should be yellow-ish!"); //example alert addAlerts("34,,,33,,,2,,,This one should be red-sih! WARNING! THE WORLD HAS ENDED!"); //example alert $alertHtml = ""; //set the alert html to be blank for ($i = 0; $i < count($alertA); $i++) { //for each alert that is to be printed, $thisAlertA = $alertA[$i]; //create a temporary variable to store the data for this alert $alertHtml = $alertHtml . '<div class="alert-item-outer color-' . $thisAlertA[2] . '" id="alert-' . $thisAlertA[0] . '"><p align="left">' . $thisAlertA[3] . '</p><p align="right"><a style="color:#606060;" href="#" onclick="dismissAlert(' . "'" . $thisAlertA[0] . "'" . ');">Dismiss</a></p></div>'; //add this alert } if ($alertHtml == '') { //if no alerts were added $alertHtml = '<p style="margin-top:3em;color:#ffffff;font-size: 300%;">No new alerts at this time</p>'; //display the no new alerts text } }
<?php include_once 'includes/functions.php'; include_once 'includes/db_connect.php'; sec_session_start(); $id = $_GET['id']; $group = getGroup($mysqli, $id); $members = getMembersInGroup($mysqli, $group["id"]); $school = $group["school"]; $schoolName = $school["name"]; $schoolLocation = $school["location"]; $messages = getBoardMessages($mysqli, $id, 'group'); ?> <!DOCTYPE html> <html> <head> <title>After School</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/main.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script> <script src="js/groupAjax.js"></script> </head> <body> <h1><?php echo $group["name"]; ?>
/** \brief Gruppe löschen Löscht eine Gruppe. */ function Group_delete() { if (!$this->userdata['rights']['groupedit']) { #no permission $this->_header("", "no permission"); } $data = $_SESSION['steps']; #information message, step 2 if ($data['deletegroup']) { #save step unset($data['deletegroup']); $_SESSION['steps'] = $data; $this->forms['information']['url'] = $this->backtracking->backlink(); $this->forms['information']['title'] = "Gruppe löschen"; $this->forms['information']['message'] = "Gruppe erfolgreich gelöscht"; $this->forms['information']['style'] = "green"; $this->show('message_information', "Gruppe löschen"); } $id = param_num("id"); if (!$id) { $this->_header("", "id fehlt"); } $return = getGroup($id); if (!$return) { $this->_header("", "ungültige Gruppe"); } #deletegroup, send if ($_REQUEST['send']) { if ($_REQUEST['yes_x']) { addToLogfile("Gruppe " . $return['name'] . " gelöscht", "Admin", $this->userdata['uid']); deletegroup($return['gid']); #save step $data['deletegroup'] = 1; $_SESSION['steps'] = $data; $this->_header("admin.php?action=deletegroup&send"); } else { $this->_header(); } } else { $this->forms['information']['url'] = "admin.php?id=" . $return['gid']; $this->forms['information']['action'] = "deletegroup"; $this->forms['information']['title'] = "Gruppe löschen"; $this->forms['information']['message'] = "Gruppe <b>" . $return['name'] . "</b> löschen ?"; if ($return['gid'] == $this->userdata['gid']) { $this->forms['information']['message'] .= "\n <br><br><b>WARNUNG!!</b><br>\n <b>Sie sind im Begriff ihre eigene Gruppe zu löschen,<br>\n Sie könnten dadurch wichtige Rechte unwiederbringlich verlieren!<b/><br>\n "; } $this->forms['information']['style'] = "red"; $this->show('message_question', "Gruppe löschen"); } }
<table> <tr> <td> <form method="POST" action="#"> Select Group: <select name="address_group_id"> <?php $groups = getGroup(); foreach ($groups as $group) { ?> <option <?php if (!empty($selectedGroup) && $selectedGroup == $group['address_group_id']) { ?> selected="selected" <?php } ?> value="<?php echo $group['address_group_id']; ?> "> <?php echo $group['address_group']; ?> </option> <?php } ?> </select> <input type="submit" value="Sort"/>
function rules_read($search = '') { global $admintpl, $language, $STYLEURL, $CURUSER, $STYLEPATH; $admintpl->set("rules_add", false, true); $admintpl->set("language", $language); $admintpl->set("groups", cat_combo_search($_POST['rules_id'])); $append = ''; if (strlen($search) > 0 && strlen($_POST['rules_id']) > 0) { $append = " AND cat_id = " . sqlesc($_POST['rules_id']) . ""; $admintpl->set("frm_action", "index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=rules&action=serch"); } $cres = genrelistrules($append); for ($i = 0; $i < count($cres); $i++) { $cres[$i]["name"] = format_comment(unesc($cres[$i]["text"])); $cres[$i]["sort_index"] = unesc($cres[$i]["sort_index"]); $cres[$i]["id"] = unesc($cres[$i]["id"]); $cres[$i]["group_name"] = unesc(getGroup($cres[$i]["cat_id"])); $cres[$i]["edit"] = "<a href=\"index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=rules&action=edit&id=" . $cres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>"; $cres[$i]["delete"] = "<a href=\"index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=rules&action=delete&id=" . $cres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>"; } $admintpl->set("categories", $cres); $admintpl->set("rules_add_new", "<a href=\"index.php?page=admin&user="******"uid"] . "&code=" . $CURUSER["random"] . "&do=rules&action=add\">" . $language["RULES_ADD"] . "</a>"); unset($cres); }
<?php $user = getUser(); $group = getGroup(); ?> <div id="loginPage" style="margin-left: auto; margin-right: auto; width: 100%; max-width: 992px;"> <h2>Benutzer bearbeiten</h2> <div style="width: 100%; margin: auto; max-width: 400px;"> <div style="width: 100%; text-align: center; margin-bottom: 10px;"> <img src="<?php echo $user["photo"]; ?> " style="width: 150px;" /> <p> <h4 style="margin-bottom: 40px;"><?php echo $user["name"]; ?> </h4> </p> </div> <div class="button" style="text-align: left;"> <form action="" method="POST"> <input type="hidden" name="action" value="updateUser" /> <p> <input type="text" value="Name: <?php echo $user["name"]; ?>
function renderSmallGroupList($db, $group, $groupLeader) { ?> <div class="content"> <!-- make sure theyre in a group --> <?php if ($group == 0) { echo "<h2>You're not in a group yet!</h2>"; } else { $myGroup = getGroup($db, $group); ?> <h2 class="subtitle"><?php echo sizeof($myGroup); ?> members</h2> <table> <?php // start looping through group members foreach ($myGroup as $a) { ?> <tr> <td> <a href="/?page=viewProfile&id=<?php echo $a['id']; ?> "> <?php if ($a['displayName'] == "") { echo $a['name']; } else { echo $a['displayName']; } ?> </a> </td> </tr> <?php } // end looping through group members ?> </table> <a class="button left" href="/?page=group">Manage Group</a> <?php } // end if ?> </div><?php }
<?php header('Content-Type: application/json'); require_once 'index.php'; require_once 'classes/group.php'; $value = array("error" => "Missing argument"); if (isset($_GET["action"])) { switch ($_GET["action"]) { case "getGroup": if (isset($_GET["id"])) { //Get player by id $value = getGroup($_GET["id"]); if ($value == false) { $value = array("error" => "No group"); } } else { $value = array("error" => "Missing argument"); } break; case "getAllGroups": $value = getAllGroups(null); if ($value == false) { $value = array("error" => "No groups"); } break; } } exit(json_encode($value));
$TITLE['helpdesk/reports'] = "Отчёты"; $c['sections'] = $TITLE; $categories = getCategories(); $c["cat"] = $_cat = checkRequest("cat"); if ($_cat) { $c['current_cat'] = getCategory($_cat); } // if ($_cat) echo 1; $_cat_parent = ""; $c["mark"] = $_mark = checkRequest("mark"); if ($_mark) { $c['current_mark'] = getMark($_mark); } $c["group"] = $_group = checkRequest("group"); if ($_group) { $c['current_group'] = getGroup($_group); } $_group_parent = ""; $c["model"] = $_model = checkRequest("model"); if ($_model) { $c['current_model'] = getModel($_model); } $c["modification"] = $_modification = checkRequest("modification"); if (checkRequest("update_catalog") == true) { $xml = simplexml_load_file($_SERVER["DOCUMENT_ROOT"] . "/tools/autoru_catalog/catalog.xml"); $all_categories = $xml->categories->rec; $all_marks = $xml->marks->rec; $all_groups = $xml->groups->rec; $all_models = $xml->models->rec; $all_modifications = $xml->modifications->rec; $all_tech_names = $xml->tech_names->rec;
} } break; case "conversations": if ($len == 2) { $groupset = getConversationSetData($parts); $groupset->cipher = $cipher; if (isset($unobfuscationid) && $unobfuscationid != "") { $groupset->unobfuscationid = $unobfuscationid; } $response = $groupset; } else { if ($len > 2) { $id = check_param($parts[2], PARAM_TEXT); global $HUB_SQL, $DB; $group = getGroup($id); if ($group instanceof Error) { global $ERROR; $ERROR = new error(); $ERROR->createGroupNotFoundError($id); include $HUB_FLM->getCodeDirPath("core/formaterror.php"); die; } $group = getConversationData($id); $group->cipher = $cipher; if (isset($unobfuscationid) && $unobfuscationid != "") { $group->unobfuscationid = $unobfuscationid; } if ($len == 4) { $subtype = check_param($parts[3], PARAM_ALPHA); $group->filter = $subtype;
function groupObjects($group_by, $objects) { if (count($group_by) == 0) { $grouped = array('groups' => array(array('group' => array('id' => 0, 'name' => '', 'pid' => 0), 'subgroups' => array())), 'grouped_objects' => array(0 => $objects)); } else { // first grouping $grouped = makeGroups($objects, $group_by[0]); // more groupings for ($gb_index = 1; $gb_index < count($group_by); $gb_index++) { $to_remove = array(); foreach ($grouped['grouped_objects'] as $key => $gobjects) { $member_id = strrpos($key, "_") === FALSE ? $key : substr($key, strrpos($key, "_") + 1); $parent_group = getGroup($grouped['groups'], $member_id); $grouped_tmp = makeGroups($gobjects, $group_by[$gb_index], $parent_group); if ($parent_group) { setGroup($grouped['groups'], $member_id, $parent_group); } if (count($grouped_tmp['grouped_objects']) > 0) { foreach ($grouped_tmp['grouped_objects'] as $m => $objs) { foreach ($objs as $obj) { $grouped['grouped_objects'][$key . "_" . $m][] = $obj; } } $to_remove[] = $key; } } foreach ($to_remove as $k) { unset($grouped['grouped_objects'][$k]); } } } return $grouped; }
* and any express or implied warranties, including, but not limited to, the * * implied warranties of merchantability and fitness for a particular purpose * * are disclaimed. In no event shall the copyright owner or contributors be * * liable for any direct, indirect, incidental, special, exemplary, or * * consequential damages (including, but not limited to, procurement of * * substitute goods or services; loss of use, data, or profits; or business * * interruption) however caused and on any theory of liability, whether in * * contract, strict liability, or tort (including negligence or otherwise) * * arising in any way out of the use of this software, even if advised of the * * possibility of such damage. * * * ********************************************************************************/ include_once $_SERVER['DOCUMENT_ROOT'] . '/config.php'; include_once $HUB_FLM->getCodeDirPath("core/formats/cipher.php"); $groupid = required_param("groupid", PARAM_ALPHANUMEXT); $group = getGroup($groupid); if ($group instanceof Error) { include_once $HUB_FLM->getCodeDirPath("ui/header.php"); echo "<h1>Group not found</h1>"; include_once $HUB_FLM->getCodeDirPath("ui/footer.php"); die; } $dashboardService = "https://cidashboard.net/ui/visualisations/index.php?"; //5,6 = scatterplots //12 Attention Map - broken at present $vises = "11,1,2,3,4,7,8,9,10"; $lang = $CFG->language; $dashboardtitle = ''; $cipher; $salt = openssl_random_pseudo_bytes(32); $cipher = new Cipher($salt);
break; case 'delHaul': delHaul($_REQUEST['haul_id']); $results['id'] = $_REQUEST['op_id']; $results['Hauls'] = getHaul($_REQUEST['op_id']); echo json_encode($results); break; ///// ///// ///// ///// case 'saveGroup': saveGroup($_REQUEST['group_id'], $_REQUEST['displayname'], $_REQUEST['url'], $_REQUEST['userids']); break; case 'getGroup': $results = getGroup($_REQUEST['user_id']); echo json_encode($results); break; ///// ///// ///// ///// case 'saveBuyer': $buyer_id = saveBuyer($_REQUEST['user_id']); echo json_encode($buyer_id); break; case 'rateBuyer': $rating_id = rateBuyer($_REQUEST['buyer_id'], $_REQUEST['user_id'], $_REQUEST['rateup']); $output = array(); $output['buyer_id'] = $_REQUEST['buyer_id']; $output['rateup'] = $_REQUEST['rateup'];
if ($r_choice['entry_type_inactive'] == '1') { $attributes[$r_choice['entry_type_id']] = ' data-inactive="true" style="display: none;"'; } } addChoice('entry_type_id', $choices); addChoiceAttribute('entry_type_id', $attributes); // Area_id $Q_area = mysql_query("select id as area_id, area_name, area_group from `mrbs_area` order by area_name"); $choices = array('0' => __('Select one')); $area2 = array(); $area_group = array(); while ($r_choice = mysql_fetch_assoc($Q_area)) { $choices[$r_choice['area_id']] = $r_choice['area_name']; $area2[$r_choice['area_id']] = $r_choice['area_name']; if ($r_choice['area_group'] != 0) { $group = getGroup($r_choice['area_group']); if (count($group)) { $area_group[$r_choice['area_id']] = $group['users']; } } } addChoice('area_id', $choices); // Room_id // -> Making some special stuff $Q_room = mysql_query("select id as room_id, room_name, area_id from `mrbs_room` order by area_id, room_name"); $choices = array('0' => __('Whole area')); $area_id = 0; $last_id = 0; $before = array(); $after = array(); if (mysql_num_rows($Q_room)) {
function getCurGroup() { return getGroup(phpCAS::getUser()); }