[xoops-cvslog 298] CVS update: xoops2jp/html/modules/system/admin/mailusers

Back to archive index

onokazu onoka****@users*****
2005年 8月 3日 (水) 21:39:16 JST


Index: xoops2jp/html/modules/system/admin/mailusers/mailform.php
diff -u xoops2jp/html/modules/system/admin/mailusers/mailform.php:1.3 xoops2jp/html/modules/system/admin/mailusers/mailform.php:1.4
--- xoops2jp/html/modules/system/admin/mailusers/mailform.php:1.3	Sat Jun 11 11:32:52 2005
+++ xoops2jp/html/modules/system/admin/mailusers/mailform.php	Wed Aug  3 21:39:16 2005
@@ -1,5 +1,5 @@
 <?php
-// $Id: mailform.php,v 1.3 2005/06/11 02:32:52 onokazu Exp $
+// $Id: mailform.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
Index: xoops2jp/html/modules/system/admin/mailusers/mailusers.php
diff -u xoops2jp/html/modules/system/admin/mailusers/mailusers.php:1.3 xoops2jp/html/modules/system/admin/mailusers/mailusers.php:1.4
--- xoops2jp/html/modules/system/admin/mailusers/mailusers.php:1.3	Sat Jun 11 11:32:52 2005
+++ xoops2jp/html/modules/system/admin/mailusers/mailusers.php	Wed Aug  3 21:39:16 2005
@@ -1,5 +1,5 @@
 <?php
-// $Id: mailusers.php,v 1.3 2005/06/11 02:32:52 onokazu Exp $
+// $Id: mailusers.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -29,6 +29,8 @@
 // Project: The XOOPS Project                                                //
 // ------------------------------------------------------------------------- //
 
+define ('SEND_SIM_PROCESS_AMMO',100);
+
 if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
 	exit("Access Denied");
 } else {
@@ -65,35 +67,34 @@
 		} else {
 			if (!empty($_POST['mail_mailok'])) {
 				$criteria[] = 'user_mailok = 1';
-			} else {
-				if (!empty($_POST['mail_to_group'])) {
-					$member_handler =& xoops_gethandler('member');
-					$user_list = array();
-					foreach ($_POST['mail_to_group'] as $groupid ) {
-						$members =& $member_handler->getUsersByGroup($groupid, false);
-						// Mith: Changed this to not fetch user objects with getUsersByGroup 
-						// as it is resource-intensive and all we want is the userIDs
-						$user_list = array_merge($members, $user_list);
+			}
+			if (!empty($_POST['mail_to_group'])) {
+				$member_handler =& xoops_gethandler('member');
+				$user_list = array();
+				foreach ($_POST['mail_to_group'] as $groupid ) {
+					$members =& $member_handler->getUsersByGroup($groupid, false);
+					// Mith: Changed this to not fetch user objects with getUsersByGroup 
+					// as it is resource-intensive and all we want is the userIDs
+					$user_list = array_merge($members, $user_list);
 						
-						// RMV: changed this because makes more sense to me
-						// if options all grouped by 'AND', not 'OR'
-						/*
-						foreach ($members as $member) {
-							if (!in_array($member->getVar('uid'), $user_list)) {
-								$user_list[] = $member->getVar('uid');
-							}
+					// RMV: changed this because makes more sense to me
+					// if options all grouped by 'AND', not 'OR'
+					/*
+					foreach ($members as $member) {
+						if (!in_array($member->getVar('uid'), $user_list)) {
+							$user_list[] = $member->getVar('uid');
 						}
-						*/
-						//	if (!in_array($member->getVar('uid'), $added_id) ) {
-						//		$added_id[] = $member->getVar('uid');
-						//		$added[] =& $member;
-						//		unset($member);
-						//	}
-						//}
-					}
-					if (!empty($user_list)) {
-						$criteria[] = 'uid IN (' . join(',', $user_list) . ')';
 					}
+					*/
+					//	if (!in_array($member->getVar('uid'), $added_id) ) {
+					//		$added_id[] = $member->getVar('uid');
+					//		$added[] =& $member;
+					//		unset($member);
+					//	}
+					//}
+				}
+				if (!empty($user_list)) {
+					$criteria[] = 'uid IN (' . join(',', $user_list) . ')';
 				}
 			}
 			if ( !empty($_POST['mail_lastlog_min']) ) {
@@ -172,7 +173,7 @@
 		//OpenTable();
 		if ( $added_count > 0 ) {
 			$mail_start = !empty($_POST['mail_start']) ? $_POST['mail_start'] : 0;
-			$mail_end = ($added_count > ($mail_start + 100)) ? ($mail_start + 100) : $added_count;
+			$mail_end = ($added_count > ($mail_start + SEND_SIM_PROCESS_AMMO)) ? ($mail_start + SEND_SIM_PROCESS_AMMO) : $added_count;
 			$myts =& MyTextSanitizer::getInstance();
 			$xoopsMailer =& getMailer();
 			for ( $i = $mail_start; $i < $mail_end; $i++) {
@@ -202,7 +203,10 @@
 						$form->addElement($group_hidden);
 					}
 				}
-				$inactive_hidden = new XoopsFormHidden("mail_inactive", $mail_inactive);
+				if(isset($_POST['mail_inactive']))
+					$form->addElement(new XoopsFormHidden("mail_inactive", intval($_POST['mail_inactive'])));
+				if(isset($_POST['mail_mailok']))
+					$form->addElement(new XoopsFormHidden("mail_mailok", intval($_POST['mail_mailok'])));
 				$lastlog_min_hidden = new XoopsFormHidden("mail_lastlog_min", $myts->makeTboxData4PreviewInForm($_POST['mail_lastlog_min']));
 				$lastlog_max_hidden = new XoopsFormHidden("mail_lastlog_max", $myts->makeTboxData4PreviewInForm($_POST['mail_lastlog_max']));
 				$regd_min_hidden = new XoopsFormHidden("mail_regd_min", $myts->makeTboxData4PreviewInForm($_POST['mail_regd_max']));
@@ -219,7 +223,6 @@
 				$submit_button = new XoopsFormButton("", "mail_submit", _AM_SENDNEXT, "submit");
 				$sent_label = new XoopsFormLabel(_AM_SENT, sprintf(_AM_SENTNUM, $_POST['mail_start']+1, $mail_end, $added_count));
 				$form->addElement($sent_label);
-				$form->addElement($inactive_hidden);
 				$form->addElement($lastlog_min_hidden);
 				$form->addElement($lastlog_max_hidden);
 				$form->addElement($regd_min_hidden);


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