public function preinit()
 {
     parent::preinit();
     session_name('sampleApp');
     session_start();
     if (session::logged_in()) {
         session::refresh();
     }
 }
Exemple #2
0
 }
 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)) {
         // 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, $sig_html);
         // Initialise the new user session.
         session::refresh($new_uid);
         // 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();
         }
         // 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);
                 html_draw_top(sprintf("title=%s", gettext("User Registration")));
 public static function create($uid)
 {
     if (!($forum_fid = get_forum_fid())) {
         $forum_fid = 0;
     }
     session::refresh($uid);
     session::update_visitor_log($uid, $forum_fid);
     forum_update_last_visit($uid);
 }