首页 \ 问答 \ x11授权如何工作?(How does x11 authorization works? (MIT Magic Cookie))

x11授权如何工作?(How does x11 authorization works? (MIT Magic Cookie))

我感兴趣的是一个深入的答案,解释x11授权是如何工作的,尤其是MIT Magic Cookies。

我知道它实际上做的是禁止除了登录的用户以外的其他人访问,还有一些控制机制可以控制客户端应用程序是否可以连接到Xdisplay服务器。

我还发现有五种标准的访问控制机制,可以分为三大类:

1 。 基于主机访问

2 。 基于cookie的访问

3 。 基于用户访问

但从这一点,我不真正了解这些工作的方式以及他们为了执行授权而使用的方式。


I am interested in an in depth answer explaining how exactly does X11 authorization works and especially MIT Magic Cookies.

I understand that what it actually does is to forbid access to everyone else except the user that is logged in, also there are some control mechanisms that control whether a client application can connect to an Xdisplay server or not.

I also found that there are five standard access control mechanisms and they can be categorized in three main categories:

  1. Access based on host
  2. Access based on cookie
  3. Access based on user

But from this point and on I don't really understand the way these work and what ways they exactly use in order to do the authorizations.


原文:https://stackoverflow.com/questions/37157097
更新时间:2022-11-01 08:11

最满意答案

您需要使用事件委派来动态添加内容。

$(document).on('click','.printBill',function () {

        // capture input and select value by traversing up into parent(tr),
        // then find element [input, select]
        // this traversing method depend on your table structure
        var studID    = $(this).closest('tr').find('input[name=studentid]').val(),
            ssizeData = $(this).closest('tr').find('select[name=ssize]').val();

        $.ajax({
        url: "admin_search_save.php",
        data: {
            id        : $(this).val(),
            studentid : studID,
            ssize     : ssizeData,
        },
        success: function (data) {
        }
    });
  });

You need to use event delegation for dynamically added content.

$(document).on('click','.printBill',function () {

        // capture input and select value by traversing up into parent(tr),
        // then find element [input, select]
        // this traversing method depend on your table structure
        var studID    = $(this).closest('tr').find('input[name=studentid]').val(),
            ssizeData = $(this).closest('tr').find('select[name=ssize]').val();

        $.ajax({
        url: "admin_search_save.php",
        data: {
            id        : $(this).val(),
            studentid : studID,
            ssize     : ssizeData,
        },
        success: function (data) {
        }
    });
  });

相关问答

更多
  • 您需要使用事件委派来动态添加内容。 $(document).on('click','.printBill',function () { // capture input and select value by traversing up into parent(tr), // then find element [input, select] // this traversing method depend on your table structure ...
  • var item_id; var item_name; 似乎没有为第二个ajax调用定义这些变量。 并且记住javascript是异步的,它不会等待你的第一个ajax调用在它调用第二个之前完成。 如果您需要这样做,请查看jquery deffered对象。 var item_id; var item_name; These variable do not seem to be defined for the second ajax call. And remember that javascript i ...
  • 我只是想知道将表单数据通过ajax发布到PHP脚本的最佳方法是什么。 完全停止。 jQuery解决了这个特殊问题。 使用serialize或serializeArray继续进行更重要的事情。 我想问一下在安全性和性能方面最好的方法是什么。 你的方法都不是“最好”的方法。 它们都比简单地使用jQuery已经提供给你的东西更糟糕,并且它们在安全性和性能方面都是空的 。 安全性和性能与您发布的代码无关 ,这些概念完全在您尝试做的外部,在完全独立的层上实现。 安全在这里完全无关紧要。 您使用的是SSL并且安全,或者 ...
  • 回应几个json编码的字符串并不意味着有效的 json。 您需要做的是json_encode您的数据并echo 一次 。 $commenters = array(); // result array while ($CommentRow=$Commentsq->fetch_row()) { $CommenterPp=$con->query("SELECT Profile_pic FROM user_opt WHERE Username='$CommentRow[3]'"); ...
  • 单个POST到PHP无法实现您想要的功能。 即使您刷新PHP输出,jQuery端也不会处理结果处理程序,直到整个PHP过程完成。 很久以前你只能在文档完成之前开始显示内容的某些浏览器(Netscape等)就可以获得类似这种行为的东西,但是,使用AJAX,在PHP脚本出现之前,你不会看到PHP产生的任何内容。完了。 因此,您一次获得所有输出的原因。 有几种方法可以实现您想要做的事情。 一种方法是将PHP循环分成几个阶段,以便每次只执行一部分循环。 然后,您可以执行几次迭代(甚至一次迭代)并将结果返回给浏览器。 ...
  • 你的问题在于你正在使用PHP循环将一个函数绑定到页面上的每个#products .rateit元素。 你应该只绑定一次 ,并使用你已经存储在每个元素上的数据来执行你的javascript逻辑。 由于storyidr设置为与PHP中的$id相同,为什么不使用它? 以下代码应该在PHP循环之外 。