} backup_log(_('Restoring Settings complete')); } //dbug($file); //run hooks if (isset($manifest['hooks']['post_restore']) && $manifest['hooks']['post_restore']) { backup_log(_('Running post restore script...')); exec($manifest['hooks']['post_restore']); } backup_log(_('Running post-restore hooks, if any...')); mod_func_iterator('backup_post_restore_hook', $manifest); //ensure that manager username and password are whatever we think they should be //the DB is authoritative, fetch whatever we have set there backup_log(_('Cleaning up...')); $freepbx_conf =& freepbx_conf::create(); fpbx_ami_update($freepbx_conf->get_conf_setting('AMPMGRUSER', true), $freepbx_conf->get_conf_setting('AMPMGRPASS', true)); // Update AstDB core_users2astdb(); core_devices2astdb(); needreload(); //delete backup file if it was a temp file if (dirname($vars['restore']) == $amp_conf['ASTSPOOLDIR'] . '/tmp/') { unlink($vars['restore']); } /* * cleanup stale backup files (older than one day) * usually, backups will be deleted after a restore * However, files that were downloaded from a remote server and * the user aborted the restore should be cleaned up here */ $files = scandir($amp_conf['ASTSPOOLDIR'] . '/tmp/');
/** Deal with corner case Settings that change and need further actions * * Some settings require further actions when they change. Any time we set, reset, * etc the settings we should call this function. * * @param string $keyword the setting that needs to be addressed * @param string $value the new value for the setting that was just changed * * @return null */ function _setting_change_special($keyword, $prep_value) { switch ($keyword) { case 'AMPMGRPASS': fpbx_ami_update(false, $prep_value); break; case 'AMPMGRUSER': fpbx_ami_update($prep_value, false); break; case 'ASTMGRWRITETIMEOUT': fpbx_ami_update(false, false, true); break; default: break; } }