[pLog-svn] r5647 - in plog/trunk: . class/action/admin class/dao class/summary/action

mark at devel.lifetype.net mark at devel.lifetype.net
Thu Jul 12 02:06:25 EDT 2007


Author: mark
Date: 2007-07-12 02:06:24 -0400 (Thu, 12 Jul 2007)
New Revision: 5647

Modified:
   plog/trunk/class/action/admin/adminadduseraction.class.php
   plog/trunk/class/dao/friendgroup.class.php
   plog/trunk/class/summary/action/dofinishregister.class.php
   plog/trunk/wizard.php
Log:
Now, when create the user, lifetyp will create the default friendGroup and inbox/outbox for the user.

Modified: plog/trunk/class/action/admin/adminadduseraction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminadduseraction.class.php	2007-07-12 04:35:18 UTC (rev 5646)
+++ plog/trunk/class/action/admin/adminadduseraction.class.php	2007-07-12 06:06:24 UTC (rev 5647)
@@ -8,7 +8,9 @@
 	lt_include( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );	
     lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
-	lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" );	
+	lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/friendgroups.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/privatemessageboxes.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/view/admin/adminadduserview.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/view/admin/adminsiteuserslistview.class.php" );	
 
@@ -99,6 +101,20 @@
 		            $res = $userPerms->grantPermission( $perm );
 				}
 			}			
+
+			// add the default friend group for user
+            $friendGroups = new FriendGroups();
+            $friendGroup = new FriendGroup( $newUserId, 
+                                            $this->_locale->tr( "register_default_friend_group_name" ), 
+                                            $this->_locale->tr( "register_default_friend_group_desc" ) );
+            $friendGroups->addFriendGroup( $friendGroup );            
+
+			// add the default private message boxes for user
+		    $privateMessageBoxes = new PrivateMessageBoxes();
+		    $inbox = new PrivateMessageBox( $newUserId, BOX_TYPE_INBOX );
+		    $outbox = new PrivateMessageBox( $newUserId, BOX_TYPE_OUTBOX );
+		    $privateMessageBoxes->addPrivateMessageBox( $inbox );
+		    $privateMessageBoxes->addPrivateMessageBox( $outbox );
 			
 			// if the userBlog parameter is different than 0, we should somehow allow the user
 			// to log into that blog although he/she won't have much to do with only the

Modified: plog/trunk/class/dao/friendgroup.class.php
===================================================================
--- plog/trunk/class/dao/friendgroup.class.php	2007-07-12 04:35:18 UTC (rev 5646)
+++ plog/trunk/class/dao/friendgroup.class.php	2007-07-12 06:06:24 UTC (rev 5647)
@@ -24,7 +24,7 @@
 		var $_numWaitingFriends;
 		var $_numPendingFriends;
 
-		function FriendGroup( $userId, $name, $description = "", $properties = Array(), $showGroup, $id = -1 )
+		function FriendGroup( $userId, $name, $description = "", $properties = Array(), $showGroup = 1, $id = -1 )
 		{
 			$this->DbObject();
 
@@ -96,7 +96,7 @@
         function setShowGroup( $showGroup )
         {
         	$this->_showGroup = $showGroup;
-			
+
 			return true;
         }
 
@@ -171,7 +171,7 @@
 			if( $this->_numAuthorizedFriends < 0 )
 				$this->_numAuthorizedFriends = 0;
         }
-        
+
         function getNumWaitingFriends()
         {
         	return( $this->getNumFriends( USER_AUTHORIZATION_WAITING, FRIEND_AUTHORIZATION_APPROVED ));
@@ -183,7 +183,7 @@
 			if( $this->_numWaitingFriends < 0 )
 				$this->_numAWaitingFriends = 0;
         }
-        
+
         function getNumPendingFriends()
         {
         	return( $this->getNumFriends( USER_AUTHORIZATION_APPROVED, FRIEND_AUTHORIZATION_WAITING ));

Modified: plog/trunk/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/trunk/class/summary/action/dofinishregister.class.php	2007-07-12 04:35:18 UTC (rev 5646)
+++ plog/trunk/class/summary/action/dofinishregister.class.php	2007-07-12 06:06:24 UTC (rev 5647)
@@ -14,7 +14,9 @@
     lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );    
     lt_include( PLOG_CLASS_PATH."class/net/http/subdomains.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" );
-	lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );	
+	lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/friendgroups.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/privatemessageboxes.class.php" );	
 
     /**
      * Finish the user and blog registration process.
@@ -116,6 +118,20 @@
 			$userPerm = new UserPermission( $userId, 0, $loginPerm->getId());
 			$userPerms->grantPermission( $userPerm );
 
+			// add the default friend group for user
+            $friendGroups = new FriendGroups();
+            $friendGroup = new FriendGroup( $userId, 
+                                            $this->_locale->tr( "register_default_friend_group_name" ), 
+                                            $this->_locale->tr( "register_default_friend_group_desc" ) );
+            $friendGroups->addFriendGroup( $friendGroup );            
+
+			// add the default private message boxes for user
+		    $privateMessageBoxes = new PrivateMessageBoxes();
+		    $inbox = new PrivateMessageBox( $userId, BOX_TYPE_INBOX );
+		    $outbox = new PrivateMessageBox( $userId, BOX_TYPE_OUTBOX );
+		    $privateMessageBoxes->addPrivateMessageBox( $inbox );
+		    $privateMessageBoxes->addPrivateMessageBox( $outbox );
+
 			// post-user create hook
 			$this->postUserCreateHook( $user );
 

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2007-07-12 04:35:18 UTC (rev 5646)
+++ plog/trunk/wizard.php	2007-07-12 06:06:24 UTC (rev 5647)
@@ -75,6 +75,8 @@
 	lt_include( PLOG_CLASS_PATH."class/dao/permission.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/userpermission.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/friendgroups.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/dao/privatemessageboxes.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/misc/integritychecker.class.php" );
     
     // table schemas
@@ -1140,6 +1142,18 @@
 				}
 			}
 
+			// add the default friend group for user
+            $friendGroups = new FriendGroups();
+            $friendGroup = new FriendGroup( $userId, "General", "General" );
+            $friendGroups->addFriendGroup( $friendGroup );            
+
+			// add the default private message boxes for user
+		    $privateMessageBoxes = new PrivateMessageBoxes();
+		    $inbox = new PrivateMessageBox( $userId, BOX_TYPE_INBOX );
+		    $outbox = new PrivateMessageBox( $userId, BOX_TYPE_OUTBOX );
+		    $privateMessageBoxes->addPrivateMessageBox( $inbox );
+		    $privateMessageBoxes->addPrivateMessageBox( $outbox );
+
             $this->_view = new Wizardview( "step4" );
             $this->_view->setValue( "ownerid", $userId );
             $this->_view->setValue( "siteLocales", Locales::getLocales());



More information about the pLog-svn mailing list