likely the last commit had a serious vulnerability. this is just a sync
Deploy vintagecoding.net / deploy (push) Canceled after 0s

This commit is contained in:
2025-06-10 10:46:22 -06:00
parent becfbc3628
commit ae76b11a87
8 changed files with 304 additions and 324 deletions
+44 -32
View File
@@ -23,23 +23,25 @@ if (isset($_GET['view'])) {
case 'show':
// TODO: After implementing the notification modal, notify the user on success/fail auth events.
if (isset($_GET['id'])) {
$space = Space::retrieveFromDB($_GET['id']);
if ($space) {
if (isset($_SESSION['user']))
if ($space->allowUser(unserialize($_SESSION['user'])))
if (isset($_SESSION['user'])) {
$availableSpaces = unserialize($_SESSION['user'])->getSpaces();
foreach ($availableSpaces as $s) {
$space = $s->getSpace();
if ($space->getId() == $_GET['id']) {
echo displaySpace($_GET['id']);
else if ($space->getVisibility() == 1)
break;
} else if ($space->getVisibility() == 1) {
echo displaySpace($_GET['id']);
else
break;
} else
echo 'TODO: Notification Modal -> User not a member';
else {
if ($space->getVisibility() == 1)
echo displaySpace($_GET['id']);
else
echo 'TODO: Notification Modal -> Space is not Open';
}
} else
echo errorScreen('Space does not exist!', 'The Space ID provided does not exist in the database.');
} else {
if ($space->getVisibility() == 1)
echo displaySpace($_GET['id']);
else
echo 'TODO: Notification Modal -> Space is not Open';
}
} else
echo displaySpaceList();
break;
@@ -49,7 +51,6 @@ if (isset($_GET['view'])) {
else
echo displaySpace(2025);
break;
default:
echo displaySpaceList();
break;
@@ -134,22 +135,25 @@ function displayEssay(Essay $e)
function displaySpaceList()
{
if (!isset($_SESSION['user']))
return displaySpace();
$user = unserialize($_SESSION['user']);
$html = '
<div class="std_width std_border padding center top_margin" style="height: 75vh; overflow-y: auto;">
<div class="column space_between full_width">
<h1>Spaces</h4>
</div>
<div class="line"></div>
<div class="std_width std_border padding center top_margin" style="height: 75vh; overflow-y: auto;">
<div class="column space_between full_width">
<h1>Spaces</h4>
</div>
<div class="line"></div>
';
$spaces = $user->getSpaces();
foreach ($spaces as $s)
$html .= $s->getCardHTML();
$html .= $s->getSpace()->getCardHTML();
$html .= '
</div>
</div>
';
return $html;
@@ -157,15 +161,25 @@ function displaySpaceList()
function displaySpace($id = 2025)
{
$space = Space::retrieveFromDB($id);
$spaces = unserialize($_SESSION['user'])->getSpaces();
foreach ($spaces as $s) {
$space = $s->getSpace();
if ($space->getId() == $id) {
break;
}
}
if (!$space)
return;
if ($space) {
$html = '
<div class="std_width std_border padding center top_margin" style="height: 75vh; overflow-y: auto;">
<div class="column space_between full_width">
<h1>' . $space->getName() . '</h4>
<p>' . $space->getDescription() . '</p>
</div>
<div class="line"></div>
<div class="std_width std_border padding center top_margin" style="height: 75vh; overflow-y: auto;">
<div class="column space_between full_width">
<h1>' . $space->getName() . '</h4>
<p>' . $space->getDescription() . '</p>
</div>
<div class="line"></div>
';
$subspaces = $space->getSubSpaces();
@@ -175,11 +189,9 @@ function displaySpace($id = 2025)
// TODO: Need to investigate this bug in Posts
$posts = $space->getPosts();
foreach ($posts as $post) {
foreach ($post as $p) {
foreach ($posts as $post)
foreach ($post as $p)
$html .= $p->getCardHTML();
}
}
$html .= '
</div>