philbertphotos / osticket-multildap-auth-plugin

Plugin for OS Ticket that allows for authentication with multiple domains.
GNU General Public License v3.0
28 stars 16 forks source link

Sync not working with ost 1.17.4 #72

Closed Fe3lApAcUt closed 3 months ago

Fe3lApAcUt commented 1 year ago

Hey @philbertphotos Hope you're doing great! I think the sync function is not working since I last tried osTicket again after a few months of abstinence. I'm using your latest version and ost 1.17.4.

Is there an easy fix to get this to work correctly?

Best regards Marcel

malti1984 commented 1 year ago

Hey @philbertphotos

i install today your Plugin on my new osTicket System (V 1.18) and i have the same same error/issue as Marcel.

Thanks for the help.

Best regards Andreas

philbertphotos commented 1 year ago

Hmmm @Fe3lApAcUt lots of strange problems ... this update should be rock solid since I updated and fixed so many bugs. I worked on this extensively and the changes in 1.18 would not cause a single issue. LDAP_SYNC only updates if they user is create or login via the plugin.

Turn on logs ... I need to see what it says when a user tries to login. Did you do the connect test? What about the LDAP string any special characters?

philbertphotos commented 1 year ago

I am wondering if you upgrading a current copy or a test version of osticket.

malti1984 commented 1 year ago

With Logs do you need?

for me it doesn't matter what I enter, for example, on the ldap server (i put a other ip), Connect Test says OK.

what i must add for the cronjob, i don't understand this point sorry :)

philbertphotos commented 1 year ago

@malti1984 Logs here image PHP Logs and CRON LOGS if its separate from php log

philbertphotos commented 1 year ago

Yours woudl say "user login" since I have a new version that has some new features that I am still testing before release but its built off this base. I the connect says ok the LDAP is working (need to fix it so it shows all domains) The issue is the LDAP search if its the default then they should be no issues.

philbertphotos commented 1 year ago

Ok for got I updated the ldapclass ... it could be the reason it was not working properly but unlikely. In any case up date to that one and let me know.

malti1984 commented 1 year ago

Hello, thanks for the help :-)

User creation ist working after the user logs in manually. Wan't sync the agents or user on my page.

Can you tell my, how i start the sync user manually? And how i add the cron job for the sync? I don't understand this :)

on my config - every time i save, it's the same time grafik

that's my sysmtelog, after saved config. That's all: grafik

when i try to login manually - i checked out "Register staff member to be registered automatically" grafik

Thanks alot

philbertphotos commented 1 year ago

Looks like the logs are doing GREAT and users are able to login. The issue is that you need to turn on Cron Jobs in OSTICKET I can see its updating the schedule but nothing is changing last scheduled time as a test change the schedule to "1 minute" or "5 minute" or any where in between for testing instead of waiting for a day.

It will fill up the logs so only do it for an hour and check what is happening.

image

I have my cron jobs in Osticket running every minute but my environment is very very active. https://www.easycron.com/cron-job-tutorials/how-to-set-up-cron-job-for-osticket https://gist.github.com/snowyTheHamster/46e165350f77d59d9a55f558c9a51947

malti1984 commented 1 year ago

Thanks, so i add the CronJob and the CronJob is running without errors.

The NEXT and LAST Schedule have the same TIME and DATE. Then i check the php files and see that you look at the ost_config table. there you search for sync_data and namespace (PLUGIN ID, INSTANCE ID).

on my installation (new installed with 1.17.4 and your plugin): grafik There ist no NAMESPACE on the SYNC_DATA line.

Then i change the line and now i see that the time has changed: grafik

Sync are running: grafik

But no Agents where created?!

any idea?

thanks for your help

philbertphotos commented 1 year ago

Agents are not automatically created during sync (not until the next release) An agent can be created during login or manually created and they sync when changes in AD is detected. As for plugin instance on the sync_data ... that is a GREAT catch now I have to find out why that was not created properly. Very strange that should have been fix. That is DEF a bug.

malti1984 commented 1 year ago

Ok thanks, then i test the next day's the User SYNC. I install a new Debian Server and try it. At the moment, no SYNC works on my Apache2 Server with PHP 8.0.

I see the User's when i search it under Users, but in the OSTicket Log i don't see the LDAP Sync. Very strange, It show's the LDAP-Sync once.

I give you a feedback tomorrow

philbertphotos commented 1 year ago

This is me ... my environment is about 20 thousand users. So email like this is a regular occurrence. image

philbertphotos commented 1 year ago

Best thing to do is to change the schedule that way you can tell it worked with out wating for the next day. For testing I just tell it 5 minutes then change it back after it executed a few times.

malti1984 commented 1 year ago

I change the sync an crontab to 2 minutes, but no sync and no email. I will try it tomorrow with a fresh installed osTicket Version.

malti1984 commented 1 year ago

For me: the sync create User automatically or only when users Login First time? Like Agents?

Should i set to private Mode or Public in Settings?

philbertphotos commented 1 year ago

@malti1984 Syncing does not create a users it just updates existing accounts based on AD . For instance if I change the user name or other information it will get what ever is AD and overwrite OSTICKET. Ina future version it will import users not in OSticket from AD but personally I dont need this feature since users are automatically created when the login for the first time.

philbertphotos commented 1 year ago

@malti1984 modes no longer matter. I found a way around this and it creates users regardless what setting you have and yes ... only when user login for the first time.

malti1984 commented 1 year ago

@philbertphotos Sorry for my many Messages, but something won't work on my new installed osTicket with the Plungin. osTicket-Version: 1.18 phpVersion: 8.2.8 new Debian 12 apache2 server

when i "Enable user synchronization" grafik

i become this error in the cli of my debian - execute cron.php grafik

when i "disable user synchronization" and only "Enable agent synchronization" the LDAP-Sync is showing in the "System Logs". grafik

I can Login with LDAP Users and Agents, but the Update Sync will not work. - no E-Mail, no Sync. Only Add new Users with SignIn.

Thanks for your help

philbertphotos commented 1 year ago

@malti1984 I looking at this bug.

flimby1 commented 1 year ago

Hi, I have Sync problem too with the plugin on OsTicket 1.18. I configured all and seems all correctly but I don't receive any Log on the system and also no email

philbertphotos commented 3 months ago

@flimby1 FIXED