$user_prefs['PM_NOTIFY_EMAIL'] = "Y";
    } else {
        $user_prefs['PM_NOTIFY_EMAIL'] = "N";
    }
    if (isset($_POST['anon_logon']) && is_numeric($_POST['anon_logon'])) {
        $user_prefs['ANON_LOGON'] = $_POST['anon_logon'];
    } else {
        $user_prefs['ANON_LOGON'] = 0;
    }
    if (isset($_POST['dob_display'])) {
        $user_prefs['DOB_DISPLAY'] = trim($_POST['dob_display']);
    } else {
        $user_prefs['DOB_DISPLAY'] = 0;
    }
    // Update USER_PREFS
    if (user_update_prefs($_SESSION['UID'], $user_prefs, $user_prefs_global)) {
        header_redirect("edit_email.php?webtag={$webtag}&updated=true");
        exit;
    } else {
        $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
        $valid = false;
    }
}
// Check to see if we should show the set for all forums checkboxes
$show_set_all = forums_get_available_count() > 1 ? true : false;
html_draw_top(array('title' => gettext('My Controls - Email & Privacy'), 'class' => 'window_title', 'js' => array('js/prefs.js')));
echo "<h1>", htmlentities_array(gettext("Email & Privacy")), "</h1>\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    html_display_error_array($error_msg_array, '700', 'left');
} else {
    if (isset($_GET['updated'])) {
Exemple #2
0
    } else {
        if (isset($_POST['emots_toggle'])) {
            if (isset($_POST['t_subject']) && strlen(trim($_POST['t_subject'])) > 0) {
                $t_subject = trim($_POST['t_subject']);
            }
            if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) {
                $t_content = nl2br(fix_html(emoticons_strip($_POST['t_content'])));
            }
            if (isset($_POST['t_to_uid']) && is_numeric($_POST['t_to_uid'])) {
                $t_to_uid = $_POST['t_to_uid'];
            } else {
                $t_to_uid = 0;
            }
            $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY;
            $user_prefs = array('POST_PAGE' => $page_prefs);
            if (!user_update_prefs($_SESSION['UID'], $user_prefs)) {
                $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
                $valid = false;
            }
        } else {
            if (!isset($message_data['EDITABLE']) || $message_data['EDITABLE'] == 0) {
                pm_edit_refuse();
            }
            $parsed_message = new MessageTextParse(pm_get_content($mid));
            $t_content = $parsed_message->getMessage();
            $t_subject = $message_data['SUBJECT'];
        }
    }
}
light_html_draw_top(array('title' => gettext('Edit Message'), 'js' => array('js/fineuploader.min.js')));
light_navigation_bar(array('back' => "lpm.php?webtag={$webtag}&mid={$mid}"));
            $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY;
        } else {
            if (isset($_POST['sig_toggle_x'])) {
                $page_prefs = (double) $page_prefs ^ POST_SIGNATURE_DISPLAY;
            } else {
                if (isset($_POST['poll_additional_message_toggle_x'])) {
                    $page_prefs = (double) $page_prefs ^ POLL_ADDITIONAL_MESSAGE_DISPLAY;
                } else {
                    if (isset($_POST['poll_advanced_toggle_x'])) {
                        $page_prefs = (double) $page_prefs ^ POLL_ADVANCED_DISPLAY;
                    }
                }
            }
        }
        $user_prefs = array('POST_PAGE' => $page_prefs);
        if (!user_update_prefs($uid, $user_prefs)) {
            $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
            $valid = false;
        }
    }
}
if (!isset($message_text)) {
    $message_text = "";
}
if (!isset($sig_text)) {
    $sig_text = "";
}
if (mb_strlen($message_text) >= 65535) {
    $error_msg_array[] = sprintf(gettext("Message length must be under 65,535 characters (currently: %s)"), number_format(mb_strlen($message_text)));
    $valid = false;
}
Exemple #4
0
     if (user_exists($logon)) {
         $error_msg_array[] = gettext("Sorry, a user with that name already exists");
         $valid = false;
     }
 }
 if ($valid) {
     $user_data = array('IPADDRESS' => get_ip_address(), 'REFERER' => session::get_http_referer(), 'LOGON' => $logon, 'NICKNAME' => $nickname, 'EMAIL' => $email);
     if (ban_check($user_data)) {
         $error_msg_array[] = gettext("The username or password you supplied is not valid.");
         $valid = false;
     }
 }
 if ($valid) {
     if (($new_uid = user_create($logon, $password, $nickname, $email)) !== false) {
         // Save the new user preferences
         user_update_prefs($new_uid, $new_user_prefs);
         // Save the new user signature
         user_update_sig($new_uid, $sig_content, true);
         // Initialise the new user session.
         session::start($new_uid);
         // Update User's last forum visit
         forum_update_last_visit($new_uid);
         // Update the visitor log
         session::update_visitor_log($new_uid, true);
         // Check to see if the user is going somewhere after they have registered.
         $final_uri = isset($final_uri) ? rawurlencode($final_uri) : '';
         // If User Confirmation is enabled send the forum owners an email.
         if (forum_get_setting('require_user_approval', 'Y')) {
             admin_send_user_approval_notification($new_uid);
         }
         // If New User Notification is enabled send the forum owners an email.
        $user_prefs['START_PAGE'] = trim($_POST['start_page']);
    } else {
        $user_prefs['START_PAGE'] = 0;
    }
    if (isset($_POST['start_page_global'])) {
        $user_prefs_global['START_PAGE'] = $_POST['start_page_global'] == "Y" ? true : false;
    } else {
        $user_prefs_global['START_PAGE'] = false;
    }
    if (isset($_POST['sig_toggle']) && $_POST['sig_toggle'] == "Y") {
        $user_prefs['POST_PAGE'] = $user_prefs['POST_PAGE'] | POST_SIGNATURE_DISPLAY;
    } else {
        $user_prefs['POST_PAGE'] = $user_prefs['POST_PAGE'] & ~POST_SIGNATURE_DISPLAY;
    }
    // Update USER_PREFS
    if (user_update_prefs($uid, $user_prefs, $user_prefs_global)) {
        html_set_cookie("forum_style", $user_prefs['STYLE'], time() + YEAR_IN_SECONDS);
        header_redirect("forum_options.php?webtag={$webtag}&updated=true", gettext("Preferences were successfully updated."));
        exit;
    } else {
        $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
        $valid = false;
    }
}
// Check to see if we should show the set for all forums checkboxes
$show_set_all = forums_get_available_count() > 1 ? true : false;
// Start output here
html_draw_top(sprintf('title=%s', gettext("My Controls - Forum Options")), "emoticons.js", 'forum_options.js', 'class=window_title');
echo "<h1>", gettext("Forum Options"), "</h1>\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    html_display_error_array($error_msg_array, '600', 'left');
             if (!($image_info = getimagesize("{$attachment_dir}/{$attachment_details['hash']}"))) {
                 $error_msg_array[] = gettext("Unsupported image attachment. You can only use jpg, gif and png image attachments for your profile picture.");
                 $valid = false;
             }
             if ($image_info[0] > 95 || $image_info[1] > 95) {
                 $error_msg_array[] = gettext("Selected attachment is too large for profile picture. Maximum dimensions are 95x95px");
                 $valid = false;
             }
         }
     } else {
         $user_prefs['AVATAR_AID'] = null;
     }
 }
 if ($valid) {
     // Update User Preferences
     if (user_update_prefs($profile_uid, $user_prefs, $user_prefs_global)) {
         // Update basic settings in USER table
         if (user_update($profile_uid, $user_info_new['LOGON'], $user_info_new['NICKNAME'], $user_info_new['EMAIL'])) {
             // If email confirmation is requied and the user has changed
             // their email address we need to get them to confirm the
             // change by sending them another email.
             if ($profile_uid == $_SESSION['UID'] && $admin_edit === false) {
                 if (forum_get_setting('require_email_confirmation', 'Y') && $user_info_new['EMAIL'] != $user_info['EMAIL']) {
                     if (email_send_changed_email_confirmation($profile_uid)) {
                         perm_user_apply_email_confirmation($profile_uid);
                         html_draw_top(array('title' => gettext('My Controls - User Details - Email address has been changed'), 'class' => 'window_title'));
                         html_display_msg(gettext("Email address has been changed"), gettext("Your email address has been changed and a new confirmation email has been sent. Please check and read the email for further instructions."), 'index.php', 'get', array('continue' => gettext("Continue")), array(), '_top');
                         html_draw_bottom();
                         exit;
                     } else {
                         html_draw_top(array('title' => gettext("Error")));