Stripped app
zykes [Mon, 16 Aug 2010 13:05:40 +0000 (13:05 +0000)]
36 files changed:
Changes [deleted file]
README [deleted file]
TODO [deleted file]
Test-Session-Broken/Changes [deleted file]
Test-Session-Broken/Makefile.PL
Test-Session-Broken/README [deleted file]
Test-Session-Broken/config.json [deleted file]
Test-Session-Broken/lib/Test/LDAP.pm
Test-Session-Broken/lib/Test/LDAP/Controller/Auth.pm
Test-Session-Broken/lib/Test/LDAP/Controller/Root.pm
Test-Session-Broken/lib/Test/LDAP/Controller/User.pm
Test-Session-Broken/lib/Test/LDAP/View/TT.pm [deleted file]
Test-Session-Broken/root/auth/index.tt [deleted file]
Test-Session-Broken/root/auth/login.tt [deleted file]
Test-Session-Broken/root/common/noarg.tt [deleted file]
Test-Session-Broken/root/common/noresult.tt [deleted file]
Test-Session-Broken/root/common/results.tt [deleted file]
Test-Session-Broken/root/default.tt [deleted file]
Test-Session-Broken/root/error-404.tt [deleted file]
Test-Session-Broken/root/error-500.tt [deleted file]
Test-Session-Broken/root/error-generic.tt [deleted file]
Test-Session-Broken/root/forms/auth/index.json [deleted file]
Test-Session-Broken/root/forms/search/index.json [deleted file]
Test-Session-Broken/root/forms/user/edit.json [deleted file]
Test-Session-Broken/root/index.tt [deleted file]
Test-Session-Broken/root/static/images/btn_120x50_built.png [deleted file]
Test-Session-Broken/root/static/images/btn_120x50_built_shadow.png [deleted file]
Test-Session-Broken/root/static/images/btn_120x50_powered.png [deleted file]
Test-Session-Broken/root/static/images/btn_120x50_powered_shadow.png [deleted file]
Test-Session-Broken/root/static/images/btn_88x31_built.png [deleted file]
Test-Session-Broken/root/static/images/btn_88x31_built_shadow.png [deleted file]
Test-Session-Broken/root/static/images/btn_88x31_powered.png [deleted file]
Test-Session-Broken/root/static/images/btn_88x31_powered_shadow.png [deleted file]
Test-Session-Broken/root/static/images/catalyst_logo.png [deleted file]
Test-Session-Broken/root/user/edit.tt [deleted file]
Test-Session-Broken/t/view_TT.t [deleted file]

