| 254 | */ |
| 255 | |
| 256 | void |
| 257 | cgiMoveJobs(http_t *http, /* I - Connection to server */ |
| 258 | const char *dest, /* I - Destination or NULL */ |
| 259 | int job_id) /* I - Job ID or 0 for all */ |
| 260 | { |
| 261 | int i; /* Looping var */ |
| 262 | const char *user; /* Username */ |
| 263 | ipp_t *request, /* IPP request */ |
| 264 | *response; /* IPP response */ |
| 265 | ipp_attribute_t *attr; /* Current attribute */ |
| 266 | const char *name; /* Destination name */ |
| 267 | const char *job_printer_uri; /* JOB_PRINTER_URI form variable */ |
| 268 | char current_dest[1024]; /* Current destination */ |
| 269 | |
| 270 | |
| 271 | /* |
| 272 | * Make sure we have a username... |
| 273 | */ |
| 274 | |
| 275 | if ((user = getenv("REMOTE_USER")) == NULL) |
| 276 | user = "guest"; |
| 277 | |
| 278 | /* |
| 279 | * See if the user has already selected a new destination... |
| 280 | */ |
| 281 | |
| 282 | if ((job_printer_uri = cgiGetVariable("JOB_PRINTER_URI")) == NULL) |
| 283 | { |
| 284 | /* |
| 285 | * Make sure necessary form variables are set... |
| 286 | */ |
| 287 | |
| 288 | if (job_id) |
| 289 | { |
| 290 | char temp[255]; /* Temporary string */ |
| 291 | |
| 292 | |
| 293 | snprintf(temp, sizeof(temp), "%d", job_id); |
| 294 | cgiSetVariable("JOB_ID", temp); |
| 295 | } |
| 296 | |
| 297 | if (dest) |
| 298 | cgiSetVariable("PRINTER_NAME", dest); |
| 299 | |
| 300 | /* |
| 301 | * No new destination specified, show the user what the available |
| 302 | * printers/classes are... |
| 303 | */ |
| 304 | |
| 305 | if (!dest) |
| 306 | { |
| 307 | /* |
| 308 | * Get the current destination for job N... |
| 309 | */ |
| 310 | |
| 311 | char job_uri[1024]; /* Job URI */ |
| 312 | |
| 313 |
no test coverage detected