From: Jess Robinson Date: Mon, 21 May 2012 13:04:13 +0000 (+0000) Subject: Remove unused files X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=99053f4f39cf3702c8146b0a5ec75d19f7c14429;p=scpubgit%2Fstemmatology.git Remove unused files --- diff --git a/script/admin_users,pl b/script/admin_users,pl deleted file mode 100644 index 7abedea..0000000 --- a/script/admin_users,pl +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; - -use v5.10.0; - -use Getopt::Long; -use Text::Tradition::UserStore; - -use lib 'lib'; - -my ($dsn, $command) = ('dbi:SQLite:dbname=db/traditions.db', 'add', undef); -my ($username, $password); - -GetOptions( - 'c|command:s' => \$command, - 'dsn:s' => \$dsn, - 'u|username=s' => \$username, - 'p|password:s' => \$password, - ) or usage(); - -if(!$command || !($command ~~ [qw/add modify delete/])) { - print "No command supplied, chickening out ... \n\n"; - usage(); -} - -if(!$username) { - print "No username supplied, confused ... \n\n"; - usage(); -} - -my $userstore = Text::Tradition::UserStore->new( dsn => $dsn); - -given ($command) { - when ('add') { - if(!$password || !$userstore->validate_password($password)) { - print "Can't add a new user without a valid password\n\n"; - usage(); - } - my $user = $userstore->add_user({ username => $username, - password => $password }); - if(!$user) { - print "Failed to add user! (you should see errors above this..)\n"; - } else { - print "OK.\n"; - } - } - - when ('modify') { - if(!$password || !$userstore->validate_password($password)) { - print "Can't modify a user without a valid password\n\n"; - usage(); - } - my $user = $userstore->modify_user({ username => $username, - password => $password }); - if(!$user) { - print "Failed to modify user! (you should see errors above this..)\n"; - } else { - print "OK.\n"; - } - } - when ('delete') { - my $user = $userstore->delete_user({ username => $username}); - if(!$user) { - print "Failed to modify user! (you should see errors above this..)\n"; - } else { - print "OK.\n"; - } - } -} - -sub usage { - print "User Admin tool, to add/remove/modify users\n"; - print "===========================================\n"; - print "Usage: $0 -c add -u jimbob -p hispassword\n"; - print "Usage: $0 -c modify -u jimbob -p hisnewpassword\n"; - print "Usage: $0 -c delete -u jimbob\n"; -} - -=head1 NAME - -admin_users.pl - add / modify / delete users - -=head1 SYNOPSIS - - admin_user.pl -c add -u jimbob -p "jimspassword" - - admin_user.pl -c modify -u jimbob -p "jimsnewpassword" - - admin_user.pl -c delete -u jimbob - -=head1 OPTIONS - -=over - -=item -c | --command - -The action to take, can be one of: add, modify, delete. - -=item -u | --username - -The username of the new user or user to change. - -=item -p | --password - -The new password or password to change. - -=back diff --git a/stemmaweb/lib/stemmaweb/Model/User.pm b/stemmaweb/lib/stemmaweb/Model/User.pm deleted file mode 100644 index f10b204..0000000 --- a/stemmaweb/lib/stemmaweb/Model/User.pm +++ /dev/null @@ -1,50 +0,0 @@ -package stemmaweb::Model::User; -use strict; -use warnings; -use Moose; -use Text::Tradition::UserStore; - -extends 'Catalyst::Model::KiokuDB'; - -has '+model_class' => ( default => 'Text::Tradition::UserStore' ); - -1; - -=head1 NAME - -stemmaweb::Model::User - User/Auth KiokuDB model for stemmaweb - -=head1 SYNOPSIS - - ## CONFIGURATION, in .conf file (this is the default setting) - - model_class Text::Tradition::UserStore - - - - - - class 'Password' - password_field 'password' - password_type 'self_check' - - - class 'Model::KiokuDB' - model_name 'User' - - - - - -=head1 DESCRIPTION - -This is the User Model used as a Authentication Store (using -::Store::Model::KiokuDB) for stemmaweb user authentication. - -This separate model allows us to have self-contained user storage, -which is replaceable. The default uses Text::Tradition::UserStore and -stores the Users alongside the Traditions. - -To replace the source of users for authentication, add the -configuration shown in the L to your stemmaweb.conf file, -and adjust as necessary.