[xoops-cvslog 2383] CVS update: xoops2jp/html/modules/user/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 3月 8日 (水) 19:21:28 JST


Index: xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php
diff -u xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php:1.1.2.1 xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php:1.1.2.2
--- xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php:1.1.2.1	Thu Jan 19 21:05:35 2006
+++ xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php	Wed Mar  8 19:21:28 2006
@@ -22,6 +22,36 @@
 		$this->mActionForm->prepare();
 	}
 	
+	function _doExecute()
+	{
+		$linkHandler =& xoops_getmodulehandler('avatar_user_link');
+		$criteria =& new Criteria('avatar_id', $this->mObject->get('avatar_id'));
+		$linkArr =& $linkHandler->getObjects($criteria);
+		
+		if ($this->mObjectHandler->delete($this->mObject)) {
+			//
+			// Clear all user who set the avatar deleted with blank.gif
+			//
+			if (count($linkArr) > 0) {
+				$userHandler =& xoops_gethandler('user');
+				foreach ($linkArr as $link) {
+					$user =& $userHandler->get($link->get('user_id'));
+
+					if (is_object($user)) {
+						$user->set('user_avatar', 'blank.gif');
+						$userHandler->insert($user);
+					}
+					unset($user);
+				}
+			}
+			
+			return true;
+		}
+		else {
+			return false;
+		}
+	}
+
 	function executeViewInput(&$controller, &$xoopsUser, &$render)
 	{
 		$render->setTemplateName("avatar_delete.html");


xoops-cvslog メーリングリストの案内
Back to archive index