These are chat archives for PaperCutSoftware/PaperCutExamples

15th
Jul 2016
francispvps
@francispvps
Jul 15 2016 04:10
Hi Alec, was wondering if you can assist me again. Been a while since I've done C programming. Can you recommend a proper compiler for it. One that has the required header files. Im currently using TurboC/C++ from DOSBOX and I'm a bit struggling to find a working pwd.h, features.h and uclibc_config.h.
just want to compile the sample codes and see how it works
Alec Clews
@alecthegeek
Jul 15 2016 04:40
The code that we supply in the example is for UNIX
You will need to modify for Windows
Or you can use a proper operating system :trollface:
You could install Cygwin and gcc -- that would probably work
Alec Clews
@alecthegeek
Jul 15 2016 04:48
But I'd suggest that your final version should be a Windows native application and not rely on an emulation layer
gcc for Windows can be installed via the following project http://www.mingw.org/
the MinGW gcc compiler produces Windows native applications that do not depend an emulation layer.
YMMV of course
francispvps
@francispvps
Jul 15 2016 06:02
Thanks for this, I'll have a look. Our Papercut Server would most likely be a Windows box.
Should I develop something native from scratch, do you have a more detailed documentation on the custom program. I mean the Case Study only indicated the standard input, output or error but Im wondering about what happens behind that.
Alec Clews
@alecthegeek
Jul 15 2016 06:06
No, sorry
It depends on what is being used as the back end
francispvps
@francispvps
Jul 15 2016 06:07
...or which library does it call when I say for example.... i run the function... "is_user_in_group"
Alec Clews
@alecthegeek
Jul 15 2016 06:08
That depends on what the back end is. It will depend on your user management and auth software
Alec Clews
@alecthegeek
Jul 15 2016 06:53
So if you look at our rather simple sample code we are assuming this is running on a UNIX system and we can use UNIX lib calls. So your code will need to be different
This is UNIX/Linux specific code
francispvps
@francispvps
Jul 15 2016 07:27
ok seems I have to build our own. I'm just trying to divine how PC would understand my code... i mean if I put methods like, is_valid(), is_user_in_group() is that how it works... is PC simply looking for these methods?
or do I have to follow a certain format just like the payment gateway
Alec Clews
@alecthegeek
Jul 15 2016 07:29
No. You need write a a comand line program that PaperCut can execute and read the stdout. As explained in the KB article
francispvps
@francispvps
Jul 15 2016 07:31
yes I do get that part
so for example "MyCustomUserProgram.exe - all-users " could mean that i have to create a function switch that would connect to our back end and pull all user data? or connect to PaperCut NG and pull out all user data?
Alec Clews
@alecthegeek
Jul 15 2016 07:33
The former
francispvps
@francispvps
Jul 15 2016 07:37
... so this method is a view directly from our back-end right and not papercut
Alec Clews
@alecthegeek
Jul 15 2016 07:37
Yes
PaperCut needs the information
francispvps
@francispvps
Jul 15 2016 07:39
and this right here "username\tfullName\temailAddress\tdepartment\toffice\tcardNumber\n" is the output format read by PaperCut... correct?
Alec Clews
@alecthegeek
Jul 15 2016 07:39
yes
Experiment
francispvps
@francispvps
Jul 15 2016 07:41
so as long as I pass the format "username\tfullName\temailAddress\tdepartment\toffice\tcardNumber\n" it would be displayed in PaperCut NG users? correct?
Alec Clews
@alecthegeek
Jul 15 2016 07:57
Looks correct
I'm off for the weekend
francispvps
@francispvps
Jul 15 2016 08:01
I think I understand it a bit now... hey I know my questions are a bit trivial but its necessary for me to get the picture... and I appreciate the help and patience
thanks