Removed scripts that hook into Misuzu.

This commit is contained in:
flash 2023-07-29 22:17:38 +00:00
parent 27a0e9716d
commit f1af8b488a
6 changed files with 3 additions and 612 deletions

View file

@ -1,25 +0,0 @@
<?php
$config = parse_ini_file(__DIR__ . '/../config/flashii.ini');
require_once $config['msz-path'] . '/vendor/flashwave/index/index.php';
header('Content-Type: application/json; charset=utf-8');
if(!is_file($config['msz-config-path'])) {
echo '{"error":101}';
exit;
}
$config = parse_ini_file($config['msz-config-path']);
if(empty($config['dsn'])) {
echo '{"error":102}';
exit;
}
try {
$db = \Index\Data\DbTools::create($config['dsn']);
$db->execute('SET SESSION time_zone = \'+00:00\', sql_mode = \'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\';');
} catch(Exception $ex) {
echo json_encode(['error' => 103, 'msg' => $ex->getMessage()]);
exit;
}

View file

@ -1,19 +0,0 @@
<?php
require_once '_flashii.php';
$userId = (int)filter_input(INPUT_GET, 'user', FILTER_SANITIZE_NUMBER_INT);
$fieldId = (int)filter_input(INPUT_GET, 'field', FILTER_SANITIZE_NUMBER_INT);
try {
$fetch = $db->prepare('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = ? AND `user_id` = ?');
$fetch->addParameter(1, $fieldId);
$fetch->addParameter(2, $userId);
$fetch->execute();
$result = $fetch->getResult();
if($result->next())
echo json_encode(['field_value' => $result->getString(0)]);
else echo '{"error":105}';
} catch(Exception $ex) {
echo json_encode(['error' => 104, 'msg' => $ex->getMessage()]);
}

View file

