Archived
1
0
Disbranĉigi 0

Who knows?

This commit is contained in:
Jenga Phoenix 2019-03-05 08:33:32 -06:00
parent 1714e5b80d
commit a987549ce8
15 changed files with 168 additions and 10 deletions

31
p/oust/index.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/* This file is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public
License as published by the Free Software Foundation.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. */
$title = "Delete Post";
$mark = "p_oust_index";
$depth = "../../";
include "../../res/lib/load.php";
$id = scrub($_GET['id']);
// --------------------------------------
auth_enforce(user_logged_in(),
array("wizard", "archmage"), "liquify posts");
input_enforce(array($id),
array("id"),
array("post_id"));
// -------------------------------------
display_page($mark, $depth, $title, array('post_id' => $id));
?>

View File

@ -0,0 +1,31 @@
<?php
/* This file is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public
License as published by the Free Software Foundation.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. */
$depth = "../../../";
include "../../../res/lib/load.php";
$id = scrub($_GET['id']);
// -------------------------------------
auth_enforce(user_logged_in(),
array("wizard", "archmage"), "liquify posts");
input_enforce(array($id),
array("id"),
array("post_id"));
// -------------------------------------
post_delete($id);
root_redirect("p/list");
?>

View File

@ -24,6 +24,7 @@ function auth_enforce($id, $permitted, $message="do that") {
. $class . "!"); . $class . "!");
return false; return false;
} }
return true;
} }
// ARRAY ARRAY ARRAY --> ARRAY // ARRAY ARRAY ARRAY --> ARRAY

View File

@ -1,13 +1,13 @@
<article class="card"> <article class="card">
<h2 class="title"> <h2 class="title">
<a href="{{ depth }}p/index.php?id={{ post_id }}"> <a href="{{ depth }}{{ post_prefix_id }}{{ post_id }}">
{{ post[post_id]['title'] }} {{ post[post_id]['title'] }}
</a> </a>
</h2> </h2>
{% set author = post[post_id]['author'] %} {% set author = post[post_id]['author'] %}
<h3 class="date">{{ post[post_id]['date'] }}</h3> <h3 class="date">{{ post[post_id]['date'] }}</h3>
<h4 class="author"> <h4 class="author">
<a href="{{ depth }}u/index.php?id={{ author }}"> <a href="{{ depth}}{{ user_prefix_id }}{{ author }}">
{{ user[author]['full_name'] }} {{ user[author]['full_name'] }}
</a> </a>
</h4> </h4>

View File

@ -1,13 +1,13 @@
<article class="card"> <article class="card">
<h2 class="title"> <h2 class="title">
<a href="{{ depth }}p/index.php?id={{ post_id }}"> <a href="{{ depth }}{{ post_prefix_id }}{{ post_id }}">
{{ post[post_id]['title'] }} {{ post[post_id]['title'] }}
</a> </a>
</h2> </h2>
{% set author = post[post_id]['author'] %} {% set author = post[post_id]['author'] %}
<h3 class="date">{{ post[post_id]['date'] }}</h3> <h3 class="date">{{ post[post_id]['date'] }}</h3>
<h4 class="author"> <h4 class="author">
<a href="{{ depth }}u/index.php?id={{ author }}"> <a href="{{ depth }}{{ user_prefix_id }}{{ author }}">
{{ user[author]['full_name'] }} {{ user[author]['full_name'] }}
</a> </a>
</h4> </h4>

View File

@ -1,6 +1,6 @@
<article class="card"> <article class="card">
<h2 class="title"> <h2 class="title">
<a href="{{ depth }}u/?id={{ user_id }}"> <a href="{{ depth }}{{ user_prefix_id }}{{ user_id }}">
{{ user[user_id]['full_name'] }} {{ user[user_id]['full_name'] }}
</a> </a>
</h2> </h2>

View File

@ -1,5 +1,5 @@
{% if logged_in == true %} {% if logged_in == true %}
<p><a class="button" href="new">New post</a></p> <p><a class="button" href="{{ depth }}p/new">New post</a></p>
{% endif %} {% endif %}
{% for post_id in posts %} {% for post_id in posts %}

View File

@ -0,0 +1,13 @@
<h2>Are you sure you want to delete the post?</h2>
<h3>It <em>is</em> permenant, you know.</h3>
<p>
<a class="button" href="{{ depth }}">
No, wait, I've changed my mind! ;-;
</a>
</p>
<p>
<a class="button" href="private/post_delete.php?id={{ post_id }}">
Ugh, stop nagging >;c
</a>
</p>

View File

