[siesta-commit] siesta/lib/Siesta List.pm,1.13,1.14

[prev] [thread] [next] [lurker] [Date index for 2002/08/23]

From: gmccarroll
Subject: [siesta-commit] siesta/lib/Siesta List.pm,1.13,1.14
Date: 08:19 on 23 Aug 2002
Update of /cvsroot/siesta/siesta/lib/Siesta
In directory usw-pr-cvs1:/tmp/cvs-serv27840

Modified Files:
	List.pm 
Log Message:

still work to be done on this


Index: List.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/List.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- List.pm	22 Aug 2002 19:21:23 -0000	1.13
+++ List.pm	23 Aug 2002 07:19:53 -0000	1.14
@@ -44,11 +44,34 @@
 
 sub is_member {
     my $self = shift;
-    my $address = shift;
+    my $member = shift;
+    my $address = ref($member) ? $member->id() : $member;
     my $t_list_users = Siesta::Storage::Table::List_Users->new();
     my @results = $t_list_users->search2(list_id => $self->{id}, user_id => $address);
     return scalar(@results);
 }
+
+sub add_member {
+  my $self = shift;
+  my ($member) = @_;
+  if (!(is_member($member))) {
+    # you can't be a member of a list twice
+  } else {
+    return 0;
+  }
+}
+
+sub remove_member {
+  my $self = shift;
+  my ($member) = @_;
+  if (is_member($member)) {
+    # you have to be a member of a list to be removed
+  } else {
+    return 0;
+  }
+
+}
+
 
 sub members {
   my $self = shift;



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52