diff --git a/Changes b/Changes
deleted file mode 100644 (file)
index e850fb8..0000000
--- a/Changes
+++ /dev/null
@@ -1,113 +0,0 @@
-1.011  7 July 2010
-  - fix t/05-user_attributes.t to skip correct number of tests if
-    Catalyst::Model::LDAP is not installed.
-
-1.010  6 July 2010
-  - Make AUTOLOAD method work for ->dn by generically calling has_attribute
-    which has a special case for it.
-  - Unify the handling of the ->username method between AUTOLOAD and
-    has_attribute by special casing it more generically in has_attribute.
-    Both RT#57610, patch and tests by Jason Fried
-
-1.009  15 May 2010
-   - Fix pod for get_user() and from_session() in Backend.pm, adding
-     the missing $c param. Pass $c in from_session() through to get_user().
-     Reported in https://rt.cpan.org/Ticket/Display.html?id=56983 with
-     patch from Bjørn-Olav Strand.
-
-1.008  02 April 2010
-   - Allow for multiple uid values on a User object. See RT
-     https://rt.cpan.org/Ticket/Display.html?id=51505
-     and patch from Andrew Kirkpatrick.
-
-1.007  19 Mar 2010
-   - Store the user password for the ldap_connection method in an inside
-     out hash rather than a closure so that the user object can be serialized
-     with Storable as people are putting them in the session (RT#53279)
-
-1.006  11 Dec 2009
-   - Pass $c along to find_user method so overridden user_class users can
-     get at models (or whatever crazy things they might do) (gphat)
-   - Add an ldap_connection method to the user class, which will return
-     an LDAP connection bound as the user who authenticated.
-   - Trim trailing whitespace from submitted usernames otherwise we generate
-     bad LDAP queries.
-
-0.1005  30 April 2009
-   - Stop throwing an exception when the lookup_user method fails
-      to find a user and instead return undef. (t0m)
-   - Add tests for above (t0m)
-   - Change documentation which still refers to the old ::Plugin:: style
-     auth system to use ->authenticate instead of ->login, and not say that
-     you need to do things manually to have multiple stores. (t0m)
-
-0.1004  21 Oct 2008
-   - Add the ability to have the user inflated into a custom
-     user class with the user_class option (t0m)
-   - Add the ability for role lookup to be performed within
-     the same (user) bind context that the user's password is
-     checked in (t0m)
-
-0.1003  10 Sept 2008
-    - get entries in array context rather than scalar context, 
-      allowing for multiple values. patch by scpham.
-    - lc() to compare Net::LDAP results with supplied $id
-      bug reported via RT #39113
-
-
-0.1002  9 July 2008
-    - tests updated to use Net::LDAP::Server::Test 0.03
-
-
-0.1001  9 April 2008
-    - matthewr pointed out that the SYNOPSIS 'use Catalyst' line is wrong.
-    - imacat reported that t/03-entry was failing when Catalyst::Model::LDAP was
-      not installed. Fixed RT# 34777.
-
-
-0.1000  4 Feb 2008
-    - forked from Catalyst::Plugin::Authentication::Store::LDAP and name changed 
-      to Catalyst::Authentication::Store::LDAP
-    - tests now use Net::LDAP::Server::Test instead of relying on openldap.org
-    - changed release date for 0.0600
-    - added AD config suggestions from matija@serverflow.com
-    - bumped req base Auth package to 0.10003
-    - lookup_user() now throws an exception if there is more than one entry returned
-      from a LDAP search
-    - added new user_search_filter config option to filter out multiple entries on
-      Perl side
-
-
-0.0600  karman 18 Oct 2007 [was: omega Thu Aug 09 09:22:00 CET 2007]
-    - Someone had put some 0.052 version out, need to bump past that
-    - Add realms API support to match newest C::P::Authentication API. (karman)
-    - Add POD tests. (karman)
-    
-0.06 omega Thu Aug 09 09:00:00 CET 2007
-    - Added support for entry_class in the same way that Catalyst::Model::LDAP
-      supports it, allowing one to override what class is returned from
-      $c->user->ldap_entry, and thus allowing one to add methods to the user
-      object
-      
-0.05
-    - Added support for multiple identifiers.
-
-0.04 adam Tue Mar 21 15:31:57 PST 2006
-    - Fixed rt.cpan.org #18250, sample YAML config incorrectly using arrays
-    - Added some error checking around whether or not we have been properly
-      configured.
-
-0.03 adam Fri Feb 17 09:51:36 PST 2006
-    - Gavin Henry's documentation patch for YAML configuration
-
-0.02 adam Fri Feb 10 14:10:23 PST 2006
-    - Now throws an exception if the initial bind fails
-    - Changed the default role_filter from (member=%s) to (memberUid=%s)
-    - Fixed bug in Backend->lookup_user that was not properly handling
-      when a user was not found in the backing store at all.
-
-0.01 adam Thu Feb  8 14:28:18 2006  
-    - initial revision
-    - supports authentication
-    - supports roles
-
diff --git a/README b/README
deleted file mode 100644 (file)
index 1ffefe6..0000000
--- a/README
+++ /dev/null
@@ -1,307 +0,0 @@
-NAME
-    Catalyst::Authentication::Store::LDAP - Authentication from an LDAP
-    Directory.
-
-SYNOPSIS
-        use Catalyst qw(
-          Authentication
-          );
-
-        __PACKAGE__->config(
-          'authentication' => {
-             default_realm => "ldap",
-             realms => {
-               ldap => {
-                 credential => {
-                   class => "Password",
-                   password_field => "password",
-                   password_type => "self_check",
-                 },
-                 store => {
-                   binddn              => "anonymous",
-                   bindpw              => "dontcarehow",
-                   class               => "LDAP",
-                   ldap_server         => "ldap.yourcompany.com",
-                   ldap_server_options => { timeout => 30 },
-                   role_basedn         => "ou=groups,ou=OxObjects,dc=yourcompany,dc=com",
-                   role_field          => "uid",
-                   role_filter         => "(&(objectClass=posixGroup)(memberUid=%s))",
-                   role_scope          => "one",
-                   role_search_options => { deref => "always" },
-                   role_value          => "dn",
-                   role_search_as_user => 0,
-                   start_tls           => 1,
-                   start_tls_options   => { verify => "none" },
-                   entry_class         => "MyApp::LDAP::Entry",
-                   use_roles           => 1,
-                   user_basedn         => "ou=people,dc=yourcompany,dc=com",
-                   user_field          => "uid",
-                   user_filter         => "(&(objectClass=posixAccount)(uid=%s))",
-                   user_scope          => "one",
-                   user_search_options => { deref => "always" },
-                   user_results_filter => sub { return shift->pop_entry },
-                 },
-               },
-             },
-           },
-        );
-
-        sub login : Global {
-            my ( $self, $c ) = @_;
-
-            $c->authenticate({
-                              id          => $c->req->param("login"), 
-                              password    => $c->req->param("password") 
-                             });
-            $c->res->body("Welcome " . $c->user->username . "!");
-        }
-
-DESCRIPTION
-    This plugin implements the Catalyst::Authentication v.10 API. Read that
-    documentation first if you are upgrading from a previous version of this
-    plugin.
-
-    This plugin uses "Net::LDAP" to let your application authenticate
-    against an LDAP directory. It has a pretty high degree of flexibility,
-    given the wide variation of LDAP directories and schemas from one system
-    to another.
-
-    It authenticates users in two steps:
-
-    1) A search of the directory is performed, looking for a user object
-    that matches the username you pass. This is done with the bind
-    credentials supplied in the "binddn" and "bindpw" configuration options.
-
-    2) If that object is found, we then re-bind to the directory as that
-    object. Assuming this is successful, the user is Authenticated.
-
-CONFIGURATION OPTIONS
-  Configuring with YAML
-    Set Configuration to be loaded via Config.yml in YourApp.pm
-
-        use YAML qw(LoadFile);
-        use Path::Class 'file';
-
-        __PACKAGE__->config(
-            LoadFile(
-                file(__PACKAGE__->config->{home}, 'Config.yml')
-            )
-        );
-
-    Settings in Config.yml (adapt these to whatever configuration format you
-    use):
-
-        # Config for Store::LDAP
-        authentication:
-            default_realm: ldap
-            realms:
-                ldap:
-                    credential:
-                        class: Password
-                        password_field: password
-                        password_type:  self_check
-                    store:
-                        class: LDAP
-                        ldap_server: ldap.yourcompany.com
-                        ldap_server_options:
-                            timeout: 30
-                        binddn: anonymous
-                        bindpw: dontcarehow
-                        start_tls: 1
-                        start_tls_options:
-                            verify: none
-                        user_basedn: ou=people,dc=yourcompany,dc=com
-                        user_filter: (&(objectClass=posixAccount)(uid=%s))
-                        user_scope: one
-                        user_field: uid
-                        user_search_options:
-                            deref: always
-                        use_roles: 1
-                        role_basedn: ou=groups,ou=OxObjects,dc=yourcompany,dc=com
-                        role_filter: (&(objectClass=posixGroup)(memberUid=%s))
-                        role_scope: one
-                        role_field: uid
-                        role_value: dn
-                        role_search_options:
-                            deref: always
-
-    NOTE: The settings above reflect the default values for OpenLDAP. If you
-    are using Active Directory instead, Matija Grabnar suggests that the
-    following tweeks to the example configuration will work:
-
-        user_basedn: ou=Domain Users,ou=Accounts,dc=mycompany,dc=com
-        user_field:  samaccountname
-        user_filter: (sAMAccountName=%s)
-
-    He also notes: "I found the case in the value of user_field to be
-    significant: it didn't seem to work when I had the mixed case value
-    there."
-
-  ldap_server
-    This should be the hostname of your LDAP server.
-
-  ldap_server_options
-    This should be a hashref containing options to pass to Net::LDAP->new().
-    See Net::LDAP for the full list.
-
-  binddn
-    This should be the DN of the object you wish to bind to the directory as
-    during the first phase of authentication. (The user lookup phase)
-
-    If you supply the value "anonymous" to this option, we will bind
-    anonymously to the directory. This is the default.
-
-  bindpw
-    This is the password for the initial bind.
-
-  start_tls
-    If this is set to 1, we will convert the LDAP connection to use SSL.
-
-  start_tls_options
-    This is a hashref, which contains the arguments to the Net::LDAP
-    start_tls method. See Net::LDAP for the complete list of options.
-
-  user_basedn
-    This is the basedn for the initial user lookup. Usually points to the
-    top of your "users" branch; ie "ou=people,dc=yourcompany,dc=com".
-
-  user_filter
-    This is the LDAP Search filter used during user lookup. The special
-    string '%s' will be replaced with the username you pass to $c->login. By
-    default it is set to '(uid=%s)'. Other possibly useful filters:
-
-        (&(objectClass=posixAccount)(uid=%s))
-        (&(objectClass=User)(cn=%s))
-
-  user_scope
-    This specifies the scope of the search for the initial user lookup.
-    Valid values are "base", "one", and "sub". Defaults to "sub".
-
-  user_field
-    This is the attribute of the returned LDAP object we will use for their
-    "username". This defaults to "uid". If you had user_filter set to:
-
-        (&(objectClass=User)(cn=%s))
-
-    You would probably set this to "cn". You can also set it to an array, to
-    allow more than one login field. The first field will be returned as
-    identifier for the user.
-
-  user_search_options
-    This takes a hashref. It will append it's values to the call to
-    Net::LDAP's "search" method during the initial user lookup. See
-    Net::LDAP for valid options.
-
-    Be careful not to specify:
-
-        filter
-        scope
-        base
-
-    As they are already taken care of by other configuration options.
-
-  user_results_filter
-    This is a Perl CODE ref that can be used to filter out multiple results
-    from your LDAP query. In theory, your LDAP query should only return one
-    result and find_user() will throw an exception if it encounters more
-    than one result. However, if you have, for whatever reason, a legitimate
-    reason for returning multiple search results from your LDAP query, use
-    "user_results_filter" to filter out the LDAP entries you do not want
-    considered. Your CODE ref should expect a single argument, a
-    Net::LDAP::Search object, and it should return exactly one value, a
-    Net::LDAP::Entry object.
-
-    Example:
-
-     user_results_filter => sub {
-                              my $search_obj = shift;
-                              foreach my $entry ($search_obj->entries) {
-                                  return $entry if my_match_logic( $entry );
-                              }
-                              return undef; # i.e., no match
-                            }
-
-  use_roles
-    Whether or not to enable role lookups. It defaults to true; set it to 0
-    if you want to always avoid role lookups.
-
-  role_basedn
-    This should be the basedn where the LDAP Objects representing your roles
-    are.
-
-  role_filter
-    This should be the LDAP Search filter to use during the role lookup. It
-    defaults to '(memberUid=%s)'. The %s in this filter is replaced with the
-    value of the "role_value" configuration option.
-
-    So, if you had a role_value of "cn", then this would be populated with
-    the cn of the User's LDAP object. The special case is a role_value of
-    "dn", which will be replaced with the User's DN.
-
-  role_scope
-    This specifies the scope of the search for the user's role lookup. Valid
-    values are "base", "one", and "sub". Defaults to "sub".
-
-  role_field
-    Should be set to the Attribute of the Role Object's returned during Role
-    lookup you want to use as the "name" of the role. Defaults to "CN".
-
-  role_value
-    This is the attribute of the User object we want to use in our
-    role_filter. If this is set to "dn", we will use the User Objects DN.
-
-  role_search_options
-    This takes a hashref. It will append it's values to the call to
-    Net::LDAP's "search" method during the user's role lookup. See Net::LDAP
-    for valid options.
-
-    Be careful not to specify:
-
-        filter
-        scope
-        base
-
-    As they are already taken care of by other configuration options.
-
-  role_search_as_user
-    By default this setting is false, and the role search will be performed
-    by binding to the directory with the details in the *binddn* and
-    *bindpw* fields. If this is set to false, then the role search will
-    instead be performed when bound as the user you authenticated as.
-
-  entry_class
-    The name of the class of LDAP entries returned. This class should exist
-    and is expected to be a subclass of Net::LDAP::Entry
-
-  user_class
-    The name of the class of user object returned. By default, this is
-    Catalyst::Authentication::Store::LDAP::User.
-
-METHODS
-  new
-    This method will populate "default_auth_store" in
-    Catalyst::Plugin::Authentication with this object.
-
-AUTHORS
-    Adam Jacob <holoway@cpan.org>
-
-    Some parts stolen shamelessly and entirely from
-    Catalyst::Plugin::Authentication::Store::Htpasswd.
-
-    Currently maintained by Peter Karman <karman@cpan.org>.
-
-THANKS
-    To nothingmuch, ghenry, castaway and the rest of #catalyst for the help.
-    :)
-
-SEE ALSO
-    Catalyst::Authentication::Store::LDAP,
-    Catalyst::Authentication::Store::LDAP::User,
-    Catalyst::Authentication::Store::LDAP::Backend,
-    Catalyst::Plugin::Authentication, Net::LDAP
-
-COPYRIGHT & LICENSE
-    Copyright (c) 2005 the aforementioned authors. All rights reserved. This
-    program is free software; you can redistribute it and/or modify it under
-    the same terms as Perl itself.
-
diff --git a/TODO b/TODO
deleted file mode 100644 (file)
index bc287f8..0000000
--- a/TODO
+++ /dev/null
@@ -1,10 +0,0 @@
-* Cache - this hits the directory a lot during full Auth/Authz usage.  
-
-* Recipes - We could handle some default recipes in the documentation for
-             different usage patterns.
-
-* Tests - We don't do any but the most cursory of tests
-
-(13:22:23) jayk: karpet: yah. the ability to define the user class to use 
-in config would make the module much more flexible.  
-able to customize without so much hacking around. 
diff --git a/Test-Session-Broken/Changes b/Test-Session-Broken/Changes
deleted file mode 100644 (file)
index 991849b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This file documents the revision history for Perl extension Test::LDAP.
-
-0.01  2010-08-03 15:00:19
-        - initial revision, generated by Catalyst
index 6135f74..92ce2ae 100644 (file)
@@ -23,12 +23,9 @@ requires 'Catalyst::Plugin::ConfigLoader';
 requires 'Catalyst::Plugin::Static::Simple';
 requires 'Catalyst::Action::RenderView';
 