@ -1,7 +1,7 @@
<article class="user_info"> <article class="user_info">
<h1 class="title">{{ user_full_name }}</h1> <h1 class="title">{{ user_full_name }}</h1>
<h3 class="author">{{ user_website }} &lt;{{ user_email }}&gt;</h3> <h3 class="author">{{ user_website }} &lt;{{ user_email }}&gt;</h3>
<h3 class="date">({{ user_name }})</h3> <h3>({{ user_name }} - {{ user_class }})</h3>
<div class="text">{{ user_bio }}</div> <div class="text">{{ user_bio }}</div>
</article> </article>
@ -9,7 +9,7 @@
{% if (logged_id == user_id) or (user[logged_id]['class'] == "archmage") {% if (logged_id == user_id) or (user[logged_id]['class'] == "archmage")
or (user[logged_id]['class'] == "wizard") %} or (user[logged_id]['class'] == "wizard") %}
<a class="button" href="edit/?id={{ user_id }}">Edit profile</a> <a class="button" href="edit/?id={{ user_id }}">Edit profile</a>
<a class="button" href="delete">Delete user</a> <a class="button" href="oust/?id={{ user_id }}">Delete user</a>
{% endif %} {% endif %}
</p> </p>

View File

@ -1,5 +1,5 @@
<form id="user_creation" action="private/user_create.php" method="post"> <form id="user_creation" action="private/user_create.php" method="post">
<p><label>Username</label> <input name="username" type="text" /></p> <p><label>Username</label> <input name="name" type="text" /></p>
<p><label>Password</label> <input name="password" type="password" /></p> <p><label>Password</label> <input name="password" type="password" /></p>
<p><label>Repeat Password</label> <p><label>Repeat Password</label>
<input name="password_repeat" type="password" /></p> <input name="password_repeat" type="password" /></p>

View File

@ -0,0 +1,13 @@
<h2>Are you sure you want to kick them to the curb like that?</h2>
<h3>It <em>is</em> permenant, you know.</h3>
<p>
<a class="button" href="{{ depth }}">
You're right, I was being too heartless.
</a>
</p>
<p>
<a class="button" href="private/user_delete.php?id={{ user_id }}">
Who cares? Heck them.
</a>
</p>

View File

@ -42,7 +42,7 @@ if ($class != false) {
$auth = auth_enforce($cur_id, array("archmage"), $auth = auth_enforce($cur_id, array("archmage"),
"edit other people's classes"); "edit other people's classes");
if ($auth != false) { if ($auth != false) {
$user_set($edit_id, "class", $class); user_set($edit_id, "class", $class);
} }
} }
@ -51,4 +51,6 @@ user_set($edit_id, "biography", $bio);
user_set($edit_id, "email", $email); user_set($edit_id, "email", $email);
user_set($edit_id, "website", $url); user_set($edit_id, "website", $url);
root_redirect($GLOBALS['user_prefix_id'] . $edit_id);
?> ?>

View File

@ -50,6 +50,7 @@ $local_exports = array('user_id' => $id,
'user_bio' => unscrub(user_biography($id)), 'user_bio' => unscrub(user_biography($id)),
'user_email' => user_email($id), 'user_email' => user_email($id),
'user_website' => user_website($id), 'user_website' => user_website($id),
'user_class' => user_class($id),
'user_posts' => $user_posts, 'user_posts' => $user_posts,
'user_post' => $user_post); 'user_post' => $user_post);

33
u/oust/index.php Normal file
View File

@ -0,0 +1,33 @@
<?php
/* This file is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public
License as published by the Free Software Foundation.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. */
$title = "Delete User";
$mark = "u_oust_index";
$depth = "../../";
include "../../res/lib/load.php";
$id = scrub($_GET['id']);
// --------------------------------------
if (user_logged_in() != $id) {
auth_enforce(user_logged_in(),
array("wizard", "archmage"), "obliterate people");
}
input_enforce(array($id),
array("id"),
array("user_id"));
// -------------------------------------
display_page($mark, $depth, $title, array('user_id' => $id));
?>

View File

@ -0,0 +1,33 @@
<?php
/* This file is free software: you can redistribute it and/or modify
it under the terms of version 3 of the GNU Affero General Public
License as published by the Free Software Foundation.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. */
$depth = "../../../";
include "../../../res/lib/load.php";
$id = scrub($_GET['id']);
// -------------------------------------
if (user_logged_in() != $id) {
auth_enforce(user_logged_in(),
array("wizard", "archmage"), "obliterate users");
}
input_enforce(array($id),
array("id"),
array("user_id"));
// -------------------------------------
user_delete($id);
root_redirect("u/list");
?>