LDAP: Filtering using an Attribute that has a forward slash in its name - ldap

We have an LDAP system with an unknown number of users who have erroneously had a custom attribute added to their account which contains a forward slash in the name
I want to use our LDAP Browser to figure out how many of these entries there are.
The problem is that I cannot seem to construct a filter based on that attribute name because of the presence of that forward slash in the attribute name causes errors.
Trying something like this
Results in a "Search Failed" message in my LDAP Browser (It's a Radiant ONE Browser)
If I remove the forward slash and search again I get a "0 entries returned" message as would be expected since I am now searching on an attribute name that does not exist.
I have tried escaping using a backslash but this does not work either.

First, it depends.
As the "Radiant ONE Browser" probably also does some parsing to the values.
Only way I am aware you might is something like:
(sn//lastName=*)
Generally I would recommend that you fix the attribute within the schema these type of issues only seem to get worse down the road.

Related

Use category name in Sitefinity blog URL

I followed the instructions here on establishing a new provider and generating custom URLs, and it works as expected. There doesn't seem to be a clear reference for what parameters can be utilized in the settings as the example given is very basic.
I want to use the category name of the post in the URL. I tried:
/[Category]/[UrlName]
but what I got in the frontend was:
http://localhost:60327/my-page/Telerik.OpenAccess.TrackedList%601[System.Guid]/my-post-name
I also tried
/[Category.Title]/[UrlName]
which just threw errors.
Anyone know how to do this, or better yet, a good reference for the parameters?
I don't think this is possible since the Category property is actually a collection (TrackedList).
In theory you would need one of the collection items, let's say the first one, and your URL expression would be /[Category[0].Title]/[UrlName], but this is currently not supported by the expression parser.
Also, the idea of making the URL dependent on a complex (related) field is not a good idea. If someone deletes that category, they will break all your blog post URLs.
I would suggest you to create a custom text field for the blog post item (ex: CategoryUrl) and then you should be able to set the URL format to /[CategoryUrl]/[UrlName]. Make sure CategoryUrl field is required.

Is there a way to make Prestashop's Layared Filter Module to use query parameters instead of anchors (hashes)?

Is there any way to make the standart PrestaShop's Layered filters module to use URL parameters instead of anchors (the part after hash)?
I ment that I want the layered filter generate and accept the URLs like this (or maybe somehow diferrent, but the key is to use parameters and not to use hashes):
my-example-shop.ru/some-category/?color=red&size=xl
instead of this:
my-example-shop.ru/some-category#/color-red/size-xl
The reason is that the most of advertisment systems could add some parameters to the URL, but they usuaul add it directly to the end of the URL, and dont trying to analyze url structure and insert parameters to the right place.
So, as far as i see, the obvious solution is to avoid using hashes in url, using just query parameters, and to use history.pushState to change URL without refreshing whole page...
It seems obvious, usable, but I cant find any ready-to-use solution that do this such way, and I cant find even information about how does someone did it..
So the questions are:
is there any ready-to-use solution?
is there any described way to reach this by myself?
Thanks in advance.
UPD
All I found by myself for now is that such URLs could be accepted:
my-example-shop.ru/some-category/color-red/size-xl
my-example-shop.ru/some-category?selected_filters=/color-red/size-xl
BUT any filters changing causes using hashes again (afaik, hashed filters values overrides values passed via selected_filters parameter, so subsequent navigation just ignores selected_filters). In other words - I just can clear the entry URL, BUT I couldnt make URLs to be clean for subsequent navigation.
The change is very large.
You should create the override classes/Dispatcher.php
For filters instead you should edit the file: blocklayered/blocklayered.php
find function: getSelectedFilters()
Inside are two foreach, you should withdraw from the url "featured" fields that you need and compile the new array "$selected_filters"

LDAP Bad Search Filter

I'm using an open source software called LDAP Account Manager to manage ldap users, groups, and hosts for my company. I'm having a weird problem though, and I was hoping someone could give me an idea what's happening on the LDAP side of things as opposed to the actual software.
So here's the problem in a nutshell.
The software can find all users at the following suffix:
ou=Users,ou=Accounts,dc=xxxx,dc=com
When I try to view the details of one of these users, I get an error that says:
Bad search filter
Here's the weird part. When I add a new user, the entry appears with the other users at the same suffix.
ou=Users,ou=Accounts,dc=xxxx,dc=com
In other words, all of the users (the old ones that were already in the LDAP tree, and the new one I added, exist in the same place).
I can navigate to the new user at:
CN=User, Test,ou=Users,ou=Accounts,dc=xxxxx,dc=com
But I can't navigate to any of the existing users at this location (I get the Bad Search Filter error):
CN=Fakename, John,ou=Users,ou=Accounts,dc=xxxxx,dc=com
This seems inconsistent, and I'm trying to brainstorm what could be happening. The users exist in the same location, but I get an error when accessing some, but not others. Could this be a permissions issue, or is there something I am missing?
It sounds very much like your software has troubles encoding the , (comma) separating the name and the surname in the create command or in the search filter.

Google Custom Search automatic spell checking

We're having a problem with the automatic spell checking on queries in the XML results of the Google Custom Search.
Queries which are spelled incorrectly return results with the correct spelling e.g. socer becomes soccer and returns the correct results. On Google.com there is the option to then search for results on the original query using nfpr=1 in the query string. However this doesn't work in the Google Custom search, and I've been unable to find any other way to search for the incorrect spelling.
For a standard google search this behavior can be avoided by adding the argument &nfpr=1 to the query url.
For a custom search based on the AJAX API, this unfortunately isn't possible. The only way I've found is to use javascript to parse the user's query, then use a regular expression to put quotes around each single word that is not yet quoted. So for example, if the keywords received are
"bmw z4" manual
you would change that to
"bmw z4" "manual"
which has the same effect, except that it disables the auto-correction. Unfortunately if you want to deal with all the special cases of advanced logical syntax (AND, OR, |, -, etc.), your regexp gets a bit complex.
Myself, I just parse the response from Google to see if this is happening, and if so notify the user how to prevent it (by putting quotes around the offending word(s)).

yql and firebug xpath copy/paste returning no result

I'm trying to do a little bit of screenscraping of a 3rd party vendors bug tracking system (jira) where I can scrape the count/category of all the unresolved bugs. I want to put this info on our intranet so management can see it without going to the 3rd party site (which they don't have login credentials for).
I'm having problems getting xpath results back, though. Here's what I'm doing. Using Firebug, I select the DOM element I'm interested in and right-click "copy as xpath". Then I paste that into the YQL console, so I have something that looks like:
select *
from html
where url='http://username:password#jira.3rdparty.com/path/to/page_i_want.aspx'
and xpath='//*[#id="primary"]'
My JSON results come back null. If I remove the xpath in my query, I get back results. If I select other elements on the page, my JSON results come back null. If I start tweaking the xpath, say remove the last div in the path, I can sometimes get results, it just depends on what I've selected and what I've tweaked in the xpath.
Anyone know why I'm not getting any results doing the Firebug copy as xpath? I can't really say I'm an xpath pro :)
Edit: Actually, looking at the results I'm getting back with no xpath, it looks like I'm not authenticating. My username has an # and domain in it, so I log in via a browser with something like:
username#domain
password
YQL doesn't seem to like the #domain and \ escaping the # doesn't seem to work. Anyone have any ideas?
This will work as long as following criteria are met:
The module will only fetch HTML pages under 1.5MB and the page must also be indexable (e.g. allowed by the site’s robots.txt file.) .
Since it is behind a login, it's probably not indexable. The robots.txt is public, such as:
http://internet.com/robots.txt
For future reference, use double quotes to escape the commercial-at symbol:
'http://"username#domain:password"#jira.3rdparty.com/path/to/page_i_want.aspx'
Here are some resources:
Pipes XPath fetch page
Commercial-at Unicode