Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect popup comment is displayed when activate user #1491

Open
yuma-o opened this issue Sep 12, 2018 · 0 comments

Comments

@yuma-o
Copy link

commented Sep 12, 2018

Version examined: 2.9.10 and 2.9.11

I think that it is the same as the code of deletion.

Applicable file: /phpmyfaq/admin/user.php

function activateUser(identifier) { if (confirm('<?php echo $PMF_LANG['ad_user_del_3'] ?>')) {

I think this is correct.
function activateUser(identifier) { if (confirm('<?php echo $PMF_LANG['ad_user_active'] ?>')) {

This comment also duplicates.
* Ajax call to delete user

[Original code]

    <script>
    /**
     * Ajax call to delete user
     *
     * @param identifier
     */
    function deleteUser(identifier) {
        if (confirm('<?php echo $PMF_LANG['ad_user_del_3'] ?>')) {
            var csrf   = $(identifier).data('csrf-token');
            var userId = $(identifier).data('user-id');

            $.getJSON("index.php?action=ajax&ajax=user&ajaxaction=delete_user&user_id=" + userId + "&csrf=" + csrf,
                function(response) {
                    $('#user_message').html(response);
                    $('.row_user_id_' + userId).fadeOut('slow');
                });
        }
    }

    /**
     * Ajax call to delete user
     *
     * @param identifier
     */
    function activateUser(identifier) {
        if (confirm('<?php echo $PMF_LANG['ad_user_del_3'] ?>')) {
            var csrf   = $(identifier).data('csrf-token');
            var userId = $(identifier).data('user-id');

            $.getJSON("index.php?action=ajax&ajax=user&ajaxaction=activate_user&user_id=" + userId + "&csrf=" + csrf,
                function() {
                    var icon = $('.icon_user_id_' + userId);
                    icon.toggleClass('fa-lock fa-check');
                    $('.btn_user_id_' + userId).remove();
                });
        }
    }

    </script>

Thanks,

@thorsten thorsten self-assigned this Sep 12, 2018
@thorsten thorsten added the Bug label Sep 12, 2018
@thorsten thorsten added this to the 2.9.12 milestone Sep 12, 2018
@thorsten thorsten modified the milestones: 2.9.12, 2.9.13 Feb 10, 2019
@thorsten thorsten modified the milestones: 2.9.13, 2.9.14 Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.