-requires 'Catalyst::Model::Adaptor';
-requires 'Catalyst::Controller::HTML::FormFu';
-
 requires 'Moose';
 requires 'namespace::autoclean';
-requires 'Config::JSON'; # This should reflect the config file format you've chosen
+#requires 'Config::JSON'; # This should reflect the config file format you've chosen
                  # See Catalyst::Plugin::ConfigLoader for supported formats
 test_requires 'Test::More' => '0.88';
 catalyst;
diff --git a/Test-Session-Broken/README b/Test-Session-Broken/README
deleted file mode 100644 (file)
index 483a386..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Run script/test_ldap_server.pl to test the application.
diff --git a/Test-Session-Broken/config.json b/Test-Session-Broken/config.json
deleted file mode 100644 (file)
index 3a6bede..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-{
-    "name" : "Test::LDAP",
-
-
-    "authentication" : {
-        "default_realm" : "ldap",
-
-        "realms" : {
-            "ldap" : {
-                "credential" : {
-                    "class" : "Password",
-                    "password_field" : "password",
-                    "password_type" : "self_check",
-                    "password_hash_type" : "crypt"
-                },
-
-                "store" : {
-                    "binddn"                : "anonymous",
-                    "bindpw"                : "dontcare",
-
-                    "class"                 : "LDAP",
-
-                    "ldap_server"           : "ldap.test.no",
-                    "ldap_server_options"   : { "timeout" : 30, "port" : "636", "scheme" : "ldaps" },
-
-
-                    "role_basedn"           : "ou=stavanger,o=test,c=no",
-                    "role_field"            : "cn",
-                    "role_filter"           : "(&(objectClass=groupOfNames)(member=%s))",
-                    "role_scope"            : "one",
-                    "role_search_options"   : { "deref" : "always" },
-                    "role_value"            : "dn",
-                    "role_search_as_user"   : "1",
-                    
-                    "user_basedn"           : "ou=stavanger,o=test,c=no",
-                    "user_field"            : "uid",
-                    "user_filter"            : "(&(objectClass=posixAccount)(uid=%s))",
-                    "user_scope"              : "one",
-                    "user_search_options"   : { "deref" : "always" }
-                }
-            }
-        }
-    },
-
-    "Controller::HTML::FormFu" : { "config_file_ext" : ".json" }
-}
index 8bbda31..1a7f695 100644 (file)
@@ -14,7 +14,6 @@ use Catalyst::Runtime 5.80;
 
 use Catalyst qw/
     -Debug
