kritbit

kritbit Commit Details


Date:2015-11-22 14:41:23 (9 years 29 days ago)
Author:Natalie Adams
Branch:master
Commit:5c021cdd67e11a87bcce1c6e64ce28c15f9edce8
Parents: 555bd1d25a7c972c853b0d8d07582942ea929d0f
Message:adding CSRF token updating README

Changes:

File differences

README.md
1919
2020
2121
22
22
2323
2424
2525
# Authentication/Authorization
Each user logs in using OAuth (see below for setup) and can only edit jobs that they have created (there are no groups or way of "granting" permission). A job history can have a flag to allow anonymous users to view the history. However, kritbit does not censor the output so be careful allowing people to view history of jobs that may contain sensitive information.
Each user logs in using OAuth (see below for setup) and can only edit jobs that they have created (there are no groups or way of "granting" permission). A user MUST be pre-registered into the users table otherwise they will not be able to login and create jobs (this is done to prevent abuse - though you can easily change this behavior). A job history can have a flag to allow anonymous users to view the history. However, kritbit does not censor the output so be careful allowing people to view history of jobs that may contain sensitive information.
# Install
web/application/controllers/base.php
116116
117117
118118
119
120
121
122
123
124
125
119126
120127
if ($this->loginRequired && !$this->user) {
$this->login();
}
if (isset($_POST["csrfmiddlewaretoken"])) {
if ($_POST["csrfmiddlewaretoken"] != $_COOKIE["csrftoken"]) {
throw new \Exception("CSRF tokens did not match");
}
}
}
}
web/application/views/add.html
77
88
99
10
10
1111
1212
1313
</div>
<form method="post" class="form-horizontal">
{% csrf_token %}
<div class="form-group col-sm-10">
<label for="jobName" class="col-sm-2 control-label">Job Name</label>
<div class="col-sm-10">

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06438s using 14 queries.