Exemple #1
0
            $result = false;
            $length = strlen($conf['server']['root']);
            if ($adminDelete && substr($saveName, 0, $length) == $conf['server']['root']) {
                $saveName = str_replace('../', '', $saveName);
                $result = rmdirr(escapeshellcmd($saveName));
            }
            if (!$result) {
                $notification->push(_("Could not delete the save game."), 'horde.error');
            } else {
                $notification->push(_("Successfully deleted the saved game."), 'horde.success');
            }
            break;
        case 'load':
            $result = false;
            if ($admin) {
                $result = NWNAdmin::sendCommand('load ' . $saveName);
            }
            if (is_a($result, 'PEAR_Error')) {
                $notification->push(_("There was a problem loading the game: ") . $result->getMessage(), 'horde.error');
            } else {
                $notification->push(_("Save game loaded."), 'horde.sucess');
            }
            break;
    }
}
// get the listing of modules
$saveList = NWNAdmin::getSaveGameList($saveDir);
$saveDone = empty($saveList);
if ($saveDone) {
    $notification->push(_("No save games were found"), 'horde.warning');
}