|
#21
|
|||
|
|||
|
ALL CREDITS TO jpastin! FIRST STEP First create a file userfind.php with the following content: PHP Code:
Copy the userfind.php to following path: osTicketRootFolder/scp/ SECOND STEP make the following modifications: File: include/client/header.inc.php. FIND ~10 PHP Code:
PHP Code:
THIRD STEP File: include/client/open.inc.php. FIND ~37 PHP Code:
PHP Code:
FIND ~119 PHP Code:
PHP Code:
FOURTH STEP File: include/staff/newticket.inc.php. FIND ~163 PHP Code:
PHP Code:
|
|
#22
|
|||
|
|||
|
I tried your version and it works !
The error in the jpastin's version came from the links in include/client/header.inc.php and in include/client/open.inc.php (you must add a point before scp/[...]). Thanks a lot guys ! Do you know how to display the caracted accents received from the AD ? If the username is "MARTIN Stéphanie", it displays "MARTIN St?anie" I tried to change the charset to iso-8859-1 in include/client/header.inc.php : Code:
header("Content-Type: text/html; charset=iso-8859-1\r\n");
[...]
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
[...]
<script type="text/javascript" src="./scp/js/bsn.AutoSuggest_2.1.3.js" charset="iso-8859-1"></script>
<link rel="stylesheet" href="./scp/css/autosuggest_inquisitor.css" type="text/css" media="screen" charset="iso-8859-1" />
|
|
#23
|
|||
|
|||
|
I think i have to rewrite the $user_info[$i-1]['displayname'][0] with the HTML Special Characters like é or è... in scp/userfind.php in this part of code :
Code:
if (!empty($_REQUEST['mail'])) {
$arr[]= "{\"id\": \"".$i."\", \"value\": \"".$user_info[$i-1]['mail'][0]."\", \"info\": \"".$user_info[$i-1]['displayname'][0]."\"}";
}elseif (!empty($_REQUEST['name'])) {
$arr[]= "{\"id\": \"".$i."\", \"value\": \"".$user_info[$i-1]['displayname'][0]."\", \"info\": \"".$user_info[$i-1]['mail'][0]."\"}";
}
|
|
#24
|
|||
|
|||
|
I tried the PHP function htmlentities() but it displays (in my example) Stéphanie in the input.
The html code is not decoded ![]() A solution seems to be in the charset but the iso-8859-1 doesn't work. I also loouk up in the bsn.AutoSuggest_2.1.3.js but i don't really understand the _b.AutoSuggest.prototype.createList function. Can someone help me ? Last edited by pti_breton; 03-09-2010 at 08:44 AM. |
|
#25
|
|||
|
|||
|
Great job JoseLuis. I didn't include line numbers because my setup is so hacked up they would be worse than meaningless. That will definitely help people out.
pti_breton: I'm not really sure how to make it deal with the special characters well. I would try UTF-8, hopefully that can handle it. Good Luck!! Last edited by jpastin; 03-09-2010 at 10:39 AM. |
|
#26
|
|||
|
|||
|
I found a workaround by disabling the accented characters in userfing.php
with strtr() function I hope i will find a real solution... |
|
#27
|
|||
|
|||
|
Don't forget that file encoding is also a "problem" I had some issues with encoding my national characters like "ãõêçÇ".
And solved by setting the php files to utf-8 in Notepad++ like:
|
|
#28
|
|||
|
|||
|
First of all I would say that this Mod is great and works perfectly.
Is there a way to supplement the modification so that even the phone number is read from the AD and placed in the appropriate field. Perhaps it there also the ability to view the login name in the select list ? I have already started a few experiments, unfortunately without success. Regards Schnarchnase |
|
#29
|
|||
|
|||
|
Hi guys, Im sure this is a great script when i can get it to work. I am trying to get this to work without success, i dont get any error messages its as there there is code in the file but nothing is happening with it. It wouldn't suprise me if its the domain string. I go to scp->tickets->new ticket, doesn't matter what i type in the name or email there is no popup box appearig to do auto fill.
Code: // Replace this with your AD Domain Controller $ds=ldap_connect('ldap://brg-inet.schools.mn.local:389/') or die("Couldn't connect to AD!"); //Replace this with a username that has read permissions on your AD $connect_u = "SCHOOLS.MN\brg.serviceaccount"; //Replace this with the password of the user $conect_p="*********"; //Replace this with the DN of the base OU you want to search $search_user_dn = "OU=Users,OU=BRG,OU=Lakes,OU=Schools,DC=Schools,DC =mn"; //STOP EDIT ======= Will it search the sub folders of the Users OU or do i need to specify each level? Code: = "OU=Admins,OU=Users,OU=BRG,OU=Lakes,OU=Schools,DC= Schools,DC=mn"; = "OU=Staff,OU=Users,OU=BRG,OU=Lakes,OU=Schools,DC=S chools,DC=mn"; = "OU=Library,OU=Staff,OU=Users,OU=BRG,OU=Lakes,OU=S chools,DC=Schools,DC=mn"; Is there some code i can place into a php script to test the connection? am using IE8 and Mozilla 2.0.0.14 How do we get it to do user login autentication is there another script for this? Last edited by brendan_hooper; 06-10-2010 at 11:12 PM. Reason: updated. |
|
#30
|
|||
|
|||
|
Mhh, I made every changes like in the tutorial above and i get following error message:
"Ajax error: 500" Any ideas? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|