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

Error on sync users #8

Closed gabrielemontano closed 5 years ago

gabrielemontano commented 6 years ago

On osticket 1.10.1 i've found an error on config.php line 324

url: "' . OST_ROOT . '/scp/sync_mldap.php?ajax=true",

fixed in

url: "/scp/sync_mldap.php?ajax=true",

but now i've got another error on sync_mldap.php when i click the button "sync users" on config page:

Fatal error: Class 'LDAPMultiAuthentication' not found in /data/upload/scp/sync_mldap.php on line 2

any suggestions?

jesusaristigueta commented 6 years ago

Having the same issue, can't figure out why it can't find it, it's a class in another file. Is it something related to PHP version? OS?.. Tested with Debian 9 (PHP 5.6), Windows 10 (Wamp3 w/ PHP 5.6 and PHP 7.0). Did clean installs always, and having issues with the table creation as well, I created them manually anyways.

Any help is very appretiated! Thanks.

philbertphotos commented 6 years ago

/data/upload/scp/sync_mldap.php This is a permission error... Let me check... its been a while since I used the sync button ... usually just let it do it automatically ... does it work when its done on its own?

jesusaristigueta commented 6 years ago

It doesn't work for me on its own either, I have the same errors in the PHP error log:

Fatal error: Class 'LDAPMultiAuthentication' not found in /data/upload/scp/sync_mldap.php on line 2

By the way I checked permissions. Did recursive 777 for the whole osTicket folder.

Help very appretiated! đź‘Ť And Thank you so much for your answer!

philbertphotos commented 6 years ago

Is the folder link accurate? Can you open the file in "data/upload/scp/sync_mldap.php" and verify it has data and not empty.

Sent from my iPhone

On Jan 10, 2018, at 11:22 AM, JesĂşs T. Aristigueta notifications@github.com wrote:

It doesn't work for me on its own either, I have the same errors in the PHP error log:

Fatal error: Class 'LDAPMultiAuthentication' not found in /data/upload/scp/sync_mldap.php on line 2

By the way I checked permissions. Did recursive 777 for the whole osTicket folder.

Help very appretiated! đź‘Ť And Thank you so much for your answer!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jesusaristigueta commented 6 years ago

The folder /data/ does not exist in my osTicket main folder, both Windows or Linux installs. The file sync_mldap.php is in OSTICKET_ROOT/scp/sync_mldap.php and of course in OSTICKET_ROOT/include/plugins/multi-ldap/sync_mldap.php

jesusaristigueta commented 6 years ago

Just checked, my previos comment. I copy&pasted the URI from @gabrielemontano my actual error is (installed in Windows):

PHP Fatal error: Class 'LDAPMultiAuthentication' not found in C:\wamp\www\scp\sync_mldap.php on line 2

jesusaristigueta commented 6 years ago

I also did a modification mentioned by @gabrielemontano about the line 324 in config.php

url: "' . OST_ROOT . '/scp/sync_mldap.php?ajax=true",

I removed the definition OST_ROOT so the sync button could work and actually request the syncronization. I had no response from the error mentioned before or any action or log at all of the plugin trying to work. After this modification, when the plugin is now capable of trying to do the sync, i get the error.

philbertphotos commented 6 years ago

Seems on windows the OSTROOT gets some extra crap... What error you get after the modifications?

Sent from my iPhone

On Jan 10, 2018, at 12:33 PM, JesĂşs T. Aristigueta notifications@github.com wrote:

I also did a modification mentioned somewhere about the line 324 in config.php

url: "' . OST_ROOT . '/scp/sync_mldap.php?ajax=true",

I removed the definition OST_ROOT so the sync button could work and actually request the syncronization. I had no response from the error mentioned before or any action or log at all of the plugin trying to work. After this modification, when the plugin is now capable of trying to do the sync, i get the error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jesusaristigueta commented 6 years ago

I get the same issue with OST_ROOT both in Windows and Linux. The error is always the same:

PHP Fatal error: Class 'LDAPMultiAuthentication'

philbertphotos commented 6 years ago

https://mediatemple.net/community/products/dv/204643880/how-can-i-create-a-phpinfo.php-page

Paste the "Apache Environment" remove any important information I need to see what the system is seeing. On Wed, Jan 10, 2018 at 01:51 PM, "Jesús T. Aristigueta" wrote: I get the same issue with OST_ROOT both in Windows and Linux. The error is always the same: PHP Fatal error: Class 'LDAPMultiAuthentication' — You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/philbertphotos/osticket-multildap-auth/issues/8#issuecomment-356681754), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACwiuoZ6YSIFmk15jTdfHPLo2DLdkMsGks5tJPiHgaJpZM4QnNNs).

