Mediawiki to display different links to different geographic locations - mediawiki

Scenario: An intranet site is accessed from two different countries through different site names. We use mediawiki as knowledge base and wish to reference this intranet site. mediawiki is used by teams in both countries.
Currently we are providing two different URLs in the wiki. example:
Country one: ur1.in.intranet\hello\world
Country two: ur1.en.intranet\hello\world
Problem: How do we ensure that the correct (accessible) intranet site address is presented to the person accessing from each country?
I have tried to find information using wiki templates. Say, while authoring, all users must use a specific template {{Intranet_Page | < URL >}}
In the template, a code could check the IP of the accessing user and determine which site name has to be used. I was unable to find the right special word for finding the IP. :(
Is there any way... PHP modifications / Templates / others?

It's not quite clear what you want. If I understand correctly you want a wiki page to contain a link to an external website, which exists in multiple variants depending on country. The page should be served to the visiting user with the link rendered in the correct country variant.
This is similar to the issue of linking a translatable page but redirecting the user to the user's (interface) language's subpage thereof. To do so, MediaWiki core provides Special:MyLanguage, a redirect special page.
A redirecting special page is the easiest solution for such issues because:
the page HTML doesn't need to vary based on each parameter (in your case country) but can be cached identical;
you gain a canonical URL for the resource, which is the same for everyone to link and yet brings everyone to the correct variant.
See https://www.mediawiki.org/wiki/Manual:Special_pages on how to make a special page and https://www.mediawiki.org/wiki/Extension:GeoIP or similar to extract country from IP.

Related

Display a different URL for a subdomain

I've developed an application that a client might access at a URL like this: http://example.com. In this case, I own and control http://example.com.
I now have a case where another company would like present my application as their own by changing some of the branding and the URL (say: http://companyx.com). The application and all the data will still remain hosed with me just like it was at http://example.com.
What's the best way to handle this? I was going to create a separate directory for this company so I can update the branding (mainly just a logo) to make it specific to them, but I'm not sure how I can make this directory accessible to people going to a directory on the company site (http://companyx.com). Using sub-domains is also an option if this makes it easier. Assume that I'll be able to add records to companyx.com's DNS, etc.
You need to create a separate directory, then create a subdomain at sub.example.com and point it to directory (you can do this from your hosting control panel). Now your company needs to point their desired url (within their domain) to your subdomain.
IMHO this is the cleanest solution, if you need to have control over the site's content.
edit
what company needs to do is to point cname record of domain to your url and it should work, (otherwise you will need to get separate ip for your subdomain in order to point A record there)

Finding the list of all subdirectories in a link

Is there any way that I can find all subdirectories for one link? Should I get the permission? For example, in the lecture instructor opened the solutions by entering some keywords after www.site.com/keyword. Now I cannot remember the word, whatever I try, I cannot find, but I know there is a file. That's why I want to see the files, other pages for the link.
The only way to find out what resources are available on an HTTP server is to request a resource that tells you. There isn't anything particularly standard about web servers that will provide that, so you'll need to do something specific to the webserver you want the details from.
Note that not all servers will provide something like this.
The closest thing to a standard is that most servers, for a URL that maps on to a directory on their file system, if there isn't an index file in that directory, will generate an HTML document containing a list of links to the resources in that directory.

How to modify the lotus notes hyperlinks from Sharepont Search

I'm able to crawl lotus notes databases and have the results appear in my search results using sharepoint search server.
The problem I'm having, though, is that the results contain links that send me to a blank lotus notes document.
In sharepoint I have defined my content source as C:\lotus\notes\databases\ where all of my databases are stored. After a full crawl I can do a search and my results appear this way:
notes://domino_server/database.nsf/($defaultview)/<document_id>
I've narrowed my issue down to being the ($defaultview) included in the link.
My questions are, where is this value coming from, and how can I change the results and links being provided?
Some of my research has stated that I want to modify the html web part, but I have no idea how to do that or where to do that.
You have to set one view to "default view" in your Notes database. It works like an index of all documents in database.

Differentiate between types of open graph object pages

One of our applications uses open graph tags so that when users like or comment on a page, the resulting feed story is rich with content, images etc.
Another part of our application (the web platform side) allows users to connect to a Facebook profile page so they can manage the wall, add apps to their profile page etc.
Trouble is, by calling /me/accounts, you get all open graph objects that user has rights to and not just the proper profile pages.
Is there any way to differentiate between types do the users don't have potentially thousands of pages to sift through when they want to connect to their profile page? For example, in Facebook, if I click "Use Facebook as a Page" in the top right drop down, that list is filtered to be just the profile pages and not every single open graph object I'm considered an admin for. How can we get just that list of pages?
you can use FQL for that, the following query should give you relevant info:
SELECT page_id, type
FROM page_admin
WHERE uid=me()
AND type="COMPANY"
hope this helps

Protected Pages in MediaWiki

I am currently using MediaWiki as a documentation website, with login authenticated by LDAP.
However, we have hit a snag. Certain pages contain sensitive information. For example links that say "click here to log in". I would like to be able to protect certain pages from being edited by just anyone. I would like to allow certain groups of users (like employees) to edit those pages.
How do I set up page protection by group in MediaWiki (if it is possible)?
This is well-covered in the MediaWiki docs:
In addition the page protection options Andy Lester linked to you can also setup site wide protection against account creation and anominous editing. See MediaWiki Manual:Preventing access