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

First run configuration error #4

Closed EBS-DarkD closed 6 years ago

EBS-DarkD commented 6 years ago

I've done a clean install of v1.10 on to a debian lampstack with php 5.6.30 & MySQL 5.5.57 I'm initially trying to get the agents side to work as there are only 10 accounts but I have 2000+ users across a multidomain AD forest. When I try login with one of the agent accounts I get a screen saying 'First run configuration error' Looking in the logs it also states 'Unable to copy files' 'ldap login (username)' 'User authenticated on (domain)'

After reading the thread on the forum mentioning this error, I manually copied sync_mldap.php into the scp folder & restarted apache. Still got the same issue.

It then did a sync and I found the following error in the logs

First run configuration error. Unable to copy files
 DB Error #1054
[SELECT staff.username, ost_staff.email, ost_staff.phone, ost_staff.phone_ext as ext, ost_staff.mobile FROM ost_staff WHERE ost_staff.username IS NOT NULL] Unknown column 'staff.username' in 'field list'

 ---- Backtrace ----
 #0 (root)/include/mysqli.php(204): osTicket->logDBError('DB Error #1054', '[SELECT staff.u...')
 #1 (root)/scp/sync_mldap.php(361): db_query('SELECT staff.us...')
 #2 (root)/include/plugins/multi-ldap/auth.php(97): SyncLDAPMultiClass->check_users()
 #3 [internal function]: LdapMultiAuthPlugin->onCronProcessed(NULL, Array)
 #4 (root)/include/class.signal.php(98): call_user_func_array(Array, Array)
 #5 (root)/scp/autocron.php(69): Signal::send('cron', NULL, Array)
 #6 {main}
First run configuration error. Unable to copy files
 results
{"totalldap":1000, "totalagents":0, "executetime":"0:00:00.714"}
First run configuration error. Unable to copy files
 LDAP Sync
Sync executed on (August 10 2017 12:05 am) next execution in (August 10 2017 12:05 am)Total ldapusers: (1000) Total agents: (0) Total Updated Users: () Execute Time: (0:00:00.714)

Any pointers on getting this working as I a. don't trust my users to do things right if I let them register b. don't want to have to enter 2000 accounts manually

Cheers Andy

philbertphotos commented 6 years ago

Fixed this it seems I introduced the bug when making the update. its kills the syncing of Staff/Agent only... I corrected it. Turn off syncing for the Staff/Agents let me know if it works or update from github. I have a multiple Domains also with 30,000 plus users and it works and sync up like a CHARM.

Edit line #359 $qry_ostagents = "SELECT susername, " . "email, " . "phone, " . "phone_ext as ext, " . "mobile FROM " . TABLE_PREFIX . "staff WHERE " . "username IS NOT NULL";

EBS-DarkD commented 6 years ago

The updated files did the trick, I can now authenticate an agent with LDAP. Just need to work out why I get a 500 error when I login with the agent account now!

philbertphotos commented 6 years ago

GREAT I consider this closed. If you get a 500 error on ONLY one account then that is a different issue. Just check the PHP and Osticket Logs usually that means a duplicate agent email exists somehow. If that does not work open another issue and I will have a look at any log you post.