jesusaristigueta commented 6 years ago

In Windows, this is my Apache Environment

`

Variable Value
HTTP_HOST localhost
HTTP_CONNECTION keep-alive
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
HTTP_ACCEPT_ENCODING gzip, deflate, br
HTTP_ACCEPT_LANGUAGE es-ES,es;q=0.9
PATH C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\12.0\DLLShared\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\PuTTY\;C:\Program Files (x86)\SecureCRT;
SystemRoot C:\Windows
COMSPEC C:\Windows\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR C:\Windows
SERVER_SIGNATURE
Apache/2.4.27 (Win32) PHP/5.6.31 Server at localhost Port 80
SERVER_SOFTWARE Apache/2.4.27 (Win32) PHP/5.6.31
SERVER_NAME localhost
SERVER_ADDR ::1
SERVER_PORT 80
REMOTE_ADDR ::1
DOCUMENT_ROOT C:/wamp/www
REQUEST_SCHEME http
CONTEXT_PREFIX no value
CONTEXT_DOCUMENT_ROOT C:/wamp/www
SERVER_ADMIN wampserver@wampserver.invalid
SCRIPT_FILENAME C:/wamp/www/info.php
REMOTE_PORT 2538
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /info.php
SCRIPT_NAME /info.php

Linux:

Variable Value
HTTP_HOST 192.168.0.245
HTTP_CONNECTION keep-alive
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE es-ES,es;q=0.9
HTTP_COOKIE OSTSESSID=oulot8h5itna9j6gqek0jnms81
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE
Apache/2.4.25 (Debian) Server at 192.168.0.245 Port 80
SERVER_SOFTWARE Apache/2.4.25 (Debian)
SERVER_NAME 192.168.0.245
SERVER_ADDR 192.168.0.245
SERVER_PORT 80
REMOTE_ADDR 192.168.101.15
DOCUMENT_ROOT /var/www/html
REQUEST_SCHEME http
CONTEXT_PREFIX no value
CONTEXT_DOCUMENT_ROOT /var/www/html
SERVER_ADMIN webmaster@localhost
SCRIPT_FILENAME /var/www/html/info.php
REMOTE_PORT 2574
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /info.php
SCRIPT_NAME /info.php

`

jesusaristigueta commented 6 years ago

Help :'( lol

philbertphotos commented 6 years ago

Lets try hard coding the ROOT.. hold.

philbertphotos commented 6 years ago

This very confusing to me. C:/wamp/www /var/www/html

jesusaristigueta commented 6 years ago

Okay, yes, I'm available to do any test :) The error is because the file sync_mldap.php can't find the class right? (LDAPMultiAuthentication) which is located in another file. But sync_mldap.php never makes any reference to it, so how it can see it? does it need an import, require or something? And those are just the directories for each system, in Windows I'm using Wamp, and thats the location for the files. Same stuff with Linux, the uri it's just different, but that's the root for Apache htmls

jesusaristigueta commented 6 years ago

Help again :'( lol

philbertphotos commented 6 years ago

Will you be available for testing tonight?

Sent from my iPhone

On Jan 29, 2018, at 12:12 PM, JesĂşs T. Aristigueta notifications@github.com wrote:

Help again :'( lol

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

dundee-81 commented 6 years ago

The issue is still occur. It seems that sync_mldap.php doesn't have refer to LDAPMultiAuthentication class defined in auth.php. Could someone help to resolve this problem?

shanept commented 6 years ago

The issue (at least in my configuration) is that it simply doesn't include the auth file. I've just started playing around with osTicket, but as far as I can tell there is no autoloading capabilities built in. The first two lines of sync_mldap.php are as follows:

<?php
class SyncLDAPMultiClass extends LDAPMultiAuthentication {

So how's it supposed to know where to find LDAPMultiAuthentication?

EDIT I have been playing around with this, starting to get it to work. I've looked over the history of the sync_mldap.php file and I'm actually confused as to how it actually did execute anything, as it seemed to only contain function and class declarations, however no code to call it. If anyone else understands otherwise, please let me know.

For now, I've forked the repo and you will be able to see my changes here

philbertphotos commented 5 years ago

This should be fixed in the most recent update.