mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-07 09:06:03 +00:00
made tooltip support reusable.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2398 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
3372a3258d
commit
08e79738eb
5 files changed
+38
-14
No files matched your search
@@ -328,10 +328,23 @@ public class Functions {
|
||||
return Util.encode(s);
|
||||
}
|
||||
|
||||
public void adminCheck(StaplerRequest req, StaplerResponse rsp,boolean required) throws IOException, ServletException {
|
||||
public static void adminCheck(StaplerRequest req, StaplerResponse rsp,boolean required) throws IOException, ServletException {
|
||||
if(required && !Hudson.adminCheck(req,rsp)) {
|
||||
// check failed
|
||||
throw new ServletException("Unauthorized access");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Infers the hudson installation URL from the given request.
|
||||
*/
|
||||
public static String inferHudsonURL(StaplerRequest req) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append(req.getScheme()).append("://");
|
||||
buf.append(req.getServerName());
|
||||
if(req.getLocalPort()!=80)
|
||||
buf.append(':').append(req.getLocalPort());
|
||||
buf.append('/').append(req.getContextPath());
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user