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

ldap sync copy failed #25

Closed NoobAdmin430 closed 3 years ago

NoobAdmin430 commented 5 years ago

I have installed the plugin and did the setup, however, osTicket log keeps showing "ldap sync copy failed" when I mouse over the error it says "C:\xampp\htdocs{sitename}\include\plugins\mult-ldap/sync_mldap.php"

I have opened the error logs for PHP and get the following:

[Tue Jan 22 10:33:34.924007 2019] [:error] [pid 3036:tid 1972] [client ::1:59067] PHP Warning: include_once(C:/xampp/htdocs/Support/include/scp/sync_mldap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\Support\include\plugins\multi-ldap\auth.php on line 68, referer: http://localhost/support/scp/index.php

[Tue Jan 22 10:33:34.924007 2019] [:error] [pid 3036:tid 1972] [client ::1:59067] PHP Warning: include_once(): Failed opening 'C:/xampp/htdocs/Support/include/scp/sync_mldap.php' for inclusion (include_path='./;C:/xampp/htdocs/Support/include/;C:/xampp/htdocs/Support/include/pear/;phar://C:/xampp/htdocs/Support/include/plugins/auth-ldap.phar/include') in C:\xampp\htdocs\Support\include\plugins\multi-ldap\auth.php on line 68, referer: http://localhost/support/scp/index.php

I have tried deleting the plugin and reinstalling it and I have verified the "sync_mldap.php" file is in the /scp folder.

I'm running osTicket 1.10.4 with PHP version 5.6.39. This is running on a Windows Server 2016 box with Xampp. If you need any other information, I'm happy to provide it.

philbertphotos commented 5 years ago

Copy "sync_mldap.php" manually to "C:/xampp/htdocs/Support/include/scp/" It seems there is a problem with the script and windows systems. I will have to create a gracefully way to check so the plugin lets the user know what the issue is.

NoobAdmin430 commented 5 years ago

OK, so I didn't have a /include/scp directory at all so I created one and placed the file in there. The /scp directory is set as "C:/xampp/htdocs/Support/scp" by default. However, I'm getting another error message in the PHP logs now:

PHP Fatal error: Cannot redeclare class SyncLDAPMultiClass in C:\xampp\htdocs\Support\include\scp\sync_mldap.php on line 507, referer: http://{Server}/support/scp/logs.php

The osTicket log is showing the same error above:

"ldap sync copy failed" when I mouse over the error it says "C:\xampp\htdocs\Support\include\plugins\mult-ldap/sync_mldap.php"

philbertphotos commented 5 years ago

sorry its supposed to be in "C:/xampp/htdocs/Support/scp/"

NoobAdmin430 commented 5 years ago

OK, but I think it's looking for stuff in "C:/xampp/htdocs/Support/include/scp/". After I copied the "sync_mldap.php" file to "C:/xampp/htdocs/Support/include/scp/" and I uninstalled the plugin, the file disappeared. I think something is trying to look for the file in the wrong place. I'm just not sure what or where.

NoobAdmin430 commented 5 years ago

In fact the more and more I look at things I think my issue and issue #24 are the same. I don't mean to make it seem like I know what is going on, just trying to help in any way possible. I really do appreciate the time you have placed into this and can't wait to get it working :)

philbertphotos commented 5 years ago

Will look at the code and maybe do a windows install to see why it messes up on windows. Bother me all you like its a good thing becasue I want to get rid of these stupid bugs.

NoobAdmin430 commented 5 years ago

OK, I messed with this for about 8 hours for as much as I understand PHP (which isn't a lot) and I cannot get past the error:

PHP Fatal error: Cannot redeclare class SyncLDAPMultiClass in C:\xampp\htdocs\Support\include\scp\sync_mldap.php on line 507, referer: http://{Server}/support/scp/logs.php

I'm not sure what's going on, but hopefully you or someone more proficient in PHP can figure it out.

niphint commented 5 years ago

Here is what I did: auth.php, from row 268:

function loadSync() { $sql = 'SELECT * FROM ' . PLUGIN_TABLE . ' WHERE isactive=1 AND id=' . db_input($this->getId()); $source = MULTI_PLUGIN_ROOT . 'sync_mldap.php'; //$file = $_SERVER["DOCUMENT_ROOT"] . OST_WEB_ROOT . 'scp/sync_mldap.php'; $file = 'C:\xampp\htdocs\helpdesk\include\plugins\multi-ldap\sync_mldap.php';

I commented the $file out, there is something wrong with that. it has to lead to the plugin sync_mldap. After that everything worked.

NoobAdmin430 commented 5 years ago

niphint,

I tried what you suggested and while I'm no longer getting any error messages, I'm also not getting the sync to work at all. It is not showing that the sync completed or even attempted to run in the logs.

niphint commented 5 years ago

Did you found a solution @NoobAdmin430 ?

philbertphotos commented 3 years ago

Is this still an issue with the updates?

philbertphotos commented 3 years ago

This has been fixed with the new version I suggest you update.