ErikVB wrote
like John suggested, you could check for the tabpath, thats a public property of TabInfo, and if it starts with //admin it is reasonably safe to assume this is the admin menu.
My point was that it is possible to actually change the name of the admin root page now, which would change the tabpath value, so you can never be 100% sure. Alternatively you could check the authorizedroles property and not calculate friendly urls when the the only authorized role is the administrators role. That would mean that you would skip calculations for any page that is only accesible to administrators.. .not sure if that is what you want...
Erik is correct here : you could theoretically change the tab path for the admin pages. Probably more likely on ML sites : presumably they might like to modify this to a local language version of 'Admin'.
To fix my software, I'm putting in a configurable field called 'AdminPageName' which defaults to 'admin' but can be changed per-portal to different values. Thus 99% of the cases will work OK, but the edge case can also be handled with extra configuration.
I would say a simlar approach would be a useful addition to the site settings to specify which tab contains the root of the admin menu : thus every page below that could have the 'IsAdmin' value specified as 'true'. This would assist those developers making modules which cut across all pages in DNN, not just content-specific user pages. Things like skins with inline code, menus, providers, etc. There are many reasons to want to easily detect an admin page which have nothing to do with security.
I might develop a solution and put it up on Gemini but we'll see if it's well received or not.