Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #38 from brunnopleffken/development
Browse files Browse the repository at this point in the history
Merge 'development' (v0.6.0) into 'master'
  • Loading branch information
brunnopleffken committed Jul 3, 2015
2 parents cac2d7d + 35cb401 commit 08c79a2
Show file tree
Hide file tree
Showing 45 changed files with 403 additions and 140 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## v0.6.0 (2015-07-03)

#### Added
- Rooms categories.

#### Fixed
- Member getting SQL error when reporting a post/thread (#26);
- Broken links when viewing reports in Administration CP;
- Bug fixes related to failed MySQL connection under certain scenarios (#16, #26 and #29, thanks to @halojoy);
- SQL error when adding a new reply (#30);
- Several minor bug fixes and general enhancements.



## v0.5.1 (2015-06-19)

#### Fixed
Expand All @@ -20,7 +34,7 @@
- Minor bug fixes and layout enhancements.

#### Security
- Improved validations when performing moderation actions (lock/unlock, delete, ...).
- Improved validations when performing moderation actions (lock/unlock, delete, etc).



Expand Down
3 changes: 2 additions & 1 deletion admin/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

// Load MySQL driver and connect

$Db = new Database($config);
$Db = new Database();
$Db->Connect($config);

// Get security hash key
$Db->Query("SELECT * FROM c_config c WHERE field = 'security_salt_hash' OR field = 'security_salt_key';");
Expand Down
6 changes: 4 additions & 2 deletions admin/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
require("../kernel/String.php");
require("../kernel/Template.php");

$Db = new Database($config);
$Db = new Database();
$Db->Connect($config);

$Db->Query("SELECT * FROM c_config;");
$Core = new Core($Db, $Db->FetchConfig());
Expand Down Expand Up @@ -140,8 +141,9 @@ function CreateMenu($section)
<a href="main.php?act=system" class="transition">System</a>
</div>
<div class="section-subnav">
<a href="main.php?act=rooms&amp;p=add">Add New Room</a>
<a href="main.php?act=rooms&amp;p=manage">Manage Rooms</a>
<a href="main.php?act=rooms&amp;p=add">Add New Room</a>
<a href="main.php?act=rooms&amp;p=categories">Categories</a>
<a href="main.php?act=rooms&amp;p=moderators">Moderators</a>
</div>
HTML;
Expand Down
77 changes: 71 additions & 6 deletions admin/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
require_once("../kernel/String.php");
require_once("../kernel/Database.php");

$Db = new Database($config);
$Db = new Database();
$Core = new Core($Db, $config);
$Admin = new Admin($Db);

$Db->Connect($config);

// Do we have an action?
$do = Http::Request("do");
Expand All @@ -64,18 +66,74 @@

$id = Http::Request("id");
$Db->Query("DELETE FROM c_reports WHERE rp_id = {$id}");
$Admin->RegisterLog("Removed a report");

header("Location: main.php");
exit;

break;

case "new_category":

$category = array(
"name" => Http::Request("name"),
"order_n" => 0,
"visible" => 1
);

$Db->Insert("c_categories", $category);
$Admin->RegisterLog("Created new category: " . $category['name']);

header("Location: main.php?act=rooms&p=manage&msg=1");
exit;

break;

case "update_categories":

$categories = $_POST['category'];

foreach($categories as $id => $value) {
$category = array(
"order_n" => $value['order_n'],
"visible" => $value['visible']
);

$Db->Update("c_categories", $category, "c_id = {$id}");
}

header("Location: main.php?act=rooms&p=categories&msg=1");
exit;

break;

case "remove_category":

$id = Http::Request("id");

// Get the first category
$category = $Db->Query("SELECT c_id FROM c_categories LIMIT 1;");
$first_category = $Db->Fetch($category);

// Update all rooms th the first selected category
$Db->Update("c_rooms", "category_id = {$first_category['c_id']}", "category_id = {$id}");

// Remove the selected category
$Db->Delete("c_categories", "c_id = {$id}");

header("Location: main.php?act=rooms&p=categories&msg=2");
exit;

break;

case "newroom":

$room = array(
"category_id" => $_POST['category_id'],
"name" => String::Sanitize($_POST['name']),
"description" => String::Sanitize($_POST['description']),
"url" => ($_POST['url'] != "") ? $_POST['url'] : NULL,
"threads" => 0,
"password" => ($_POST['password'] != "") ? $_POST['password'] : NULL,
"read_only" => (isset($_POST['read_only'])) ? "1" : "0",
"invisible" => (isset($_POST['invisible'])) ? "1" : "0",
Expand Down Expand Up @@ -125,18 +183,18 @@
// Register room exclusion in Admin log
$Db->Query("SELECT name FROM c_rooms WHERE r_id = {$r_id}");
$room = $Db->Fetch();
$Admin->RegisterLog("Deleted room: " . $room['name']);

// Delete all related posts
$threads = $Db->Query("SELECT t_id FROM c_threads WHERE room_id = '{$r_id}';");

while($_threads = $Db->Fetch($threads)) {
$Db->Query("DELETE FROM c_posts WHERE thread_id = '{$threads['t_id']}';");
$Db->Query("DELETE FROM c_posts WHERE thread_id = '{$_threads['t_id']}';");
}

// Delete threads and room itself
$Db->Query("DELETE FROM c_threads WHERE room_id = '{$r_id}';");
$Db->Query("DELETE FROM c_rooms WHERE r_id = '{$r_id}';");
$Admin->RegisterLog("Deleted room: " . $room['name']);

header("Location: main.php?act=rooms&p=manage&msg=3");
exit;
Expand Down Expand Up @@ -174,6 +232,8 @@
WHERE t_id = {$thread['t_id']};");
}

$Admin->RegisterLog("Resynchronized room: " . $id);

header("Location: main.php?act=rooms&p=manage&msg=4");
exit;

Expand Down Expand Up @@ -210,14 +270,12 @@
case "savelang":

// File info

$file = Http::Request("file");
$dir = Http::Request("dir");

$file_path = "../languages/" . $dir . "/" . $file . ".php";

// Language file content

$file_content = "<?php\n";
foreach(Http::Request("index") as $key) {
$file_content .= "\t\$t[\"" . $key . "\"] = \"" . $_REQUEST[$key] . "\";\n";
Expand All @@ -230,6 +288,8 @@
fclose($handle);
}

$Admin->RegisterLog("Edited language file '" . $file . "' from '" . $dir . "'");

header("Location: " . $_SERVER['HTTP_REFERER']);
exit;

Expand All @@ -249,6 +309,8 @@
exit;
}

$Admin->RegisterLog("Edited CSS file: " . Http::Request("css_file"));

break;

case "install_language":
Expand All @@ -270,6 +332,7 @@
);

$Db->Insert("c_languages", $language);
$Admin->RegisterLog("Installed new language : " . $code);

header("Location: " . $_SERVER['HTTP_REFERER']);
exit;
Expand All @@ -291,7 +354,7 @@

// Delete from database
$Db->Query("DELETE FROM c_languages WHERE l_id = {$id};");

$Admin->RegisterLog("Uninstalled language package: " . $language_directory['directory']);

header("Location: " . $_SERVER['HTTP_REFERER']);
exit;
Expand Down Expand Up @@ -355,6 +418,7 @@

// Save new data in database
$Db->Query("UPDATE c_rooms SET moderators = '{$serialized}' WHERE r_id = {$room_id};");
$Admin->RegisterLog("Added moderator: member ID #" . $member_id . " to the room ID #" . $room_id);

header("Location: main.php?act=rooms&p=moderators&msg=1");
exit;
Expand Down Expand Up @@ -384,6 +448,7 @@

// Save new data in database
$Db->Query("UPDATE c_rooms SET moderators = '{$serialized}' WHERE r_id = {$room_id};");
$Admin->RegisterLog("Removed moderator: member ID #" . $member_id . " from the room ID #" . $room_id);

header("Location: main.php?act=rooms&p=remove_mod&id=6&msg=1&m_id={$member_id}");
exit;
Expand Down
4 changes: 2 additions & 2 deletions admin/sources/adm_dashboard_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
$report['post'] = "-";
}
else {
$report['post'] = "Yes (<a href='" . $Admin->SelectConfig("general_community_url") . "thread/2#post-" . $report['post_id'] . "' target='_blank'>view post</a>)";
$report['post'] = "Yes (<a href='" . $Admin->SelectConfig("general_community_url") . "thread/{$report['thread_id']}#post-" . $report['post_id'] . "' target='_blank'>view post</a>)";
}

