Thursday, October 20, 2016

Disabled and read-only controls

Check this out : https://www.w3.org/TR/html401/interact/forms.html#disabled

Tuesday, October 4, 2016

Eviter d'etre marqué comme spam par google

Ci joint le message :

This is the mail system at host xxxxx

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<mail@qmail.com> (expanded from  mail@domain.com): host
    gmail-smtp-in.l.google.com[2a00:1450:400c:c07::1a] said: 550-5.7.1
    [2001:41d0:1004:21bc::      12] Our system has detected that this 550-5.7.1
    message is likely unsolicited mail. To reduce the amount of spam sent
    550-5.7.1 to Gmail, this message has been blocked. Please visit 550-5.7.1
    https://support.google.com/mail/?p=UnsolicitedMessageError 550 5.7.1  for
    more information. l130si4589472wmf.42 - gsmtp (in reply to end of DATA
    command)

Final-Recipient: rfc822; mail@gmail.com
Original-Recipient: rfc822;mail@domain.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [2001:41d0:1004:21bc::      12] Our system has
    detected that this 550-5.7.1 message is likely unsolicited mail. To reduce
    the amount of spam sent 550-5.7.1 to Gmail, this message has been blocked.
    Please visit 550-5.7.1
    https://support.google.com/mail/?p=UnsolicitedMessageError 550 5.7.1  for
    more information. l130si4589472wmf.42 - gsmtp

Extrait :

Il vous faut simplement éditer vos zones DNS chez votre registrar, pour y ajouter une entrée de type TXT. L'instruction pour la cas décrit précédemment est :
v=spf1 a mx ip4:<IP> -all
Paramètres :
  • spf1 : la version de SPF
  • a : s'applique au A-record courant
  • mx : s'applique à l'entre MX courante
  • ip4<IP> : n'accepte que l'IP spécifiée (IP du serveur)
  • -all : refuse tous les autres
Ci joint la solution  : http://wiki.hoa.ro/doku.php?id=admin-systeme:mail-server-marked-as-spam-google

Wednesday, September 21, 2016

[Security] Switching Users with HTTP Basic Auth does not work

https://github.com/symfony/symfony/issues/8260

A part of the discussion
I'm experiencing an issue with HTTP Basic Auth and the SwitchUserListener. The symptoms are that switching users just does not work:
  • The firewall is configured with stateless: false and switch_user: true
  • When attempting to GET /<existing_path>?_switch_user=<valid_other_user>, the SwitchUserListenerredirectes to /<existing_path>.
  • The active token still points to the 'old' user.
After some research, I found out that this behaviour is caused by two things:
  1. The BasicAuthenticationListener is built in a way that should prevent credentials being checked again when the current token is already authenticated. This condition (among others) is being tested in line 64 and evaluates to false since $token->getUsername() !== $username. This results in the token withROLE_PREVIOUS_ADMIN to be overwritten in SecurityContext (line 75).
  2. Apparently persisting a token with ROLE_PREVIOUS_ADMIN does not work as expected. There already is anissue for this to which I added a comment.
In general, I don't know whether this is a bug or a feature that was never planned, but I would really appreciate some feedback on this. Switching users when providing the user's credentials with every request might sound strange, but there are cases in which this makes perfect sense.
Thank you in advance,

Friday, September 9, 2016