From a987549ce8aef357b9c8a6a36740aa74ee8bdec3 Mon Sep 17 00:00:00 2001 From: Jenga Phoenix Date: Tue, 5 Mar 2019 08:33:32 -0600 Subject: [PATCH] Who knows? --- p/oust/index.php | 31 +++++++++++++++++ p/oust/private/post_delete.php | 31 +++++++++++++++++ res/lib/sterilize.php | 1 + .../default/html/meta_post_card.twig.html | 4 +-- .../html/meta_post_card_header.twig.html | 4 +-- .../default/html/meta_user_card.twig.html | 2 +- .../default/html/p_list_index.twig.html | 2 +- .../default/html/p_oust_index.twig.html | 13 ++++++++ res/themes/default/html/u_index.twig.html | 4 +-- res/themes/default/html/u_new_index.twig.html | 2 +- .../default/html/u_oust_index.twig.html | 13 ++++++++ u/edit/private/user_edit.php | 4 ++- u/index.php | 1 + u/oust/index.php | 33 +++++++++++++++++++ u/oust/private/user_delete.php | 33 +++++++++++++++++++ 15 files changed, 168 insertions(+), 10 deletions(-) create mode 100644 p/oust/index.php create mode 100644 p/oust/private/post_delete.php create mode 100644 res/themes/default/html/p_oust_index.twig.html create mode 100644 res/themes/default/html/u_oust_index.twig.html create mode 100644 u/oust/index.php create mode 100644 u/oust/private/user_delete.php diff --git a/p/oust/index.php b/p/oust/index.php new file mode 100644 index 0000000..9108383 --- /dev/null +++ b/p/oust/index.php @@ -0,0 +1,31 @@ + $id)); + +?> diff --git a/p/oust/private/post_delete.php b/p/oust/private/post_delete.php new file mode 100644 index 0000000..ef98a16 --- /dev/null +++ b/p/oust/private/post_delete.php @@ -0,0 +1,31 @@ + diff --git a/res/lib/sterilize.php b/res/lib/sterilize.php index 979b955..8cd4356 100644 --- a/res/lib/sterilize.php +++ b/res/lib/sterilize.php @@ -24,6 +24,7 @@ function auth_enforce($id, $permitted, $message="do that") { . $class . "!"); return false; } + return true; } // ARRAY ARRAY ARRAY --> ARRAY diff --git a/res/themes/default/html/meta_post_card.twig.html b/res/themes/default/html/meta_post_card.twig.html index 76c5d07..f646d1e 100644 --- a/res/themes/default/html/meta_post_card.twig.html +++ b/res/themes/default/html/meta_post_card.twig.html @@ -1,13 +1,13 @@

- + {{ post[post_id]['title'] }}

{% set author = post[post_id]['author'] %}

{{ post[post_id]['date'] }}

- + {{ user[author]['full_name'] }}

diff --git a/res/themes/default/html/meta_post_card_header.twig.html b/res/themes/default/html/meta_post_card_header.twig.html index d12dfaa..45e2852 100644 --- a/res/themes/default/html/meta_post_card_header.twig.html +++ b/res/themes/default/html/meta_post_card_header.twig.html @@ -1,13 +1,13 @@

- + {{ post[post_id]['title'] }}

{% set author = post[post_id]['author'] %}

{{ post[post_id]['date'] }}

- + {{ user[author]['full_name'] }}

diff --git a/res/themes/default/html/meta_user_card.twig.html b/res/themes/default/html/meta_user_card.twig.html index f42d175..0b44c50 100644 --- a/res/themes/default/html/meta_user_card.twig.html +++ b/res/themes/default/html/meta_user_card.twig.html @@ -1,6 +1,6 @@

- + {{ user[user_id]['full_name'] }}

diff --git a/res/themes/default/html/p_list_index.twig.html b/res/themes/default/html/p_list_index.twig.html index 4960a88..ad8b11f 100644 --- a/res/themes/default/html/p_list_index.twig.html +++ b/res/themes/default/html/p_list_index.twig.html @@ -1,5 +1,5 @@ {% if logged_in == true %} -

New post

+

New post

{% endif %} {% for post_id in posts %} diff --git a/res/themes/default/html/p_oust_index.twig.html b/res/themes/default/html/p_oust_index.twig.html new file mode 100644 index 0000000..8c0740a --- /dev/null +++ b/res/themes/default/html/p_oust_index.twig.html @@ -0,0 +1,13 @@ +

Are you sure you want to delete the post?

+

It is permenant, you know.

+ +

+ + No, wait, I've changed my mind! ;-; + +

+

+ + Ugh, stop nagging >;c + +

diff --git a/res/themes/default/html/u_index.twig.html b/res/themes/default/html/u_index.twig.html index 2b7b3bb..72093e0 100644 --- a/res/themes/default/html/u_index.twig.html +++ b/res/themes/default/html/u_index.twig.html @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ {% if (logged_id == user_id) or (user[logged_id]['class'] == "archmage") or (user[logged_id]['class'] == "wizard") %} Edit profile -Delete user +Delete user {% endif %}

diff --git a/res/themes/default/html/u_new_index.twig.html b/res/themes/default/html/u_new_index.twig.html index ec25586..56e3745 100644 --- a/res/themes/default/html/u_new_index.twig.html +++ b/res/themes/default/html/u_new_index.twig.html @@ -1,5 +1,5 @@
-

+

diff --git a/res/themes/default/html/u_oust_index.twig.html b/res/themes/default/html/u_oust_index.twig.html new file mode 100644 index 0000000..596e83c --- /dev/null +++ b/res/themes/default/html/u_oust_index.twig.html @@ -0,0 +1,13 @@ +

Are you sure you want to kick them to the curb like that?

+

It is permenant, you know.

+ +

+ + You're right, I was being too heartless. + +

+

+ + Who cares? Heck them. + +

diff --git a/u/edit/private/user_edit.php b/u/edit/private/user_edit.php index 0f0d033..445bf9c 100644 --- a/u/edit/private/user_edit.php +++ b/u/edit/private/user_edit.php @@ -42,7 +42,7 @@ if ($class != false) { $auth = auth_enforce($cur_id, array("archmage"), "edit other people's classes"); 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, "website", $url); +root_redirect($GLOBALS['user_prefix_id'] . $edit_id); + ?> diff --git a/u/index.php b/u/index.php index 4a34e55..1ecfc50 100644 --- a/u/index.php +++ b/u/index.php @@ -50,6 +50,7 @@ $local_exports = array('user_id' => $id, 'user_bio' => unscrub(user_biography($id)), 'user_email' => user_email($id), 'user_website' => user_website($id), + 'user_class' => user_class($id), 'user_posts' => $user_posts, 'user_post' => $user_post); diff --git a/u/oust/index.php b/u/oust/index.php new file mode 100644 index 0000000..c8d4c50 --- /dev/null +++ b/u/oust/index.php @@ -0,0 +1,33 @@ + $id)); + +?> diff --git a/u/oust/private/user_delete.php b/u/oust/private/user_delete.php new file mode 100644 index 0000000..e91a8e9 --- /dev/null +++ b/u/oust/private/user_delete.php @@ -0,0 +1,33 @@ +