Ejemplo n.º 1
0
    $extension['RingGroups'] = TextBoxToArray($extendata['RingGroups']);
    $extension['HaveQueues'] = $extendata['HaveQueues'] != 'yes' ? "no" : "yes";
    $extension['Queues'] = TextBoxToArray($extendata['Queues']);
    $extension['Context'] = "fonb-from-internal";
    $extension['Terminal'] = "SIP/" . $exten;
    /// Get Users Configuration
    $data = $users;
    if (!array_key_exists($exten, $data)) {
        /// Error NoExtension
        header("Location: users.php");
        exit;
    }
    // Update Users Configuration
    $data[$exten] = $extension;
    // Reformat the $data
    $data = removeNonIntSections($data);
    $data = removeEmptyPasswords($data);
    // Save the file
    $fonb->write_users($data);
    header("Location: users.php");
    exit;
}
### VIEW the edit user form
// Creat the listusers object
$Json = array();
$Json['EditExtension'] = $users[$exten];
$Json['EditExtension']['Platform'] = GetPlatform();
$Json['Departments'] = $fonb->getDepartments();
//$Json['RingGroups'] = getRingGroups();
$Json['RingGroups'] = RingGroupsOf($exten);
//$Json['Queues'] = getQueues();
Ejemplo n.º 2
0
        unset($_POST['new_extension']['Password']);
    }
    $data[$_POST['new_extension']['Extension']] = $_POST['new_extension'];
    $_POST = $data;
    // Save the file
    $data = removeNonIntSections($_POST);
    $data = removeEmptyPasswords($data);
    $fonb->write_users($data);
    prepareContext();
    header("Location: users.php");
    exit;
}
### UPDATE button
if (isset($_POST['action']) && $_POST['action'] == "Update") {
    // Save the file
    $data = removeNonIntSections($_POST);
    $data = removeEmptyPasswords($data);
    $fonb->write_users($data);
    prepareContext();
    header("Location: users.php");
    exit;
}
### VIEW the edit user form
// Creat the listusers object
$Json = array();
$Json['Extensions'] = MustacheReformatExtensions(getExtensions());
$Json['NoExtensionErrorMessage'] = getNoExtensionErrorMessage();
$Json['RingGroups'] = getRingGroups();
$Json['Queues'] = getQueues();
$Json['DeletedExtensions'] = getDeletedExtensions();
$Json['License'] = $fonb->getTotalUsersAllowed();