$info_mbr = $Sql->query_array(DB_TABLE_MEMBER, 'user_id', 'level', 'user_mail', "WHERE user_id = '" . $id_get . "'", __LINE__, __FILE__); if (!empty($info_mbr['user_id']) && ($info_mbr['level'] < 2 || $User->check_level(ADMIN_LEVEL))) { if ($new_warning_level < 100) { $Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET user_warning = '" . $new_warning_level . "' WHERE user_id = '" . $info_mbr['user_id'] . "'", __LINE__, __FILE__); if ($info_mbr['user_id'] != $User->get_attribute('user_id')) { if (!empty($warning_contents)) { import('members/pm'); $Privatemsg = new PrivateMsg(); $Privatemsg->start_conversation($info_mbr['user_id'], addslashes($LANG['warning_title']), $warning_contents, '-1', SYSTEM_PM); } } forum_history_collector(H_SET_WARNING_USER, $info_mbr['user_id'], 'moderation_forum.php?action=warning&id=' . $info_mbr['user_id']); } elseif ($new_warning_level == 100) { $Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET user_warning = 100 WHERE user_id = '" . $info_mbr['user_id'] . "'", __LINE__, __FILE__); $Sql->query_inject("DELETE FROM " . DB_TABLE_SESSIONS . " WHERE user_id = '" . $info_mbr['user_id'] . "'", __LINE__, __FILE__); forum_history_collector(H_BAN_USER, $info_mbr['user_id'], 'moderation_forum.php?action=warning&id=' . $info_mbr['user_id']); import('io/mail'); $Mail = new Mail(); $Mail->send_from_properties($info_mbr['user_mail'], addslashes($LANG['ban_title_mail']), sprintf(addslashes($LANG['ban_mail']), HOST, addslashes($CONFIG['sign'])), $CONFIG['mail_exp']); } } redirect(HOST . DIR . '/forum/moderation_forum' . url('.php?action=warning', '', '&')); } $Template->assign_vars(array('MODULE_DATA_PATH' => $Template->get_module_data_path('forum'), 'L_FORUM' => $LANG['forum'], 'L_LOGIN' => $LANG['pseudo'], 'L_MODERATION_PANEL' => $LANG['moderation_panel'], 'L_MODERATION_FORUM' => $LANG['moderation_forum'], 'L_INFO_MANAGEMENT' => $LANG['warning_management'], 'U_XMLHTTPREQUEST' => 'warning_moderation_panel', 'U_MODERATION_FORUM_ACTION' => '» <a href="moderation_forum.php' . url('?action=warning&token=' . $Session->get_token()) . '">' . $LANG['warning_management'] . '</a>', 'U_ACTION' => url('.php?action=warning&token=' . $Session->get_token()))); if (empty($id_get)) { if (retrieve(POST, 'search_member', false)) { $login = retrieve(POST, 'login_member', ''); $user_id = $Sql->query("SELECT user_id FROM " . DB_TABLE_MEMBER . " WHERE login LIKE '%" . $login . "%'", __LINE__, __FILE__); if (!empty($user_id) && !empty($login)) { redirect(HOST . DIR . '/forum/moderation_forum' . url('.php?action=warning&id=' . $user_id, '', '&')); } else {
function Del_alert_topic($id_alert) { PersistenceContext::get_querier()->delete(PREFIX . 'forum_alerts', 'WHERE id=:id', array('id' => $id_alert)); //Si la contribution associée n'est pas réglée, on la règle $corresponding_contributions = ContributionService::find_by_criteria('forum', $id_alert, 'alert'); if (count($corresponding_contributions) > 0) { $file_contribution = $corresponding_contributions[0]; //We delete the contribution ContributionService::delete_contribution($file_contribution); } //Insertion de l'action dans l'historique. forum_history_collector(H_DEL_ALERT); }
function Del_alert_topic($id_alert) { global $Sql; $Sql->query_inject("DELETE FROM " . PREFIX . "forum_alerts WHERE id = '" . $id_alert . "'", __LINE__, __FILE__); import('events/contribution'); import('events/contribution_service'); $corresponding_contributions = ContributionService::find_by_criteria('forum', $id_alert, 'alert'); if (count($corresponding_contributions) > 0) { $file_contribution = $corresponding_contributions[0]; ContributionService::delete_contribution($file_contribution); } forum_history_collector(H_DEL_ALERT); }