public function setSessionUserFromDatabase($user_id){ $user = mysql_fetch_assoc(getUserByID($user_id)); $this->setSessionUser($user['user_id'], $user['user_level']); }
/** * * @param unknown $user - Current User * @param unknown $postUser - Person who posted the post. * @return string */ public function printPost($user, $postUser) { global $permission; if ($user->hasPermission($permission["signature_edit"], $this)) { $editSignature = "\r\n\t\t\t<div class='forum_signature quick_edit' name='{$postUser->id}' data-type='signature' contenteditable='true'>\r\n\t\t\t\t{$postUser->signature}\r\n\t\t\t</div>"; } else { $editSignature = "<div class='forum_signature'>{$postUser->signature}</div>"; } $lastEdit = ""; if ($this->fields["LastEditTime"] > 0 && !empty($this->fields["LastEditUser"])) { $editUser = getUserByID($this->fields["LastEditUser"]); if ($editUser != null) { $lastEdit = "Last edit: <b>" . $editUser->username . "</b>, " . date("F j, Y, g:i a", $this->fields["LastEditTime"]); } } if ($user->hasPermission($permission["post_edit"], $this)) { $editPost = "<a href=\"javascript:void(0);\" data-forum-target=\"" . $this->getID() . "\" class=\"post_edit btn_small btn_white btn_flat\">Edit</a>"; } if ($user->hasPermission($permission["post_delete"], $this)) { $removePost = "<a href=\"javascript:if(confirm('Delete Post?')) {window.location='{$_SERVER['PHP_SELF']}?p=t{$this->fields["Parent"]}&d=p{$this->getID()}';}\" class=\"btn_small btn_white btn_flat\">Delete</a>"; } if ($user->hasPermission($permission["post_create"], $this)) { $quotePost = "<a href=\"javascript: postEditor.insertHtml('<blockquote>'+\$('#post_content_" . $this->getID() . "').html()+'<cite>Quoted from {$postUser->username}</cite>\r\n </blockquote><p></p>');\" class=\"btn_small btn_white btn_flat\">Quote</a>"; } return "\r\n <div class='post'>\r\n <a id='" . $this->getID() . "'></a>\r\n " . $postUser->printProfile() . "\r\n <div class='comment_box'>\r\n <div class='comment_inner'>\r\n <div class='forum_menu'>\r\n {$quotePost}\r\n {$editPost}\r\n {$removePost}\r\n </div>\r\n <div class='clear'></div>\r\n <div id='post_content_" . $this->getID() . "'>{$this->fields["Content"]}</div>\r\n <div class='hrline_silver'></div>\r\n {$editSignature}\r\n <span class='last_edit'>{$lastEdit}</span>\r\n <span class='date'>{$this->getDate()}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class='clear'></div>"; }
function xml_user_get($id) { if (!is_numeric($id)) { #soap_fault('Client','',"Ung�ltiger Parameter: '$id'") return null; } return getUserByID($id); }
function getUserByUsername($username) { $user = fetchUserDetails($username); if ($user != null) { return getUserByID($user["id"]); return getUserByID($user["id"]); } }
function sendWarningNotice($userid, $reason, $type) { $subject = "Reservation System Warning"; $message = "You have been given a(n) " . getWarningType($type) . ". The reason given was: " . $reason; $headers = 'From: ' . getConfigVar('smtp_email') . "\r\n" . 'Reply-To: ' . getConfigVar('smtp_email') . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $user = mysql_fetch_assoc(getUserByID($userid)); //sendMail(getConfigVar('smtp_email'), $user['email'], $subject, $message); mail($row['email'], $subject, $message); }
function attendingEventBox($userID) { $userattendance = getEventsUserAttends($userID); if (!empty($userattendance)) { foreach ($userattendance as $row) { $creator = getUserByID($row['user_id']); $link = '"event.php?id=' . $row['id'] . '"'; $linkToCreator = '"profile.php?id=' . $row['user_id'] . '"'; $alt = '"image_' . $row['event_id'] . '"'; $imgPath = '"Images/Event/' . $row['image_path'] . '.jpg"'; $value = '"' . $row['id'] . '"'; ?> <div class="event_box"> <a class="event_id" href=<?php echo $link; ?> ><?php echo $row['event_id']; ?> </a> <span class="event_type"><?php echo getEventsByTypeID($row['type'])['type']; ?> </span> <span class="event_user">Created by: <a href=<?php echo $linkToCreator; ?> ><?php echo $creator['user_name']; ?> </a></span> <span class="event_date"><?php echo $row['date']; ?> </span> <img class="event_img" src=<?php echo $imgPath; ?> alt=<?php echo $alt; ?> > </div> <?php } } else { ?> <span class="no-results">This user is currently not attending any events.</span> <?php } }
function getNews($last = 6) { include_once("functions.php"); $sql = "SELECT * FROM " . DB_PREFIX . "news ORDER BY date DESC LIMIT 0, $last"; $result = db_result($sql); $return_str = '<div class="news-block">'; while($row = mysql_fetch_object($result)) { $return_str .= "\t\t\t<div class=\"news\"> <span class=\"news-title\"> " . $row->title . " <span class=\"news-date\">" . date('d.m.Y H:i:s', $row->date) . "</span> </span> " . nl2br($row->text) . " <span class=\"news-author\">" . getUserByID($row->userid) . "</span> </div>\r\n"; } $return_str .= "</div>"; return $return_str; }
function articlesPreview($count = 5) { $sql = "SELECT *\r\n\t\t\tFROM " . DB_PREFIX . "articles\r\n\t\t\tORDER BY article_date DESC\r\n\t\t\tLIMIT 0, {$count}"; $result = db_result($sql); $out = '<div class="articles-block">'; while ($data = mysql_fetch_object($result)) { $out .= "\t\t\t<div class=\"article\">\r\n\t\t\t\t<span class=\"article-title\">" . $data->article_title . "\r\n\t\t\t\t\t<span class=\"article-date\">" . date('d.m.Y H:i:s', $data->article_date) . "</span>\r\n\t\t\t\t</span>\r\n\t\t\t\t" . nl2br($data->article_description) . " <a href=\"article.php?page_id={$data->article_id}\">mehr...</a>\r\n\t\t\t\t<span class=\"article-author\">" . getUserByID($data->article_creator) . "</span>\r\n\t\t\t</div>\r\n"; } $out .= '</div>'; return $out; }
function user_fleets_update($uid, $fleets) { Assert::isId($uid); $user = getUserByID($uid); if (!$user) { trigger_error("user not found", E_USER_ERROR); return false; } $userfleets = user_fleet_list_byuser($uid); if (!$userfleets || !is_array($userfleets)) { trigger_error("user fleets for user {$uid} not found", E_USER_ERROR); return false; } #fleetstatus_delete_bykoords($user['gala'],$user['pos']); foreach ($userfleets as $fleet) { if (isset($fleets[$fleet['fleetnum']])) { fleet_update($fleet['fid'], $fleets[$fleet['fleetnum']]); #$fleets[$fleet['fleetnum']]['fleetnum'] = $fleet['fleetnum']; #fleetstatus_add($fleets[$fleet['fleetnum']]); } } query("update user set fleetupdate = unix_timestamp() where uid = {$uid}"); }
$category->edit($currentUser, $title, $con); $successes[] = "Changed category name to: " . $title; } } else { if ($request_type == "post_edit") { $post = Post::getByID(intval($edit)); $data = clean($data); if ($post != null && !empty($data)) { $post->edit($data, $currentUser, time()); $post->save($con); $successes[] = "Edited Post!"; } } else { if ($request_type == "signature") { $data = clean($data); $user = getUserByID($edit); if ($user != null && $user instanceof ForumUser && !empty($data)) { if ($currentUser->hasPermission($permission["signature_edit"]) || $currentUser->id == $user->id) { $user->editSignature($data, $con); $successes[] = "Changed signature to: " . $data; } } } } } } } if (count($successes) > 0) { echo json_encode($successes); } else { echo json_encode(array("Invalid " . $request_type . " Request: " . $edit . ", " . strip_tags($data)));
$warnings = getWarningsForUser($_GET['user_id']); $user = mysql_fetch_assoc(getUserByID($_GET['user_id'])); $options = ""; while ($row = mysql_fetch_assoc($warnings)) { $options = $options . "<option value=\"" . $row['warn_id'] . "\">" . $row['time'] . " - " . getWarningType($row['type']) . "</option>"; } echo "<center><h3>View Warnings For " . $user['name'] . "</h3>"; if ($options != "") { echo "<form action=\"index.php\" method=\"GET\">\r\n\t\t\t<input type=\"hidden\" name=\"pageid\" value=\"editwarning\">\r\n\t\t\t<select name=\"warn_id\">" . $options . "</select><input type=\"submit\" value=\"View\"></form></center>"; } else { echo "<h4>User has no warnings.</h4>"; } } } else { if ($pageid == "editwarning" || $pageid == "savewarning") { $message = ""; if ($pageid == "savewarning") { saveWarning($_POST['warn_id'], $_POST['reason'], $_POST['type']); $warning = mysql_fetch_assoc(getWarningByID($_POST['warn_id'])); $message = "<font color=\"#008800\"><b>Warning Saved</b></font><br><br>"; } else { $warning = mysql_fetch_assoc(getWarningByID($_GET['warn_id'])); } $user = mysql_fetch_assoc(getUserByID($warning['user_id'])); $selected = array(RES_WARNING_ACTIVE => "", RES_WARNING_NOTE => "", RES_WARNING_INACTIVE => ""); $selected[$warning['type']] = "SELECTED"; echo "<center><h3>Edit Warning For " . $user['name'] . "</h3>" . $message . "</center>\r\n\t<form action=\"./index.php?pageid=savewarning\" method=\"POST\">\r\n\t\t<input type=\"hidden\" name=\"warn_id\" value=\"" . $warning['warn_id'] . "\">\r\n\t\t\t<table class=\"warning\">\r\n\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=2 class=\"centeredcellbold\">Warn Reason</th>\r\n\t\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=2 class=\"centeredcell\"><textarea cols=\"55\" rows=\"7\" name=\"reason\">" . $warning['reason'] . "</textarea></td>\r\n\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td class=\"centeredcell\"><select name=\"type\"><option value=\"" . RES_WARNING_ACTIVE . "\" {$selected['1']}>Active</option><option value=\"" . RES_WARNING_NOTE . "\" {$selected['2']}>Notification</option><option value=\"" . RES_WARNING_INACTIVE . "\" {$selected['3']}>Inactive</option></select></td>\r\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"submit\" value=\"Save\"></textarea></td>\r\n\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\r\n\t\t\t</table>\r\n\t\t\r\n\t\t</form>\r\n\t</center>"; } } } }
</head> <?php session_start(); include_once 'database/connect.php'; include_once 'database/access_db.php'; if (!isset($_SESSION['user'])) { header("Location: index.html"); } $idUser = $_SESSION; if (!isset($_GET['id'])) { $profileUserID = $_SESSION['user']; } else { $profileUserID = $_GET['id']; } $user = getUserByID($profileUserID); $profile = getUserProfileByID($profileUserID); ?> <body> <?php include 'templates/topbar.php'; include 'templates/leftbar.php'; ?> <div id="profile"> <h1>User Profile</h1> <div id="conteudo"> <section id="profile_header"> <img id="userphoto" src ="<?php echo $profile['image']; ?>
/** * Prints out the board as a forum block. * @param ForumUser $user - The current user. * @return string To be printed. */ public function printBoard($user) { global $posts_per_page, $permission; /** * Display the stats. */ $stats = count($this->getPosts()) . " post(s) " . $this->getViews() . " view(s)"; $printLatestPost = "No posts."; $latestPost = $this->getLatestPost(); if ($latestPost != null) { $latestPostUser = getUserByID($latestPost->fields["User"]); $thread = Thread::getByID($latestPost->fields["Parent"]); if ($latestPostUser != null && $thread != null) { $printLatestPost = "Lastest: <a href='{$_SERVER['PHP_SELF']}?p=t" . $thread->getID() . "&page=" . ceil(count($thread->getPosts()) / $posts_per_page) . "#" . $latestPost->getID() . "'>" . limitString($latestPost->name) . "</a><br /> By: <b>" . limitString($latestPostUser->username, 20) . "</b>, " . $latestPost->getDate() . "."; } } $subBoards = ""; foreach ($this->getChildren() as $child) { if ($child instanceof Board) { $subBoards .= "<li><a href='{$_SERVER['PHP_SELF']}?p=b{$child->getID()}'>{$child->name}</a></li>"; } } if (!empty($subBoards)) { $subBoards = "<ul>Sub-Boards: " . $subBoards . "</ul>"; } if ($user->hasPermission($permission['board_edit'], $this->getParent())) { $orderHTML = "<a href=\"{$_SERVER['PHP_SELF']}?&o=b{$this->getID()}\" class='btn_small btn_silver btn_flat'>↓</a>"; } return "\r\n\t \t<div class='board_box forum_element'>\r\n\t \t\t<div class='two_third'>\r\n\t \t\t\t<span class='" . ($this->isUnread($user) ? "icon_on" : "icon_off") . "'></span>\r\n\t \t\t\t<div class='board_content'>\r\n\t \t\t\t\t<h3 class='element_title'><a href='{$_SERVER['PHP_SELF']}?p=b{$this->getID()}'>{$this->name}</a> {$orderHTML}</h3>\r\n\t \t\t\t\t<div class='element_text'>\r\n\t \t\t\t\t\t<span>{$this->fields["Description"]}</span>\r\n\t \t\t\t\t\t<div class='forum_element_info'>{$stats}</div>\r\n\t \t\t\t\t</div>\r\n\t \t\t\t</div>\r\n\t \t\t</div>\r\n\t \t\t<div class='board_info forum_element_info one_third column-last'>\r\n\t \t\t\t<p>{$printLatestPost}</p>\r\n\t \t\t\t<div class='sub_boards'>\r\n\t \t\t\t\t{$subBoards}\r\n\t \t\t\t\t<div class='clear'></div>\r\n\t \t\t\t</div>\r\n\t \t\t</div>\r\n <div class='clear'></div>\r\n\t \t</div>\r\n\t\t\t<div class='hrline_silver'></div>"; }
$uid = $uid->id; } else { $uid = 0; } $la[] = "`uid` = {$uid}"; } if ($la) { $limit = "WHERE " . join(" AND ", $la); } if (isset($_GET['offset'])) { $offset = "OFFSET " . (int) $_GET['offset']; } $res = mysql_query("SELECT * FROM `submit` {$limit} ORDER BY `id` DESC LIMIT 50 {$offset}"); while ($r = mysql_fetch_object($res)) { unset($r->code); $r->uname = getUserByID($r->uid)->name; $r->pname = getProblemByID($r->pid)->name; $list[] = $r; } mysql_free_result($res); if ($offset == '') { $offset = "OFFSET 50"; } else { $offset = "OFFSET " . ((int) $_GET['offset'] + 50); } $msg = new stdClass(); $res = mysql_query("SELECT * FROM `submit` {$limit} ORDER BY `id` DESC LIMIT 1 {$offset}"); if (mysql_fetch_object($res)) { $msg->more = true; } else { $msg->more = false;
function confirmReservation($resid, $admincomment, $status) { $resid = makeStringSafe($resid); $admincomment = makeStringSafe($admincomment); $status = makeStringSafe($status); doQuery("UPDATE " . getDBPrefix() . "_reservations SET admin_comment = '" . $admincomment . "', mod_status = '" . $status . "' WHERE res_id = '" . $resid . "'"); $res = mysql_fetch_assoc(getReservationByID($resid)); $user = mysql_fetch_assoc(getUserByID($res['user_id'])); sendReservationNoticeToUser($user['email'], $resid, $status, $admincomment); logAdminConfirmReservation(getSessionVariable('user_id'), $resid); }
function setUserGoesToEvent($idUser, $idEvent, $state) { global $db; if (getUserByID($idUser) == FALSE) { return FALSE; } if (getEventByID($idEvent) == FALSE) { return FALSE; } if ($state) { if (getUserGoesToEvent($idUser, $idEvent)) { return FALSE; } if (!userIsInvited($idUser, $idEvent)) { inviteToEvent($idUser, $idEvent); } $result = createUserToEvent($idUser, $idEvent); } else { if (!getUserGoesToEvent($idUser, $idEvent) && userIsInvited($idUser, $idEvent)) { return FALSE; } if (!userIsInvited($idUser, $idEvent)) { inviteToEvent($idUser, $idEvent); } $result = deleteUserToEvent($idUser, $idEvent); } return $result; }
<div class="col-xs-4 block"> <?php echo "TO: " . $recent[$i]->destination; ?> </div> </div> <div class="row info"> <div class="col-sm-3 col-xs-4"> <div class="profile-photo"> <img src=<?php echo 'https://graph.facebook.com/' . $recent[$i]->owner . '/picture?height=100&width=100'; ?> /> <p class="username"><?php $user = getUserByID($recent[$i]->owner); $username = $user['name']; echo $username; ?> </p> </div> </div> <div class="col-sm-9 col-xs-8"> <div class="row"> <div class="col-xs-12 more-info"> <div class="col-xs-12 time-info"> <span><i class="fa fa-calendar"></i> Ride Date: </span> <?php echo $recent[$i]->ridedate; ?>
<!DOCTYPE HMTL> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../css/perfil.css"> </head> <?php include_once 'database/access_db.php'; $user = getUserByID($idUser); ?> <div id="tela"> <h1>User Profile</h1> <div id="conteudo"> <div id="userphoto"> <img src ="<?php $image_url = "../" . $user['image'] . ""; echo $image_url; ?> "/> </div> <h2><?php echo $user['user']; ?> </h2> <section id="bio"> <p><?php echo $user['description']; ?> </p> </section>
$sel = " SELECTED"; } $users = $users . "<option value=\"".$row['user_id']."\"$sel>".$row['name']."</option>"; $sel = ""; } if($pageid == "edituser" || $pageid == "adminsavepassword" || $pageid == "adminsaveemail" || $pageid == "adminsavenotes" || $pageid == "adminsavelevel"){ echo "<center><h3>Manage Users</h3></center> <center><form action=\"index.php\" method=\"GET\"><input type=\"hidden\" name=\"pageid\" value=\"edituser\"><select name=\"user\"> ".$users." </select><input type=\"submit\" value=\"Edit\"></form>".$message."</center>"; $user = mysql_fetch_assoc(getUserByID($userid)); echo "<table class=\"userinfo\"> <tr> <td colspan=4 class=\"header\">User Information</td> </tr> <tr> <td class=\"centeredcellbold\">ID Number</th> <td colspan=3 class=\"centeredcell\">".$user['username']."</td> </tr>
/** * @access private * @return string */ function _homePage() { $dates = new Dates($this->_SqlConnection, $this->_ComaLib, $this->_User, $this->_Config); $datesArray = $dates->FillArray(-1, false); $out = "<h2>{$this->_Lang['dates']}</h2>\r\n \t\t\t\t<a href=\"admin.php?page=module_dates&action=new\" class=\"button\">{$this->_Lang['add_a_new_date']}</a>\r\n\t\t\t\t<table class=\"text_table full_width\">\r\n\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th>{$this->_Lang['date']}</th>\r\n\t\t\t\t\t\t\t<th>{$this->_Lang['location']}</th>\r\n\t\t\t\t\t\t\t<th>{$this->_Lang['topic']}</th>\r\n\t\t\t\t\t\t\t<th>{$this->_Lang['creator']}</th>\r\n\t\t\t\t\t\t\t<th>{$this->_Lang['actions']}</th>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</thead>\r\n\t\t\t\t\t<tbody>\r\n"; foreach ($datesArray as $dateEntry) { $out .= "\t\t\t\t\t<tr ID=\"dateid{$dateEntry['DATE_ID']}\">\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t" . date("d.m.Y H:i", $dateEntry['DATE_DATE']) . "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t{$dateEntry['DATE_LOCATION']}\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t{$dateEntry['DATE_TOPIC']}\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t" . getUserByID($dateEntry['DATE_CREATOR']) . "\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td colspan=\"2\">\r\n\t\t\t\t\t\t\t<a href=\"admin.php?page=module_dates&action=edit&dateID={$dateEntry['DATE_ID']}\" title=\"{$this->_Lang['edit']}\"><img src=\"./img/edit.png\" height=\"16\" width=\"16\" alt=\"{$this->_Lang['edit']}\" title=\"" . $this->_Lang['edit'] . "\"/></a>\r\n\t\t\t\t\t\t\t <a href=\"admin.php?page=module_dates&action=delete&dateID={$dateEntry['DATE_ID']}\" title=\"{$this->_Lang['delete']}\"><img src=\"./img/del.png\" height=\"16\" width=\"16\" alt=\"{ {$this->_Lang}['delete']}\" title=\"" . $this->_Lang['delete'] . "\"/></a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n"; } $out .= "</tbody>\r\n\t\t\t\t</table>"; return $out; }
function _showSimulator() { for ($i = 0; $i < 14; $i++) { if (isset($_REQUEST['deff' . $i]) && is_numeric($_REQUEST['deff' . $i]) && $_REQUEST['deff' . $i] >= 0) { $deff[$i] = $_REQUEST['deff' . $i]; } else { $deff[$i] = 0; } } for ($i = 0; $i < 9; $i++) { if (isset($_REQUEST['attack' . $i]) && is_numeric($_REQUEST['attack' . $i]) && $_REQUEST['attack' . $i] >= 0) { $attack[$i] = $_REQUEST['attack' . $i]; } else { $attack[$i] = 0; } } $kristall = param_num("kristall", 0); $metall = param_num("metall", 0); $Simu = new GNSimu(); $Simu->attacking = $attack; $Simu->deffending = $deff; $Simu->mexen = $metall; $Simu->kexen = $kristall; $ticks = param_num("ticks", 1); $fleets_loaded = $_SESSION['fleets_loaded']; if ($_POST['send']) { if ($fleets_loaded) { for ($i = 0; $i < count($fleets_loaded); $i++) { if ($fleets_loaded[$i] && $_POST["deleteattfleet_" . $fleets_loaded[$i]['uid'] . "_x"]) { #echo $fleets_loaded[$i]['nick']." löschen <br>"; $attack[0] -= $fleets_loaded[$i]['jaeger']; $attack[1] -= $fleets_loaded[$i]['bomber']; $attack[2] -= $fleets_loaded[$i]['fregatten']; $attack[3] -= $fleets_loaded[$i]['zerstoerer']; $attack[4] -= $fleets_loaded[$i]['kreuzer']; $attack[5] -= $fleets_loaded[$i]['schlachter']; $attack[6] -= $fleets_loaded[$i]['traeger']; $attack[7] -= $fleets_loaded[$i]['kleptoren']; $attack[8] -= $fleets_loaded[$i]['cancris']; for ($j = 0; $j < count($attack); $j++) { if ($attack[$j] < 0) { $attack[$j] = 0; } } #element löschen und rest verschieben for ($j = $i; $j < count($fleets_loaded) - 1; $j++) { $fleets_loaded[$j] = $fleets_loaded[$j + 1]; } unset($fleets_loaded[count($fleets_loaded) - 1]); $_SESSION['fleets_loaded'] = $fleets_loaded; break; } } } if ($_POST['resetatter'] && $this->userdata) { unset($_SESSION['fleets_loaded']); unset($fleets_loaded); for ($i = 0; $i < count($attack); $i++) { $attack[$i] = 0; } } if ($_POST['loadattfleet'] && $this->userdata) { $loadattfleet = $_POST['loadattfleet']; $userfleet = user_fleet_sum($loadattfleet); $user = getUserByID($loadattfleet); #user wrong or no fleet if (!$userfleet) { $this->_header("index.php", "Userid falsch oder keine Flotte"); } #wrong attfleet, no permission if (!$this->userdata['rights']['admin'] && !$this->userdata['rights']['attorga'] && $user['aid'] != $this->userdata['aid']) { $this->_header("index.php", "Keine Rechte zum Flotte laden"); } for ($i = 0; $i < count($fleets_loaded); $i++) { if ($fleets_loaded[$i] && $fleets_loaded[$i]['uid'] == $loadattfleet) { $isloaded = $i; break; } } #bash if ($_POST['attfleetselect'] == 1) { $userfleet['kleptoren'] = 0; $userfleet['cancris'] = 0; } #bash + cleps if ($_POST['attfleetselect'] == 2) { $userfleet['cancris'] = 0; } #cleponly if ($_POST['attfleetselect'] == 3) { $userfleet['jaeger'] = 0; $userfleet['bomber'] = 0; $userfleet['fregatten'] = 0; $userfleet['zerstoerer'] = 0; $userfleet['kreuzer'] = 0; $userfleet['schlachter'] = 0; $userfleet['traeger'] = 0; $userfleet['cancris'] = 0; } #clepdeff if ($_POST['attfleetselect'] == 4) { $userfleet['jaeger'] = 0; $userfleet['bomber'] = 0; $userfleet['fregatten'] = 0; $userfleet['zerstoerer'] = 0; $userfleet['kreuzer'] = 0; $userfleet['schlachter'] = 0; $userfleet['kleptoren'] = 0; $userfleet['cancris'] = 0; } #flotte schon geladen if (isset($isloaded)) { $fleets_loaded[$isloaded]['jaeger'] += $userfleet['jaeger']; $fleets_loaded[$isloaded]['bomber'] += $userfleet['bomber']; $fleets_loaded[$isloaded]['fregatten'] += $userfleet['fregatten']; $fleets_loaded[$isloaded]['zerstoerer'] += $userfleet['zerstoerer']; $fleets_loaded[$isloaded]['kreuzer'] += $userfleet['kreuzer']; $fleets_loaded[$isloaded]['schlachter'] += $userfleet['schlachter']; $fleets_loaded[$isloaded]['traeger'] += $userfleet['traeger']; $fleets_loaded[$isloaded]['kleptoren'] += $userfleet['kleptoren']; #neu laden } else { $userfleet['fleetdate'] = formatdate("d.m.y", $userfleet['fleetdate']); $fleets_loaded[] = $userfleet; } $attack[0] += $userfleet['jaeger']; $attack[1] += $userfleet['bomber']; $attack[2] += $userfleet['fregatten']; $attack[3] += $userfleet['zerstoerer']; $attack[4] += $userfleet['kreuzer']; $attack[5] += $userfleet['schlachter']; $attack[6] += $userfleet['traeger']; $attack[7] += $userfleet['kleptoren']; $attack[8] += $userfleet['cancris']; $_SESSION['fleets_loaded'] = $fleets_loaded; } # tick laden if ($_POST['loadtick_0'] || $_POST['loadtick_1'] || $_POST['loadtick_2'] || $_POST['loadtick_3'] || $_POST['loadtick_4'] || $_POST['loadtick_5'] || $_POST['loadtick_6']) { # 2 vorticks if ($_POST['loadtick_0']) { $tickload = 0; } if ($_POST['loadtick_1']) { $tickload = 1; } #5 hauptticks if ($_POST['loadtick_2']) { $tickload = 2; } if ($_POST['loadtick_3']) { $tickload = 3; } if ($_POST['loadtick_4']) { $tickload = 4; } if ($_POST['loadtick_5']) { $tickload = 5; } if ($_POST['loadtick_6']) { $tickload = 6; } #vorticks berechnen oder laden if ($_POST['vorticks'] || $tickload < 2) { $Simu->vorticks(0); if ($_POST['vorticks'] && $tickload != 0) { $Simu->vorticks(1); } } for ($i = 2; $i < $tickload; $i++) { $Simu->Compute(0); } if ($tickload > 1) { if ($ticks == $tickload - 1) { #den letzten tick laden $Simu->Compute(1); } else { #tick laden $Simu->Compute(0); } } $attack = $Simu->attacking; $deff = $Simu->deffending; } if ($_POST['calculate']) { if ($_POST['vorticks']) { $Simu->vorticks(0); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Vortick 1"; $tick['nr'] = 0; $ticklist[] = $tick; $Simu->vorticks(1); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Vortick 2"; $tick['nr'] = 1; $ticklist[] = $tick; } for ($i = 0; $i < $ticks - 1; $i++) { $Simu->Compute(0); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Tick " . ($i + 1); $tick['nr'] = $i + 2; $ticklist[] = $tick; } $Simu->Compute(1); $tick[1] = $Simu->attacking; $tick[0] = $Simu->Oldatt; $tick[3] = $Simu->deffending; $tick[2] = $Simu->Olddeff; $tick['metall'] = $Simu->stolenmexen; $tick['kristall'] = $Simu->stolenkexen; $tick['name'] = "Tick " . $ticks; $tick['nr'] = $ticks + 1; $ticklist[] = $tick; $this->template->assign('ticklist', $ticklist); $this->template->assign('attlost', $Simu->geslostshipsatt); $this->template->assign('defflost', $Simu->geslostshipsdeff); $ress[0][0] = $Simu->getlostmetall[0]; $ress[1][0] = $Simu->getlostmetall[1]; $ress[0][1] = $Simu->getlostkristall[0]; $ress[1][1] = $Simu->getlostkristall[1]; $ress[0][2] = $ress[0][1] + $ress[0][0]; $ress[1][2] = $ress[1][1] + $ress[1][0]; for ($i = 0; $i < 2; $i++) { for ($j = 0; $j < 3; $j++) { $ress[$i][$j] = substr_replace(strrev(chunk_split(strrev($ress[$i][$j]), 3, '.')), '', 0, 1); } } $this->template->assign('ress', $ress); $this->template->assign('metallstolen', $Simu->gesstolenexenm); $this->template->assign('kristallstolen', $Simu->gesstolenexenk); } $this->template->assign('deffsel' . $ticks, 'selected'); if ($_POST['vorticks']) { $this->template->assign('vortickssel', 'checked'); } $this->template->assign('attfleetselect' . $_POST['attfleetselect'], 'selected'); } else { $this->template->assign('deffsel1', 'selected'); $this->template->assign('attfleetselect1', 'selected'); } $this->template->assign('metall', $metall); $this->template->assign('kristall', $kristall); $this->template->assign('deff', $deff); $this->template->assign('attack', $attack); $attfleets = array(); if ($this->userdata['rights']['attorga'] == 1) { $except = array(); #for ($i=0;$i<count($fleets_loaded);$i++) { # if ($fleets_loaded[$i]) $except[] = $fleets_loaded[$i]['id']; #} $attfleets = user_get_except($except); } else { $attfleets = user_get_except($except, $this->userdata['aid']); # if ($this->userdata['fleetupdate']) { # $attfleets[] = array("id" => $this->userdata['uid'],"wert" => $this->userdata['nick']." (".$this->userdata['gala'].":".$this->userdata['pos'].")"); # } # if (!$fleets_loaded[0] && $this->userdata['fleet']) { # $attfleets[] = array("id" => $this->userdata['uid'],"wert" => $this->userdata['nick']." (".$this->userdata['gala'].":".$this->userdata['pos'].")"); # } } for ($i = 0; $i < count($attfleets); $i++) { $attfleets[$i]['id'] = $attfleets[$i]['uid']; $attfleets[$i]['wert'] = $attfleets[$i]['nick'] . " (" . $attfleets[$i]['gala'] . ":" . $attfleets[$i]['pos'] . ")"; } $this->template->assign("fleets_loaded", $fleets_loaded); $this->template->assign("attfleets", $attfleets); $this->show('simulator_form', 'Kampfsimulator'); }
$message = "Reservation Updated!"; } } if ((isset($_GET['resid']) || isset($_POST['resid'])) && issetSessionVariable('user_level')) { if (isset($_GET['resid'])) { $resid = $_GET['resid']; } else { if (isset($_POST['resid'])) { $resid = $_POST['resid']; } } if (getSessionVariable('user_level') >= RES_USERLEVEL_ADMIN) { $resresult = getReservationByID($resid); if (mysql_num_rows($resresult) > 0) { $reservation = mysql_fetch_assoc($resresult); $user = mysql_fetch_assoc(getUserByID($reservation['user_id'])); $equipment = mysql_fetch_assoc(getEquipmentByID($reservation['equip_id'])); $accept = ""; $deny = ""; if ($reservation['mod_status'] == RES_STATUS_CONFIRMED) { $accept = "selected"; } else { if ($reservation['mod_status'] == RES_STATUS_DENIED) { $deny = "selected"; } } $status = ""; if ($reservation['mod_status'] == RES_STATUS_CONFIRMED) { $status = "<font color=\"#005500\">Current Status: Confirmed</font>"; } else { if ($reservation['mod_status'] == RES_STATUS_PENDING) {
<div class="col-xs-4 block"> <?php echo "TO: " . $results[$i]->destination; ?> </div> </div> <div class="row info"> <div class="col-sm-3 col-xs-4"> <div class="profile-photo"> <img src=<?php echo 'https://graph.facebook.com/' . $results[$i]->owner . '/picture?height=100&width=100'; ?> /> <p class="username"><?php $user = getUserByID($results[$i]->owner); $username = $user['name']; echo $username; ?> </p> </div> </div> <div class="col-sm-9 col-xs-8"> <div class="row"> <div class="col-xs-12 more-info"> <div class="col-xs-12 time-info"> <span><i class="fa fa-calendar"></i> Ride Date: </span> <?php echo $results[$i]->ridedate; ?>
/** * @param array admin_lang * @access private */ function overview($admin_lang) { $out = "<a class=\"button\" href=\"admin.php?page=groups&action=new_group\">Neue Gruppe erstellen</a><br />\r\n\t\t\t\t\t\t<table class=\"text_table full_width margin_center\">\r\n\t\t\t\t<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Gruppenname</th>\r\n\t\t\t\t\t\t<th>Beschreibung</th>\r\n\t\t\t\t\t\t<th>Gruppenleiter</th>\r\n\t\t\t\t\t\t<th>Aktionen</th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n"; $sql = "SELECT *\r\n\t\t\t\tFROM " . DB_PREFIX . "groups\r\n\t\t\t\tORDER BY group_name ASC"; $group_result = db_result($sql); while ($group = mysql_fetch_object($group_result)) { $out .= "\t\t\t\t<tr>\r\n\t\t\t\t\t<td>{$group->group_name}</td>\r\n\t\t\t\t\t<td>" . nl2br($group->group_description) . "</td>\r\n\t\t\t\t\t<td>" . getUserByID($group->group_manager) . "</td>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<a href=\"admin.php?page=groups&action=edit_group&group_id={$group->group_id}\"><img src=\"./img/edit.png\" class=\"icon\" height=\"16\" width=\"16\" alt=\"" . $admin_lang['edit'] . "\" title=\"" . $admin_lang['edit'] . "\"/></a>\r\n\t\t\t\t\t\t<a href=\"admin.php?page=groups&action=delete&group_id={$group->group_id}\"><img src=\"./img/del.png\" class=\"icon\" height=\"16\" width=\"16\" alt=\"" . $admin_lang['delete'] . "\" title=\"" . $admin_lang['delete'] . "\"/></a>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>"; } $out .= "\t\t\t</table>"; return $out; }
<?php $error = ''; if (isset($_POST['submit_username'])) { if (empty($_POST['newusername']) || empty($_POST['password1']) || !password_verify($_POST['password1'], getUserByID($_SESSION['user_id'])['password'])) { $error = 'Username is invalid!'; } else { $Userid = $_SESSION['user_id']; $newusername = $_POST['newusername']; if (existsUserByName($newusername)) { echo '<span class="message">Username "' . $newusername . '" is already taken!</span>'; exit; } changeUsername($Userid, $newusername); $_SESSION['login_user'] = $newusername; echo '<script>window.location = "profile.php"</script>'; } }
}else{ $message = "<font color=\"#005500\"><b>Error: A Required Field Was Left Blank</b></font><br><br>"; } } else if($pageid == "saveemail"){ $email = $_POST['email']; if($email != ""){ changeUserEmail(getSessionVariable('user_id'), $email); $user = mysql_fetch_assoc(getUserByID(getSessionVariable('user_id'))); $message = "<font color=\"#005500\"><b>Email Updated!</b></font><br><br>"; }else{ $message = "<font color=\"#FF0000\"><b>Error: Email Field Was Left Blank</b></font><br><br>"; } } $pageData = " <center><h3>My Account</h3>".$message."</center>
if (!($article_data = mysql_fetch_object($article_result))) { header("Location: special.php?page=404¬found=g:{$extern_page}"); } $title = "Artikel: {$article_data->article_title}"; $position = $article_data->article_title; $text = ''; $text .= "\t\t\t<h3>{$article_data->article_title}</h3><hr /><br />\r\n\t\t\t{$article_data->article_html}"; } else { $sql = "SELECT *\r\n\t\t\tFROM " . DB_PREFIX . "articles"; $article_result = db_result($sql); $title = "Artikelliste"; $text = "\t\t\t<h3>Artikelliste</h3><hr /><br />\r\n"; $text .= "\t\t\t<table>\r\n"; $text .= "\t\t\t\t<tr>\r\n\t\t\t\t\t<td>Titel</td>\r\n\t\t\t\t\t<td>Datum</td>\r\n\t\t\t\t\t<td>Beschreibung</td>\r\n\t\t\t\t\t<td>Autor</td>\r\n\t\t\t\t</tr>\r\n"; while ($articles_data = mysql_fetch_object($article_result)) { $text .= "\t\t\t\t<tr>\r\n\t\t\t\t\t<td><a href=\"article.php?page_id={$articles_data->article_id}\">" . $articles_data->article_title . "</a></td>\r\n\t\t\t\t\t<td>" . date('d.m.Y H:i:s', $articles_data->article_date) . "</td>\r\n\t\t\t\t\t<td>" . nl2br($articles_data->article_description) . "</td>\r\n\t\t\t\t\t<td>" . getUserByID($articles_data->article_creator) . "</td>\r\n\t\t\t\t</tr>\r\n"; } $text .= "\t\t\t</table>"; } // // insert data into style // $page = str_replace("[title]", $title, $page); $page = str_replace("[text]", $text, $page); $page = str_replace("[menu]", generatemenu(@$internal_style, 1, $extern_page), $page); $page = str_replace("[menu2]", generatemenu(@$internal_style, 2, $extern_page), $page); if (isset($position)) { $page = str_replace("[position]", "<a href=\"article.php\">Artikel</a>-><a href=\"article.php?page_id={$article_data->article_id}\">{$position}</a>", $page); } else { $page = str_replace("[position]", "<a href=\"article.php\">Artikel</a>", $page); }
/** \brief User löschen Löscht einen User aus dem TC */ function User_delete() { #check rights $rank = $this->userdata['rights']['useredit']['rank']; if (!$rank) { #no permission $this->_header("", "no permission"); } $data = $_SESSION['steps']; #information message, step 2 if ($data['deleteuser']) { #save step unset($data['deleteuser']); $_SESSION['steps'] = $data; $this->forms['information']['url'] = $this->backtracking->backlink(); $this->forms['information']['title'] = "Benutzer löschen"; $this->forms['information']['message'] = "Benutzer erfolgreich gelöscht"; $this->forms['information']['style'] = "green"; $this->show('message_information', "Benutzer löschen"); } $id = param_num("id"); if (!$id) { $this->_header(); } $return = getUserByID($id); if (!$return) { $this->_header(); } #check rights if ($rank > 1 && $this->userdata['aid'] != $return['aid'] || $rank > 2 && $this->userdata['gala'] != $return['gala']) { #no permission $this->_header("", "no permission"); } #deleteuser, send if ($_REQUEST['send']) { if ($_REQUEST['yes_x']) { addToLogfile("User " . $return['nick'] . " gelöscht", "Admin", $this->userdata['uid']); deleteUser($return['uid']); #save step $data['deleteuser'] = 1; $_SESSION['steps'] = $data; $this->_header("admin.php?action=deleteuser&send"); } else { $this->_header(); } } else { $this->forms['information']['url'] = "admin.php?id=" . $return['uid']; $this->forms['information']['action'] = "deleteuser"; $this->forms['information']['title'] = "Benutzer löschen"; $this->forms['information']['message'] = "Benutzer <b>" . $return['nick'] . " (" . $return['tag'] . ")</b> löschen ?"; if ($return['uid'] == $this->userdata['uid']) { $this->forms['information']['message'] .= "\n <br><br><b>WARNUNG!!</b><br>\n <b>Sie sind im Begriff sich selbst zu löschen!<br>\n Sie können sich danach nicht mehr einloggen!<b/><br>\n "; } $this->forms['information']['style'] = "red"; $this->show('message_question', "Benutzer löschen"); } }
public function delete($con) { global $table_prefix; $children = $this->getChildren(); if ($children != null && count($children) > 0) { foreach ($children as $child) { $child->delete($con); } } if ($this instanceof Post) { $user = getUserByID($this->fields["User"]); if ($user != null) { $user->unmoderate($this); } } mysql_query("DELETE FROM {$table_prefix}{$this->element_name} WHERE ID={$this->id} LIMIT 1"); }
$item->lane = R::load('lane', $data->lane); } else { $item->position = $data->position; } runAutoActions($item); R::store($item); logAction($user->username . ' updated item ' . $item->title, $before, $item->export(), $itemId); $jsonResponse->addAlert('success', 'Updated item ' . $item->title . '.'); $jsonResponse->addBeans(getBoards()); $lane = R::load('lane', $item->lane_id); $board = R::load('board', $lane->boardId); foreach ($board->sharedUser as $user) { $actor = getUser(); $assignee = 'Unassigned'; if ($item->assignee > 0) { $assignee = getUserByID($item->assignee)->username; } $body = getEditItemEmailBody($board->id, $actor->username, $board->name, $item->title, $item->description, $assignee, $item->category, $item->dueDate, $item->points, $item->position); $subject = 'TaskBoard: Item edited'; $recipient = $user->username; $email = $user->email; sendEmail($email, $recipient, $subject, $body); } } } $app->response->setBody($jsonResponse->asJson()); })->conditions(['itemId' => '\\d+']); // Update item positions $app->post('/items/positions', function () use($app, $jsonResponse) { $data = json_decode($app->environment['slim.input']); if (validateToken()) {