Рефакторинг, очистка, работа над ошибками, связанными с базой, отказ от глобальной переменной $user во многих файлах.
Singleton в некоторых местах вместо решения #42. Новые шаги для решения #16 и #52. Closes #42. Closes #32. Closes #31.
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Battles\Template;
|
||||
use Battles\User;
|
||||
|
||||
require_once "functions.php";
|
||||
$errkom = '';
|
||||
@@ -306,7 +307,7 @@ Template::header('Вход в Лабиринты');
|
||||
</div>
|
||||
<?
|
||||
if (isset($_GET['del_com'])) {
|
||||
if ($user->getAdmin()) {
|
||||
if (User::getInstance()->getAdmin()) {
|
||||
mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1');
|
||||
$re = 'Комментарий удалён';
|
||||
} else {
|
||||
@@ -398,7 +399,7 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
}
|
||||
$userszv = ltrim($userszv, ', ');
|
||||
if ($pl['com'] != '') {
|
||||
if ($user->getAdmin()) {
|
||||
if (User::getInstance()->getAdmin()) {
|
||||
$del = ' <a href=\'lab_enter.php?del_com=' . $pl['id'] . '\'>Удалить комментарий</a>';
|
||||
} else {
|
||||
$del = '';
|
||||
|
||||
Reference in New Issue
Block a user