Posted by robin on 02 Jul 2008 in Photography
En kollega av meg (Frode Rustøy) er atter en gang i avisa, denne gangen med et bilde tatt av meg.
Det er alltid gøy å bli publisert!
En kollega av meg (Frode Rustøy) er atter en gang i avisa, denne gangen med et bilde tatt av meg.
Det er alltid gøy å bli publisert!
First you need to follow the Catalyst tutorial and enable the authentication and session layers.
After that you need to install these two CPAN modules:
# cpan install Catalyst::Authentication::Credential::OpenID
# cpan install Catalyst::Authentication::Store::DBIx::Class,
After that you need to add the following to myapp.yml.
authentication:
default_realm: openid
realms:
openid:
credential:
class: OpenID
dbic:
credential:
class: Password
password_type: none
store:
class: DBIx::Class
user_class: MyAppDB::User
id_field: id
role_column: user_role
And after that you need to add the following code to lib/MyApp/Controller/Root.pm.
sub login : Local {
my ( $self, $c ) = @_;
# eval necessary because LWPx::ParanoidAgent
# croaks if invalid URL is specified
eval {
# Authenticate against OpenID to get user URL
if ( $c->authenticate({}, 'openid' ) ) {
$c->flash->{'status_msg'}='OpenID login was successful.';
# Create basic user entry unless already found
# (or use auto_create_user: 1)
unless ( $c->model('MyAppDB::User')->find($c->user->url) ) {
$c->model('MyAppDB::User')->create(
{ id => $c->user->url }
);
}
# Re-authenticate against local DBIC store
if ( $c->authenticate({ id => $c->user->url }, 'dbic') ) {
$c->flash->{'status_msg'}='Login was successful.';
$c->response->redirect( $c->uri_for("/") );
}
else {
$c->flash->{'error_msg'}='Local login failed.';
$c->stash->{'template'}='login.tt';
}
}
else {
$c->stash->{'template'}='login.tt';
}
};
if ($@) {
$c->log->error("Failure during login: " . $@);
$c->flash->{'error_msg'}='Failure during login: ' . $@;
$c->stash->{'template'}='login.tt';
}
}
And finally you create a form to use this method (root/login.tt):
<form action="[% c.uri_for('/login') %]" method="get">
<input type="text" name="openid_identifier" value="http://" />
<button type="submit">Sign in with OpenID</button>
</form>
Følg linken over for å stemme på bildet jeg har valgt å delta med i årets fotokonkurranse fra Canon.
A very good article about ways to make Windows Vista perform better on borderline hardware.
I decided to keep only these settings activated in visual effects. It gives a nice balance between speed in good looks.
Siste tilgjengeliggjøring om oppløsninger, nettleser og plattform.
Kort summert: