</div> </div> <!-- Space --> <div class="col-md-12" style = "background-color:#CCCCCC; height: 20px;"> </div> <div class="col-md-10" style = "background-color:#DDDDDD; height: 500px; margin-left: 100px;"> <div class="col-md-11" style = "background-color:#CCCCCC; height: 400px; margin-left: 50px; margin-top: 50px"> <div align = "center" style = "margin-top:50px; margin-bottom:50px;"> <?php if (!isset($_SESSION['email'])) { echo "You have to <a href = 'signinform.php'> login </a> first!"; } else { getProfile(); } ?> <a href="edit_profile.php" align = "right"><button style = "margin-left:500px ;margin-top:220px ">Edit profile</button></a> <!--<a href="history.php" align = "right"><button style = "margin-left:300px ; ">History</button></a>--> </div> </div> </div>
<?php include "../config.php"; include "../include/common.php"; include "../include/db_connect.php"; include "../include/session.php"; if (isset($_SESSION['admin']) && isset($_REQUEST['id'])) { //todo: admins currently can get information of users that didn't apply to their club $user_id = escape($_REQUEST['id']); $userinfo = getUserInformation($user_id); //userinfo is array(username, email) $profile = getProfile($user_id); get_page_advanced("user_detail", "admin", array('username' => $userinfo[0], 'email' => $userinfo[1], 'name' => $userinfo[2], 'profile' => $profile)); } else { header('Location: index.php'); }
<?php date_default_timezone_set('Asia/Kolkata'); require '../vendor/autoload.php'; require 'controllers.php'; //ForLogging - AccessLogs $log = new \Slim\LogWriter(fopen('../logs/access.log', 'a')); $app = new \Slim\Slim(array('mode' => 'development', 'log.writer' => $log, 'log.level' => \Slim\Log::DEBUG, 'log.enabled' => true, 'http.version' => '1.1', 'contentType' => 'application/json')); $app->setName('HIND'); // TEST GET route $app->get('/hello', function () use($app) { $request = $app->request; $response = $app->response; $response->write(json_encode("API Application is Up and Running :) by " . $app->getName())); $app->log->info('RequestIP: ' . $request->getIp() . ',TimeStamp: ' . date('Y-m-d h:i:s') . ',RequestPath: /api/v1' . $request->getPathInfo() . ',ResponseCode: ' . $response->getStatus() . ',Response: ' . $response->getBody()); $app->log->info('-----------------------------------------------------------------------------------------------------------------------'); }); //GET ROUTES $app->get('/categories', 'getCategories'); $app->get('/users/count', 'getUsersCount'); $app->get('/threads/count', 'getThreadsCount'); $app->get('/view/profile/:username', function ($username) { getProfile($username); }); $app->get('/view/:deal_category/:thread_type/:thread_state', function ($deal_category, $thread_type, $thread_state) { getThread($deal_category, $thread_type, $thread_state); }); //POST ROUTES $app->post('/submit/misc', 'postMiscellaneous'); $app->post('/submit/deal', 'postDeal'); $app->run();
//****************************************************************************** // ShowProfiles //****************************************************************************** case "showProfiles": case "editProfiles": $tmpl->setvar('ShowProfiles', 1); $pid = tfb_getRequestVar('pid'); !empty($pid) ? $add1 = $cfg['_UPDATE'] : ($add1 = "Add"); $tmpl->setvar('add1', $add1); !empty($pid) ? $op2 = "modProfile" : ($op2 = "addProfile"); $tmpl->setvar('op', $op2); $name = $minport = $maxport = $maxcons = $rerequest = $rate = $maxuploads = $drate = $runtime = $sharekill = $public = $savepath = ""; $runtime = $cfg['die_when_done']; $superseeder = 0; if (!empty($pid)) { $profile = getProfile($pid); $name = " value=\"" . $profile['name'] . "\""; $minport = " value=\"" . $profile['minport'] . "\""; $maxport = " value=\"" . $profile['maxport'] . "\""; $maxcons = " value=\"" . $profile['maxcons'] . "\""; $rerequest = " value=\"" . $profile['rerequest'] . "\""; $rate = " value=\"" . $profile['rate'] . "\""; $maxuploads = " value=\"" . $profile['maxuploads'] . "\""; $drate = " value=\"" . $profile['drate'] . "\""; $runtime = $profile['runtime']; $sharekill = " value=\"" . $profile['sharekill'] . "\""; $superseeder = $profile['superseeder']; $savepath = " value=\"" . $profile['savepath'] . "\""; if ($profile['public'] == 1) { $public = "checked"; }
<?php /* * IMPLEMENTATION OF: https://api.mojang.com/users/profiles/minecraft/<username>?at=<timestamp> * Read about it here: http://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time */ define('METHUSELAH_INCLUDE_CHECK', true); require_once "../yggdrasil.php"; $subquery = strpos($name, "?"); if ($subquery !== false) { $break = explode("?", $uuid); $name = $break[0]; } $uuid = findProfileByName($name); if ($uuid == false) { responseWithError("Profile not found"); } response(getProfile($uuid, false));
} else { $page_title = $messages["pageTitleSignIn"][$locale]; // если пользователь не авторизован - на страницу авторизации require_once "views/signInForm.php"; } break; case "profile": // страница профиля if (!isset($_SESSION["signedUserId"]) && empty($_SESSION["signedUserId"])) { // если не авторизован - на страницу авторизации $_SESSION["errors"] = "<p class=errorMsg>" . $messages["profile"]["shouldSignIn"][$locale] . "</p>"; echo header('Location: http://' . $_SERVER['SERVER_NAME'] . "/index.php?action=signIn", true, 301); } else { //если авторизован - взять из БД данные и подключить страницу профиля $page_title = $messages["pageTitleProfile"][$locale]; $profile = getProfile($_SESSION["signedUserId"], $mysqli); require_once "views/profile.php"; } break; case "main": // главная страница $page_title = $messages["pageTitleMain"][$locale]; if (empty($_SESSION["success"]) || !isset($_SESSION["success"])) { // если нет других уведомлений - вывести приветствие $_SESSION["success"] = "<p class=successMsg>" . $messages["msgBlockGreetings"][$locale] . "</p>"; } require_once "views/main.php"; break; default: require_once "views/main.php"; }
<?php /* * IMPLEMENTATION OF: https://sessionserver.mojang.com/session/minecraft/profile/<uuid> * Read about it here: http://wiki.vg/Mojang_API#UUID_-.3E_Profile_.2B_Skin.2FCape */ define('METHUSELAH_INCLUDE_CHECK', true); require_once "../yggdrasil.php"; $subquery = strpos($uuid, "?"); if ($subquery !== false) { $break = explode("?", $uuid); $uuid = $break[0]; } $profile = getProfile($uuid, true); if ($profile != false) { response($profile); } responseWithError("Wrong profile identifier.");
$formrating = "\n<form action='comment.php' method='post'>\n<input type='hidden' name='id_articles' value='" . $_GET['id'] . "'>\n<div align='right'>\n<select name='user_rating'>\n<option>case rating</option>\n<option value='1'>1</option>\n<option value='2'>2</option>\n<option value='3'>3</option>\n<option value='4'>4</option>\n<option value='5'>5</option>\n</select>\n</div>\n<div align='right'><input type='submit' name='rating1'></div>\n</form>"; echo $formrating; } } //form of comment if (!empty($_POST['rating'])) { if (!empty($_POST['commenttext'])) { include "addtocomment.php"; $id_articles = $_POST['id_articles']; $text_comment = clearData($_POST['commenttext']); if (empty($_POST['commenttitle'])) { $title_comment = substr($text_comment, 0, 15); } else { $title_comment = clearData($_POST['commenttitle']); } $profile = getProfile($_SESSION['name']); $id_user_of_comment = $profile[0]['id']; $date_of_public = time(); $user_rating = $_POST['case']; setComment($id_articles, $title_comment, $text_comment, $id_user_of_comment, $date_of_public); } else { echo "<div>" . $lang['comment field is not filled'] . "</div>"; } } //comment if (isset($_GET['id'])) { $articles = getComment($_GET['id']); if (!empty($articles)) { foreach ($articles as $article) { echo "<hr><div><a href='index.php?profile=" . getName($article['id_user_of_comment']) . "'>" . getName($article['id_user_of_comment']) . "</a></div>"; if (!empty($_SESSION['status']) and $_SESSION['status'] == '3') {
<?php require_once '../includes/general.php'; require_once '../includes/db.php'; include_once 'access_control.php'; if (loggedIn(false)) { db_connect(); header('Content-type: application/json'); $jsonp = false; if (isset($_REQUEST['callback'])) { $jsonp = true; } if ($jsonp) { echo $_REQUEST['callback'] . "("; } if (isset($_SESSION['sid'])) { echo json_encode(getMotherInfo()); } else { if (isset($_SESSION['mid'])) { echo json_encode(getProfile()); } else { echo "{}"; } } if ($jsonp) { echo ")"; } }
<?php if (isset($_SESSION['status']) and $_SESSION['status'] == '0') { $_SESSION['error'] = $lang['you profile is blocked'] . "!!!"; exit; } $profile = getProfile($_GET['profile']); if (!empty($profile[0]['img'])) { $saved = "files/" . $_GET['profile']; } else { $saved = ''; } ?> <form name='profile' method='post' action='' enctype="multipart/form-data"> <?php echo $lang['avatar:']; ?> <br><input type='file' name='img' accept='image/png,image/gif,image/jpeg'> <img src='<?php echo $saved; ?> ' height='150' width='150'><br> <?php echo $lang['first name:']; ?> <br><input type='text' name='fname' value="<?php echo $profile[0]['fname']; ?> " size='17'><br> <?php echo $lang['last name:'];
function getExpandedProfile($userName) { $profile = getProfile($userName); if (!$profile) { return null; } // Expand all the groups to just include the names foreach ($profile['groups'] as $key => $groupId) { $profile['groups'][$key] = array(); $profile['groups'][$key]['info'] = getGroupInfo($groupId); } // Expand all the tasks foreach ($profile['tasks'] as $key => $task) { $profile['tasks'][$key]['contig_meta'] = getContigMeta($task['contig_id']); } // Expand all the history foreach ($profile['history'] as $key => $annotation) { $profile['history'][$key]['annotation_info'] = getAnnotation($annotation['anno_id']); $profile['history'][$key]['contig_info'] = getContigMeta($profile['history'][$key]['annotation_info']['contig_id']); } // Expand all the partials foreach ($profile['incomplete_annotations'] as $key => $annotationId) { $profile['incomplete_annotations'][$key] = array(); $profile['incomplete_annotations'][$key]['annotation_id'] = $annotationId; $profile['incomplete_annotations'][$key]['annotation_info'] = getAnnotation($annotationId); $profile['incomplete_annotations'][$key]['contig_info'] = getContigMeta($profile['incomplete_annotations'][$key]['annotation_info']['contig_id']); } return $profile; }
<!DOCTYPE> <?php include "functions/functions.php"; session_start(); $username = "******"; $password = ""; $database = "eshop"; $response = "empty"; $array = ""; mysql_connect("localhost", $username, $password); @mysql_select_db($database) or die("Unable to select database"); if (isset($_SESSION['user'])) { $response = "entered"; $array = getProfile($_SESSION['user']); } ?> <html> <head> <title>E-shop</title> <!-- {Bootstrap}--> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <!--<link rel="stylesheet" href="styles/style.css" media="all" />--> </head> <body> <div class="main_container"> <!--Header--> <div class="header_container"="header_container">
/** * gets an extended user profile given a userid * @param string $userId * @return ProfileExtended */ public function getProfileExtended($userId) { getProfile($userId, 'extended'); }
$numColors = count($colors); echo "There are {$numColors} colors.<br>"; sort($colors); for ($i = 0; $i < $numColors; $i++) { echo "Color[{$i}]= {$colors[$i]}.<br>"; } function writeMsg() { echo "Hello world!"; } writeMsg(); function getProfile($name) { return array("fullName" => "Huzaifa Al Nahas", "email" => "*****@*****.**"); } print_r(getProfile("Huzaifa")); echo "<br>"; ?> <?php $servername = "localhost"; $username = "******"; $password = "******"; $dbname = "tutorial"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully.<br>";
<?php include "../include/common.php"; include "../config.php"; include "../include/db_connect.php"; include "../include/session.php"; if (isset($_SESSION['user_id'])) { $profile = getProfile($_SESSION['user_id']); $userInfo = getUserInformation($_SESSION['user_id']); //array of (username, email, name) if (isset($_POST['old_password']) && isset($_POST['new_password']) && isset($_POST['new_password_conf']) && isset($_POST['new_email'])) { $result = updateAccount($_SESSION['user_id'], $_POST['old_password'], $_POST['new_password'], $_POST['new_password_conf'], $_POST['new_email']); if ($result === 0) { get_page_advanced("account", "apply", array("profile" => $profile, "userInfo" => $userInfo, "message" => "Account updated successfully.")); } else { if ($result == -1) { get_page_advanced("account", "apply", array("profile" => $profile, "userInfo" => $userInfo, "message" => "Invalid password for old password supplied. Information was not changed.")); } else { if ($result == -2) { get_page_advanced("account", "apply", array("profile" => $profile, "userInfo" => $userInfo, "message" => "Action attempted too many times. Please try again later.")); } else { if ($result == 1) { get_page_advanced("account", "apply", array("profile" => $profile, "userInfo" => $userInfo, "message" => "New password is too short (less than six characters).")); } else { if ($result == 10) { get_page_advanced("account", "apply", array("profile" => $profile, "userInfo" => $userInfo, "message" => "New email address is invalid.")); } else { if ($result == 11) { get_page_advanced("account", "apply", array("profile" => $profile, "userInfo" => $userInfo, "message" => "New passwords do not match.")); } }
<?php require_once '../core/config.php'; $templatePath = "{$path}/temp/smarty/templates"; require "{$path}/Smarty/libs/Smarty.class.php"; require '../core/core.php'; require_once '../classes/Connection.php'; require_once '../core/smarty.init.php'; if (isset($_GET["action"])) { $action = htmlspecialchars($_GET["action"]); if ($action == "viewprofile") { $sidp = htmlentities($_GET["action"]); $username = htmlentities($_GET["action"]); $token = htmlentities($_GET["action"]); $profile = getProfile($sidp, $username, $token, 'student'); $smarty->assign('mainContent', $smarty->fetch('profileview.tpl')); $smarty->assign('title', '..::ECE_E-Learning:Profile View'); } else { if ($action == "updateprofile") { $smarty->assign('mainContent', $smarty->fetch('profileupdate.tpl')); $smarty->assign('title', '..::ECE_E-Learning:Profile Update'); } else { if ($action == "closeaccount") { $smarty->assign('mainContent', $smarty->fetch('deletaccount.tpl')); $smarty->assign('title', '..::ECE_E-Learning:Delet Account'); } else { if ($action == "inbox") { $smarty->assign('mainContent', $smarty->fetch('deletaccount.tpl')); $smarty->assign('title', '..::ECE_E-Learning:Delet Account'); } else { if ($action == "composemail") {