diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index 858580ed948461970485befc89fb00bc78642a12..141bac16fc0cd74cd05237c3c4e8f1a3048bb9c5 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -88,6 +88,7 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import org.kohsuke.stapler.interceptor.RequirePOST; /** * Base implementation of {@link Run}s that build software. @@ -1360,6 +1361,7 @@ public abstract class AbstractBuild

,R extends Abs * * @since 1.489 */ + @RequirePOST public synchronized HttpResponse doStop() throws IOException, ServletException { Executor e = getExecutor(); if (e==null) diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index f1842002db0424985bbc4efa338b05ed3db5377b..e0a0007b7003fd101bf2b9b20b6fdbd0c573b0ed 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -1838,6 +1838,7 @@ public abstract class AbstractProject

,R extends A /** * Cancels a scheduled build. */ + @RequirePOST public void doCancelQueue( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(ABORT); diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index 6a7c26c000d553e362e7fc3f2f617f986a819db1..ee4eddec365ddfe6277b1e8af73a5ce1ff6841e8 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -57,6 +57,7 @@ import java.lang.reflect.Method; import static hudson.model.queue.Executables.*; import static java.util.logging.Level.FINE; +import org.kohsuke.stapler.interceptor.RequirePOST; /** @@ -468,6 +469,7 @@ public class Executor extends Thread implements ModelObject { * @deprecated as of 1.489 * Use {@link #doStop()}. */ + @RequirePOST public void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { doStop().generateResponse(req,rsp,this); } diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 3ff6bc7db9b685ab2a86b1c4b8a94c2233fcb623..f1a852d6dcd5b15714bca18ad98f43e45ce8b609 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -106,6 +106,7 @@ import org.kohsuke.stapler.export.ExportedBean; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter; import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.interceptor.RequirePOST; /** * Build queue. @@ -612,6 +613,7 @@ public class Queue extends ResourceController implements Saveable { /** * Called from {@code queue.jelly} and {@code entries.jelly}. */ + @RequirePOST public HttpResponse doCancelItem(@QueryParameter int id) throws IOException, ServletException { Item item = getItem(id); if (item != null) { @@ -1435,6 +1437,7 @@ public class Queue extends ResourceController implements Saveable { /** @deprecated Use {@link #doCancelItem} instead. */ @Deprecated + @RequirePOST public HttpResponse doCancelQueue() throws IOException, ServletException { Jenkins.getInstance().getQueue().cancel(this); return HttpResponses.forwardToPreviousPage(); diff --git a/core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.jelly b/core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.jelly index c368425e8e37ca42421eef100ef0e030c7ed3fe8..2c9f091bffb488e0da22804a85525388ccf60158 100644 --- a/core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.jelly +++ b/core/src/main/resources/hudson/widgets/BuildHistoryWidget/entries.jelly @@ -43,9 +43,7 @@ THE SOFTWARE.

- - ${%cancel this build} - +
diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly index c5d99b57787c23b13d925b4c366cce5bf728140b..c21b4762af499bc32b0e1898cffb25ea1932af52 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly @@ -58,7 +58,7 @@ THE SOFTWARE. - [cancel] + diff --git a/core/src/main/resources/lib/hudson/buildCaption.jelly b/core/src/main/resources/lib/hudson/buildCaption.jelly index 254d8beccb326af27c3db88a9337dec912835330..2d0befb162ed302a9c5e63b444a1f5e728ca5f1e 100644 --- a/core/src/main/resources/lib/hudson/buildCaption.jelly +++ b/core/src/main/resources/lib/hudson/buildCaption.jelly @@ -37,7 +37,7 @@ THE SOFTWARE. - [${%cancel}] + diff --git a/core/src/main/resources/lib/hudson/executors.jelly b/core/src/main/resources/lib/hudson/executors.jelly index 398a9f4a278f8a0bece54e80ad5cd9c136c4cb43..2530004a3a98be7ac31ce6539b54afd8d7abb3ae 100644 --- a/core/src/main/resources/lib/hudson/executors.jelly +++ b/core/src/main/resources/lib/hudson/executors.jelly @@ -91,7 +91,7 @@ THE SOFTWARE. - ${%terminate this build} + diff --git a/core/src/main/resources/lib/hudson/queue.jelly b/core/src/main/resources/lib/hudson/queue.jelly index 405844c2d8a562f750b0de858c3332a7d87dbfbc..6d5eb2e0d25d0dafeaee973e9fca060513a05ba5 100644 --- a/core/src/main/resources/lib/hudson/queue.jelly +++ b/core/src/main/resources/lib/hudson/queue.jelly @@ -79,7 +79,7 @@ THE SOFTWARE. - cancel this build + diff --git a/core/src/main/resources/lib/layout/stopButton.jelly b/core/src/main/resources/lib/layout/stopButton.jelly new file mode 100644 index 0000000000000000000000000000000000000000..48cf43453c41008c7d6c2b07075e5133fa569027 --- /dev/null +++ b/core/src/main/resources/lib/layout/stopButton.jelly @@ -0,0 +1,40 @@ + + + + + + + Creates a clickable “Stop” button. + + Link target. Relative to the current page. + + + Alt text for image. + + + + ${alt} + +