×óþ, îïÿòü ìíå îòâå÷àòü... ;-)
Xan wrote:Ñêàæèò, ïîæàëóéñòà, ÷òî íóæíî â ñêðèïòå äîáàâèòü/ïîäðåäàêòèðîâàòü, ÷òîáû ìîäåðàòîðû íå ìîãëè áàíèòü àäìèíîâ
Èùåøü â admin_bans.php, âíóòðè áëîêà if (isset($_REQUEST['add_ban'])) ... (îí â ñàìîì íà÷àëå)
$result = $db->query('SELECT username, email FROM '.$db->prefix.'users
çàìåíÿåøü íà:
$result = $db->query('SELECT username, email, status FROM '.$db->prefix.'users
íèæå èùåøü:
list($ban_user, $ban_email) = $db->fetch_row($result);
çàìåíÿåøü íà:
list($ban_user, $ban_email, $status) = $db->fetch_row($result);
è íèæå ñòàâèøü ïðîâåðêó:
if ($status < 2)
message($lang_common['No permission']);
Òàêèõ èçìåíåíèé íóæíî ñäåëàòü äâà. ×óòü íèæå ïîäîáíûé áëîê, ñ íåáîëüøèìè îòëè÷èÿìè, òàì ïðèìåðíî òî æå ñàìîå äåëàåøü.
è ÷òîáû àäìèíîâ íåëüçÿ áûëî óäàëèòü (ïî êðàéíåé ìåðå ïåðåä óäàëåíèåì àäìèíà, ïîíèçèòü åãî â çâàíèè).
Îòêðûâàåøü profile.php, èäåøü â áëîê if (isset($_POST['update_status'])) ...
 íåãî äîáàâëÿåøü ïîñëå ïðîâåðêè ñòàòóñà cur_user:
$result = $db->query('SELECT status FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user status', __FILE__, __LINE__, $db->error());
list($status) = $db->fetch_row($result);
if ($status == 2)
message($lang_common['No permission']);
Ñóäÿ ïî òâîèì çàïðîñàì, ó òåáÿ òàì íåõèëàÿ âîéíóøêà íà ôîðóìå... :-)
Big Brother is not watching you, Big Brother is testing you