$query->where = 'u.email = :email'; $params = array(':email' => $email1); $result = $query->run($params); if (!empty($result)) { if ($pun_config['p_allow_dupe_email'] == '0') { $errors[] = $lang->t('Dupe email'); } foreach ($result as $cur_dupe) { $dupe_list[] = $cur_dupe['username']; } } unset($query, $params, $result); // Make sure we got a valid language string if (isset($_POST['language'])) { $language = $_POST['language']; if (!Flux_Lang::languageExists($language)) { message($lang->t('Bad request')); } } else { $language = $pun_config['o_default_lang']; } $timezone = round($_POST['timezone'], 1); $dst = isset($_POST['dst']) ? '1' : '0'; $email_setting = intval($_POST['email_setting']); if ($email_setting < 0 || $email_setting > 2) { $email_setting = $pun_config['o_default_email_setting']; } // Did everything go according to plan? if (empty($errors)) { // Insert the new user into the database. We do this now to get the last inserted ID for later use $now = time();
if ($pun_user['id'] != $id && (!$pun_user['is_admmod'] || $pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_mod_edit_users'] == '0' || $group_id == PUN_ADMIN || $is_moderator))) { // or the user is another mod message($lang->t('No permission')); } if ($pun_user['is_admmod']) { confirm_referrer('profile.php'); } $username_updated = false; // Validate input depending on section switch ($section) { case 'essentials': $form = array('timezone' => floatval($_POST['form']['timezone']), 'dst' => isset($_POST['form']['dst']) ? '1' : '0', 'time_format' => intval($_POST['form']['time_format']), 'date_format' => intval($_POST['form']['date_format'])); // Make sure we got a valid language string if (isset($_POST['form']['language'])) { $form['language'] = pun_trim($_POST['form']['language']); if (!Flux_Lang::languageExists($form['language'])) { message($lang->t('Bad request')); } } if ($pun_user['is_admmod']) { $form['admin_note'] = pun_trim($_POST['admin_note']); // Are we allowed to change usernames? if ($pun_user['g_id'] == PUN_ADMIN || $pun_user['g_moderator'] == '1' && $pun_user['g_mod_rename_users'] == '1') { $form['username'] = pun_trim($_POST['req_username']); if ($form['username'] != $old_username) { // Check username $lang->load('register'); $errors = array(); check_username($form['username'], $id); if (!empty($errors)) { message($errors[0]);
define('PUN_ADMIN_CONSOLE', 1); define('PUN_ROOT', dirname(__FILE__) . '/'); require PUN_ROOT . 'include/common.php'; require PUN_ROOT . 'include/common_admin.php'; if ($pun_user['g_id'] != PUN_ADMIN) { message($lang->t('No permission')); } // Load the admin_options.php language file $lang->load('admin_options'); if (isset($_POST['form_sent'])) { confirm_referrer('admin_options.php', $lang->t('Bad HTTP Referer message')); $form = array('board_title' => pun_trim($_POST['form']['board_title']), 'board_desc' => pun_trim($_POST['form']['board_desc']), 'default_timezone' => floatval($_POST['form']['default_timezone']), 'default_dst' => $_POST['form']['default_dst'] != '1' ? '0' : '1', 'default_lang' => pun_trim($_POST['form']['default_lang']), 'default_style' => pun_trim($_POST['form']['default_style']), 'time_format' => pun_trim($_POST['form']['time_format']), 'date_format' => pun_trim($_POST['form']['date_format']), 'timeout_visit' => intval($_POST['form']['timeout_visit']), 'timeout_online' => intval($_POST['form']['timeout_online']), 'redirect_delay' => intval($_POST['form']['redirect_delay']), 'show_version' => $_POST['form']['show_version'] != '1' ? '0' : '1', 'show_user_info' => $_POST['form']['show_user_info'] != '1' ? '0' : '1', 'show_post_count' => $_POST['form']['show_post_count'] != '1' ? '0' : '1', 'smilies' => $_POST['form']['smilies'] != '1' ? '0' : '1', 'smilies_sig' => $_POST['form']['smilies_sig'] != '1' ? '0' : '1', 'make_links' => $_POST['form']['make_links'] != '1' ? '0' : '1', 'topic_review' => intval($_POST['form']['topic_review']), 'disp_topics_default' => intval($_POST['form']['disp_topics_default']), 'disp_posts_default' => intval($_POST['form']['disp_posts_default']), 'indent_num_spaces' => intval($_POST['form']['indent_num_spaces']), 'quote_depth' => intval($_POST['form']['quote_depth']), 'quickpost' => $_POST['form']['quickpost'] != '1' ? '0' : '1', 'users_online' => $_POST['form']['users_online'] != '1' ? '0' : '1', 'censoring' => $_POST['form']['censoring'] != '1' ? '0' : '1', 'signatures' => $_POST['form']['signatures'] != '1' ? '0' : '1', 'ranks' => $_POST['form']['ranks'] != '1' ? '0' : '1', 'show_dot' => $_POST['form']['show_dot'] != '1' ? '0' : '1', 'topic_views' => $_POST['form']['topic_views'] != '1' ? '0' : '1', 'quickjump' => $_POST['form']['quickjump'] != '1' ? '0' : '1', 'gzip' => $_POST['form']['gzip'] != '1' ? '0' : '1', 'search_all_forums' => $_POST['form']['search_all_forums'] != '1' ? '0' : '1', 'additional_navlinks' => pun_trim($_POST['form']['additional_navlinks']), 'feed_type' => intval($_POST['form']['feed_type']), 'feed_ttl' => intval($_POST['form']['feed_ttl']), 'report_method' => intval($_POST['form']['report_method']), 'mailing_list' => pun_trim($_POST['form']['mailing_list']), 'avatars' => $_POST['form']['avatars'] != '1' ? '0' : '1', 'avatars_dir' => pun_trim($_POST['form']['avatars_dir']), 'avatars_width' => intval($_POST['form']['avatars_width']), 'avatars_height' => intval($_POST['form']['avatars_height']), 'avatars_size' => intval($_POST['form']['avatars_size']), 'admin_email' => strtolower(pun_trim($_POST['form']['admin_email'])), 'webmaster_email' => strtolower(pun_trim($_POST['form']['webmaster_email'])), 'forum_subscriptions' => $_POST['form']['forum_subscriptions'] != '1' ? '0' : '1', 'topic_subscriptions' => $_POST['form']['topic_subscriptions'] != '1' ? '0' : '1', 'smtp_host' => pun_trim($_POST['form']['smtp_host']), 'smtp_user' => pun_trim($_POST['form']['smtp_user']), 'smtp_ssl' => $_POST['form']['smtp_ssl'] != '1' ? '0' : '1', 'regs_allow' => $_POST['form']['regs_allow'] != '1' ? '0' : '1', 'regs_verify' => $_POST['form']['regs_verify'] != '1' ? '0' : '1', 'regs_report' => $_POST['form']['regs_report'] != '1' ? '0' : '1', 'rules' => $_POST['form']['rules'] != '1' ? '0' : '1', 'rules_message' => pun_trim($_POST['form']['rules_message']), 'default_email_setting' => intval($_POST['form']['default_email_setting']), 'announcement' => $_POST['form']['announcement'] != '1' ? '0' : '1', 'announcement_message' => pun_trim($_POST['form']['announcement_message']), 'maintenance' => $_POST['form']['maintenance'] != '1' ? '0' : '1', 'maintenance_message' => pun_trim($_POST['form']['maintenance_message'])); if ($form['board_title'] == '') { message($lang->t('Must enter title message')); } if (!Flux_Lang::languageExists($form['default_lang'])) { message($lang->t('Bad request')); } $styles = forum_list_styles(); if (!in_array($form['default_style'], $styles)) { message($lang->t('Bad request')); } if ($form['time_format'] == '') { $form['time_format'] = 'H:i:s'; } if ($form['date_format'] == '') { $form['date_format'] = 'Y-m-d'; } require PUN_ROOT . 'include/email.php'; if (!is_valid_email($form['admin_email'])) { message($lang->t('Invalid admin email message'));
if (pun_strlen($password1) < 4) { $alerts[] = $lang->t('Short password'); } else { if ($password1 != $password2) { $alerts[] = $lang->t('Passwords not match'); } } // Validate email require PUN_ROOT . 'include/email.php'; if (!is_valid_email($email)) { $alerts[] = $lang->t('Wrong email'); } if ($title == '') { $alerts[] = $lang->t('No board title'); } if (!Flux_Lang::languageExists($default_lang)) { $alerts[] = $lang->t('Error default language'); } $styles = forum_list_styles(); if (!in_array($default_style, $styles)) { $alerts[] = $lang->t('Error default style'); } } // Check if the cache directory is writable if (!forum_is_writable(FORUM_CACHE_DIR)) { $alerts[] = $lang->t('Alert cache', FORUM_CACHE_DIR); } // Check if default avatar directory is writable if (!forum_is_writable(PUN_ROOT . 'img/avatars/')) { $alerts[] = $lang->t('Alert avatar', PUN_ROOT . 'img/avatars/'); }