spike/views/whitelistsets.py 1 location
|
@@ 57-68 (lines=12) @@
|
| 54 |
|
return render_template("whitelistsets/index.html", whitelistsets=wls, selection=_selection) |
| 55 |
|
|
| 56 |
|
|
| 57 |
|
@whitelistsets.route("/del/<int:wid>", methods=["POST"]) |
| 58 |
|
def remove(wid): |
| 59 |
|
_wlset = NaxsiWhitelistSets.query.filter(NaxsiWhitelistSets.id == wid).first() |
| 60 |
|
if _wlset is None: |
| 61 |
|
flash("The whitelist set %s doesn't exist." % wid, "error") |
| 62 |
|
return redirect(url_for("whitelistsets.index")) |
| 63 |
|
|
| 64 |
|
db.session.delete(_wlset) |
| 65 |
|
db.session.commit() |
| 66 |
|
|
| 67 |
|
flash("Successfully deleted %s " % _wlset.name, "success") |
| 68 |
|
return redirect(url_for("whitelistsets.index")) |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
def __get_whitelist_for_whitelistset(whitelistset): |
spike/views/rulesets.py 1 location
|
@@ 54-65 (lines=12) @@
|
| 51 |
|
return redirect(url_for("rulesets.index")) |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
@rulesets.route("/del/<int:rname>", methods=["POST"]) |
| 55 |
|
def remove(rname): |
| 56 |
|
_rset = NaxsiRuleSets.query.filter(NaxsiRuleSets.id == rname).first() |
| 57 |
|
if _rset is None: |
| 58 |
|
flash("The ruleset %s doesn't exists." % rname, "error") |
| 59 |
|
return redirect(url_for("rulesets.index")) |
| 60 |
|
|
| 61 |
|
db.session.delete(_rset) |
| 62 |
|
db.session.commit() |
| 63 |
|
|
| 64 |
|
flash("OK deleted: %s " % rname, "success") |
| 65 |
|
return redirect(url_for("rulesets.index")) |
| 66 |
|
|
| 67 |
|
|
| 68 |
|
@rulesets.route("/select/<string:selector>", methods=["GET"]) |
spike/views/rules.py 1 location
|
@@ 154-164 (lines=11) @@
|
| 151 |
|
return redirect("/rules/edit/%s" % sid) |
| 152 |
|
|
| 153 |
|
|
| 154 |
|
@rules.route("/del/<int:sid>", methods=["GET"]) |
| 155 |
|
def del_sid(sid=''): |
| 156 |
|
nrule = NaxsiRules.query.filter(NaxsiRules.sid == sid).first() |
| 157 |
|
if not nrule: |
| 158 |
|
return redirect(url_for("rules.index")) |
| 159 |
|
|
| 160 |
|
db.session.delete(nrule) |
| 161 |
|
db.session.commit() |
| 162 |
|
|
| 163 |
|
flash("Successfully deleted %s : %s" % (sid, nrule.msg), "success") |
| 164 |
|
return redirect(url_for("rules.index")) |
| 165 |
|
|
| 166 |
|
|
| 167 |
|
@rules.route("/deact/<int:sid>", methods=["GET"]) |
spike/views/whitelists.py 1 location
|
@@ 50-60 (lines=11) @@
|
| 47 |
|
return redirect(url_for('whitelists.new')) |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
@whitelists.route("/del/<string:wid>", methods=["GET"]) |
| 51 |
|
def del_sid(wid): |
| 52 |
|
_wlist = NaxsiWhitelist.query.filter(NaxsiWhitelist.id == wid).first() |
| 53 |
|
if not _wlist: |
| 54 |
|
return redirect(url_for('whitelists.index')) |
| 55 |
|
|
| 56 |
|
db.session.delete(_wlist) |
| 57 |
|
db.session.commit() |
| 58 |
|
|
| 59 |
|
flash("Successfully deleted %s" % wid, "success") |
| 60 |
|
return redirect(url_for('whitelists.index')) |
| 61 |
|
|
| 62 |
|
|
| 63 |
|
@whitelists.route("/generate", methods=["GET", "POST"]) |