Web Users" fields in the manager"> Web Users" fields in the manager" />
We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I have a client who would like to see web users’ zip codes listed on one screen in the manager. The easiest method I can think of for this would be to grant him access to the "Security --> Web Users" page in the manager. However, this method requires him to click on each person’s name to see the zip code.

    Is it possible to change the fields on the summary page? "Gender" is there by default, but I don’t really need that one. I can’t seem to find this as a setting anywhere. The closest I’ve come is editing the "web_user_management.static.php" file, but I must be doing something wrong, because that won’t display the zip, either.
      • 4310
      • 2,310 Posts
      If you want to modify manager/actions/web_user_management.static.php (remember this makes upgrading more difficult !).
      Then at around line 108 (Modx 0.9.6.3) replace the whole php section with :
      <?php
      
      	$sql = "SELECT wu.id,wu.username,wua.fullname,wua.email,wua.zip,IF(wua.blocked,'".$_lang['yes']."','-') as 'blocked'" .
      			"FROM ".$modx->getFullTableName("web_users")." wu ".
      			"INNER JOIN ".$modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id ".
      			($sqlQuery ? " WHERE (wu.username LIKE '$sqlQuery%') OR (wua.fullname LIKE '%$sqlQuery%') OR (wua.email LIKE '$sqlQuery%')":"")." ".
      			"ORDER BY username";
      	$ds = mysql_query($sql);
      	include_once $base_path."manager/includes/controls/datagrid.class.php";
      	$grd = new DataGrid('',$ds,$number_of_results); // set page size to 0 t show all items
      	$grd->noRecordMsg = $_lang["no_records_found"];
      	$grd->cssClass="grid";
      	$grd->columnHeaderClass="gridHeader";
      	$grd->itemClass="gridItem";
      	$grd->altItemClass="gridAltItem";
      	$grd->fields="id,username,fullname,email,zip,blocked";
      	$grd->columns=$_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,Zip Code ,".$_lang["user_block"];
      	$grd->colWidths="34,,,,80,34";
      	$grd->colAligns="center,,,,center,center";
      	$grd->colTypes="template:<a class='gridRowIcon' href='#' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><img src='media/style/$manager_theme/images/icons/user.gif' width='18' height='18' /></a>||template:<a href='index.php?a=88&id=[+id+]' title='".$_lang["click_to_edit_title"]."'>[+value+]</a>";
      	if($listmode=='1') $grd->pageSize=0;
      	if($_REQUEST['op']=='reset') $grd->pageNumber = 1;
      	// render grid
      	echo $grd->render();
      	?>

      ’Gender’ should now read ’Zip Code’ and the field info should appear in the column.
      • Worked like a charm! Thanks so much.
          • 4310
          • 2,310 Posts
          Worked like a charm! Thanks so much.
          Don’t sound so surprised grin