} if ($_POST['action'] == 'restore') { $cmd = "sudo chmod 666 {$_INICONF['settingspath']}/*"; exec($cmd); $restored = $snapshot->restore($profile_name, $type); if (!empty($restored)) { $_MSGS[] = array('type' => 'info', 'msg' => "arkontrol has restored the configuration profile `{$profile_name}`."); // make sure we send a message telling them to restart ARK dedicated server. $_SESSION['need_to_restart'] = true; } else { $_MSGS[] = array('type' => 'error', 'msg' => "Restoration of configuration profile `{$profile_name}` has failed."); } } if ($_POST['action'] == 'save') { $cmd = "sudo chmod 666 {$_INICONF['settingspath']}/*"; exec($cmd); $saved = $snapshot->create($profile_name, $type); if (!empty($saved)) { $_MSGS[] = array('type' => 'info', 'msg' => "arkontrol has saved the configuration profile `{$profile_name}`."); } else { $_MSGS[] = array('type' => 'error', 'msg' => "Unable to save configuration profile `{$profile_name}`."); } } } } $profiles_snapshot = $snapshot->list_profiles("snapshot"); $profiles_custom = $snapshot->list_profiles("custom"); $_VIEW->assign('profiles_snapshot', $profiles_snapshot); $_VIEW->assign('profiles_custom', $profiles_custom); $_VIEW->assign('_MSGS', $_MSGS); $_VIEW->display('serverProfiles.tpl');