RSS Feed
2012/02/04

[Symfony 2] Security Bundle: Set User Locale on Form Login

Johannes Heinen, 2011/08/14 12:15

[UPDATE]
A recent update to this article may be found here: http://nerdpress.org/symfony-2-set-default-locale-on-form-login-2/

Das Security Bundle ist ein wenig magisch. Da muss man eine HTML-Form definieren, der Rest wird irgendwie konfiguriert (Namen der Post-Parameter wie “_username”, “_password” etc., den Redirect zum Referrer, Remember-Me Funktion und so weiter, das alles wird von der Firewall intern geregelt. Man muss nur eine Login-Route definieren, einen Stub-Controller + Action-Callable (der aber nie ausgeführt wird, weil die Firefall sich davorhängt), fertig.

Das ist angenehm einfach, solange man keine Fragen stellt. Aber wie führe ich zusätzliche Aktionen direkt nach erfolgtem Login aus, ohne Einfuss auf den Code des Security Bundles zu haben?

» read more

4 comments

[Symfony 2] Security Bundle – Benutzer mit username oder email anmelden.

Johannes Heinen, 2011/08/12 15:04

Augenscheinlich unterstützt das Security-Module nur die Authentifizierung via Benutzername und Password. Wie man sich mit einem Benutzernamen ODER der E-Mail-Adresse und einem Password authentifiziert, ist ein wenig versteckt. So gehts:

» read more

no comments yet

obsvr.net

Ivo Bathke, 2011/08/02 17:05

Just wanted to mention it here: http://obsvr.net

A media search aggregator build by Me and Max, as the wonderfulwebsolutions.

Its a luckily distributed wolpertinger of symfony, silex, node.js, jquery, isotope, apache and lighty, more to come.

» read more

no comments yet

install ant ftp task on ubuntu

Ivo Bathke, 2011/07/29 17:17

Tired of manually uploading your changes via FTP?
And no shell because your client cant/wont buy a hosting package for real men?

Then go for ant and its ftp task!

Install it on ubuntu like so (given you have ant and java already):

» read more

no comments yet

jquery pump effect

Ivo Bathke, 2011/07/25 18:02

some new loader effect?
this is a small jquery plugin that renders something like a pump or glow effect by switching two css classes with jquery UI transitions in an endless loop.
the loop can be stopped by applying a stop class to the element.

watch the demo on this almost autogenerated github page:
Demo

» read more

1 comment

Synchronous http request in node.js, that you dont want, probably

Ivo Bathke, 2011/06/28 12:08

Achtung dummy code!

…and so it goes Asynchronous:

 for(var i = 0; i < loop.length; i++)
 {
	var proxy = http.createClient(PORT,SERVER);
	var request = proxy.request('GET', url,
        {
            "host": SERVER
        });
	request.end();
	...
 }

fire, fire, fire, fire

… and so it dont, Synchronous then:

var proxy = http.createClient(PORT,SERVER);

for(var i = 0; i < loop.length; i++)
 {
	var request = proxy.request('GET', url,
        {
            "host": SERVER
        });
	request.end();
	...
 }

point – shoot, point – shoot, point – shoot

well i didnt know that :)

no comments yet

install lame on debian lenny

Max Girkens, 2011/06/20 13:09

If you are going to install the mp3 en/decoder lame on debian lenny,
this is how i got it done:

choose your package: http://debian-multimedia.org/pool/main/l/lame/

wget http://debian-multimedia.org/pool/main/l/lame/lame_3.98.2-0.4_i386.deb
dpkg -i lame_3.98.2-0.4_i386.deb

yay!

no comments yet

Lighttpd, Plesk und PHP

Ivo Bathke, 2011/06/17 18:00

Will man auf seinem Server(debian) Lighttpd paralell zu Plesk’s Apache zum laufen kriegen sollte man auf jeden fall PHP als FPM laufen lassen.
Das kommt sich nicht mit dem von Plesk und Apache regierten PHPs in die Quere und ist sowieso schneller und kann auch die Prozesse killen und neuladen.
Falls man mal was in der ini ändern will.

FPM installieren geht so, wie er es dort beschreibt:

Allerdings in der conf den Port nicht als String, sondern numeric:

server.modules   += ( "mod_fastcgi" )

## Start an FastCGI server for php (needs the php5-cgi package)
fastcgi.server    = ( ".php" =>
        (
"localhost" =>
        (
                "host" => "127.0.0.1",
                "port" => 9000
        ))
)

Bleibt noch das Problem mit dem APC Konflikt, falls da jemand eine Lösung weiß, nur her damit.

Man, das war ein kampf ;)
Mal sehen wie lang das hält…

no comments yet

jQuery .scrollToViewPort()

Max Girkens, 2011/06/11 15:53

yesterday i found this very useful jQuery-script on github:

https://gist.github.com/853841

jQuery.fn.scrollToViewPort = function(animTimeInterval) {
  animTimeInterval = (typeof animTimeInterval == "undefined")?"slow":animTimeInterval;
  return this.each(function(){
    $('html,body').animate({scrollTop: $(this).offset().top},animTimeInterval);
  });
}

it moves the users’ viewport to show the element that it has been called on.

I modified it somehow so that it will check now if the element is already in the viewport.
So we can avoid auto-scrolling in that case.
A offset Parameter has also been added in case we need some margin.

https://gist.github.com/1018842

jQuery.fn.scrollToViewPort = function(options) {
  var animTimeInterval = (typeof options.interval == "undefined")?"slow":animTimeInterval;
  return this.each(function(){
    var offSet = (typeof options.offset == "undefined")? $(this).offset().top : options.offset;
    if( $(this).offset().top <= $(window).scrollTop() || ( $(this).offset().top + $(this).height() ) >= ( $(window).scrollTop() + $(window).height() ) ){
      $('html,body').animate( { scrollTop: offSet }, animTimeInterval );
    }
  });
}

usage:

 $(this).scrollToViewPort( { offset : ( ( $(this).offset().top + my_custom_offset ) - $(window).height() ) } );

no comments yet

SilverStripe Image Gallery installation

Ivo Bathke, 2011/06/06 12:33

Theres a lot of old, deprecated and now wrong installation guides for the SilverStripe Image Gallery Module on the web that will lead you to where you dont want to. Dont trust them!

Unclecheese made some changes to the module dependencies and also moved to git, some time ago. He now uses the new Uploadify module instead of the SwfFileUpload module.

So a working installation of the image-gallery for git-people is to:

» read more

no comments yet