Exemple #1
0
 // 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.
 if (forum_get_setting('send_new_user_email', 'Y')) {
     admin_send_new_user_notification($new_uid);
 }
 // Display final success / confirmation page.
 if (forum_get_setting('require_email_confirmation', 'Y')) {
     if (email_send_user_confirmation($new_uid)) {
         perm_user_apply_email_confirmation($new_uid);
         light_html_draw_top(array('title' => gettext("User Registration")));
         light_navigation_bar();
         light_html_display_msg(gettext("Successfully created user account"), gettext("Your user account has been created but before you can start posting you must confirm your email address. Please check your email for a link that will allow you to confirm your address."), 'index.php', 'get', array('continue' => gettext("Continue")), array('final_uri' => $final_uri));
         light_html_draw_bottom();
         exit;
     } else {
         light_html_draw_top(array('title' => gettext("User Registration")));
         light_navigation_bar();
         light_html_display_msg(gettext("Successfully created user account"), gettext("Your user account has been created but the required confirmation email was not sent. Please contact the forum owner to rectify this. In this meantime please click the continue button to login."), 'index.php', 'get', array('continue' => gettext("Continue")), array('final_uri' => $final_uri));
         light_html_draw_bottom();
         exit;
     }
 } else {
     light_html_draw_top(array('title' => gettext("User Registration")));
     light_navigation_bar();
     } 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")));
                         html_display_msg(gettext("Email address has been changed"), gettext("You have changed your email address, but we were unable to send a confirmation request. Please contact the forum owner for assistance."), 'index.php', 'get', array('continue' => gettext("Continue")), array(), '_top');
                         html_draw_bottom();
                         exit;
                     }
                 }
             }
             // Force redirect to prevent refreshing the page prompting to user to resubmit form data.
             if ($admin_edit === true) {
                 header_redirect("admin_user.php?webtag={$webtag}&uid={$profile_uid}&profile_updated=true");