-    ConfigLoader
     Static::Simple
     
     Authentication
@@ -42,9 +41,45 @@ __PACKAGE__->config(
     # Disable deprecated behavior needed by old applications
     disable_component_resolution_regex_fallback => 1,
 
-    'Plugin::ConfigLoader' => { file => 'config.json' },
+    authentication => {
+        default_realm => "ldap",
+
+        realms => {
+            ldap => {
+                credential => {
+                    "class" => "Password",
+                    "password_field" => "password",
+                    "password_type" => "self_check",
+                    "password_hash_type" => "crypt",
+                },
+
+                "store" => {
+                    "binddn"                => "anonymous",
+                    "bindpw"                => "dontcare",
+        
+                    "class"                 => "LDAP",
+    
+                    "ldap_server"           => "ldap.test.no",
+                    "ldap_server_options"   => { 
+                        "timeout" => 30, 
+                        "port" => "636", 
+                        "scheme" => "ldaps" 
+                    },
+    
+                    "role_basedn"           => "ou=stavanger,o=test,c=no",
+                    "role_field"            => "cn",
+                    "role_filter"           => "(&(objectClass=groupOfNames)(member=%s))",
+                    "user_scope"            => "one",
+                    "user_search_options"   => { 
+                        "deref" => "always" 
+                    }
+                }
+            }
+        }
+    }
 );
 
