Ejemplo n.º 1
0
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
adr_template_file('adr_cell_body.tpl');
include_once $phpbb_root_path . 'includes/page_header.' . $phpEx;
$user_id = $userdata['user_id'];
$caution = $userdata['user_cell_caution'];
$pay = isset($HTTP_POST_VARS['submit']);
// Update the time sentence
adr_cell_update_users();
if ($pay) {
    $sql = "UPDATE " . ADR_JAIL_USERS_TABLE . " \r\n\t\tSET user_freed_by = {$user_id}\r\n\t\tWHERE user_id = {$user_id} ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "", __LINE__, __FILE__, $sql);
    }
    $sql = "DELETE FROM " . ADR_JAIL_VOTES_TABLE . " \r\n\t\tWHERE vote_id = {$user_id} ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "", __LINE__, __FILE__, $sql);
    }
    $sql = "UPDATE " . USERS_TABLE . " \r\n\t\tSET user_points = user_points - {$caution} ,\r\n\t\tuser_cell_time = 0 ,\r\n\t\tuser_cell_time_judgement = 0 ,\r\n\t\tuser_cell_enable_caution = 0,\r\n\t\tuser_cell_enable_free = 0,\r\n\t\tuser_cell_sentence = '',\r\n\t\tuser_cell_caution = 0\r\n\t\tWHERE user_id = {$user_id} ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "", __LINE__, __FILE__, $sql);
    }
    message_die(GENERAL_MESSAGE, $lang['Adr_cell_free']);
}
Ejemplo n.º 2
0
         $sql = "SELECT * FROM " . USERS_TABLE . "\n\t\tWHERE user_cell_time > 0\n\t\tORDER BY username";
         if (!($result = $db->sql_query($sql))) {
             message_die(GENERAL_ERROR, 'Could not obtain celled list', '', __LINE__, __FILE__, $sql);
         }
         $celleds = $db->sql_fetchrowset($result);
         $sql = array();
         while (list(, $celled) = @each($celleds)) {
             if (isset($_POST[$celled['user_id']])) {
                 adr_cell_free_user($celled['user_id'], 2);
             }
         }
         adr_previous(Adr_cell_admin_uncelled_ok, admin_adr_cell_users, '');
     } else {
         if ($manual_update) {
             $free = '';
             $free = adr_cell_update_users();
             $free = $free == '' ? $lang['None'] : $free;
             message_die(GENERAL_MESSAGE, $lang['Adr_cell_admin_celled_manual_update_ok'] . '<br />' . $free);
         } else {
             $sql = "SELECT * FROM " . USERS_TABLE . "\n\t\tWHERE user_cell_time > 0\n\t\tAND user_id > 1\n\t\tORDER by username";
             if (!($result = $db->sql_query($sql))) {
                 message_die(GENERAL_ERROR, 'Could not obtain celled list', '', __LINE__, __FILE__, $sql);
             }
             $celled = $db->sql_fetchrowset($result);
             for ($i = 0; $i < count($celled); $i++) {
                 $user_id = $celled[$i]['user_id'];
                 $template->assign_block_vars('celled', array('CELLED_ID' => $celled[$i]['user_id'], 'CELLED_NAME' => $celled[$i]['username'], 'CELLED_SENTENCE' => $celled[$i]['user_cell_sentence'], 'CELLED_TIME' => adr_make_time($celled[$i]['user_cell_time']), 'CELLED_CAUTION' => $celled[$i]['user_cell_caution'], 'U_EDIT' => append_sid("admin_adr_cell_users.{$phpEx}?from=list&amp;id=" . $user_id . "")));
             }
         }
     }
 }