$reason[1] = "Nudity or pornography";
Expand All @@ -63,7 +63,7 @@
<td rowspan='2' style='border-right: 1px solid #eee; border-bottom: 2px solid #eee' nowrap>{$report['username']}</td>
<td nowrap>{$report['date']}</td>
<td>{$reason[$report['reason']]}</td>
<td><a href='../index.php?module=thread&amp;id={$report['thread_id']}'>{$report['title']}</a></td>
<td><a href='../thread/{$report['thread_id']}'>{$report['title']}</a></td>
<td>{$report['post']}</td>
<td rowspan='2' style='border-left: 1px solid #eee; border-bottom: 2px solid #eee'>
<a href='process.php?do=remove_report&id={$report['rp_id']}' onclick='DeleteReport({$report['rp_id']},{$report['thread_id']})'><img src='images/trash.png'></a>
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_calendars.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_community.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_date.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
4 changes: 2 additions & 2 deletions admin/sources/adm_general_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<tr><td><a href="main.php?act=general&amp;p=cookies"><b>Cookies</b></a><br>This section contains settings for cookies and sessions.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=date"><b>Date &amp; Time</b></a><br>This section contains the date and time formats used throughout the board.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=email"><b>E-mail</b></a><br>This section will allow you to change the incoming and outgoing e-mail addresses as well as the e-mail method.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=pm"><b>PM (Personal Messages)</b></a><br>This section allows you to control the global personal messages options.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=pm"><b>PM (Personal Messages)</b></a><br>These settings allow you to control the global personal messages options.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=profiles"><b>Profiles</b></a><br>This section allows you to adjust your members' global permissions and other options.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=security"><b>Security</b></a><br>These options allow you to adjust the security and privacy options.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=topics_posts"><b>Topics and Posts</b></a><br>These options control various elements when posting, reading threads and polls.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=warnings"><b>Warnings</b></a><br>This section will allow you to configure moderator settings.</td></tr>
<tr><td><a href="main.php?act=general&amp;p=warnings"><b>Warnings</b></a><br>This section will allow you to configure warning and ban settings.</td></tr>
</table>
</div>
</div>
2 changes: 1 addition & 1 deletion admin/sources/adm_general_pm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_security.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_topics_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_general_warnings.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
2 changes: 1 addition & 1 deletion admin/sources/adm_languages_badwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

