web/modules/rhn/RHN/DB/User.pm | 41 -----------------------------------------
1 file changed, 41 deletions(-)
New commits:
commit 7e234cd19988c1cd411f43b75ba42729e5882092
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jan 31 14:09:53 2012 +0100
code cleanup: users are not created in web any more
sequence rhn_user_id_seq does not exist since satellite 5.2, thefore __newly_created__
could not been used for ages
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 1dc804e..2c5692e 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -282,16 +282,6 @@ sub _blank_user {
return $self;
}
-sub create {
- my $class = shift;
-
- my $user = $class->_blank_user();
- $user->{__id__} = -1;
- $user->{__newly_created__} = 1;
-
- return $user;
-}
-
# build some accessors
foreach my $field ($j->method_names) {
my $sub = q {
@@ -526,22 +516,6 @@ sub commit {
my @columns_to_use;
my $mode = 'update';
- if ($self->{__newly_created__}) {
- croak "$self->commit called on newly created object when id != -1\nid ==
$self->{__id__}" unless $self->{__id__} == -1;
- $sth = $dbh->prepare("SELECT rhn_user_id_seq.nextval FROM DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- die "No new user id from seq rhn_user_id_seq (possible error: " .
$sth->errstr . ")" unless $id;
- $sth->finish;
- $self->{":modified:"}->{id} = 1;
- $self->{__id__} = $id;
- $self->{":modified:"}->{web_user_id} = 1;
- $self->{__web_user_id__} = $id;
- $self->{":modified:"}->{contact_web_user_id} = 1;
- $self->{__contact_web_user_id__} = $id;
-
- $mode = 'insert';
- }
die "$self->commit called on user without valid id" unless $self->id;
my @modified = keys %{$self->{":modified:"}};
@@ -619,21 +593,6 @@ sub RHN::DB::UserSite::commit {
my $sth;
my $mode = 'update';
- if ($self->{__newly_created__}) {
- croak "$self->commit called on newly created object when id != -1\nid ==
$self->{__site_id__}" unless $self->{__site_id__} == -1;
- $sth = $dbh->prepare("SELECT web_user_site_info_id_seq.nextval FROM
DUAL");
- $sth->execute;
- my ($id) = $sth->fetchrow;
- #warn "fetched id == ".$id;
- die "No new usersite id from seq web_user_site_id_seq (possible error: " .
$sth->errstr . ")" unless $id;
- $sth->finish;
- $self->{":modified:"}->{site_id} = 1;
- $self->{__site_id__} = $id;
-
- $mode = 'insert';
- }
- #RHN::DB->objectify_error("$self->commit called on user_site without valid
id") unless $self->site_id;
-
my @modified = keys %{$self->{":modified:"}};
my %modified = map { $_ => 1 } @modified;
Show replies by date