google / cloud-print-connector

Google Cloud Print Connector
BSD 3-Clause "New" or "Revised" License
764 stars 184 forks source link

User name is not displayed in print job name, even with cups_job_full_username set to true #414

Open remyfv-baret opened 6 years ago

remyfv-baret commented 6 years ago

connector is running on a W2012R2 server, using file in "C:\Program Files\Google\Cloud Print Connector\gcp-windows-connector.exe" --config-filename="C:\ProgramData\Google\Cloud Print Connector\gcp-windows-connector.config.json"

that contains { "local_printing_enable": false, "cloud_printing_enable": true, "cups_job_full_username": true, "fcm_notifications_enable": false, "xmpp_jid": "redacted@cloudprint.googleusercontent.com", "robot_refresh_token": "redacted", "proxy_name": "redacted", "printer_blacklist": [ "Fax", "CutePDF Writer", "Microsoft XPS Document Writer", "Google Cloud Printer" ], "log_level": "INFO" }

job names don't contain any user name of any kind, and I don't see why...

sicklittlemonkey commented 5 years ago

From the wiki: cups_job_full_username | Whether to use the full username (joe@example.cominstead of joe) to create CUPS jobs.

On Windows this username will be used in the "job user" field (which Windows displays as the "Owner"). The username doesn't get inserted into the "job name" (what Windows calls the "document name").

remyfv-baret commented 5 years ago

for what it's worth, the standard GCP connector does insert that into the job name, which is why I had opened this issue.

is there any way to do this ? our end-users like being able to distinguish which stored job is theirs that way.

sicklittlemonkey commented 5 years ago

By Standard GCP Connector, do you mean the one built into Chrome? If so, perhaps you could describe in a comment here the the exact "job name" format that it creates with the user name.

The change would be trivial, but it would be a feature request that the project owners would need to accept. Or you could build it with the change yourself if you're a programmer or you know one.

remyfv-baret commented 5 years ago

I mean this one : https://tools.google.com/dlpage/cloudprintservice

the format is simple, it just prepends the user mail address to the job name with a dash in between : [user@domain.tld - jobname]

I'll take a look at the code and see if I can change that myself.

sicklittlemonkey commented 5 years ago

Probably the best place to change it would be near line 373 where the username is changed in: \src\github.com\google\cloud-print-connector\manager\printermanager.go

func (pm *PrinterManager) printJob(
...
    if !pm.jobFullUsername {
        user = strings.Split(user, "@")[0]
    }
remyfv-baret commented 5 years ago

yeah finding the code wasn't hard, now I'll have to find some time to look up how to setup a go dev environment to compile this, learn how to do it, and then cross my fingers it works once I get there.

thanks anyway !