Beispiel #1
0
 if (isset($response)) {
     if (isXMLRPCError() || $response['err']) {
         new NotifyWidgetFailure(nl2br($response['errtext']));
     } else {
         new NotifyWidgetSuccess(sprintf(_T('Computer %s has been added to backup system successfully.<br />You can now configure its filesets and scheduling.', 'backuppc'), $computer_name));
         $_GET['tab'] = 'tab2';
     }
 }
 // Setting default profile to nightly
 set_host_period_profile($_POST['host'], 1);
 $rep = getComputersOS($_POST['host']);
 $os = $rep[0]['OSName'];
 // Init best profile
 $bestProfile = NULL;
 $bestSim = 0;
 $backup_profiles = get_backup_profiles();
 foreach ($backup_profiles as $profile) {
     $profilename = $profile['profilename'];
     similar_text($os, $profilename, $perc);
     //
     if ($perc > $bestSim) {
         $bestSim = $perc;
         $bestProfile = $profile;
     }
     // Windows 7 special case
     similar_text($os, str_replace('/Vista', '', $profilename), $perc);
     //
     if ($perc > $bestSim) {
         $bestSim = $perc;
         $bestProfile = $profile;
     }
Beispiel #2
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "graph/navbar.inc.php";
require "localSidebar.php";
$p = new PageGenerator(_T("Filesets", 'backuppc'));
$p->setSideMenu($sidemenu);
$p->display();
require_once "modules/backuppc/includes/xmlrpc.php";
// =========== BACKUP PROFILES =================================
$response = get_backup_profiles();
// Defining element actions
$editAction = new ActionItem(_T("Edit profile", "backuppc"), "EditBackupProfile", "edit", "profile", "backuppc", "backuppc");
$delAction = new ActionPopupItem(_T("Delete profile", "backuppc"), "deleteProfile", "delete", "profile", "backuppc", "backuppc");
$emptyAction = new EmptyActionItem();
$profile_names = array();
$editActions = array();
$delActions = array();
$params = array();
foreach ($response as $profile) {
    $profile_names[$profile['id']] = _T($profile['profilename'], 'backuppc');
}
asort($profile_names);
foreach ($profile_names as $pid => $pname) {
    $params[] = array('id' => $pid, 'type' => 0);
    // Delete only for user defined profiles [id>=1000]