Archive for the 'Projects' Category

Published by Niels on 23 Feb 2010

Forcing a Yii application to authenticate

I wanted my Yii based application to force users to authenticate. After studying the forums, the manuals and searching the web the solution came to me just as I was about to go to bed. It is dead simple: just make sure that the only action a default user can perform is actionLogin(). See the code below on how to accomplish this:

<?php
 
class SiteController extends Controller
{
    /**
     * @return array action filters
     */
    public function filters()
    {
        return array(
            'accessControl', // perform access control for CRUD operations
        );
    }
 
    /**
     * Specifies the access control rules.
     * This method is used by the 'accessControl' filter.
     * @return array access control rules
     */
    public function accessRules()
    {
        return array(
            array('allow',  // allow all users to perform 'login'
                'actions'=>array('login'),
                'users'=>array('*'),
            ),
            array('allow', // allow authenticated user to perform any action
                'users'=>array('@'),
            ),
            array('deny',  // deny all users
                'users'=>array('*'),
            ),
        );
    }
 
    // The rest of the SiteController implementation
 
}
 
?>

I am not sure if this is the best possible solution, but since it is simple and elegant I am inclined to think it is.

Published by Niels on 03 Dec 2006

AScopy 1.0.0 has arrived

And it is with at least a bit of pride to announce this release. There are two major updates in this release:

  1. The decision has been made to drop the DocBook based documentation in favor of a regular man page. Man pages are still the standard and enough converters are freely available to convert the documentation to any possible format.
  2. AScopy now recognizes when a file is new but a copy of a file already present or when a file has been moved. A move of a file will look like a copy of a known file and then the removal of that file, but at least the file can be handled locally on the remote site and does not have to be transported over the network.

The new version can be downloaded here.

For the next version I will probably add the possibility to use different transportation mechanisms like FTP and WebDAV.

Published by Niels on 19 Nov 2006

RUP Template Project announcement

It has been a while since the last time a post has been added to this site. Apart from the fact that I have been very busy lately, I also started a new project. Because it seems that one of the most popular items on this side is the Vision Document template for the Rational Unified Process in DocBook format.

So I decided to make a DocBook formatted template for all RUP documents and give the RUP Template Project its own section on this site.

So far only 7 out of the 44(!) templates have been done, but I will try to add one each day (on average). Because of my enthusiasm I decided to release early and often, which means that both the section of the site and the contents of the templates might be a bit ‘rough around the edges’. For now the templates will have to be downloaded individually, but I will provide a gzipped tarball soon.

You can find the RUP Template Project here.

Published by Niels on 06 Sep 2006

New AScopy release 0.9.3

It always takes longer than you think. In the FAQ list for the AScopy home page I stated that for a version 1.0.0 to arrive AScopy should be (among other things) be able to exclude files and directories. This means that I can safely update a site for which I still have files open, e.g. using ViM.

Normally that would cause AScopy to detect the ViM swap-files as new files, but now they can be excluded in the .ascopyrc file like this:

exclude .*.swp

And that is all there is to it. The new version can be downloaded here.

Published by Niels on 29 Aug 2006

Release of NanoBlogger Gallery plugin 0.6.0

There is a new release of the NanoBlogger Gallery plugin. The previous version had a problem when run in Bash versions below 3.1. There are some differences when initializing arrays from a ‘string’ using $IFS.

In Bash 3.1 you can do this:

1
2
3
4
5
6
7
8
#!/bin/bash
 
a="1.2.3"
IFS='.'
declare -a arr=( $a )
echo "${#arr[@]}"
 
# Outputs 3 in version 3.1 and 1 in version 3.0

But if you instead do this then it works in both versions:

1
2
3
4
5
6
7
8
9
#!/bin/bash
 
a="1.2.3"
IFS='.'
declare -a arr
eval "arr=( $a )"
echo "${#arr[@]}"
 
# Outputs 3 in version 3.1 and 3.0

So hopefully the Gallery plug-in is better prepared for the real world :). Thanks to Chris Gratham for helping me out with this.

The new version can be downloaded here.

Published by Niels on 25 Aug 2006

New AScopy release 0.9.2

A new version of AScopy has been released: 0.9.2. This is a major bug fix release as the previous version did not remove directories in the correct order, i.e. deleting them before they were empty.

You can download the new version here.

Published by Niels on 25 Aug 2006

Release of Gallery plug-in 0.5.0

Version 0.5.0 of the NanoBlogger Gallery plug-in has just been released. It does not offer any extra features and is just a bug fix release to make the plug-in work with all versions of NanoBlogger from 3.0 and up.

It has been tested on the for the following releases:

  • 3.0
  • 3.1
  • 3.2
  • 3.2.3
  • 3.3 RC5

The major problem that needed to be fixed is that the plug-in uses standard NanoBlogger calls as often as possible. This means that the standard entry format can be used and even that (from version 3.3) the format field can be used to put markup into the entry.

Unfortunately the NanoBlogger API has changed a bit between versions. The call to read_metadata does not fill the same return variable in the versions mentioned above:

  • $NB_Metadata for version 3.0 and 3.1
  • $META_DATA for versions 3.2 and 3.2.3
  • $METADATA for version 3.3

There was already a function in the plug-in to determine for two given version numbers which was the newer one because the parameters to read_metadata also needed to have $METADATA_CLOSETAG specified from version 3.3 and up if the entry’s body is requested. So the plug-in already had to choose between two different calls based on the NanoBlogger version.

But everything seems to be fixed for now. The new plug-in can be downloaded here.

Published by Niels on 23 Jul 2006

Official release of AScopy 0.9.1

It is official the 0.9.1 release of AScopy. This site and its project site itself has been maintained with it for the last few weeks and everything goes so well that I am confident that this release can be publicly used.

If you ever want to set up an open source project like this then be prepared to put a lot of time in the initial set up. Stuff like getting SourceForge and FreshMeat working correctly for your project is a lot of work.

Published by Niels on 13 Jul 2006

RUP Vision document template in DocBook format

As mentioned in a previous post I started creating RUP templates in the DocBook format. The template for the Vision document is finally in a usable state and can be downloaded here. The contents are still a bit rough around the edges, but should be self-explanatory.

I hope they are as useful to you as they are to me. If there are any questions or remarks then please contact me.

Published by Niels on 02 Jul 2006

Added a link

A link to the AScopy web site has been added to the links menu.

Next »