2) { // This is to account for three-part names; example here is Somebody von Username // if there were more than two substrings, we know there are three names $middlename = $namearray[1]; // e.g. von $lastname = $namearray[2]; // e.g. Username $minitial = substr($middlename, 0, 1); // e.g. v $userid = strtolower($firstinitial . $minitial . $lastname); // e.g. "svusername" $emailalias = strtolower($firstname . '.' . $middlename . '.' . $lastname); // e.g. "somebody.von.username" $lastname = $middlename . " " . $lastname; // Reassign to glue them together // because FC has no middle name field, e.g. "von Username" } // end "if we have a three-part name" else { $lastname = $namearray[1]; $userid = strtolower($firstinitial . $lastname); $emailalias = strtolower($firstname.'.'.$lastname.'@'.$groupdomain); } // end "else we have a regular firstname lastname person" // Next block creates the user and adds them to the specified group and adds an email alias to their user form. // The email aliases field in the user form is 1252 and the type is text (0) $string = '
ADD network "'.$userid.'" "'.$firstname.'" "" "'.$lastname.'" "" "'.$temppass.'" "" "" "" 1 "'.$groupname1.'"
PUT USER "'.$userid.'" 1252 0 "'.$emailalias.'"
'; // Next (optional) block adds existing users to a(nother) group. /* $groupname2 = "Another Group"; $string .= '
PGADD '.$userid.' "'.$groupname2.'"
'; */ echo $string; } // end "for each name" // Drop this in your webroot (/Library/WebServer/Documents on Mac OS X), // browser to http://localhost/batchadd-maker.php, // copy and paste the output into a new message to batch admin and send. ?>