function prefs_smarty_validate() { global $_RUN; if (SmartyValidate::is_init() && SmartyValidate::is_valid($_POST)) { SmartyValidate::clear(); // And set the preferences $ok = ""; $errors['PARAMS'] = "Incorrect parameters specified..\n"; $data['name'] = $_POST['name']; $data['email'] = $_POST['email']; $data['theme_id'] = $_POST['theme']; $data['gender'] = $_POST['gender']; $data['city'] = $_POST['city']; $data['country'] = $_POST['country']; $data['tag'] = $_POST['tag']; $data['dob'] = $_POST['dob_Year'] . "-" . $_POST['dob_Month'] . "-" . $_POST['dob_Day']; if (isset($inform)) { $data['inform'] = $_POST['inform']; } if (isset($login_pass)) { $data['login_pass'] = $_POST['login_pass']; } $user_id = decrypt_get_vars($_POST['uid']); $data['user_id'] = $user_id; comm_send_to_server("SETPREFS", $data, $ok, $errors); $result = sql_query("SELECT * FROM perihelion.u_users WHERE id=" . $user_id); $tmp = sql_fetchrow($result); session_reinit($tmp); $template = new Smarty(); $template->display($_RUN['theme_path'] . "/preferences-success.tpl"); return true; } return false; }
$tmpvar['ids'][] = $row['id']; $tmpvar['names'][] = $row['name']; } $template->assign("themes_ids", $tmpvar['ids']); $template->assign("themes_names", $tmpvar['names']); if (!SmartyValidate::is_init() && !isset($_POST['submit'])) { SmartyValidate::init(); SmartyValidate::register_criteria("validate_email"); SmartyValidate::register_criteria("validate_login"); SmartyValidate::register_criteria("validate_specie"); SmartyValidate::register_criteria("validate_sector"); SmartyValidate::register_criteria("validate_planet"); $template->display($_RUN['theme_path'] . "/register.tpl"); } else { if (SmartyValidate::is_valid($_POST)) { SmartyValidate::clear(); $ok = ""; $errors['PARAMS'] = "Incorrect parameters specified..\n"; $data['tag'] = $_POST['tag']; $data['name'] = $_POST['name']; $data['email'] = $_POST['email']; $data['inform'] = $_POST['inform']; $data['gender'] = $_POST['gender']; $data['city'] = $_POST['city']; $data['country'] = $_POST['country']; $data['species'] = $_POST['species']; $data['planet'] = $_POST['planet']; $data['sector'] = $_POST['sector']; $data['login_name'] = $_POST['login_name']; $data['login_pass'] = $_POST['login_pass']; if (comm_send_to_server("REGISTER", $data, $ok, $errors) == 1) {