Exemplo n.º 1
0
    $results = $db->query($sql);
    if (DB::IsError($results)) {
        die($results->getMessage());
    }
    out("Done");
}
// Make sure we save the settings as they are currenlty parsed
//
$current_amp_conf = $amp_conf;
// Now let's initialize all the settings, if they happen to already exist for
// some reason, this is ok as the define_conf_settings() method does not save the
// values back once defined, you must explicitly set them. Don't commit to db,
// that is down a little further down anyhow.
//
outn(_("Initialize freepbx_conf settings.."));
freepbx_settings_init(false);
out(_("ok"));
// Now we will set the current value of all settings
//
$freepbx_conf =& freepbx_conf::create();
$update_arr = array();
/* Previously 'none' was the default. If migrating from old system, and it was
 * not set, then it was in 'none' mode. We need to retain this as part of the
 * migration or we may lock out admins after the migration.
 */
if (!isset($current_amp_conf['AUTHTYPE']) || $current_amp_conf['AUTHTYPE'] != 'database' && $current_amp_conf['AUTHTYPE'] != 'webserver') {
    out(_("Setting AUTHTYPE to none consistent with old default"));
    $current_amp_conf['AUTHTYPE'] = 'none';
}
if (!isset($current_amp_conf['MOHDIR']) || $current_amp_conf['MOHDIR'] == '') {
    out(_("Setting MOHDIR to mohmp3 consistent with old default"));
Exemplo n.º 2
0
}
/*TODO: (Requirment for #4733)
 *
 * 1. Update publish.pl to grab a copy of amportal and put it somehwere.
 * 2. If we have access to do an md5sum on AMPSBIN/amportal do it and
 *    compare to the local copy.
 * 3. If the md5sum is different or we couldn't check, put amportal in AMPBIN
 * 4. If we decided they need a new one, then write out a message that they
 *    should run amportal to update it.
 */
if (function_exists('upgrade_all')) {
    upgrade_all(getversion());
    // We run this each time so that we can add settings if need be
    // without requiring a major version bump
    //
    freepbx_settings_init(true);
} else {
    out("[ERROR] Function: 'upgrade_all' not present, libfreepbx.install.php seems not to be installed");
}
// We now delete the files, this makes sure that if someone had an unprotected system where they have not enabled
// the .htaccess files or otherwise allowed direct access, that these files are not around to possibly cause problems
//
out(_("framework file install done, removing packages from module"));
$rem_files[] = $base_source;
$rem_files[] = dirname(__FILE__) . "/upgrades";
$rem_files[] = dirname(__FILE__) . "/libfreepbx.install.php";
foreach ($rem_files as $target) {
    unset($out);
    exec("rm -rf {$target} 2>&1", $out, $ret);
    if ($ret != 0) {
        out(sprintf(_("an error occured removing the packaged file/directory: %s"), $target));