gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/common/include User.class,1.34,1.35


From: tperdue
Subject: [Gforge-commits] gforge/common/include User.class,1.34,1.35
Date: Tue, 14 Sep 2004 14:58:14 -0500

Update of /cvsroot/gforge/gforge/common/include
In directory db.perdue.net:/home/tperdue/share/dev.gforge.org/common/include

Modified Files:
        User.class 
Log Message:
deleting rest of perm data when deleting user account

Index: User.class
===================================================================
RCS file: /cvsroot/gforge/gforge/common/include/User.class,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- User.class  16 May 2004 16:54:58 -0000      1.34
+++ User.class  14 Sep 2004 19:58:11 -0000      1.35
@@ -492,11 +492,9 @@
                }
 
                db_begin();
-               $res=db_query("
-                       UPDATE users 
+               $res=db_query("UPDATE users 
                        SET status='$status' 
-                       WHERE user_id='". $this->getID()."'
-               ");
+                       WHERE user_id='". $this->getID()."'");
 
                if (!$res) {
                        $this->setError('ERROR - Could Not Update User Status: 
'.db_error());
@@ -506,15 +504,30 @@
                        $this->data_array['status']=$status;
                        if ($status == 'D') {
                                // Remove this user from all groups
-                               $res = db_query("
-                                       DELETE FROM user_group
-                                       WHERE user_id='".$this->getID()."'
-                               ");
+                               $res = db_query(" DELETE FROM user_group WHERE 
user_id='".$this->getID()."' ");
                                if (!$res) {
                                        $this->setError('ERROR - Could Not 
Propogate Deleted Status: '.db_error());
                                        db_rollback();
                                        return false;
                                }
+                               $res=db_query("DELETE FROM forum_perm WHERE 
user_id='".$this->getID()."'");
+                               if (!$res) {
+                                       $this->setError('ERROR - Could Not 
Propogate Deleted Status to forums: '.db_error());
+                                       db_rollback();
+                                       return false;
+                               }
+                               $res=db_query("DELETE FROM artifact_perm WHERE 
user_id='".$this->getID()."'");
+                               if (!$res) {
+                                       $this->setError('ERROR - Could Not 
Propogate Deleted Status to tracker: '.db_error());
+                                       db_rollback();
+                                       return false;
+                               }
+                               $res=db_query("DELETE FROM project_perm WHERE 
user_id='".$this->getID()."'");
+                               if (!$res) {
+                                       $this->setError('ERROR - Could Not 
Propogate Deleted Status to task manager: '.db_error());
+                                       db_rollback();
+                                       return false;
+                               }
                        }
                        db_commit();
                        return true;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]