philbertphotos / osticket-multildap-auth-plugin

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

sync_mldap.php PHP fatal error #61

Closed eamkrc closed 1 year ago

eamkrc commented 1 year ago

Hi, Thanks for helping fix the plugin for 1.16! After installing the new version of the plugin, we lost all access through the browser, the error log showed:

2022/10/25 11:52:05 [error] 8624#8624: *471 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot make non static method LDAPMultiAuthentication::getconfig() static in class SyncLDAPMultiClass in /var/www/html/osTicket/scp/sync_mldap.php on line 185" while reading response header from upstream, client: , server: , request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host:

We fixed it by modifying the sync_mldap.php file

diff /var/www/html/osTicket/scp/sync_mldap.php /var/www/html/osTicket/scp/sync_mldap.php.bak 
185c185
<   public function getconfig($id = '' , $_ = null) {
---
>   public static function getconfig($id = '' , $_ = null) {

Hope this helps. Best Regards, Rainer

philbertphotos commented 1 year ago

@eamkrc I think the issue there is the plugin is not updating the sync_mldap.php properly. Delete the file in SCP and allow the plugin to copy a new one and let me know.

philbertphotos commented 1 year ago

@eamkrc question did you do an uninstall and reinstall or a just a copy of the new version?

eamkrc commented 1 year ago

@eamkrc question did you do an uninstall and reinstall or a just a copy of the new version?

for 1.17 I did uninstall from the Admin Panel but that didn't delete the sync_mldap.php, so we moved it and let v1.17 plugin create a new one by itself, after that the error above started.

I did notice that the current repo sync_mldap.php file is 5 months old, do the other files modify the content when being installed in osTicket?

Best Regards, Rainer

philbertphotos commented 1 year ago

@eamkrc Hmmmm it seems I forgot to update the changes in sync_mldap.php thats totally my fault I dont usually need to change that file ... let me know if that does it (it should)

eamkrc commented 1 year ago

Got the new sync_mldap.php file working, Staff is being created , Thank You very much!

Just FYI, now "check connection" and "sync" buttons don't work

Check connection button error: 2022/10/26 13:38:22 [error] 8623#8623: *1948 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "sync" in /var/www/html/osTicket/scp/sync_mldap.php on line 3PHP message: PHP Fatal error: Uncaught Error: Class "LDAPMultiAuthentication" not found in /var/www/html/osTicket/scp/sync_mldap.php:16 Stack trace:

0 {main}

thrown in /var/www/html/osTicket/scp/sync_mldap.php on line 16" while reading response header from upstream, client: server: , request: "POST /scp/sync_mldap.php?check=true&plugin=multi-ldap HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "", referrer: "/scp/plugins.php?id=11"

LDAP Sync button just shows ERROR in the Browser Develepor Console

philbertphotos commented 1 year ago

@eamkrc yea those broke during all the changes will fix this in the next release.