From: Victor Wagner Date: Tue, 25 Mar 2008 12:49:57 +0000 (+0000) Subject: DEbugged getUserRights X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=a0981d6fc522fd2073145598eacb0023bb06d364;p=oss%2Fstilllife.git DEbugged getUserRights --- diff --git a/templates/basicset/page.js b/templates/basicset/page.js index e10791b..9eca966 100644 --- a/templates/basicset/page.js +++ b/templates/basicset/page.js @@ -53,7 +53,7 @@ function showUser(username) { links[i].href=userListUrl+"/" + username; } links[i].appendChild(document.createTextNode(username)); - links[i].className = status; + links[i].className = userStatus; } else if (links[i].href.substring(0,forumScriptUrl.length)== forumScriptUrl && links[i].href.indexOf("login=")!=-1) { while (links[i].childNodes.length>0) { @@ -74,24 +74,27 @@ function getUserRights(user) { var status="user"; var xhr=getXMLHttpRequest(); if(!xhr) return status; - + // Strip http:// prefix from OpenID url + if (user.substring(0,7) == "http://") { + user=user.substring(7,user.length); + } var hr=location.href.match(/^\w+:\/\/[^/]*\/([^?#]+)/); if(hr==null) return status; var depth=hr[1].split(/\//).length; - var re=new RegExp("\n\[\s*(admins|moderators|banned)\s*\]\s*[^[]+\n"+user+"\n","m"); + var re=new RegExp("\n\\\[\s*(admins|moderators|banned)\s*\\\]\s*[^[]*\n"+user+"\n","m"); for(var path="",i=0;i