小编Clo*_*edi的帖子

SQL - 如何从右表中找不到左表中的行?

我有两个具有相似列名的表,我需要从左表中返回在右表中找不到的记录?我有一个主键(列),可以帮助我比较两个表.哪个加入是首选?

sql join left-join outer-join

39
推荐指数
3
解决办法
14万
查看次数

Symfony如何返回所有登录的活动用户

我想返回我的应用程序的所有登录用户并在我的仪表板中呈现它.在user_iduser_name应该从会话中检索(我使用的是外部LDAP库进行验证)

我在数据库中创建了一个字段,该字段lastActivity将包含上次登录时间,然后我可以在数据库中查询lastActivity 最近2分钟内登录的显示用户.

ActivityListener.php

     <?php

namespace Bnpp\SecurityBundle\EventListener;

use Doctrine\ORM\EntityManager;
//use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\HttpKernel;
use Acme\SecurityBundle\Entity\User;
use Doctrine\Bundle\DoctrineBundle\Registry;


/**
 * Listener that updates the last activity of the authenticated user
 */

class ActivityListener

    {
    protected $securityContext;
    protected $entityManager;

    public function __construct(SecurityContext $securityContext, EntityManager $entityManager)
    {
        $this->securityContext = $securityContext;
        $this->entityManager = $entityManager;
    }



    /**
     * Update the user "lastActivity" on each request
     * @param FilterControllerEvent $event
     */


    public function …
Run Code Online (Sandbox Code Playgroud)

php doctrine symfony symfony-2.3

11
推荐指数
2
解决办法
9968
查看次数

Terraform - 启用访问负载均衡器日志 InvalidConfigurationRequest:存储桶的访问被拒绝

我正在使用 terraform 来配置 ELB,并希望为 S3 存储桶中的 ELB 启用访问日志。当我尝试应用资源时,出现以下错误 - InvalidConfiguration:存储桶访问被拒绝:

以下是我的 TF 资源以及使用 IAM 策略文档创建的 S3 存储桶策略。

resource "aws_lb" "this" {
  name               = var.name
  load_balancer_type = "application"

  access_logs {
    bucket  = aws_s3_bucket.this.bucket
    prefix  = var.name
    enabled = true
  }
}

resource "aws_s3_bucket" "this" {
  bucket        = "${var.bucket_name}"
  acl           = "log-delivery-write"
  force_destroy = true

}

resource "aws_s3_bucket_policy" "this" {
  bucket = "aws_s3_bucket.this.id"
  policy = "${data.aws_iam_policy_document.s3_bucket_lb_write.json}"
}


data "aws_iam_policy_document" "s3_bucket_lb_write" {
  policy_id = "s3_bucket_lb_logs"

  statement {
    actions = [
      "s3:PutObject",
    ]
    effect …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services amazon-elb terraform terraform-provider-aws

5
推荐指数
1
解决办法
1万
查看次数