+
 # Start the application
 __PACKAGE__->setup();
 
index 64c3c59..027fc70 100644 (file)
@@ -2,7 +2,7 @@ package Test::LDAP::Controller::Auth;
 use Moose;
 use namespace::autoclean;
 
-BEGIN {extends 'Catalyst::Controller::HTML::FormFu'; }
+BEGIN {extends 'Catalyst::Controller'; }
 
 =head1 NAME
 
@@ -20,10 +20,10 @@ Catalyst Controller.
 =head2 index
 
 =cut
-sub index :Path :Args(0) :FormConfig {
+sub index :Path :Args(0) {
     my ( $self, $c ) = @_;
 
-    my $form = $c->stash->{form};
+    $c->res->body("Login");
 }
 
 sub login :Path("login") :Args(0) {
@@ -52,12 +52,12 @@ sub login :Path("login") :Args(0) {
             # Since we got auth, let's bind with the model with a dn & pass as well.
             #$c->model('LDAP')->bind (dn => $
         } else {
-            $c->stash->{"message"} = ("Bad username and/or password");
+            $c->res->body("Bad user/password")
         }
 
     } else {
         # If not throw a message c
-        $c->stash->{"message"} = "Missing Username and/or password"
+        $c->res->body("Missing credentials");
     }
 }
 
