plugins/admin/UserManager.php
changeset 832 7152ca0a0ce9
parent 801 eb8b23f11744
child 928 e2971f4a3123
equal deleted inserted replaced
831:45e887f23282 832:7152ca0a0ce9
    52     {
    52     {
    53       $q = $db->sql_query('DELETE FROM '.table_prefix."users_extra WHERE user_id=$user_id;");
    53       $q = $db->sql_query('DELETE FROM '.table_prefix."users_extra WHERE user_id=$user_id;");
    54       if ( !$q )
    54       if ( !$q )
    55         $db->_die();
    55         $db->_die();
    56       $q = $db->sql_query('DELETE FROM '.table_prefix."users WHERE user_id=$user_id;");
    56       $q = $db->sql_query('DELETE FROM '.table_prefix."users WHERE user_id=$user_id;");
       
    57       if ( !$q )
       
    58         $db->_die();
       
    59       $q = $db->sql_query('DELETE FROM '.table_prefix."session_keys WHERE user_id=$user_id;");
    57       if ( !$q )
    60       if ( !$q )
    58         $db->_die();
    61         $db->_die();
    59       echo '<div class="info-box">' . $lang->get('acpum_msg_delete_success') . '</div>';
    62       echo '<div class="info-box">' . $lang->get('acpum_msg_delete_success') . '</div>';
    60     }
    63     }
    61     else
    64     else
   114       if ( !preg_match('/@([a-z0-9-]+)(\.([a-z0-9-\.]+))?/', $imaddr_msn) && !empty($imaddr_msn) )
   117       if ( !preg_match('/@([a-z0-9-]+)(\.([a-z0-9-\.]+))?/', $imaddr_msn) && !empty($imaddr_msn) )
   115       {
   118       {
   116         $imaddr_msn = "$imaddr_msn@hotmail.com";
   119         $imaddr_msn = "$imaddr_msn@hotmail.com";
   117       }
   120       }
   118       
   121       
   119       if ( substr($homepage, 0, 7) != 'http://' )
   122       if ( !preg_match('#^https?://#', $homepage) )
   120       {
   123       {
   121         $homepage = "http://$homepage";
   124         $homepage = "http://$homepage";
   122       }
   125       }
   123       
   126       
   124       if ( !preg_match('/^http:\/\/([a-z0-9-.]+)([A-z0-9@#\$%\&:;<>,\.\?=\+\(\)\[\]_\/\\\\]*?)$/i', $homepage) )
   127       if ( !preg_match('/^http:\/\/([a-z0-9-.]+)([A-z0-9@#\$%\&:;<>,\.\?=\+\(\)\[\]_\/\\\\]*?)$/i', $homepage) )
   147         if ( $user_id != $session->user_id )
   150         if ( $user_id != $session->user_id )
   148         {
   151         {
   149           $to_update_users['username'] = $username;
   152           $to_update_users['username'] = $username;
   150           if ( $password )
   153           if ( $password )
   151           {
   154           {
   152             $password = $session->pk_encrypt($password, ENC_HEX);
   155             $session->set_password($user_id, $password);
   153             $to_update_users['password'] = $password;
       
   154           }
   156           }
   155           $to_update_users['email'] = $email;
   157           $to_update_users['email'] = $email;
   156           $to_update_users['real_name'] = $real_name;
   158           $to_update_users['real_name'] = $real_name;
   157         }
   159         }
   158         $to_update_users['signature'] = $signature;
   160         $to_update_users['signature'] = $signature;