if ($data = $result->fetch_assoc()) { $result->close(); extract($data); $_SESSION['logged'] = 'Logged'; $_SESSION['user'] = $username; $_SESSION['first_name'] = $first_name; $_SESSION['middle_name'] = $middle_name; $_SESSION['last_name'] = $last_name; $_SESSION['ip_address'] = get_ip(); $data_con = new data_abstraction(); $data_con->set_fields('skin_name, header, footer, master_css, colors_css, fonts_css, override_css, icon_set'); $data_con->set_table('system_skins'); $data_con->set_where("skin_id=?"); $bind_params = array('i', $skin_id); $data_con->stmt_prepare($bind_params); $data_con->stmt_fetch('single'); if ($data_con->num_rows == 1) { extract($data_con->dump); $_SESSION['header'] = $header; $_SESSION['footer'] = $footer; $_SESSION['skin'] = $skin_name; $_SESSION['master_css'] = $master_css; $_SESSION['colors_css'] = $colors_css; $_SESSION['fonts_css'] = $fonts_css; $_SESSION['override_css'] = $override_css; $_SESSION['icon_set'] = $icon_set; if (trim($_SESSION['icon_set'] == '')) { $_SESSION['icon_set'] = 'cobalt'; } } $data_con->close_db();
if (isset($_POST['group_field1'])) { $group_field1 = $_POST['group_field1']; $_SESSION[$sess_var]['group_field1'] = $group_field1; } if (isset($_POST['group_field2'])) { $group_field2 = $_POST['group_field2']; $_SESSION[$sess_var]['group_field2'] = $group_field2; } if (isset($_POST['group_field3'])) { $group_field3 = $_POST['group_field3']; $_SESSION[$sess_var]['group_field3'] = $group_field3; } $token = generate_token(); $_SESSION[$sess_var]['token'] = $token; $token = rawurlencode($token); $result_page = $reporter->result_page; $open_result_page = TRUE; } } } //retrieve saved reports (if any) $d = new data_abstraction(); $d->set_table('cobalt_reporter'); $d->set_fields('report_name'); $d->set_where("module_name=?"); $reporter_mod_name = $reporter->session_array_name; $bind_params = array('s', $reporter_mod_name); $d->stmt_prepare($bind_params); $d->stmt_fetch(); $arr_saved_reports = $d->dump; $d = null;
$data_con = new data_abstraction(); $data_con->set_fields('citizen_id'); $data_con->set_table('citizen'); $data_con->set_where("username=?"); $bind_params = array('s', $username); $data_con->stmt_prepare($bind_params); $data_con->stmt_fetch('single'); if ($data_con->num_rows > 0) { extract($data_con->dump); $data_con_validate = new data_abstraction(); $data_con_validate->set_fields('status'); $data_con_validate->set_table('validate'); $data_con_validate->set_where("citizen_id=?"); $bind_params = array('i', $citizen_id); $data_con_validate->stmt_prepare($bind_params); $data_con_validate->stmt_fetch('single'); if ($data_con_validate->num_rows > 0) { extract($data_con_validate->dump); if ($status == 'Accepted') { $verified = TRUE; } } $data_con_validate->close_db(); } $data_con->close_db(); $_SESSION['logged'] = 'Logged'; $_SESSION['user'] = $username; $_SESSION['first_name'] = $first_name; $_SESSION['middle_name'] = $middle_name; $_SESSION['last_name'] = $last_name; $_SESSION['ip_address'] = get_ip();
function cobalt_password_must_rehash($username) { $must_rehash = FALSE; $dbh = new data_abstraction(); $dbh->set_table('user'); $dbh->set_fields('`iteration`, `method` AS `current_method`'); $dbh->set_where("`username`= ?"); $bind_params = array('s', $username); $dbh->stmt_prepare($bind_params); $dbh->stmt_fetch('single'); if ($dbh->num_rows == 1) { extract($dbh->dump); } $method = cobalt_password_set_method(); if ($method == $current_method) { if ($method == 'blowfish') { $blowfish_cost_factor = AUTH_BLOWFISH_COST_FACTOR; if ((int) $iteration != (int) $blowfish_cost_factor) { $must_rehash = TRUE; } } else { $min = constant('AUTH_' . strtoupper($method) . '_MIN_ROUNDS'); $max = constant('AUTH_' . strtoupper($method) . '_MAX_ROUNDS'); if ($max < $min) { $max = $min; } if ($iteration < $min || $iteration > $max) { $must_rehash = TRUE; } } } else { $must_rehash = TRUE; } return $must_rehash; }