index 0d85a6b..36757b6 100644 (file)
@@ -28,6 +28,8 @@ The root page (/)
 
 sub index :Path :Args(0) {
     my ( $self, $c ) = @_;
+
+    $c->res->body("Index");
 }
 
 =head2 default
@@ -39,7 +41,7 @@ Standard 404 error page
 sub default :Path {
     my ( $self, $c ) = @_;
 
-    $c->stash->{"template"} = "error-404.tt";
+    $c->res->body("Not found");
     $c->res->status(404);
 }
 
@@ -53,11 +55,9 @@ sub end : ActionClass('RenderView') {
     my ($self, $c) = @_;
     my $errors = scalar @{$c->error};
 
-    if ($errors && not defined $c->stash->{"error_msg"}) {
-        $c->stash->{"template"} = "error-500.tt";
-
-        $c->stash->{"message"} = join "\n", @{$c->error};
-        $c->res->status(500);
+    if ($errors) {
+        $c->res->body("Internal error");
+        $c->res->status("500");
         $c->clear_errors;
     }
 }
index 88b3400..b466729 100644 (file)
@@ -38,7 +38,7 @@ sub user :Chained('base') :PathPart('') :CaptureArgs(2) {
     }
 
     if ($noargs) {
-        $c->stash->{template} = "common/noarg.tt";
+        $c->res->body("No Args");
         $c->detach;
     }
 
@@ -69,7 +69,7 @@ sub user :Chained('base') :PathPart('') :CaptureArgs(2) {
     }
 
     if ($noresult) {
-        $c->stash->{template} = "common/noresult.tt";
+        $c->res->body("No results");
         $c->detach;
     }
 }
