<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Alf’s blog about geek stuffs</title>
	<link>http://blog.alfbox.net</link>
	<description>News about Wisss and other free softwares</description>
	<pubDate>Mon, 23 Nov 2009 14:23:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Permission required decorator for django</title>
		<link>http://blog.alfbox.net/index.php/2009/11/23/permission-required-decorator-for-django/</link>
		<comments>http://blog.alfbox.net/index.php/2009/11/23/permission-required-decorator-for-django/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 14:23:55 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2009/11/23/permission-required-decorator-for-django/</guid>
		<description><![CDATA[Very long time since last post. The new thing in my geek life is I&#8217;ve switched to Django.
My last issue today was to display an error message instead of redirecting to login page when the use doesn&#8217;t have permission. Here is a decorator which replace the permission_required of django. Feel free to rename it to [...]]]></description>
			<content:encoded><![CDATA[<p>Very long time since last post. The new thing in my geek life is I&#8217;ve switched to Django.</p>
<p>My last issue today was to display an error message instead of redirecting to login page when the use doesn&#8217;t have permission. Here is a decorator which replace the permission_required of django. Feel free to rename it to avoid confusion <img src='http://blog.alfbox.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<pre>from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.http import urlquote
from django.http import HttpResponseRedirect
from django.contrib.auth.models import Permission

class permission_required(object):
    """
    decorator which redirects to login page if user is anonymous
    and display a permission denied template if user is logged in
    doesn't have permission
    """
    def __init__(self,
                 perm,
                 login_url=None,
                 redirect_field_name=REDIRECT_FIELD_NAME,
                 template='permission_denied.html'):

        if not login_url:
            from django.conf import settings
            login_url = settings.LOGIN_URL

        self.perm = perm
        self.login_url = login_url
        self.redirect_field_name = redirect_field_name
        self.template = template

    def __call__(self, func):
        def wrap(request, *args, **kwargs):
            if request.user.is_anonymous():
                path = urlquote(request.get_full_path())
                tup = self.login_url, self.redirect_field_name, path
                return HttpResponseRedirect('%s?%s=%s' % tup)

            if request.user.has_perm(self.perm):
                return func(request, *args, **kwargs)

            (app_label, codename) = self.perm.split('.', 1)
            perm_name = Permission.objects.get(codename=codename,
                                               content_type__app_label=app_label)

            return render_to_response(self.template,
                                      {'perm': perm_name},
                                      context_instance=RequestContext(request))
        return wrap</pre>
<p>My template permission_denied.html contains :</p>
<pre>{% extends "base.html" %}
{% load i18n %}</pre>
<pre>{% block body %}
&lt;h2&gt;{% trans "Permission denied" %}&lt;/h2&gt;
&lt;p&gt;{% blocktrans with perm as perm %}You need to have the permission "{{ perm }}"
 to see this page{% endblocktrans %}&lt;/p&gt;
{% endblock %}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2009/11/23/permission-required-decorator-for-django/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Talk about Wisss during the Acceleo Day at RMLL 2009</title>
		<link>http://blog.alfbox.net/index.php/2009/07/08/talk-about-wisss-during-the-acceleo-day-at-rmll-2009/</link>
		<comments>http://blog.alfbox.net/index.php/2009/07/08/talk-about-wisss-during-the-acceleo-day-at-rmll-2009/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 09:02:40 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[Wisss]]></category>

		<category><![CDATA[acceleo]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2009/07/08/talk-about-wisss-during-the-acceleo-day-at-rmll-2009/</guid>
		<description><![CDATA[Long time not posting here. I&#8217;ve had a lot of work and nothing really interesting to post. I just inform you that I will make a speech about Wisss during the Acceleo Day in Nantes, at L&#8217;école des Mines, next friday at 2:30 pm.
More information at :
http://2009.rmll.info/Eclipse-Acceleo-Day-Presentation,938.html
http://www.acceleo.org/wiki/index.php/EclipseAcceleoDay:Program
]]></description>
			<content:encoded><![CDATA[<p>Long time not posting here. I&#8217;ve had a lot of work and nothing really interesting to post. I just inform you that I will make a speech about Wisss during the Acceleo Day in Nantes, at L&#8217;école des Mines, next friday at 2:30 pm.</p>
<p>More information at :</p>
<p><a href="http://2009.rmll.info/Eclipse-Acceleo-Day-Presentation,938.html">http://2009.rmll.info/Eclipse-Acceleo-Day-Presentation,938.html</a></p>
<p><a href="http://www.acceleo.org/wiki/index.php/EclipseAcceleoDay:Program">http://www.acceleo.org/wiki/index.php/EclipseAcceleoDay:Program</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2009/07/08/talk-about-wisss-during-the-acceleo-day-at-rmll-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Array search performance</title>
		<link>http://blog.alfbox.net/index.php/2008/10/30/array-search-performance/</link>
		<comments>http://blog.alfbox.net/index.php/2008/10/30/array-search-performance/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 16:22:16 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/10/30/array-search-performance/</guid>
		<description><![CDATA[You probably have often searched for a value in an array using the in_array() function. Reading php&#124;architect&#8217;s Guide to PHP Security by Ilia Alshanetsky, I&#8217;ve noticed that searching on values can be slower than searching on keys. I&#8217;ve wanted to compare performance between the three methods to check a value in a white list and [...]]]></description>
			<content:encoded><![CDATA[<p>You probably have often searched for a value in an array using the in_array() function. Reading <strong>php|architect&#8217;s Guide to PHP Security</strong> by Ilia Alshanetsky, I&#8217;ve noticed that searching on values can be slower than searching on keys. I&#8217;ve wanted to compare performance between the three methods to check a value in a white list and it&#8217;s amazing how slower is in_array(), look at the result :</p>
<pre>fga@brian:~/tmp$ php5 test_array.php
With in_array :
111
time : 0.349022865295 sec
With isset on keys :
111
time : 0.000214099884033 sec
With array_key_exists :
111
time : 0.00021505355835 sec</pre>
<p>Searching on keys is 1000 to 10000 times faster regarding the bench on an array containing 700 000 elements.</p>
<p>Here is the code of the test :</p>
<pre>&lt;?php
// array to store white list as values
$t = array();
// array to store white list as keys
$u = array();

// elements count
$max = 700000;

$first = $last = $middle = '';
for($i=$max-1;$i&gt;=0;$i--){
        // values are random strings
        $id = uniqid(rand());
        $t[] = $id;
        $u[$id] = '';
        // we store first, last and middle values to
        // to search for them
        switch($i) {
                case $max-1:
                        $first = $id;
                break;
                case 0:
                        $last = $id;
                break;
                case $max/2:
                        $middle = $id;
                break;
        }
}

echo "With in_array :\n";
$start_time = microtime(true);
echo in_array($first,$t);
echo in_array($last,$t);
echo in_array($middle,$t);
echo "\n";
echo "time : " . (microtime(true)-$start_time) . " sec";
echo "\n";

echo "With isset on keys :\n";
$start_time = microtime(true);
echo isset($u[$first]);
echo isset($u[$last]);
echo isset($u[$middle]);
echo "\n";
echo "time : " . (microtime(true)-$start_time) . " sec";
echo "\n";

echo "With array_key_exists :\n";
$start_time = microtime(true);
echo array_key_exists($first,$u);
echo array_key_exists($last,$u);
echo array_key_exists($middle,$u);
echo "\n";
echo "time : " . (microtime(true)-$start_time) . " sec";
echo "\n";</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/10/30/array-search-performance/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zend Pdf and PNG transparency issue</title>
		<link>http://blog.alfbox.net/index.php/2008/06/05/zend-pdf-and-png-transparency-issue/</link>
		<comments>http://blog.alfbox.net/index.php/2008/06/05/zend-pdf-and-png-transparency-issue/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 14:00:44 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/06/05/zend-pdf-and-png-transparency-issue/</guid>
		<description><![CDATA[Currently working on PDF generation, I&#8217;ve noticed that drawing a big PNG image with transparency (about 600&#215;800, 150kB) brings the script computation up to 20 seconds. I&#8217;ve raised the bug in the Zend Framework issue tracker and for now, don&#8217;t forget to remove transparency in your background image if you can.
See the bug at :  [...]]]></description>
			<content:encoded><![CDATA[<p>Currently working on PDF generation, I&#8217;ve noticed that drawing a big PNG image with transparency (about 600&#215;800, 150kB) brings the script computation up to 20 seconds. I&#8217;ve raised the bug in the Zend Framework issue tracker and for now, don&#8217;t forget to remove transparency in your background image if you can.</p>
<p>See the bug at :  <a href="http://framework.zend.com/issues/browse/ZF-3392" target="_blank">http://framework.zend.com/issues/browse/ZF-3392</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/06/05/zend-pdf-and-png-transparency-issue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wrapping text for Zend Pdf</title>
		<link>http://blog.alfbox.net/index.php/2008/06/04/wrapping-text-for-zend-pdf/</link>
		<comments>http://blog.alfbox.net/index.php/2008/06/04/wrapping-text-for-zend-pdf/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 11:40:19 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/06/04/wrapping-text-for-zend-pdf/</guid>
		<description><![CDATA[A common issue in Zend_Pdf is to wrap text in a box. I&#8217;ve found partial solutions such as wrapping text each 80 characters for instance but the line width can vary regarding the font and the character width. Since we can&#8217;t rely on the character count unless using a monospaced font, we have to wrap [...]]]></description>
			<content:encoded><![CDATA[<p>A common issue in Zend_Pdf is to wrap text in a box. I&#8217;ve found partial solutions such as wrapping text each 80 characters for instance but the line width can vary regarding the font and the character width. Since we can&#8217;t rely on the character count unless using a monospaced font, we have to wrap text on the real box width.</p>
<p>In partial solutions, I&#8217;ve found a function which computes the real width of a string according to the font and the font size. By aggregating every chunks, I&#8217;ve made my getWrappedText() method which returns a string with the correct \n :</p>
<pre>protected function getWrappedText($string, Zend_Pdf_Style $style,$max_width)
{
    $wrappedText = '' ;
    $lines = explode("\n",$string) ;
    foreach($lines as $line) {
         $words = explode(' ',$line) ;
         $word_count = count($words) ;
         $i = 0 ;
         $wrappedLine = '' ;
         while($i &lt; $word_count)
         {
             /* if adding a new word isn't wider than $max_width,
             we add the word */
             if($this-&gt;widthForStringUsingFontSize($wrappedLine.' '.$words[$i]
                 ,$style-&gt;getFont()
                 , $style-&gt;getFontSize()) &lt; $max_width) {
                 if(!empty($wrappedLine)) {
                     $wrappedLine .= ' ' ;
                 }
                 $wrappedLine .= $words[$i] ;
             } else {
                 $wrappedText .= $wrappedLine."\n" ;
                 $wrappedLine = $words[$i] ;
             }
             $i++ ;
         }
         $wrappedText .= $wrappedLine."\n" ;
     }
     return $wrappedText ;
}</pre>
<pre>/**
 * found here, not sure of the author :
 * http://devzone.zend.com/article/2525-Zend_Pdf-tutorial#comments-2535
 */
 protected function widthForStringUsingFontSize($string, $font, $fontSize)
 {
     $drawingString = iconv('UTF-8', 'UTF-16BE//IGNORE', $string);
     $characters = array();
     for ($i = 0; $i &lt; strlen($drawingString); $i++) {
         $characters[] = (ord($drawingString[$i++]) &lt;&lt; 8 ) | ord($drawingString[$i]);
     }
     $glyphs = $font-&gt;glyphNumbersForCharacters($characters);
     $widths = $font-&gt;widthsForGlyphs($glyphs);
     $stringWidth = (array_sum($widths) / $font-&gt;getUnitsPerEm()) * $fontSize;
     return $stringWidth;
 }</pre>
<p>then you can draw the text easily :</p>
<pre>$y = 700;
$lines = explode("\n",$this-&gt;getWrappedText($text,$style_text,400)) ;
foreach($lines as $line)
{
    $page2-&gt;drawText($line, 140, $y);
    $y-=15;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/06/04/wrapping-text-for-zend-pdf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Integration of Scriptaculous slider in Zend framework</title>
		<link>http://blog.alfbox.net/index.php/2008/05/29/integration-of-scriptaculous-slider-in-zend-framework/</link>
		<comments>http://blog.alfbox.net/index.php/2008/05/29/integration-of-scriptaculous-slider-in-zend-framework/#comments</comments>
		<pubDate>Thu, 29 May 2008 09:45:42 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/05/29/integration-of-scriptaculous-slider-in-zend-framework/</guid>
		<description><![CDATA[For a customer need, I&#8217;ve integrated the scriptaculous slider as shown here in Zend framework.
To achieve this, I&#8217;ve created a formSlider view helper which is then used by a slider form element.
The view helper and form element code is here. To allow ZF to find the helper, don&#8217;t forget to add path to helper in [...]]]></description>
			<content:encoded><![CDATA[<p>For a customer need, I&#8217;ve integrated the scriptaculous slider as shown <a href="http://github.com/madrobby/scriptaculous/wikis/slider" title="Scriptaculous slider" target="_blank">here</a> in Zend framework.</p>
<p>To achieve this, I&#8217;ve created a formSlider view helper which is then used by a slider form element.</p>
<p>The view helper and form element code is <a href="http://depot.makina-corpus.org/public/makina/Zend_Framework/Mc.tar.gz" title="Slider form element">here</a>. To allow ZF to find the helper, don&#8217;t forget to add path to helper in your bootstrap :</p>
<pre>$layout-&gt;getView()-&gt;addHelperPath('Mc/View/Helper','Mc_View_Helper') ;</pre>
<p>You need of course to include scriptaculous and prototype to make it work (available <a href="http://script.aculo.us/" title="Scriptaculous" target="_blank">here</a> and <a href="http://prototypejs.org/" title="Prototype" target="_blank">here</a>) :</p>
<pre>&lt;script src="/prototype-1.6.0.2.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="/scriptaculous.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<p>Then, you can create a slider like this :</p>
<pre>require_once('Mc/Form/Element/Slider.php') ;
$my_form-&gt;addElement(new Mc_Form_Element_Slider('my_element')
    ,'my_element') ;
$my_form-&gt;my_element-&gt;setLabel('My element : ')
    -&gt;setMin(10)
    -&gt;setMax(30)
    -&gt;setStep(2);</pre>
<p>and retrieve the value as usual :</p>
<pre>$my_form-&gt;my_element-&gt;getValue() ;</pre>
<p>And if you want to override the default style in your css, don&#8217;t forget the !important argument :</p>
<pre>div.slider {
    width:256px !important;
    margin:10px 0 !important;
    background-color:lightgray !important;
    height:15px !important;
    position: relative !important;
 }

div.slider div.handle {
     width:10px !important;
     height:15px !important;
     background-color:darkgray !important;
     cursor:move !important;
     position: absolute !important;
 }</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/05/29/integration-of-scriptaculous-slider-in-zend-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Autoresize textarea</title>
		<link>http://blog.alfbox.net/index.php/2008/05/28/autoresize-textarea/</link>
		<comments>http://blog.alfbox.net/index.php/2008/05/28/autoresize-textarea/#comments</comments>
		<pubDate>Wed, 28 May 2008 15:11:31 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/05/28/autoresize-textarea/</guid>
		<description><![CDATA[I was looking for a javascript which could automatically resize a textarea but the ones I&#8217;ve found were a bit buggy or ugly, so I&#8217;ve written mine. There&#8217;s just a tiny bug with copy/paste with mouse.

function autoresize(txtbox)
{
    var cols = txtbox.cols ;
    var content = txtbox.value ;
   [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for a javascript which could automatically resize a textarea but the ones I&#8217;ve found were a bit buggy or ugly, so I&#8217;ve written mine. There&#8217;s just a tiny bug with copy/paste with mouse.</p>
<pre>
function autoresize(txtbox)
{
    var cols = txtbox.cols ;
    var content = txtbox.value ;
    var lineCount = 0 ;

    var lastEOL = -1 ;
    do {
        var begin = lastEOL+1 ;
        lastEOL = content.indexOf("\n",lastEOL+1) ;
        var line = "" ;
        if(lastEOL != -1) {
            line = content.substring(begin,lastEOL) ;
        } else {
            line = content.substring(begin,content.length) ;
        }
        var rows_in_line = Math.floor(line.length/cols)+1 ;
        lineCount += rows_in_line
    } while (lastEOL != -1) ;
    txtbox.rows = lineCount ;
}</pre>
<p>and html code :</p>
<pre>&lt;textarea name="my_textbox" onkeyup="autoresize(this)"
onmouseup="autoresize(this)" rows="24" cols="80"&gt;&lt;/textarea&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/05/28/autoresize-textarea/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to extract audio from a DVD and encode to flac</title>
		<link>http://blog.alfbox.net/index.php/2008/05/27/how-to-extract-audio-from-a-dvd-and-encode-to-flac/</link>
		<comments>http://blog.alfbox.net/index.php/2008/05/27/how-to-extract-audio-from-a-dvd-and-encode-to-flac/#comments</comments>
		<pubDate>Tue, 27 May 2008 12:36:28 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/05/27/how-to-extract-audio-from-a-dvd-and-encode-to-flac/</guid>
		<description><![CDATA[To see information about the dvd :
 mplayer -identify -frames 0 dvd://
To encode the 17 chapters of the first title of a dvd :
for i in $(seq 17) ; do mplayer -vo null -ao pcm -ao pcm:file=$i.wav:fast -chapter $i-$i dvd://01 ; flac $i.wav --best &#38; done
]]></description>
			<content:encoded><![CDATA[<p>To see information about the dvd :</p>
<p><code> mplayer -identify -frames 0 dvd://</code></p>
<p>To encode the 17 chapters of the first title of a dvd :</p>
<p><code>for i in $(seq 17) ; do mplayer -vo null -ao pcm -ao pcm:file=$i.wav:fast -chapter $i-$i dvd://01 ; flac $i.wav --best &amp; done</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/05/27/how-to-extract-audio-from-a-dvd-and-encode-to-flac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Apache Virtualhost generator</title>
		<link>http://blog.alfbox.net/index.php/2008/04/02/apache-virtualhost-generator/</link>
		<comments>http://blog.alfbox.net/index.php/2008/04/02/apache-virtualhost-generator/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 08:11:06 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[acceleo]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[virtualhost]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/index.php/2008/04/02/apache-virtualhost-generator/</guid>
		<description><![CDATA[Currently I&#8217;ve not much time to work on Wisss  However, I will make a tiny dsl and generator to have a virtualhost file generated (independent from Wisss, which already generate a vhost). I&#8217;ve already done this with a shell script but it will be more powerful and easy to maintain for a few hours [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I&#8217;ve not much time to work on Wisss <img src='http://blog.alfbox.net/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> However, I will make a tiny dsl and generator to have a virtualhost file generated (independent from Wisss, which already generate a vhost). I&#8217;ve already done this with a shell script but it will be more powerful and easy to maintain for a few hours of work.</p>
<p>The initial need is for my own server but it will also be useful for my company. The goal is to provide our best practice for vhost in a tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/04/02/apache-virtualhost-generator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New features in Wisss : authentication, acl, blocks</title>
		<link>http://blog.alfbox.net/index.php/2008/03/11/new-features-in-wisss-authentication-acl-blocks/</link>
		<comments>http://blog.alfbox.net/index.php/2008/03/11/new-features-in-wisss-authentication-acl-blocks/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 00:08:15 +0000</pubDate>
		<dc:creator>alf</dc:creator>
		
		<category><![CDATA[Wisss]]></category>

		<guid isPermaLink="false">http://blog.alfbox.net/?p=21</guid>
		<description><![CDATA[Following my last post about authentication, I&#8217;ve implemented it in Wisss. I&#8217;ve also added a simple ACL management which retrieves all resources, roles and privileges from database and constructs a Zend_Acl object in the boostrap. I&#8217;m not very happy to have to retrieve all stuffs about ACL each time, but for now, I have no [...]]]></description>
			<content:encoded><![CDATA[<p>Following my last post about authentication, I&#8217;ve implemented it in Wisss. I&#8217;ve also added a simple ACL management which retrieves all resources, roles and privileges from database and constructs a Zend_Acl object in the boostrap. I&#8217;m not very happy to have to retrieve all stuffs about ACL each time, but for now, I have no time to implement something smarter.</p>
<p>To manage ACL, I&#8217;ve also begun to generate an admin interface which is also for now quite simple (displaying a big table with all roles and resources). Concerning resources, I&#8217;ve define three layers : module, screen, action. I don&#8217;t know yet what is the best practice to apply ACL to a particular object. I will think of it during next weeks.</p>
<p>I&#8217;ve also added a block view helper which displays blocks in the layout if you are allowed to. A block is just a screen rendered as a menu, what minimize concepts in the model. There&#8217;s also a special block : the context. Thanks to a context action helper, each action can register contextual action which will then appear in the context menu. For instance, the &#8220;create&#8221; action will be able to set &#8220;edit&#8221; and &#8220;delete&#8221; action as contextual actions.</p>
<p>I&#8217;m busy this week, and I was this last two weeks (giving a ZF formation <img src='http://blog.alfbox.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) but I will switch form generation to Zend_Form as soon as possible. Despite my first opinion, which was against the use of Zend_Form, I find this component very useful and productive. Even if it&#8217;s bad to put view logic in the controller, it seems to be far easier to maintain.</p>
<p>I think the 0.3.0 release will happen soon including everything to build a blog example (and many other application). 0.4.0 will focus on cleaning up the code, polishing the interface, trying to improve ACL. I hope there won&#8217;t be a 0.5 <img src='http://blog.alfbox.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alfbox.net/index.php/2008/03/11/new-features-in-wisss-authentication-acl-blocks/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