@ -82,18 +82,15 @@ switch($_SERVER['HTTP_X_GITHUB_EVENT']) {
case 'delete': case 'delete':
switch($data->ref_type) { switch($data->ref_type) {
case 'tag': case 'tag':
if (acl_check(ACL_BROADCAST)) $message = "[b][url={$data->repository->html_url}]{$data->repository->full_name}[/url][/b]: [url={$data->sender->html_url}]{$data->sender->login}[/url] deleted tag {$data->ref}";
$message = "[b][url={$data->repository->html_url}]{$data->repository->full_name}[/url][/b]: [url={$data->sender->html_url}]{$data->sender->login}[/url] deleted tag {$data->ref}";
break; break;
case 'branch': case 'branch':
if (acl_check(ACL_BROADCAST)) $message = "[b][url={$data->repository->html_url}]{$data->repository->full_name}[/url][/b]: [url={$data->sender->html_url}]{$data->sender->login}[/url] deleted branch {$data->ref}";
$message = "[b][url={$data->repository->html_url}]{$data->repository->full_name}[/url][/b]: [url={$data->sender->html_url}]{$data->sender->login}[/url] deleted branch {$data->ref}";
break; break;
case 'repository': case 'repository':
if (acl_check(ACL_BROADCAST)) $message = "[b]{$data->repository->full_name}[/b]: [url={$data->sender->html_url}]{$data->sender->login}[/url] deleted the repository :crying:";
$message = "[b]{$data->repository->full_name}[/b]: [url={$data->sender->html_url}]{$data->sender->login}[/url] deleted the repository :crying:";
break; break;
} }
break; break;

View file

@ -1,477 +0,0 @@
<?php
require_once '_flashii.php';
header('Content-Type: text/html; charset=utf-8');
$separator = "\r\n\r\nHOjGbeCdZHrVVFz3lBD0cIMGw2hPmkw4\r\n\r\n";
?>
<!doctype html>
<h1>msz_changelog_changes -> change_log</h1>
<textarea><?php
$getShit = $db->query('SELECT `change_log` FROM `msz_changelog_changes`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_changelog_changes -> change_text</h1>
<textarea><?php
$getShit = $db->query('SELECT `change_text` FROM `msz_changelog_changes`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_changelog_tags -> tag_name</h1>
<textarea><?php
$getShit = $db->query('SELECT `tag_name` FROM `msz_changelog_tags`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_changelog_tags -> tag_description</h1>
<textarea><?php
$getShit = $db->query('SELECT `tag_description` FROM `msz_changelog_tags`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_comments_posts -> comment_text</h1>
<textarea><?php
$getShit = $db->query('SELECT `comment_text` FROM `msz_comments_posts`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_forum_categories -> forum_name</h1>
<textarea><?php
$getShit = $db->query('SELECT `forum_name` FROM `msz_forum_categories`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_forum_categories -> forum_description</h1>
<textarea><?php
$getShit = $db->query('SELECT `forum_description` FROM `msz_forum_categories`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_forum_posts -> post_text</h1>
<textarea><?php
$getShit = $db->query('SELECT `post_text` FROM `msz_forum_posts`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_forum_topics -> topic_title</h1>
<textarea><?php
$getShit = $db->query('SELECT `topic_title` FROM `msz_forum_topics`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_news_categories -> category_name</h1>
<textarea><?php
$getShit = $db->query('SELECT `category_name` FROM `msz_news_categories`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_news_categories -> category_description</h1>
<textarea><?php
$getShit = $db->query('SELECT `category_description` FROM `msz_news_categories`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_news_posts -> post_title</h1>
<textarea><?php
$getShit = $db->query('SELECT `post_title` FROM `msz_news_posts`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_news_posts -> post_text</h1>
<textarea><?php
$getShit = $db->query('SELECT `post_text` FROM `msz_news_posts`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_roles -> role_name</h1>
<textarea><?php
$getShit = $db->query('SELECT `role_name` FROM `msz_roles`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_roles -> role_title</h1>
<textarea><?php
$getShit = $db->query('SELECT `role_title` FROM `msz_roles`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_roles -> role_description</h1>
<textarea><?php
$getShit = $db->query('SELECT `role_description` FROM `msz_roles`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_users -> username</h1>
<textarea><?php
$getShit = $db->query('SELECT `username` FROM `msz_users`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_users -> user_about_content</h1>
<textarea><?php
$getShit = $db->query('SELECT `user_about_content` FROM `msz_users`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_users -> user_signature_content</h1>
<textarea><?php
$getShit = $db->query('SELECT `user_signature_content` FROM `msz_users`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_users -> user_title</h1>
<textarea><?php
$getShit = $db->query('SELECT `user_title` FROM `msz_users`');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 1</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 1');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 2</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 2');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 3</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 3');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 4</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 4');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 5</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 5');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 6</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 6');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 7</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 7');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 8</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 8');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 9</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 9');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 10</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 10');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 11</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 11');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 12</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 12');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 13</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 13');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 14</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 14');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 15</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 15');
$getShit->execute();
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 16</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 16');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 17</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 17');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 18</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 18');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>
<h1>msz_profile_fields_values -> field_value -> 19</h1>
<textarea><?php
$getShit = $db->query('SELECT `field_value` FROM `msz_profile_fields_values` WHERE `field_id` = 19');
while($getShit->next()) {
$line = $getShit->getString(0);
if(!empty($line))
echo htmlspecialchars($line) . $separator;
}
?></textarea>

View file

@ -1,56 +0,0 @@
<?php
require_once '_flashii.php';
$startId = (int)filter_input(INPUT_GET, 'start', FILTER_SANITIZE_NUMBER_INT);
try {
$fetch = $db->prepare('
SELECT
p.`post_id`,
t.`topic_id`, t.`topic_title`,
f.`forum_id`, f.`forum_name`,
u.`user_id`, u.`username`,
COALESCE(u.`user_colour`, r.`role_colour`) AS `user_colour`,
(
SELECT MIN(`post_id`) = p.`post_id`
FROM `msz_forum_posts`
WHERE `topic_id` = p.`topic_id`
) AS `is_opening_post`
FROM `msz_forum_posts` as p
LEFT JOIN `msz_users` AS u
ON u.`user_id` = p.`user_id`
LEFT JOIN `msz_roles` AS r
ON r.`role_id` = u.`display_role`
LEFT JOIN `msz_forum_topics` AS t
ON t.`topic_id` = p.`topic_id`
LEFT JOIN `msz_forum_categories` AS f
ON f.`forum_id` = p.`forum_id`
WHERE `post_id` > ?
AND `post_deleted` IS NULL
AND `post_created` > NOW() - INTERVAL 7 DAY
AND p.`forum_id` IN (2, 7, 24, 6, 5, 4, 16, 20, 8, 19, 10, 11, 13, 21, 15, 14, 27, 29, 28)
ORDER BY `post_id`
LIMIT 6
');
$fetch->addParameter(1, $startId);
$fetch->execute();
$result = $fetch->getResult();
$sets = [];
while($result->next())
$sets[] = [
'post_id' => $result->getInteger(0),
'topic_id' => $result->getInteger(1),
'topic_title' => $result->getString(2),
'forum_id' => $result->getInteger(3),
'forum_name' => $result->getString(4),
'user_id' => $result->getInteger(5),
'username' => $result->getString(6),
'user_colour' => $result->getInteger(7),
'is_opening_post' => $result->getInteger(8),
];
echo json_encode($sets);
} catch(Exception $ex) {
echo '{"error":104}';
}

View file

@ -1,29 +0,0 @@
<?php
require_once '_flashii.php';
$startId = (int)filter_input(INPUT_GET, 'start', FILTER_SANITIZE_NUMBER_INT);
try {
$fetch = $db->prepare('
SELECT `user_id`, `username`
FROM `msz_users`
WHERE `user_id` > ?
AND `user_created` > NOW() - INTERVAL 7 DAY
ORDER BY `user_id`
LIMIT 10
');
$fetch->addParameter(1, $startId);
$fetch->execute();
$result = $fetch->getResult();
$sets = [];
while($result->next())
$sets[] = [
'user_id' => $result->getInteger(0),
'username' => $result->getString(1),
];
echo json_encode($sets);
} catch(Exception $ex) {
echo json_encode(['error' => 104, 'msg' => $ex->getMessage()]);
}