Please make the following change:

In the file login.php change the line

$tmp_user=trim($tmp_email);

to

$tmp_user=$tmp_ht;

This change uses the email from the db instead of the one ldap returns. That hopefully fixes your issue.

Will this cause any problems with other new users?

No, the code from line 55 to line 85 of the login.php only applies for users that already have tickets.

Thank you for all your help everything works great!!

Thanks for the bug report and helping with testing.

12 days later

hi, sorry in advance for this stupid question...

how to use this mod??

I have downloaded it and replace all of the files into my current, then the website just blank.. :

Sorry again.

@[deleted]

hello omgkenny,

Did you install any other mods that modify these files? If so then simply overwriting will break things. You could try to get some error output by setting the following lines in main.inc.php

ini_set('display_errors', 0);

ini_set('display_startup_errors', 0);

to

ini_set('display_errors', 1);

ini_set('display_startup_errors', 1);

If there are any errors, they should show after this change.

@omgkenny

hello omgkenny,

Did you install any other mods that modify these files? If so then simply overwriting will break things. You could try to get some error output by setting the following lines in main.inc.php

ini_set('display_errors', 0);

ini_set('display_startup_errors', 0);

to

ini_set('display_errors', 1);

ini_set('display_startup_errors', 1);

If there are any errors, they should show after this change.

it showed this error :-

Parse error: syntax error, unexpected T_DNUMBER in /var/www/html/support2/include/class.staff.php on line 105

here is the line :-

105-106 :-

$ds=ldap_connect(10.180.200.250) or die(_("Couldn't connect to LDAP!"));

$domain="uid=zimbra".$this->username.",ou=admins,dc=zimbra,dc=zimbra";

thats strange, class.staff.php shouldn't contain anything like that. The error is thrown because the first parameter of ldap_connect isn't a string. You can look (here) for a reference.

thats strange, class.staff.php shouldn't contain anything like that. The error is thrown because the first parameter of ldap_connect isn't a string. You can look (here) for a reference.

kinda blurry.. im not so good with codes..

how to use the hostname via ip? :

Well, that depends.

But first, why the code in class.staff.php? You don't have to code the connection. If you go to scp->adminpanel->settings there is a ldap register. You can set everything there.

If you insist on modifying code, you'll have to ask yourself a few questions. Do you want to connect with ssl encryption or not? Do you want to use user@domain or do you want to use rdn to bind?

Well, that depends.

But first, why the code in class.staff.php? You don't have to code the connection. If you go to scp->adminpanel->settings there is a ldap register. You can set everything there.

If you insist on modifying code, you'll have to ask yourself a few questions. Do you want to connect with ssl encryption or not? Do you want to use user@domain or do you want to use rdn to bind?

go to "scp --> admin panel --> settings" is by log in into the osticket ?? ::

i cannot log in into the osticket, when i type my ticket address, it only shows the earlier error mentioned.

as for the question given, connect with ssl and want to use user@domain.

Then another question from me. Do you have any other mods installed?

The error you've mentioned doesn't originate from the ldap_mod_v8.zip. The files in there do not contain any hardcoded ip adresses. class.ldap.php does all the ldap connections so there can't be any in class.staff.php. To be sure i've searched for the string '$ds=ldap_connect' in the modded files, and not one of them contais it.

I'd suggest you do a rollback and try to apply this mod again.

Also make a backup of your database and files before you apply any mods.

Then another question from me. Do you have any other mods installed?

The error you've mentioned doesn't originate from the ldap_mod_v8.zip. The files in there do not contain any hardcoded ip adresses. class.ldap.php does all the ldap connections so there can't be any in class.staff.php. To be sure i've searched for the string '$ds=ldap_connect' in the modded files, and not one of them contais it.

I'd suggest you do a rollback and try to apply this mod again.

Also make a backup of your database and files before you apply any mods.

nope. no other mod installed.

Then do the following:

Backup the include/ost-config.php. It contains the mysql access configuration.

Delete all the files of your osticket installation.

Redownload osticket 1.7 and make a clean install.

Redownload the ldap_mod_v8.zip (It has the MD5 hash CBCF07A5B862C698E4EA6C879E0CF642)

Extract the files in the .zip, then overwrite the osticket folder with the contents

Expected behaviour after installing the ldap mod:

It'll create another table in your mysql db to save your ldap settings

If you didn't configure anything in ldap osticket will behave like a vanilla installation. (except another category in settings)

NOTE: If you want to add staff members you'll have to add them the traditional way first and make sure the username is exactly the same as the one in your ldap server. You'll essentially login two times when using ldap, first via ldap then in osticket. This allows to you to use the osticket passwords as well as a ldap based login at the same time.

OK. Will do.

I will update to you the output later.

Thanks.

====================================================================================

updates :-

after creating the new ldap connection, then i used the ldap diagnostic and this error

Result: Leave empty to use the Administrator in LDAP Settings

calling ldap_connect with: "10.180.200.250" and port "389"

setting LDAP_OPT_PROTOCOL_VERSION to 3 and LDAP_OPT_REFERRALS to 0

using rdn for binding

binding to ldap with "uid=zimbra,cn=admins,cn=zimbra" and his password

using the filter: "(&(sAMAccountName=zimbra))"

calling ldap_search with the domain: "DC=silk,DC=my", the Filter: "(&(sAMAccountName=zimbra))" and the Attributes: "array("zimbraAccountStatus")"

-------

what i entered in the field and username is zimbraAccountStatus & jesper

Authorization working, but login does not proceed

I've got the mod installed, and the diagnostic works.

I can give osticket credentials, and if they are wrong, it will say they are wrong, but if they are correct then it just stays at the login screen.

Any thoughts? I was thinking that it might have something to do with the PHP_AUTH_USER setting, but I'm unsure.

Then do the following:

Backup the include/ost-config.php. It contains the mysql access configuration.

Delete all the files of your osticket installation.

Redownload osticket 1.7 and make a clean install.

Redownload the ldap_mod_v8.zip (It has the MD5 hash CBCF07A5B862C698E4EA6C879E0CF642)

Extract the files in the .zip, then overwrite the osticket folder with the contents

Expected behaviour after installing the ldap mod:

It'll create another table in your mysql db to save your ldap settings

If you didn't configure anything in ldap osticket will behave like a vanilla installation. (except another category in settings)

NOTE: If you want to add staff members you'll have to add them the traditional way first and make sure the username is exactly the same as the one in your ldap server. You'll essentially login two times when using ldap, first via ldap then in osticket. This allows to you to use the osticket passwords as well as a ldap based login at the same time.

ok.. discard the above error.

already can get it working with the diagnostic.

now i want to know how to log in for staff.

as now we want current users in the ldap server (zimbra) can access into the osticket via /scp and without manually create the username in the osticket itself.

@[deleted]

Please change the following line in the file login.php

$tmp_user=trim($tmp_email);

to

$tmp_user=$tmp_ht;

That should fix your issue.

@[deleted]

You have to create the users for scp in osticket first. I can't work around that, since there are other checks for the username in osticket (the username must exist in the database). You could try to batchcreate the users with sql, but i can't help you with that.

Also, please apply the patch mentioned above.

Thane,

My login.php is like this

OST||(LDAP:()&&LDAP:()&&(isset($_SERVER)&&$_SERVER!=""))) {

$tmp_user=trim($_POST);

$tmp_pw=trim($_POST);

so how do i change it?

@[deleted]

There is a line (it should be line 59) in login.php with the content

$tmp_user=trim($tmp_email);

you search for it in the login.php and replace the complete line with

$tmp_user=$tmp_ht;