Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-11172] Don't throw exception on /signup when not possible
- Loading branch information
1 parent
aa7f0a9
commit 277b177
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3560,7 +3560,11 @@ public void doEval(StaplerRequest req, StaplerResponse rsp) throws IOException, | |
* Sign up for the user account. | ||
*/ | ||
public void doSignup( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { | ||
req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp); | ||
if (getSecurityRealm().allowsSignup()) { | ||
req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
oleg-nenashev
Member
|
||
return; | ||
} | ||
req.getView(SecurityRealm.class, "signup.jelly").forward(req, rsp); | ||
} | ||
|
||
/** | ||
|
33 changes: 33 additions & 0 deletions
33
core/src/main/resources/hudson/security/SecurityRealm/signup.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!-- | ||
The MIT License | ||
Copyright (c) 2014 Daniel Beck | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
--> | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt"> | ||
<st:include page="sidepanel.jelly" from="${app}" it="${app}" /> | ||
<l:layout title="${%Signup not supported}"> | ||
<l:main-panel> | ||
<h1>${%Sign up}</h1> | ||
${%This is not supported in the current configuration.} | ||
</l:main-panel> | ||
</l:layout> | ||
</j:jelly> |
Causes [CID-1265590]. getView() may return null
https://scan5.coverity.com:8443/reports.htm#v10074/p10292/fileInstanceId=67265201&defectInstanceId=20514187&mergedDefectId=1265590