diff --git a/webgui/include/ajax/functions/WiSPUsers.php b/webgui/include/ajax/functions/WiSPUsers.php
index c6d63dd43b6bf77167cc389d0f9b16beaa54ca44..16f214f71918f603648eef73e89d6847d82566b6 100644
--- a/webgui/include/ajax/functions/WiSPUsers.php
+++ b/webgui/include/ajax/functions/WiSPUsers.php
@@ -195,113 +195,184 @@ function createWiSPUser($params) {
 	global $db;
 
 	DBBegin();
-	# Insert username
-	$res = DBDo("INSERT INTO users (Username) VALUES (?)",array($params[0]['Username']));
-
-	# Continue with others if successful
-	if ($res !== FALSE) {
-		$userID = DBLastInsertID();
-		$res = DBDo("
-			INSERT INTO 
-					user_attributes (UserID,Name,Operator,Value) 
-			VALUES 
-					(?,?,?,?)",
-			array($userID,
-				'User-Password',
-				'==',
-				$params[0]['Password'])
-		);
-	}
-
-	# Link users ID to make user a wisp user
-	if ($res !== FALSE) {
-		$res = DBDo("INSERT INTO wisp_userdata (UserID) VALUES (?)",array($userID));
-	}
+	$res = "Username & Password required for single user. For adding multiple users an integer is required.";
+	# If we adding single user
+	if (empty($params[0]['Number']) && !empty($params[0]['Password']) && !empty($params[0]['Username'])) {
+		# Insert username
+		$res = DBDo("INSERT INTO users (Username) VALUES (?)",array($params[0]['Username']));
+
+		# Continue with others if successful
+		if ($res !== FALSE) {
+			$userID = DBLastInsertID();
+			$res = DBDo("
+				INSERT INTO 
+						user_attributes (UserID,Name,Operator,Value) 
+				VALUES 
+						(?,?,?,?)",
+				array($userID,
+					'User-Password',
+					'==',
+					$params[0]['Password'])
+			);
+		}
 
-	# Add personal information
-	if ($res !== FALSE && isset($params[0]['Firstname'])) {
-		$res = DBDo("UPDATE wisp_userdata SET FirstName = ? WHERE UserID = ?",array($params[0]['Firstname'],$userID));
-	}
-	if ($res !== FALSE && isset($params[0]['Lastname'])) {
-		$res = DBDo("UPDATE wisp_userdata SET LastName = ? WHERE UserID = ?",array($params[0]['Lastname'],$userID));
-	}
-	if ($res !== FALSE && isset($params[0]['Phone'])) {
-		$res = DBDo("UPDATE wisp_userdata SET Phone = ? WHERE UserID = ?",array($params[0]['Phone'],$userID));
-	}
-	if ($res !== FALSE && isset($params[0]['Email'])) {
-		$res = DBDo("UPDATE wisp_userdata SET Email = ? WHERE UserID = ?",array($params[0]['Email'],$userID));
-	}
-	if ($res !== FALSE && isset($params[0]['LocationID'])) {
-		$res = DBDo("UPDATE wisp_userdata SET LocationID = ? WHERE UserID = ?",array($params[0]['LocationID'],$userID));
-	}
+		# Link users ID to make user a wisp user
+		if ($res !== FALSE) {
+			$res = DBDo("INSERT INTO wisp_userdata (UserID) VALUES (?)",array($userID));
+		}
 
+		# Add personal information
+		if ($res !== FALSE && isset($params[0]['Firstname'])) {
+			$res = DBDo("UPDATE wisp_userdata SET FirstName = ? WHERE UserID = ?",array($params[0]['Firstname'],$userID));
+		}
+		if ($res !== FALSE && isset($params[0]['Lastname'])) {
+			$res = DBDo("UPDATE wisp_userdata SET LastName = ? WHERE UserID = ?",array($params[0]['Lastname'],$userID));
+		}
+		if ($res !== FALSE && isset($params[0]['Phone'])) {
+			$res = DBDo("UPDATE wisp_userdata SET Phone = ? WHERE UserID = ?",array($params[0]['Phone'],$userID));
+		}
+		if ($res !== FALSE && isset($params[0]['Email'])) {
+			$res = DBDo("UPDATE wisp_userdata SET Email = ? WHERE UserID = ?",array($params[0]['Email'],$userID));
+		}
+		if ($res !== FALSE && isset($params[0]['LocationID'])) {
+			$res = DBDo("UPDATE wisp_userdata SET LocationID = ? WHERE UserID = ?",array($params[0]['LocationID'],$userID));
+		}
 
-	# Grab each attribute and add it's details to the database
-	if ($res !== FALSE && isset($params[0]['Attributes'])) {
-		foreach ($params[0]['Attributes'] as $attr) {
-
-			# Default value without modifier
-			$attrValue = $attr['Value'];
-
-			if ($attr['Name'] == 'SMRadius-Capping-Traffic-Limit' || $attr['Name'] == 'SMRadius-Capping-Uptime-Limit') {
-				# If modifier is set we need to work out attribute value
-				if (isset($attr['Modifier'])) {
-					switch ($attr['Modifier']) {
-						case "Seconds":
-							$attrValue = $attr['Value'] / 60;
-						case "Minutes":
-							$attrValue = $attr['Value'];
-						case "Hours":
-							$attrValue = $attr['Value'] * 60;
-						case "Days":
-							$attrValue = $attr['Value'] * 1440;
-						case "Weeks":
-							$attrValue = $attr['Value'] * 10080;
-						case "Months":
-							$attrValue = $attr['Value'] * 44640; 
-						case "MBytes":
-							$attrValue = $attr['Value'];
-						case "GBytes":
-							$attrValue = $attr['Value'] * 1024;
-						case "TBytes":
-							$attrValue = $attr['Value'] * 1048576;
+		# Grab each attribute and add it's details to the database
+		if ($res !== FALSE && isset($params[0]['Attributes'])) {
+			foreach ($params[0]['Attributes'] as $attr) {
+
+				# Default value without modifier
+				$attrValue = $attr['Value'];
+
+				if ($attr['Name'] == 'SMRadius-Capping-Traffic-Limit' || $attr['Name'] == 'SMRadius-Capping-Uptime-Limit') {
+					# If modifier is set we need to work out attribute value
+					if (isset($attr['Modifier'])) {
+						switch ($attr['Modifier']) {
+							case "Seconds":
+								$attrValue = $attr['Value'] / 60;
+							case "Minutes":
+								$attrValue = $attr['Value'];
+							case "Hours":
+								$attrValue = $attr['Value'] * 60;
+							case "Days":
+								$attrValue = $attr['Value'] * 1440;
+							case "Weeks":
+								$attrValue = $attr['Value'] * 10080;
+							case "Months":
+								$attrValue = $attr['Value'] * 44640; 
+							case "MBytes":
+								$attrValue = $attr['Value'];
+							case "GBytes":
+								$attrValue = $attr['Value'] * 1024;
+							case "TBytes":
+								$attrValue = $attr['Value'] * 1048576;
+						}
 					}
 				}
+
+				# Add attribute
+				$res = DBDo("
+						INSERT INTO 
+								user_attributes (UserID,Name,Operator,Value) 
+						VALUES
+								(?,?,?,?)",
+						array(
+							$userID,
+							$attr['Name'],
+							$attr['Operator'],
+							$attrValue
+						)
+				);
 			}
+		}
 
-			# Add attribute
-			$res = DBDo("
-					INSERT INTO 
-							user_attributes (UserID,Name,Operator,Value) 
-					VALUES
-							(?,?,?,?)",
-					array(
-						$userID,
-						$attr['Name'],
-						$attr['Operator'],
-						$attrValue
-					)
-			);
+		# Link user to groups if any selected
+		if ($res !== FALSE && isset($params[0]['Groups'])) {
+			$refinedGroups = array();
+
+			# Filter out unique group ID's
+			foreach ($params[0]['Groups'] as $group) {
+				foreach ($group as $ID=>$value) {
+					$refinedGroups[$value] = $value;
+				}
+			}
+			# Loop through groups
+			foreach ($refinedGroups as $groupID) {
+				$res = DBDo("INSERT INTO users_to_groups (UserID,GroupID) VALUES (?,?)",array($userID,$groupID));
+			}
 		}
-	}
 
-	# Link user to groups if any selected
-	if ($res !== FALSE && isset($params[0]['Groups'])) {
-		$refinedGroups = array();
+	# We adding multiple users
+	} elseif (!empty($params[0]['Number']) && $params[0]['Number'] > 1) {
+		$wispUser = array();
+		# Loop for number of chosen numbers
+		for ($i = 0; $i < $params[0]['Number']; $i++) {
+
+			# Check for duplicates and add
+			$usernameReserved = 1;
+			$characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
+			while ($usernameReserved == 1) {
+
+				# Generate random username
+				$string = '';
+				for ($c = 0; $c < 7; $c++) {
+					$string .= $characters[rand(0, strlen($characters) - 1)];
+				}
+
+				$thisUsername = $string;
+				# Add prefix to string
+				if (!empty($params[0]['Prefix'])) {
+					$thisUsername = $params[0]['Prefix'].$string;
+				}
+
+				# Check if username used
+				$res = DBSelect("
+							SELECT 
+								users.Username
+							FROM 
+								users
+							WHERE 
+								users.Username = ?
+								",array($thisUsername)
+				);
+
+				# If there are no rows we may continue
+				if ($res->rowCount() == 0 && !defined($wispUser[$thisUsername])) {
+					$usernameReserved = 0;
+
+					# Generate random username
+					$string = '';
+					for ($c = 0; $c < 7; $c++) {
+						$string .= $characters[rand(0, strlen($characters) - 1)];
+					}
 
-		# Filter out unique group ID's
-		foreach ($params[0]['Groups'] as $group) {
-			foreach ($group as $ID=>$value) {
-				$refinedGroups[$value] = $value;
+					# Add username and password onto array
+					$wispUser[$thisUsername] = $string;
+				}
 			}
 		}
-		# Loop through groups
-		foreach ($refinedGroups as $groupID) {
-			$res = DBDo("INSERT INTO users_to_groups (UserID,GroupID) VALUES (?,?)",array($userID,$groupID));
+
+		# Insert users from array into database
+		foreach ($wispUser as $username => $password) {
+			$res = DBDo("INSERT INTO users (Username) VALUES (?)",array($username));
+			if ($res !== FALSE) {
+				$id = DBLastInsertID();
+				$res = DBDo("INSERT INTO user_attributes (UserID,Name,Operator,Value) VALUES (?,?,?,?)",
+						array($id,'User-Password','==',$password)
+				);
+
+				# Link to wisp users
+				if ($res !== FALSE) {
+					$res = DBDo("INSERT INTO wisp_userdata (UserID) VALUES (?)",
+							array($id)
+					);
+				}
+			}
 		}
 	}
 
-	# Commit changes if all was successful, else break
+	# Commit changes if all was successful, else rollback
 	if ($res !== FALSE) {
 		DBCommit();
 		return $res;
diff --git a/webgui/js/app/windows/WiSPUsers.js b/webgui/js/app/windows/WiSPUsers.js
index 5f3365f33122d3a865929a5f27f919d7e970cce9..1d25b10acf99d9a05503a3932aa6edd60014be9e 100644
--- a/webgui/js/app/windows/WiSPUsers.js
+++ b/webgui/js/app/windows/WiSPUsers.js
@@ -271,7 +271,9 @@ function showWiSPUserAddEditWindow(id) {
 					'0:Email,'+
 					'0:LocationID,'+
 					'0:Attributes,'+
-					'0:Groups'
+					'0:Groups,'+
+					'0:Number,'+
+					'0:Prefix'
 			},
 
 			hook: function() {
@@ -556,14 +558,14 @@ function showWiSPUserAddEditWindow(id) {
 					name: 'Username',
 					vtype: 'usernamePart',
 					maskRe: usernamePartRe,
-					allowBlank: false,
+					allowBlank: true,
 				},
 				{
 					fieldLabel: 'Password',
 					name: 'Password',
 					vtype: 'usernamePart',
 					maskRe: usernamePartRe,
-					allowBlank: false,
+					allowBlank: true,
 				},
 				{
 					xtype: 'tabpanel',
@@ -658,15 +660,12 @@ function showWiSPUserAddEditWindow(id) {
 								{
 									fieldLabel: 'Prefix',
 									name: 'Prefix',
-									vtype: 'usernamePart',
-									maskRe: usernamePartRe,
 									allowBlank: true,
 								},
 								{
 									fieldLabel: 'Number',
 									name: 'Number',
-									vtype: 'usernamePart',
-									maskRe: usernamePartRe,
+									vtype: 'number',
 									allowBlank: true,
 								},
 							]