Skip to content

Commit

Permalink
allow '.', '-', '_' in login string. new version'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkristian committed Feb 13, 2011
1 parent 4ce5b42 commit 5c9ed22
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ixtlan-core/ixtlan.gemspec
@@ -1,7 +1,7 @@
# create by maven - leave it as is
Gem::Specification.new do |s|
s.name = 'ixtlan'
s.version = '0.4.2'
s.version = '0.4.3'

s.summary = 'ixtlan plugins for rails and datamapper'
s.description = 'this is set of rails and datamapper plugins for setting up a little more advanced rails application then the default rails generator does. the focus is on security and privacy as well a complete restful xml support.'
Expand Down
145 changes: 145 additions & 0 deletions ixtlan-core/ixtlan.gemspec.pom
@@ -0,0 +1,145 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId>
<artifactId>ixtlan</artifactId>
<version>0.4.2</version>
<packaging>gem</packaging>
<name><![CDATA[ixtlan plugins for rails and datamapper]]></name>
<description><![CDATA[this is set of rails and datamapper plugins for setting up a little more advanced rails application then the default rails generator does. the focus is on security and privacy as well a complete restful xml support.]]></description>
<url>http://github.com/mkristian/ixtlan/ixtlan-core</url>
<developers>
<developer>
<id>m.kristian</id>
<name>mkristian</name>
<email>m.kristian@web.de</email>
</developer>
</developers>
<licenses>
<license>
<name>MIT-LICENSE</name>
<url>./MIT-LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>rubygems</groupId>
<artifactId>dm-core</artifactId>
<version>[1.0.0,1.0.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>dm-validations</artifactId>
<version>[1.0.0,1.0.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>dm-timestamps</artifactId>
<version>[1.0.0,1.0.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>dm-migrations</artifactId>
<version>[1.0.0,1.0.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>slf4r</artifactId>
<version>[0.3.0,0.3.4)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>datamapper4rails</artifactId>
<version>[0.5.0,0.5.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>rack-datamapper</artifactId>
<version>[0.3.0,0.3.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>logging</artifactId>
<version>[1.2.3,1.2.99999.99999)</version>
<type>gem</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>dm-sqlite-adapter</artifactId>
<version>[1.0.0,1.0.99999.99999)</version>
<type>gem</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>rspec</artifactId>
<version>[1.3.0,1.3.99999.99999)</version>
<type>gem</type>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>rubygems-releases</id>
<url>http://gems.saumya.de/releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jruby.plugins.version>0.23.0-SNAPSHOT</jruby.plugins.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>${jruby.plugins.version}</version>
<extensions>true</extensions>
<configuration>
<extraRdocFiles>History.txt,README.txt</extraRdocFiles>
<rdocOptions>--main,README.txt</rdocOptions>
<extraFiles>Rakefile</extraFiles>
<!--
<gemspecOverwrite>true</gemspecOverwrite>
-->
</configuration>
</plugin>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>rspec-maven-plugin</artifactId>
<version>${jruby.plugins.version}</version>
<executions>
<execution>
<goals><goal>test</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion ixtlan-core/lib/ixtlan/models/user.rb
Expand Up @@ -144,7 +144,7 @@ def self.included(model)

model.property :id, ::DataMapper::Types::Serial, :field => "uidnumber"

model.property :login, String, :required => true, :field => "uid", :length => 4..32, :unique_index => true, :format => /^[a-zA-Z0-9]*$/, :writer => :private
model.property :login, String, :required => true, :field => "uid", :length => 4..32, :unique_index => true, :format => /^[a-zA-Z0-9._-]*$/, :writer => :private

model.property :name, String, :required => true, :format => /^[^<">]*$/, :length => 2..64, :field => "cn"

Expand Down
2 changes: 1 addition & 1 deletion ixtlan-core/lib/ixtlan/version.rb
@@ -1,3 +1,3 @@
module Ixtlan
VERSION = '0.4.2'.freeze
VERSION = '0.4.3'.freeze
end
2 changes: 1 addition & 1 deletion ixtlan-core/pom.xml
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId>
<artifactId>ixtlan</artifactId>
<version>0.4.2</version>
<version>0.4.3</version>
<packaging>gem</packaging>
<name><![CDATA[ixtlan plugins for rails and datamapper]]></name>
<description><![CDATA[this is set of rails and datamapper plugins for setting up a little more advanced rails application then the default rails generator does. the focus is on security and privacy as well a complete restful xml support.]]></description>
Expand Down
6 changes: 3 additions & 3 deletions ixtlan-core/spec/user_spec.rb
Expand Up @@ -98,7 +98,7 @@

describe 'user_admin and locales/domains_admin' do
before(:each) do
@admin = User.create(:login => 'admin_user', :email => 'admin_user@example.com', :name => 'admin', :current_user => @root)
@admin = User.first(:login => 'admin_user') || User.create(:login => 'admin_user', :email => 'admin_user@example.com', :name => 'admin', :current_user => @root)
@admin.groups << @users
@admin.groups << @locales
@admin.groups << @domains
Expand All @@ -112,7 +112,7 @@
end

it 'should be able to create an user' do
u = User.new(:login => 'user', :email => 'user@example.com', :name => 'user', :current_user => @admin)
u = User.new(:login => 'user1', :email => 'user1@example.com', :name => 'user', :current_user => @admin)
u.update_all_children(@groups)
u.save

Expand All @@ -127,7 +127,7 @@
end

it 'should be able to create an user but ignore disallowed group root' do
u = User.new(:login => 'user', :email => 'user@example.com', :name => 'user', :current_user => @admin)
u = User.new(:login => 'user2', :email => 'user2@example.com', :name => 'user', :current_user => @admin)

groups = @groups.dup
groups[:group] << { :id => @root_group.id.to_s }
Expand Down

0 comments on commit 5c9ed22

Please sign in to comment.