switch($msg) {
case 1:
$message = Html::Notification("The settings has been changed successfully.", "success");
$message = Html::Notification("The settings has been successfully changed.", "success");
break;
default:
$message = "";
Expand Down
6 changes: 2 additions & 4 deletions admin/sources/adm_members_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
<h1>Members Settings</h1>

<div id="content">

<div class="grid-row">
<!-- LEFT -->
<table class="table-list">
<tr>
<th>Settings Groups</th>
</tr>
<tr><td><a href="main.php?act=members&p=add"><b>Add New Member</b></a><br>Register a new member manually and define initial settings.</td></tr>
<tr><td><a href="main.php?act=members&p=add"><b>Add New Member</b></a><br>Register a new member manually and define their initial settings.</td></tr>
<tr><td><a href="main.php?act=members&p=ban"><b>Ban Member</b></a><br>Add or remove member bannishments.</td></tr>
<tr><td><a href="main.php?act=members&p=manage"><b>Manage Members</b></a><br>Edit profile and delete members from community.</td></tr>
<tr><td><a href="main.php?act=members&p=manage"><b>Manage Members</b></a><br>Manage, edit profiles and delete members from community.</td></tr>
<tr><td><a href="main.php?act=members&p=usergroups"><b>User Groups</b></a><br>Add and manage user groups and their settings.</td></tr>
</table>
</div>

</div>
Loading

0 comments on commit 08c79a2

Please sign in to comment.