Index: trunk/flexform_ds_pi3.xml
===================================================================
--- trunk/flexform_ds_pi3.xml	(revision 5629)
+++ trunk/flexform_ds_pi3.xml	(working copy)
@@ -5,6 +5,56 @@
 		</TCEforms>
 	    <type>array</type>
 	    <el>
+			<groupSelectmode>
+				<TCEforms>
+					<label>LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelectmode</label>
+					<config>
+						<type>select</type>
+						<items type="array">
+							<numIndex index="0" type="array">
+								<numIndex index="0">LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelectmode_showAll</numIndex>
+								<numIndex index="1">0</numIndex>
+							</numIndex>
+							<numIndex index="1" type="array">
+								<numIndex index="0">LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelectmode_showSelected</numIndex>
+								<numIndex index="1">1</numIndex>
+							</numIndex>
+							<numIndex index="2" type="array">
+								<numIndex index="0">LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelectmode_DontShowSelected</numIndex>
+								<numIndex index="1">-1</numIndex>
+							</numIndex>
+							<numIndex index="3" type="array">
+								<numIndex index="0">LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelectmode_FromTS</numIndex>
+								<numIndex index="1">-2</numIndex>
+							</numIndex>
+						</items>
+						<maxitems>1</maxitems>
+						<size>1</size>
+					</config>
+				</TCEforms>
+			</groupSelectmode>
+			<groupSelection>
+				<TCEforms>
+					<label>LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelection</label>
+					<config>
+						<type>select</type>
+						<items type="array">
+							<numIndex index="100">
+								<numIndex index="0">LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.groupSelection_noGroup</numIndex>
+								<numIndex index="1">0</numIndex>
+							</numIndex>
+						</items>
+						<foreign_table>fe_groups</foreign_table>
+						<foreign_table_where>ORDER BY uid</foreign_table_where>
+						<minitems>0</minitems>
+						<maxitems>20</maxitems>
+						<size>5</size>
+						<selectedListStyle>width:180px</selectedListStyle>
+						<itemListStyle>width:180px</itemListStyle>
+						<allowNonIdValues>1</allowNonIdValues>
+					</config>
+				</TCEforms>
+			</groupSelection>
 	      <field_manualOrder>
 			<TCEforms>
 				<label>LLL:EXT:newloginbox/locallang_db.xml:tt_content.pi_flexform.field_manualOrder</label>
Index: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	(revision 5629)
+++ trunk/ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2007-06-07  Stefan Strasser <strada at stradax dot net>
+
+	* Added the possibility to display only selected user-groups in a user-listing. The settings may also be done through typoscript (flexform has priority). It is a modified patch of Stefan Padberg (thanks!). bug #0004532.
+
 2007-05-01  Stefan Strasser <strada at stradax dot net>
 
 	* Fixed a bug resulting of the conversion to xml-files (configuration of the pi1-wizard-icon)
Index: trunk/pi3/class.tx_newloginbox_pi3.php
===================================================================
--- trunk/pi3/class.tx_newloginbox_pi3.php	(revision 5629)
+++ trunk/pi3/class.tx_newloginbox_pi3.php	(working copy)
@@ -71,6 +71,8 @@
 		var $manualFieldOrder = FALSE;
 		var $manualFieldOrder_details = array();
 		var $manualFieldOrder_list = array();
