plugins/admin/UserManager.php
changeset 1089 16a1e8626dd9
parent 1086 6a59951b70e4
child 1099 73abd46f5148
equal deleted inserted replaced
1088:3b25a59dacd1 1089:16a1e8626dd9
    57         $db->_die();
    57         $db->_die();
    58       $q = $db->sql_query('DELETE FROM '.table_prefix."session_keys WHERE user_id=$user_id;");
    58       $q = $db->sql_query('DELETE FROM '.table_prefix."session_keys WHERE user_id=$user_id;");
    59       if ( !$q )
    59       if ( !$q )
    60         $db->_die();
    60         $db->_die();
    61       echo '<div class="info-box">' . $lang->get('acpum_msg_delete_success') . '</div>';
    61       echo '<div class="info-box">' . $lang->get('acpum_msg_delete_success') . '</div>';
       
    62       
       
    63       // deleting own account?
       
    64       if ( $user_id === $session->user_id )
       
    65       {
       
    66         // cute little hack to boot them out of the admin panel
       
    67         echo '<script type="text/javascript">
       
    68           addOnloadHook(function()
       
    69           {
       
    70             setTimeout(function()
       
    71             {
       
    72               eraseCookie("sid");
       
    73               ENANO_SID = false;
       
    74               auth_level = USER_LEVEL_MEMBER;
       
    75               window.location = makeUrlNS("Special", "Login");
       
    76             }, 3000);
       
    77           });
       
    78         </script>';
       
    79       }
    62     }
    80     }
    63     else
    81     else
    64     {
    82     {
    65       if ( $session->user_id == $user_id )
    83       if ( $session->user_id == $user_id )
    66       {
    84       {
   262           echo '<div class="info-box">' . $lang->get('acpum_msg_save_success') . '</div>';
   280           echo '<div class="info-box">' . $lang->get('acpum_msg_save_success') . '</div>';
   263         }
   281         }
   264       }
   282       }
   265     }
   283     }
   266     
   284     
   267     if ( count($errors) > 0 || $avatar_post_fail )
   285     if ( count($errors) > 0 || @$avatar_post_fail )
   268     {
   286     {
   269       if ( count($errors) > 0 )
   287       if ( count($errors) > 0 )
   270       {
   288       {
   271         echo '<div class="error-box">
   289         echo '<div class="error-box">
   272                 <b>' . $lang->get('acpum_err_validation_fail') . '</b>
   290                 <b>' . $lang->get('acpum_err_validation_fail') . '</b>