@@ -77,49 +77,18 @@ sub user :Chained('base') :PathPart('') :CaptureArgs(2) {
 sub view :Chained('user') :PathPart('view') :Args(0) {
     my ($self, $c) = @_;
 
-    $c->stash->{template} = "common/results.tt"
+    $c->res->body("Results");
 }
 
-sub edit :Chained('user') :PathPart('edit') :Args(0) :FormConfig {
+sub edit :Chained('user') :PathPart('edit') :Args(0)  {
     my ( $self, $c ) = @_;
 
     # Check if the loc that is specified is a wildcard, do an error if it's true
     if ($c->stash->{ou} =~ /^\*/) {
-        $c->stash(
-            template => "error-generic.tt",
-            message => "You cannot use '*' as an OU / Location when editing a user!",
-        );
+        $c->res->body("You cannot use '*' as an OU / Location when editing a user!");
         $c->res->status("500");
         $c->detach
     }
-
-    # Get the form.
-    my $form = $c->stash->{"form"};
-
-    # Get the ldap object from the loaded objects
-    my $entry = $c->stash->{result}->{ $c->stash->{id} }->{ $c->stash->{ou} };
-
-    #  If the form is submitted and valid let's try to update the data
-    if ($form->submitted_and_valid) {
-        my $params = $c->req->params;
-
-        foreach my $attr ($params) {
-            $entry->replace ($attr => $params->{$attr}) if ( defined ($params->{$attr}) );
-        }
-
-        $entry->update
-    }
-
-    # Autofill the form..
-    my $options = {};
-    foreach my $attr ($entry->attributes) {
-        my $value = $entry->get_value($attr);
-        $options->{$attr} = $value;
-
-        push @{$c->stash->{attributes}}, $attr . ":" . $value . "<br />"
-    }
-
-    $form->default_values($options);
 }
 
 =head2 auto
diff --git a/Test-Session-Broken/lib/Test/LDAP/View/TT.pm b/Test-Session-Broken/lib/Test/LDAP/View/TT.pm
deleted file mode 100644 (file)
index db6ab41..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package Test::LDAP::View::TT;
-
-use strict;
-use warnings;
-
-use base 'Catalyst::View::TT';
-
-__PACKAGE__->config(
-    TEMPLATE_EXTENSION => '.tt',
-    render_die => 1,
-    WRAPPER => "default.tt"
-);
-
-=head1 NAME
-
-Test::LDAP::View::TT - TT View for Test::LDAP
-
-=head1 DESCRIPTION
-
-TT View for Test::LDAP.
-
-=head1 SEE ALSO
-
-L<Test::LDAP>
-
-=head1 AUTHOR
-
-root
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
-1;
diff --git a/Test-Session-Broken/root/auth/index.tt b/Test-Session-Broken/root/auth/index.tt
deleted file mode 100644 (file)
index fd94ed8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-[% IF ! c.user_exists %]
-
-[% form %]
-
-[% ELSE %]
-
-<p>You are already logged in.</p>
-
-[% END %]
diff --git a/Test-Session-Broken/root/auth/login.tt b/Test-Session-Broken/root/auth/login.tt
deleted file mode 100644 (file)
index a18405c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Login failure
diff --git a/Test-Session-Broken/root/common/noarg.tt b/Test-Session-Broken/root/common/noarg.tt
deleted file mode 100644 (file)
index f152daf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<h2>Missing ID or too short</h2>
diff --git a/Test-Session-Broken/root/common/noresult.tt b/Test-Session-Broken/root/common/noresult.tt
deleted file mode 100644 (file)
index 8b43476..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<h2>[% type %] "[% id %]" was not found in location "[% ou %]"</h2>
diff --git a/Test-Session-Broken/root/common/results.tt b/Test-Session-Broken/root/common/results.tt
deleted file mode 100644 (file)
index 4124465..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<h3>Results</h3>
-
-[% FOREACH var IN result.keys.sort %] 
-    <!-- div pr user for example -->
-    <div class="result var">
-    <strong>Name: [% var %]</strong><br/>
-
-    <!-- div pr ou for example -->
-    [% FOREACH subvar IN result.$var.keys.sort %]
-        <div class="result subvar">
-        <strong>Location: [% subvar FILTER ucfirst %]</strong><br />
-
-        [% FOREACH attr IN result.$var.$subvar.attributes.sort %]
-            [% value = result.$var.$subvar.get_value(attr).join(", ") %]
-            <span class="result subvark">[% attr %]:</span> [% value %]<br />
-        [% END %]
-        </div>
-    [% END %]
-
-    </div>
-[% END %]
diff --git a/Test-Session-Broken/root/default.tt b/Test-Session-Broken/root/default.tt
deleted file mode 100644 (file)
index 3fd39dd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
-    <title>Test LDAP - BETA</title>
-    <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" title="no title" charset="utf-8">
-</head>
-
-<body id="body">
-<div id="container">
-
-<div id="header">
-<h1>Test LDAP - BETA</h1>
-<img id='powered' src="/static/images/btn_88x31_built.png"/>
-<div id="navbar">
-    <a href="[% c.uri_for('/') %]">Home</a>
-    [% IF c.user_exists %]
-    <a href="[% c.uri_for('/search') %]">Search</a>
-    <a href="[% c.uri_for('/auth/logout') %]">Logout</a>
-    [% ELSE %]
-    <a href="[% c.uri_for('/auth') %]">Login</a>
-    [% END %]
-</div>
-</div>
-
-<div id="content">
-[% IF message %]
-<div class="messageblock">[% message %]</div>
-[% END %]
-[% content %]
-</div>
-
-</div>
-</body>
diff --git a/Test-Session-Broken/root/error-404.tt b/Test-Session-Broken/root/error-404.tt
deleted file mode 100644 (file)
index 83d59a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<p> Error, page you requested was not found.</p>
diff --git a/Test-Session-Broken/root/error-500.tt b/Test-Session-Broken/root/error-500.tt
deleted file mode 100644 (file)
index a2c88b7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<p> 
-Error, server encountered an internal error. See above for error message.
-</p>
diff --git a/Test-Session-Broken/root/error-generic.tt b/Test-Session-Broken/root/error-generic.tt
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/Test-Session-Broken/root/forms/auth/index.json b/Test-Session-Broken/root/forms/auth/index.json
deleted file mode 100644 (file)
index 2db610f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-    "action" : "/auth/login",
-    "elements" : [
-        {
-            "name"          : "username",
-            "type"          : "Text",
-            "label"         : "Username",
-            "constraints"   : "Required"
-        },
-        {
-            "name"          : "password",
-            "type"          : "Password",
-            "label"         : "Password",
-            "constraints"   : "Required"
-        },
-        {
-            "name"  : "submit",
-            "type"  : "Submit",
-            "value" : "Login"
-        }
-    ]
-}
diff --git a/Test-Session-Broken/root/forms/search/index.json b/Test-Session-Broken/root/forms/search/index.json
deleted file mode 100644 (file)
index a08be97..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-{
-    "action" : "/search/results",
-
-    "indicator" : "Submit",
-
-    "elements" : [
-        {
-            "name"  : "search",
-            "type"  : "Text",
-            "label" : "Search",
-            "constraints" : "Required",
-
-            "auto_label" : "text search label",
-
-            "attributes" : {
-                "title" : "Enter something to search for"
-            }
-        }, 
-
-        {
-            "name"  : "submit",
-            "type"  : "Submit",
-            "value" : "Submit",
-
-            "attributes" : {
-                "title" : "Submit"
-            }
-        },
-        {
-            // OU's are gotten automagically from the LDAP Server
-            // All of them are automatically selected.
-            "name"  : "ous",
-            "type"  : "Select",
-            "label" : "Location",
-            "multiple" : 1,
-            "size"  : 10
-        },
-
-        {
-            "name" : "type",
-            "type" : "Radiogroup",
-            "options" : [
-                // Search up users
-                { 
-                    "value" : "id", 
-                    "label" : "ID", 
-                    "attributes" : { "checked" : "checked"} 
-                },
-
-                // Common name
-                [ "cn", "Common Name" ],
-
-                // UID nr
-                [ "uid", "UID Number" ],
-                
-                // Groups
-                [ "groups", "List All groups" ],
-                
-                // Users
-                [ "users", "List All users" ],
-                
-                // Groups for id
-                [ "id_groups", "Groups for ID" ],
-                
-                // Groups
-                [ "group", "Groups" ]
-            ]
-        }
-
-   ]
-}
diff --git a/Test-Session-Broken/root/forms/user/edit.json b/Test-Session-Broken/root/forms/user/edit.json
deleted file mode 100644 (file)
index 0e019f0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-    "indicator" : "submit",
-
-    "elements" : [
-        {
-            "name" : "cn",
-            "type" : "Text",
-            "label" : "Common Name",
-            "constraints" : "Required"
-        },
-        /* disabled for now{
-            "name" : "description",
-            "type" : "Text",
-            "label" : "Description"
-            //"constraints" : "Required"
-        },*/
-        {
-            "name" : "gecos",
-            "type" : "Text",
-            "label" : "Gecos",
-            "constraints" : "Required"
-        },
-        {
-            "name" : "gidNumber",
-            "type" : "Text",
-            "label" : "Group Id Number",
-            "constraints" : [ "Required", "Integer" ]
-        },
-        {
-            "name" : "loginShell",
-            "type" : "Text",
-            "label" : "Login Shell",
-            "constraints" : "Required"
-        },
-        {
-            "name" : "submit",
-            "type" : "Submit",
-            "value" : "Submit"
-        }
-    ]
-}
diff --git a/Test-Session-Broken/root/index.tt b/Test-Session-Broken/root/index.tt
deleted file mode 100644 (file)
index 021b141..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<p>Add links here later / documentation?</p>
-
-[% IF ! c.user_exists %]
-Please login
-[% ELSE %]
-
-[% END %]
diff --git a/Test-Session-Broken/root/static/images/btn_120x50_built.png b/Test-Session-Broken/root/static/images/btn_120x50_built.png
deleted file mode 100644 (file)
index c709fd6..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_120x50_built.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_120x50_built_shadow.png b/Test-Session-Broken/root/static/images/btn_120x50_built_shadow.png
deleted file mode 100644 (file)
index 15142fe..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_120x50_built_shadow.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_120x50_powered.png b/Test-Session-Broken/root/static/images/btn_120x50_powered.png
deleted file mode 100644 (file)
index 7249b47..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_120x50_powered.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_120x50_powered_shadow.png b/Test-Session-Broken/root/static/images/btn_120x50_powered_shadow.png
deleted file mode 100644 (file)
index e6876c0..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_120x50_powered_shadow.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_88x31_built.png b/Test-Session-Broken/root/static/images/btn_88x31_built.png
deleted file mode 100644 (file)
index 007b5db..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_88x31_built.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_88x31_built_shadow.png b/Test-Session-Broken/root/static/images/btn_88x31_built_shadow.png
deleted file mode 100644 (file)
index ccf4624..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_88x31_built_shadow.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_88x31_powered.png b/Test-Session-Broken/root/static/images/btn_88x31_powered.png
deleted file mode 100644 (file)
index 8f0cd9f..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_88x31_powered.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/btn_88x31_powered_shadow.png b/Test-Session-Broken/root/static/images/btn_88x31_powered_shadow.png
deleted file mode 100644 (file)
index aa776fa..0000000
Binary files a/Test-Session-Broken/root/static/images/btn_88x31_powered_shadow.png and /dev/null differ
diff --git a/Test-Session-Broken/root/static/images/catalyst_logo.png b/Test-Session-Broken/root/static/images/catalyst_logo.png
deleted file mode 100644 (file)
index 21f1cac..0000000
Binary files a/Test-Session-Broken/root/static/images/catalyst_logo.png and /dev/null differ
diff --git a/Test-Session-Broken/root/user/edit.tt b/Test-Session-Broken/root/user/edit.tt
deleted file mode 100644 (file)
index 9c0b95d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<h3>Editing user "[% id %]" in location "[% ou FILTER ucfirst %]"</h3>
-[% test %]
-[% form %]
diff --git a/Test-Session-Broken/t/view_TT.t b/Test-Session-Broken/t/view_TT.t
deleted file mode 100644 (file)
index e1a43b3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-BEGIN { use_ok 'Test::LDAP::View::TT' }
-
-done_testing();