Fixed the change password always changes admins password bug.

Also some more work on the EMS.
This commit is contained in:
Roy Johnson 2006-02-18 18:24:40 +00:00
parent c5579c81ca
commit 7dc954ebca
3 changed files with 12 additions and 8 deletions

View file

@ -294,20 +294,21 @@ sub getSubEvents {
my $self = shift;
my $eventId = shift;
my @subEvents;
#Get a list of all unique prerequisiteIds where requiredProductId matches eventId. The productId
#associated with the prerequisite entry is the one that requires the event we're listing.
my @prerequisites = $self->session->db->buildArray("
select prerequisiteId from EventManagementSystem_prerequisites
where productId=".$self->session->db->quote($eventId));
select distinct(prerequisiteId) from EventManagementSystem_prerequisiteEvents
where requiredProductId=".$self->session->db->quote($eventId));
print "<pre>".Dumper(@prerequisites)."</pre>";
foreach my $prerequisite (@prerequisites) {
my $sth = $self->session->db->read("
select p.productId, p.title, pr.operator
from products as p, EventManagementSystem_prerequisites as pr, EventManagementSystem_prerequisiteEvents as pe
from products as p, EventManagementSystem_prerequisites as pr
where
p.productId = pe.requiredProductId and
pr.prerequisiteId = pe.prerequisiteId and
p.productId = pr.productId and
pr.prerequisiteId =".$self->session->db->quote($prerequisite));
my %eventList;
my $operator;
@ -841,7 +842,7 @@ sub view {
where
p.productId = e.productId and approved=1
and e.assetId =".$self->session->db->quote($self->get("assetId"))."
and p.productId not in (select distinct(requiredProductId) from EventManagementSystem_prerequisiteEvents)";
and p.productId not in (select distinct(productId) from EventManagementSystem_prerequisites)";
my $p = WebGUI::Paginator->new($self->session,$self->getUrl,$self->get("paginateAfter"));
$p->setDataByQuery($sql);

View file

@ -624,7 +624,9 @@ sub new {
$self->{_session} = shift;
$self->{authMethod} = shift;
my $userId = shift || $self->{_session}->user->userId;
$self->{user} = $self->{_session}->user;
# Can't do this... if you're updating the account of a user that's not you, this will not work
#$self->{user} = $self->{_session}->user;
$self->{user} = WebGUI::User->new($self->{_session}, $userId);
$self->{error} = "";
$self->{profile} = ();
$self->{warning} = "";

View file

@ -333,8 +333,9 @@ sub editUserForm {
sub editUserFormSave {
my $self = shift;
my $userId = $self->session->form->get("uid");
my $properties;
my $userData = $self->getParams;
my $userData = $self->getParams($userId);
unless (!$self->session->form->process('authWebGUI.identifier') || $self->session->form->process('authWebGUI.identifier') eq "password") {
$properties->{identifier} = Digest::MD5::md5_base64($self->session->form->process('authWebGUI.identifier'));
if($userData->{identifier} ne $properties->{identifier}){