+		var $groupSelectmode = 0;
+		var $groupSelection = 0;
 
 		/**
 		* Main function, called from TypoScript
@@ -88,6 +90,26 @@
 			$this->manualFieldOrder_details = t3lib_div::trimExplode(',', $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'field_orderDetails'), 1);
 			$this->manualFieldOrder_list = t3lib_div::trimExplode(',', $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'field_orderList'), 1);
 
+			// selectable fe-group, contributed by Stefan Padberg <post@webskriptorium.com>, modified by Stefan Strasser
+
+				// FE groups 
+				// groupSelectmodes are: 0=display all groups, 1=display selected groups, -1=display deselected groups
+				//  (from Typoscript) [Flexform only]: both values are taken from Typoscript (if defined)
+				//   Typoscript-Option: plugin.tx_newloginbox_pi3.groupSelectmode = 1
+				// groupSelection: uid of de/selected groups
+				//   Typoscript-Option: plugin.tx_newloginbox_pi3.groupSelection = 2,3
+			
+			if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'groupSelectmode')==-2) { // (Flexform says: from TS)
+				$this->config['groupSelectmode'] = isset($this->conf['groupSelectmode'])?$this->conf['groupSelectmode']:0;
+				$this->config['groupSelection'] = isset($this->conf['groupSelection'])?$this->conf['groupSelection']:0;
+			} else {
+				$this->config['groupSelectmode'] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'groupSelectmode');
+				$this->config['groupSelection'] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'groupSelection');
+			}
+			$this->groupSelectArray = explode(',',$this->config['groupSelection']);
+
+			// end of selectable fe-group modification
+
 			switch((string)$conf['CMD']) {
 
 				case 'singleView':
@@ -147,9 +169,27 @@
 				$this->internal['searchFieldList'] = 'username,name,email,country,city,zip,telephone,address,title';
 				$this->internal['orderByList'] = 'username,name,email,country,city,zip';
 
-				// Get number of records:
-				$query = $this->pi_list_query('fe_users', 1);
+				// selectable fe-group, contributed by Stefan Padberg <post@webskriptorium.com>, modified by Stefan Strasser
+				// calculate where-clause:
+				if ($this->config['groupSelectmode']!=0) {
+					$where = 'AND ( ';
+					if ($this->config['groupSelectmode']==-1) {
+							$whereConn = 'AND';
+							$whereLike = 'NOT LIKE';
+						} else {
+							$whereConn = 'OR';
+							$whereLike = 'LIKE';
+					}
+					for ($i=0;$i<count($this->groupSelectArray);$i++) {
+						if ($i<>0) $where.= $whereConn;
+						$where.= ' usergroup '.$whereLike.' "'.$this->groupSelectArray[$i].'" '.$whereConn.' usergroup '.$whereLike.' "%,'.$this->groupSelectArray[$i].'" '.$whereConn.' usergroup '.$whereLike.' "'.$this->groupSelectArray[$i].',%" '.$whereConn.' usergroup '.$whereLike.' "%,'.$this->groupSelectArray[$i].',%" ';
+					}
+					$where.=')';
+				}
+				// end of selectable fe-group modification, adding $where to the query below	
 
+				// Get number of records:
+				$query = $this->pi_list_query('fe_users', 1, $where);
 				$res = $GLOBALS['TYPO3_DB']->sql_query($query);
 				if ($GLOBALS['TYPO3_DB']->sql_error()) {
 					t3lib_div::debug(array($GLOBALS['TYPO3_DB']->sql_error(), $query));
@@ -158,7 +198,7 @@
 				list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
 
 				// Make listing query, pass query to MySQL:
-				$query = $this->pi_list_query('fe_users');
+				$query = $this->pi_list_query('fe_users', 0, $where);
 
 				$res = $GLOBALS['TYPO3_DB']->sql_query($query);
 				if ($GLOBALS['TYPO3_DB']->sql_error()) {
Index: trunk/ext_typoscript_setup.txt
===================================================================
--- trunk/ext_typoscript_setup.txt	(revision 5629)
+++ trunk/ext_typoscript_setup.txt	(working copy)
@@ -26,6 +26,8 @@
     CMD =
     pidList =
     recursive =
+    groupSelectmode =
+    groupSelection =
 }
 
 plugin.tx_newloginbox_pi3.listView {
Index: trunk/locallang_db.xml
===================================================================
--- trunk/locallang_db.xml	(revision 5629)
+++ trunk/locallang_db.xml	(working copy)
@@ -21,6 +21,13 @@
             <label index="tt_content.pi_flexform.sheet_logout">Logout</label>
             <label index="tt_content.pi_flexform.show_forgot_password">Show &quot;Forgot password?&quot; link:</label>
             <label index="tt_content.pi_flexform.show_permalogin">Show &quot;Stay logged in&quot; checkbox (if switched on for the installation):</label>
+			<label index="tt_content.pi_flexform.groupSelectmode">FE group select mode:</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showAll">Show all</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showSelected">Show selected</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_DontShowSelected">Dont show selected</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_FromTS">(from Typoscript)</label>
+			<label index="tt_content.pi_flexform.groupSelection">FE group selection:</label>
+			<label index="tt_content.pi_flexform.groupSelection_noGroup">no group</label>
             <label index="tt_content.pi_flexform.field_manualOrder">Using fieldlists below:</label>
             <label index="tt_content.pi_flexform.field_orderList">User Fields/list:</label>
             <label index="tt_content.pi_flexform.field_orderDetails">User Fields/details:</label>
@@ -51,6 +58,13 @@
             <label index="tt_content.pi_flexform.sheet_logout">Abmelden</label>
             <label index="tt_content.pi_flexform.show_forgot_password">&quot;Passwort vergessen?&quot; Link anzeigen:</label>
             <label index="tt_content.pi_flexform.show_permalogin">&quot;Eingeloggt bleiben&quot; checkbox anzeigen (wenn auf dem System verfügbar)</label>
+			<label index="tt_content.pi_flexform.groupSelectmode">FE-Gruppen Auswahlmodus:</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showAll">Alle anzeigen</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showSelected">Nur die Ausgewählten anzeigen</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_DontShowSelected">Die Ausgewählten NICHT anzeigen</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_FromTS">(gemäss Typoscript)</label>
+			<label index="tt_content.pi_flexform.groupSelection">FE-Gruppen Auswahl:</label>
+			<label index="tt_content.pi_flexform.groupSelection_noGroup">in keiner Gruppe einsortiert</label>
             <label index="tt_content.pi_flexform.field_manualOrder">Folgende Felder benutzen:</label>
             <label index="tt_content.pi_flexform.field_orderList">Listenansicht:</label>
             <label index="tt_content.pi_flexform.field_orderDetails">Detailansicht:</label>
@@ -299,23 +313,6 @@
         </languageKey>
     </data>
     <orig_hash type="array">
-        <languageKey index="default" type="array">
-            <label index="tt_content.list_type1" type="integer">243211240</label>
-            <label index="tt_content.list_type3" type="integer">18995075</label>
-            <label index="tt_content.pi_flexform.header" type="integer">9618284</label>
-            <label index="tt_content.pi_flexform.message" type="integer">155215423</label>
-            <label index="tt_content.pi_flexform.sheet_general" type="integer">14366585</label>
-            <label index="tt_content.pi_flexform.sheet_welcome" type="integer">137500844</label>
-            <label index="tt_content.pi_flexform.sheet_success" type="integer">17780380</label>
-            <label index="tt_content.pi_flexform.sheet_error" type="integer">222809627</label>
-            <label index="tt_content.pi_flexform.sheet_status" type="integer">247806604</label>
-            <label index="tt_content.pi_flexform.sheet_logout" type="integer">3292644</label>
-            <label index="tt_content.pi_flexform.show_forgot_password" type="integer">8907633</label>
-            <label index="tt_content.pi_flexform.show_permalogin" type="integer">253853093</label>
-            <label index="tt_content.pi_flexform.field_manualOrder" type="integer">10735835</label>
-            <label index="tt_content.pi_flexform.field_orderList" type="integer">36548182</label>
-            <label index="tt_content.pi_flexform.field_orderDetails" type="integer">41652539</label>
-        </languageKey>
         <languageKey index="dk" type="array">
             <label index="tt_content.list_type1" type="integer">243211240</label>
             <label index="tt_content.list_type3" type="integer">18995075</label>
@@ -345,6 +342,14 @@
             <label index="tt_content.pi_flexform.field_manualOrder" type="integer">10735835</label>
             <label index="tt_content.pi_flexform.field_orderList" type="integer">36548182</label>
             <label index="tt_content.pi_flexform.field_orderDetails" type="integer">41652539</label>
+			<label index="tt_content.pi_flexform.groupSelectmode" type="integer">118280502</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showAll" type="integer">247013413</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showSelected" type="integer">19200228</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_DontShowSelected" type="integer">104849576</label>
+			<label index="tt_content.pi_flexform.groupSelection" type="integer">124947190</label>
+			<label index="tt_content.pi_flexform.groupSelection_noGroup" type="integer">37932999</label>
+			<label index="tt_content.pi_flexform.groupSelection_FromTS" type="integer">234833160</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_FromTS" type="integer">234833160</label>
         </languageKey>
         <languageKey index="no" type="array">
             <label index="tt_content.list_type1" type="integer">243211240</label>
@@ -590,11 +595,32 @@
         </languageKey>
     </orig_hash>
     <orig_text type="array">
-        <languageKey index="default" type="array">
-        </languageKey>
         <languageKey index="dk" type="array">
         </languageKey>
         <languageKey index="de" type="array">
+			<label index="tt_content.list_type1">Better login-box</label>
+			<label index="tt_content.list_type3">User Listing</label>
+			<label index="tt_content.pi_flexform.header">Header:</label>
+			<label index="tt_content.pi_flexform.message">Message:</label>
+			<label index="tt_content.pi_flexform.sheet_general">General</label>
+			<label index="tt_content.pi_flexform.sheet_welcome">Welcome</label>
+			<label index="tt_content.pi_flexform.sheet_success">Login Success</label>
+			<label index="tt_content.pi_flexform.sheet_error">Login Error</label>
+			<label index="tt_content.pi_flexform.sheet_status">Status</label>
+			<label index="tt_content.pi_flexform.sheet_logout">Logout</label>
+			<label index="tt_content.pi_flexform.show_forgot_password">Show &quot;Forgot password?&quot; link:</label>
+			<label index="tt_content.pi_flexform.show_permalogin">Show &quot;Stay logged in&quot; checkbox (if switched on for the installation):</label>
+			<label index="tt_content.pi_flexform.groupSelectmode">FE group select mode:</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showAll">Show all</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_showSelected">Show selected</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_DontShowSelected">Dont show selected</label>
+			<label index="tt_content.pi_flexform.groupSelection">FE group selection:</label>
+			<label index="tt_content.pi_flexform.groupSelection_noGroup">no group</label>
+			<label index="tt_content.pi_flexform.field_manualOrder">Using fieldlists below:</label>
+			<label index="tt_content.pi_flexform.field_orderList">User Fields/list:</label>
+			<label index="tt_content.pi_flexform.field_orderDetails">User Fields/details:</label>
+			<label index="tt_content.pi_flexform.groupSelection_FromTS">(from Typoscript)</label>
+			<label index="tt_content.pi_flexform.groupSelectmode_FromTS">(from Typoscript)</label>
         </languageKey>
         <languageKey index="no" type="array">
         </languageKey>
