function intDoSearch(&$smarty) { $user_search_helper = new ReportCollector(); $report_helper = new ReportHelper(); intSetConditions($smarty, $user_search_helper); list($count, $user_ids, $user_infos) = searchUser($smarty, $user_search_helper->getConds(), $report_helper->getFrom(), $report_helper->getTo(), $report_helper->getOrderBy(), $report_helper->getDesc()); $smarty->assign_by_ref("user_infos", $user_infos); $smarty->assign_by_ref("user_ids", $user_ids); $smarty->assign("result_count", $count); $smarty->assign("show_results", TRUE); intShowUserSearch($smarty); }
function myfriendsDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url =& UrlManager::getInstance('myfriends'); $url->setStdQuery('modname=myfriends&op=myfriends'); if (isset($_POST['undo']) || isset($_GET['undo'])) { $op = 'myfriends'; } switch ($op) { case "myfriends": myfriends($url); break; case "searchuser": searchUser($url); break; case "approveuser": approveuser($url); break; case "delfriend": delfriend($url); break; } }
echo '{"result":1,"users":['; //start of json object while ($row) { echo json_encode($row); //convert the result array to json object $row = $obj->fetch(); if ($row) { echo ","; //if there are more rows, add comma } } echo "]}"; //end of json array and object } switch ($cmd) { case 1: addUser($_REQUEST['user_name'], $_REQUEST['user_id'], $_REQUEST['user_pass'], $_REQUEST['user_type']); break; case 2: updateUser($_REQUEST['user_id'], $_REQUEST['user_name'], $_REQUEST['user_pass'], $_REQUEST['user_type']); break; case 3: delete($_REQUEST['user_id']); break; case 4: searchUser(); break; default: # code... break; }
} else { $search = 'Search'; } ?> <div class="content-block"> <div class="content-title" style="color:#4a77a4">Search for : <?php echo $search; //$_POST['search_text']; ?> </div> <?php $projects = searchProjects($search); $ideathreads = searchIdeathreads($search); $users = searchUser($search); $investors = searchInvestor($search); if ($projects) { foreach ($projects as $project) { search_popularity_update($search, $project['project_id']); $user = getUserData($project['created_by']); //$user_email = getUserData($project['created_by']); $title = $project['project_title']; if (strlen($title) < 20) { $short_title = $title; } else { $short_title = substr($title, 0, 19) . '...'; } ?> <div class="recent-project-item">
} //vidage des variables $arrayusers = []; $nbusersarchiv = 0; } ?> <div class="row"> <!-- Resultats de la recherche --> <div class="col-xs-12"> <?php if (strlen($term) >= 2) { // Recherche d'un adherent $result = searchUser($term); if (FALSE == $result or mysqli_num_rows($result) == 0) { echo "<div class=\"col-xs-6\">"; echo getError(6); echo "</div><div class=\"col-xs-6\"><div class=\"alert alert-info alert-dismissable\"><i class=\"fa fa-info\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button> <a href=\"index.php?a=1&b=1\" >Créer un nouvel utilisateur ?</a></div></div>"; } else { $nb = mysqli_num_rows($result); if ($nb > 0) { ?> <div class="box box-info"><div class="box-header"><h3 class="box-title"><?php echo "Résultats de la recherche: " . $nb . ""; ?> <small class="badge bg-blue" data-toggle="tooltip" title="Les adhérents inactifs sont grisés"><i class="fa fa-info"></i></small></h3> <!-- div recherche --> <div class="box-tools"><div class="input-group"><form method="post" action="index.php?a=1"> <div class="input-group input-group-sm">
<?php require_once "_main3.php"; switch ($_GET["a"]) { case "search_user": searchUser($_GET["user"]) ? $status = 1 : ($status = 0); echo json_encode(array("status" => $status)); break; case "login": searchPassword($_GET["name"], $_GET["password"]) ? $status = 1 : ($status = 0); //setcookie("user_logged", true, time() + 3600); $date_suscription = getDateSuscription($_GET["name"], $_GET["password"]); echo json_encode(array("status" => $status, "date_suscription" => $date_suscription)); break; }
<div class="box-header"><h3 class="box-title">Inscrire un adhérent</h3> <div class="box-tools"><form method="POST" action="index.php?a=30&b=1&idsession=<?php echo $idsession; ?> "> <div class="input-group"><input type="text" name="searchuser" class="form-control input-sm pull-right" style="width: 150px;" placeholder="Nom ou numéro de carte"/> <div class="input-group-btn"><button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> </div></div></form> </div> </div><!-- /.box-header --> <div class="box-body"> <?php //resultat de la recherche si ------------------------------------- if ($searchuser != "" and strlen($searchuser) > 2) { // Recherche d'un adherent $result = searchUser($searchuser); if (FALSE == $result or mysqli_num_rows($result) == 0) { echo getError(6); } else { $nb = mysqli_num_rows($result); if ($nb > 0) { echo "<p>Résultats de la recherche: " . $nb . "</p>"; ?> <table class="table table-hover"> <thead><tr><th></th><th>Nom Prénom</th><th><span data-toggle="tooltip" title="Inscriptions en cours / total dépensé sur total acheté">Inscriptions/Forfait</span></th></tr></thead><tbody> <?php for ($i = 1; $i <= $nb; $i++) { $row = mysqli_fetch_array($result); if ($placesrestantes > 0) { // 0= inscription en cours non validée $nbASencours = getnbASUserEncours($row['id_user'], 0);
<?php $sql = "SELECT user_name FROM users"; $stid = oci_parse($conn, $sql); $res = oci_execute($stid); while ($row = oci_fetch_array($stid, OCI_ASSOC)) { foreach ($row as $name) { echo "<option value='" . $name . "'>{$name}</option>"; } } ?> </select> <input type="submit" name="search_user" value="Search"> </form> <?php searchUser($conn); ?> </div> <div id="del_user_btn">Delete User</div> <div id="del_user_panel"> <form action="" method="post"> <b>Delete user</b><br /> Username: <select name="del_username"> <?php $sql = "SELECT user_name FROM users"; $stid = oci_parse($conn, $sql); $res = oci_execute($stid); while ($row = oci_fetch_array($stid, OCI_ASSOC)) { foreach ($row as $name) {
<div class="main-content"> <form action="" method="post"> <div class="content-block"> <div class="content-title">Search for "<?php echo $_POST['search_text']; ?> ":</div> <?php $projects = searchProjects($_POST['search_text']); $users = searchUser($_POST['search_text']); if ($projects) { foreach ($projects as $project) { $user = getUserData($project['created_by']); $title = $project['project_title']; if (strlen($title) < 20) { $short_title = $title; } else { $short_title = substr($title, 0, 19) . '...'; } ?> <div class="recent-project-item"> <?php $image = getFeaturingImage($project['project_id']); if (!empty($image)) {
<!DOCTYPE html> <html lang="tr-TR"> <?php include 'functions.php'; include 'connectdb.php'; session_start(); if (!isset($_SESSION['firstname'])) { header("location:index.php"); } $searching = $_POST["kisi-ara"]; $usersdb = searchUser($searching); $cnt = 0; ?> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="assets/img/ico/favicon.png"> <title>Mezun Arama Sayfası - İzmir Üniversitesi Mezun Bilgi Sistemi</title> <!-- Bootstrap core CSS --> <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="assets/css/app.css" rel="stylesheet"> <link href="assets/css/responsive.css" rel="stylesheet">
function showUserResults($mysqli) { if (isset($_POST['search'])) { $keywords = trim(htmlentities($_POST['search'], ENT_QUOTES, "UTF-8")); $keywords = $mysqli->real_escape_string($keywords); if (searchUser($mysqli, $keywords) != false) { $users = searchUser($mysqli, $keywords); // Ausgabe der einzelnen Suchergebnisse foreach ($users as $key => $user) { ?> <div class="row"> <div class="col-md-12"> <div class="panel-body"> <div class="row note-content"> <div class="col-md-8 col-sm-8 col-xs-8 col-lg-8 panel-note"> <div class="panel panel-info"> <div class="panel-heading"> <h3 class="panel-title"><a href="<?php echo PROJECT_HTTP_ROOT . '/profile/' . $user['userName']; ?> "><?php echo $user['userName']; ?> </a></h3> <ul class="panel-note-control"> <li><?php echo $user['points'] . " Punkte"; ?> </li> </ul> </div> <div class="panel-body"> <div class="myEditor"> <p> <?php if ($user['aboutMe'] != "") { echo substr($user['aboutMe'], 0, 150) . " ..."; } else { echo $user['userName'] . " hat noch sich noch nit vorgestellt."; } ?> </p> </div> </div> </div> </div> </div> </div> </div> </div> <?php } } } }
return; } if (count($params) == 0) { header("Location: 403.php"); return; } $deny_access = 0; if ($params['deny_access'] == 0) { $deny_access = 1; } updateUserAccess($params['user_id'], $deny_access); } $search_criteria = ""; if (isset($_POST['button_search'])) { $search_criteria = trim(strip_tags($_POST['search'])); $users = searchUser($search_criteria); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="http://getbootstrap.com/assets/ico/favicon.ico">
<?php $connection = mysqli_connect("localhost", "e47wong", "Fall2014", "e47wong") or die("Error " . mysqli_error($link)); //This switch determines which function will be performed based on what parameters are passed in. if (isset($_POST['json_data']) && !empty($_POST['json_data'])) { insertUser(json_decode($_POST['json_data'])); } else { if (isset($_GET['phone']) && !empty($_GET['phone'])) { //run update User updateUser($_GET['p'], $_GET['phone']); } else { $return = array(); $return = searchUser($_GET['p']); //Retrieve result, encode the array and echo the string back to the application layer. echo json_encode($return); } } /*Function stores Facebook credentials into the MySQL db. Input - $fbInfo, a variable for an array decoded from JSON input. Output - returns nothing. */ function insertUser($fbInfo) { global $connection; //Check if there already exists a user with the same Facebook userID. $test = "SELECT COUNT(*) FROM `User` WHERE fBLink = '{$fbInfo->profile}'"; $res = $connection->query($test); $row = $res->fetch_row(); //If the result is 0, proceed with inserting the new user into the MySQL database. if ($row[0] == 0) { $sql = "INSERT INTO `User`(`firstName`, `lastName`, `fBLink`) VALUES ('{$fbInfo->fbFirstName}', '{$fbInfo->fbLastName}', '{$fbInfo->profile}')"; $result = $connection->query($sql);
<?php require "initialize.php"; if (isset($_COOKIE["user_id"]) && !isset($_COOKIE["isLoggedIn"])) { $user = searchUser($conn); if ($user->num_rows == 0) { // echo "niet gevonden"; $registerQuery = "INSERT INTO " . DB_PREFIX . "users (idSpotify) VALUES ('" . $_COOKIE["user_id"] . "')"; $conn->query($registerQuery); } else { // echo "gevonden"; } setcookie("isLoggedIn", true, time() + 3600, "/"); } function searchUser($conn) { $userQuery = "SELECT * FROM " . DB_PREFIX . "users WHERE idSpotify = '" . $_COOKIE['user_id'] . "'"; return $conn->query($userQuery); }
break; case 'banUser': $sBanned = isset($_REQUEST["banned"]) ? process_db_input($_REQUEST['banned']) : FALSE_VAL; $sUserId = getValue("SELECT `ID` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1"); getResult(empty($sUserId) ? "INSERT INTO `" . MODULE_DB_PREFIX . "Profiles`(`ID`, `Banned`) VALUES('" . $sId . "', '" . $sBanned . "')" : "UPDATE `" . MODULE_DB_PREFIX . "Profiles` SET `Banned`='" . $sBanned . "' WHERE `ID`='" . $sId . "'"); break; case 'kickUser': getResult("UPDATE `" . MODULE_DB_PREFIX . "CurrentUsers` SET `Status`='" . USER_STATUS_KICK . "', `When`='" . time() . "' WHERE `ID`='" . $sId . "'"); break; case 'changeUserType': $sUserId = getValue("SELECT `ID` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1"); getResult(empty($sUserId) ? "INSERT INTO `" . MODULE_DB_PREFIX . "Profiles`(`ID`, `Type`) VALUES('" . $sId . "', '" . $sType . "')" : "UPDATE `" . MODULE_DB_PREFIX . "Profiles` SET `Type`='" . $sType . "' WHERE `ID`='" . $sId . "'"); break; case 'searchUser': $sContents = parseXml($aXmlTemplates['result'], "No User Found.", FAILED_VAL); $sUserId = searchUser($sParamValue, $sParamName); if (empty($sUserId)) { break; } $aUser = getUserInfo($sUserId); $aUser['sex'] = $aUser['sex'] == "female" ? "F" : "M"; $aProfile = getArray("SELECT * FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sUserId . "' LIMIT 1"); if (!is_array($aProfile) || count($aProfile) == 0) { $aProfile = array("Banned" => FALSE_VAL, "Type" => CHAT_TYPE_FULL); } $sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL); $sContents .= parseXml($aXmlTemplates['user'], $sUserId, $aUser['nick'], $aUser['sex'], $aUser['age'], $aUser['photo'], $aUser['profile'], $aProfile['Banned'], $aProfile['Type']); break; /** * Get sounds */
//--- return sender's information ---// $aUser = getUserInfo($sSndId); $aUser['sex'] = $aUser['sex'] == 'female' ? "F" : "M"; $sContents .= parseXml($aXmlTemplates['user'], $sSndId, $aUser['nick'], $aUser['sex'], $aUser['age'], $aUser['desc'], $aUser['photo'], $aUser['profile'], USER_STATUS_ONLINE); } else { $sContents = parseXml($aXmlTemplates['result'], "msgUserAuthenticationFailure", FAILED_VAL); } break; /** * Authorize recipient for IM dialog. */ /** * Authorize recipient for IM dialog. */ case 'recipientAuthorize': $sSearchResult = searchUser($sRspId); if (!empty($sSearchResult)) { $sContents = parseXml($aXmlTemplates['result'], TRUE_VAL); //--- return recipients's information ---// $aUser = getUserInfo($sRspId); $aUser['sex'] = $aUser['sex'] == 'female' ? "F" : "M"; $sContents .= parseXml($aXmlTemplates['user'], $sRspId, $aUser['nick'], $aUser['sex'], $aUser['age'], $aUser['desc'], $aUser['photo'], $aUser['profile'], getUserOnlineStatus($sRspId, $sSndId)); } else { $sContents = parseXml($aXmlTemplates['result'], FALSE_VAL); } break; /** * Get sounds */ /** * Get sounds
if ($r === NULL) { fail("searchUser {$token}", "invalid response\n{$js}"); } $got = map_obj_attr($r, 'uid'); expectToBe(json_encode($got), $expected, "searchUser {$token}"); } searchUser('Fooo Bar', '["fbar"]'); searchUser('o Bar', '["fbar","zbar"]'); searchUser('Fooo B', '["fbar"]'); searchUser('Fooo ', '["fbar"]'); searchUser('Fooo', '["fbar"]'); searchUser('Foo', '[]'); // no sub search if short token searchUser('Bar Fooo', '["fbar"]'); searchUser('Bar Foo', '["fbar"]'); searchUser('Bar', '["fbar","zbar"]'); // exact search on sn searchUser('99007', '["fbar"]'); // exact search on sn Xexpect('getSuperGroups structures', '{"diploma-L2T101":{"key":"diploma-L2T101","description":"L2T101 - Licence 1\\u00e8re ann\\u00e9e Droit (FC)","rawKey":"L2T101","name":"L2T101 - Licence 1\\u00e8re ann\\u00e9e Droit (FC)","category":"diploma","superGroups":[]}}', 'getSuperGroups', ['key' => 'structures-DGH']); $allGroups = <<<'EOS' [{"key":"groups-employees.administration.DGH","name":"employees.administration.DGH"},{"key":"groups-employees.administration.DGHA","name":"DSIUN-SAS : Service des applications et services num\u00e9riques","description":"employees.administration.DGH"},{"key":"groups-matiB1010514","name":"UFR 02 - Mati\u00e8re (Semestre 1) : Comptabilit\u00e9 d'entreprise","description":"<br>\n<br>\n<br>\n"},{"key":"affiliation-faculty","name":"Tous les enseignants","description":"Tous les enseignants"},{"key":"affiliation-teacher","name":"Tous les enseignants et charg\u00e9s d'enseignement","description":"Tous les enseignants et charg\u00e9s d'enseignement"},{"key":"affiliation-student","name":"Tous les \u00e9tudiants","description":"Tous les \u00e9tudiants"},{"key":"affiliation-staff","name":"Tous les Biatss","description":"Tous les Biatss"},{"key":"affiliation-researcher","name":"Tous les chercheurs","description":"Tous les chercheurs"},{"key":"affiliation-emeritus","name":"Tous les professeurs \u00e9m\u00e9rites","description":"Tous les professeurs \u00e9m\u00e9rites"},{"key":"affiliation-affiliate","name":"Tous les invit\u00e9s","description":"Tous les invit\u00e9s"},{"key":"businessCategory-research","name":"Laboratoires de recherche","description":"Laboratoires de recherche"},{"key":"businessCategory-library","name":"Biblioth\u00e8ques","description":"Biblioth\u00e8ques"},{"key":"businessCategory-doctoralSchool","name":"\u00c9coles doctorales","description":"\u00c9coles doctorales"},{"key":"businessCategory-administration","name":"Services","description":"Services"},{"key":"businessCategory-pedagogy","name":"Composantes personnels","description":"Composantes personnels"}] EOS; Xexpect('allGroups', $allGroups, 'allGroups', []); if (0) { $dn = 'uid=foo,dc=fr'; $entry = Net_LDAP2_Entry::createFresh($dn); $entry->add(array('entryDN' => $entry->dn())); $filter = Net_LDAP2_Filter::parse("(entryDN={$dn})"); var_dump($filter->matches($entry)); }