Skip to content
Snippets Groups Projects
Commit 750af75e authored by PavelBegunkov's avatar PavelBegunkov
Browse files

HOT FIX: security breach

parent ebbc9538
Branches
Tags
No related merge requests found
...@@ -100,7 +100,9 @@ class Controller_Handler_Settings extends Controller_Handler { ...@@ -100,7 +100,9 @@ class Controller_Handler_Settings extends Controller_Handler {
$this->post $this->post
->rule('semesterID', 'not_empty') ->rule('semesterID', 'not_empty')
->rule('semesterID', 'digit'); ->rule('semesterID', 'digit');
$semesterID = $this->post->offsetGet('semesterID'); if($this->post->check()) {
User::instance()->SetSemester($semesterID); $semesterID = $this->post->offsetGet('semesterID');
User::instance()->SetSemester($semesterID);
}
} }
} }
\ No newline at end of file
...@@ -57,8 +57,9 @@ class Kohana_User implements ArrayAccess { ...@@ -57,8 +57,9 @@ class Kohana_User implements ArrayAccess {
} }
public function SetSemester($semesterID) { public function SetSemester($semesterID) {
$this->_model->SetSemesterID($semesterID); $res = $this->_model->SetSemesterID($semesterID);
$this->_session->set("SemesterID", $semesterID); if ($res >= 0)
$this->_session->set("SemesterID", "$semesterID");
} }
......
...@@ -175,6 +175,7 @@ class Model_Kohana_Account extends Model ...@@ -175,6 +175,7 @@ class Model_Kohana_Account extends Model
{ {
$sql = "SELECT `SetSemesterID`('$semesterID') AS `Num`; "; $sql = "SELECT `SetSemesterID`('$semesterID') AS `Num`; ";
$res = DB::query(Database::SELECT, $sql)->execute(); $res = DB::query(Database::SELECT, $sql)->execute();
$id = 0;
foreach ($res as $value) { foreach ($res as $value) {
$id = $value['Num']; $id = $value['Num'];
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment