If user is set to be globally unique then hide the auto generate user option as it won't be unique per domain.

This commit is contained in:
Mark Crane 2013-12-27 18:18:50 +00:00
parent 86b757f43f
commit f1867b8835
1 changed files with 15 additions and 12 deletions

View File

@ -312,17 +312,19 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//add the extension to the database //add the extension to the database
if ($action == "add" && permission_exists('extension_add')) { if ($action == "add" && permission_exists('extension_add')) {
$user_email = ''; $user_email = '';
if ($autogen_users == "true") { if ($_SESSION["user"]["unique"]["text"] != "global") {
$auto_user = $extension; if ($autogen_users == "true") {
for ($i=1; $i<=$range; $i++) { $auto_user = $extension;
$user_last_name = $auto_user; for ($i=1; $i<=$range; $i++) {
$user_password = generate_password(); $user_last_name = $auto_user;
user_add($auto_user, $user_password, $user_email); $user_password = generate_password();
$generated_users[$i]['username'] = $auto_user; user_add($auto_user, $user_password, $user_email);
$generated_users[$i]['password'] = $user_password; $generated_users[$i]['username'] = $auto_user;
$auto_user++; $generated_users[$i]['password'] = $user_password;
$auto_user++;
}
unset($auto_user);
} }
unset($auto_user);
} }
for ($i=1; $i<=$range; $i++) { for ($i=1; $i<=$range; $i++) {
@ -869,8 +871,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " </select>\n"; echo " </select>\n";
echo "<br />\n"; echo "<br />\n";
echo $text['description-range']."<br />\n"; echo $text['description-range']."<br />\n";
echo "<input type=\"checkbox\" name=\"autogen_users\" value=\"true\"> ".$text['checkbox-range']."<br>\n"; if ($_SESSION["user"]["unique"]["text"] != "global") {
echo "\n"; echo "<input type=\"checkbox\" name=\"autogen_users\" value=\"true\"> ".$text['checkbox-range']."<br>\n";
}
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
} }