added: Activate, Deactivate, Delete User workflow activities

This commit is contained in:
Graham Knop 2009-05-21 14:49:28 +00:00
parent d011dde621
commit 8b86d56ec0
7 changed files with 261 additions and 1 deletions

View file

@ -20,6 +20,7 @@
- added: Storage now has a getHexId method for returning a cached hexadecimal version of the storageId. - added: Storage now has a getHexId method for returning a cached hexadecimal version of the storageId.
- fixed: FilePump should copy filesystem directories and their files when given a file URI that is a directory. - fixed: FilePump should copy filesystem directories and their files when given a file URI that is a directory.
- fixed #10133: Matrix compare for priv. group open to any user - fixed #10133: Matrix compare for priv. group open to any user
- added: Activate, Deactivate, Delete User workflow activities
7.7.6 7.7.6
- Added mobile style template. If enabled in settings, will serve alternate style templates - Added mobile style template. If enabled in settings, will serve alternate style templates

View file

@ -43,6 +43,7 @@ installFilePumpHandler($session);
installFilePumpTable($session); installFilePumpTable($session);
installFilePumpAdminGroup($session); installFilePumpAdminGroup($session);
addMatrixMaxGroup($session); addMatrixMaxGroup($session);
addUserControlWorkflows($session);
finish($session); # this line required finish($session); # this line required
@ -55,6 +56,16 @@ sub addMatrixMaxGroup {
print "Done.\n" unless $quiet; print "Done.\n" unless $quiet;
} }
#----------------------------------------------------------------------------
sub addUserControlWorkflows {
my $session = shift;
print "\tAdding Activate, Deactivate, Delete User workflow activities..." unless $quiet;
$session->config->addToArray('workflowActivities/WebGUI::User', 'WebGUI::Workflow::Activity::ActivateUser');
$session->config->addToArray('workflowActivities/WebGUI::User', 'WebGUI::Workflow::Activity::DeactivateUser');
$session->config->addToArray('workflowActivities/WebGUI::User', 'WebGUI::Workflow::Activity::DeleteUser');
print " Done.\n" unless $quiet;
}
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
sub fixSMSUserProfileI18N { sub fixSMSUserProfileI18N {
my $session = shift; my $session = shift;

View file

@ -875,7 +875,10 @@
], ],
"WebGUI::User" : [ "WebGUI::User" : [
"WebGUI::Workflow::Activity::CreateCronJob", "WebGUI::Workflow::Activity::CreateCronJob",
"WebGUI::Workflow::Activity::NotifyAboutUser" "WebGUI::Workflow::Activity::NotifyAboutUser",
"WebGUI::Workflow::Activity::ActivateUser",
"WebGUI::Workflow::Activity::DeactivateUser",
"WebGUI::Workflow::Activity::DeleteUser"
], ],
"WebGUI::VersionTag" : [ "WebGUI::VersionTag" : [
"WebGUI::Workflow::Activity::CommitVersionTag", "WebGUI::Workflow::Activity::CommitVersionTag",

View file

@ -0,0 +1,77 @@
package WebGUI::Workflow::Activity::ActivateUser;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2009 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use base 'WebGUI::Workflow::Activity';
=head1 NAME
Package WebGUI::Workflow::Activity::ActivateUser
=head1 DESCRIPTION
Activates a WebGUI user
=head1 SYNOPSIS
See WebGUI::Workflow::Activity for details on how to use any activity.
=head1 METHODS
These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 definition ( session, definition )
See WebGUI::Workflow::Activity::defintion() for details.
=cut
sub definition {
my $class = shift;
my $session = shift;
my $definition = shift;
my $i18n = WebGUI::International->new($session, "WebGUI");
push(@{$definition}, {
name => $i18n->get("activate user"),
properties=> {},
});
return $class->SUPER::definition($session,$definition);
}
#-------------------------------------------------------------------
=head2 execute ( [ object ] )
See WebGUI::Workflow::Activity::execute() for details.
=cut
sub execute {
my $self = shift;
my $user = shift;
my $instance = shift;
$user->enable;
return $self->COMPLETE;
}
1;
#vim:ft=perl

View file

@ -0,0 +1,77 @@
package WebGUI::Workflow::Activity::DeactivateUser;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2009 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use base 'WebGUI::Workflow::Activity';
=head1 NAME
Package WebGUI::Workflow::Activity::DeactivateUser
=head1 DESCRIPTION
Dectivates a WebGUI user
=head1 SYNOPSIS
See WebGUI::Workflow::Activity for details on how to use any activity.
=head1 METHODS
These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 definition ( session, definition )
See WebGUI::Workflow::Activity::defintion() for details.
=cut
sub definition {
my $class = shift;
my $session = shift;
my $definition = shift;
my $i18n = WebGUI::International->new($session, "WebGUI");
push(@{$definition}, {
name => $i18n->get("deactivate user"),
properties=> {},
});
return $class->SUPER::definition($session,$definition);
}
#-------------------------------------------------------------------
=head2 execute ( [ object ] )
See WebGUI::Workflow::Activity::execute() for details.
=cut
sub execute {
my $self = shift;
my $user = shift;
my $instance = shift;
$user->disable;
return $self->COMPLETE;
}
1;
#vim:ft=perl

View file

@ -0,0 +1,79 @@
package WebGUI::Workflow::Activity::DeleteUser;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2009 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use base 'WebGUI::Workflow::Activity';
=head1 NAME
Package WebGUI::Workflow::Activity::DeleteUser
=head1 DESCRIPTION
Deletes a WebGUI user
=head1 SYNOPSIS
See WebGUI::Workflow::Activity for details on how to use any activity.
=head1 METHODS
These methods are available from this class:
=cut
#-------------------------------------------------------------------
=head2 definition ( session, definition )
See WebGUI::Workflow::Activity::defintion() for details.
=cut
sub definition {
my $class = shift;
my $session = shift;
my $definition = shift;
my $i18n = WebGUI::International->new($session, "WebGUI");
push(@{$definition}, {
name => $i18n->get("delete user"),
properties=> {},
});
return $class->SUPER::definition($session,$definition);
}
#-------------------------------------------------------------------
=head2 execute ( [ object ] )
See WebGUI::Workflow::Activity::execute() for details.
=cut
sub execute {
my $self = shift;
my $user = shift;
my $instance = shift;
$instance->delete;
$user->delete;
return $self->COMPLETE;
}
1;
#vim:ft=perl

View file

@ -4451,6 +4451,18 @@ Users may override this setting in their profile.
lastUpdated => 1242438244, lastUpdated => 1242438244,
}, },
'activate user' => {
message => 'Activate User',
},
'deactivate user' => {
message => 'Deactivate User',
},
'delete user' => {
message => 'Delete User',
},
}; };
1; 1;