user ); $i++ ) { if ( !strcasecmp ( $xml->user[$i]['name'], $username )) { print "The specified user already exists\n"; return 1; } } $newuser = $xml->addChild ( 'user' ); $newuser->addAttribute ( 'name', $username ); $newuser->addAttribute ( 'pass', $password ); $newuser->addAttribute ( 'home', '/home/' . $username ); if ( !( $fp = fopen ( 'userlist.php', 'w' ))) { print "Unable to add the specified user, unknown error\n"; return 1; } fwrite ( $fp, "asXML() . "\nXML;\n\n?>\n" ); fclose ( $fp ); print 'User "'.$username.' successfully added, home directory set to "/home/'.$username."\"\n"; break; } ?>