Commit 5ca561e2 authored by Robert Czechowski's avatar Robert Czechowski

Do not allow login with empty group code or empty login code even if an...

Do not allow login with empty group code or empty login code even if an corresponding entry exists in the database
parent 67b1307a
Pipeline #851 passed with stages
in 18 minutes and 28 seconds
......@@ -428,6 +428,10 @@ impl MedalConnection for Connection {
//TODO: use session
fn login_with_code(&self, _session: Option<&str>, logincode: &str) -> Result<String, ()> {
if logincode == "" {
return Err(());
}
let query = "SELECT id
FROM session
WHERE logincode = $1";
......@@ -513,6 +517,10 @@ impl MedalConnection for Connection {
//TODO: use session
fn create_user_with_groupcode(&self, _session: Option<&str>, groupcode: &str) -> Result<String, ()> {
if groupcode == "" {
return Err(());
}
let query = "SELECT id
FROM usergroup
WHERE groupcode = $1";
......
......@@ -547,6 +547,10 @@ impl MedalConnection for Connection {
//TODO: use session
fn login_with_code(&self, _session: Option<&str>, logincode: &str) -> Result<String, ()> {
if logincode == "" {
return Err(());
}
let query = "SELECT id
FROM session
WHERE logincode = $1";
......@@ -632,6 +636,10 @@ impl MedalConnection for Connection {
//TODO: use session
fn create_user_with_groupcode(&self, _session: Option<&str>, groupcode: &str) -> Result<String, ()> {
if groupcode == "" {
return Err(());
}
let query = "SELECT id
FROM usergroup
WHERE groupcode = $1";
......
......@@ -547,6 +547,10 @@ impl MedalConnection for Connection {
//TODO: use session
fn login_with_code(&self, _session: Option<&str>, logincode: &str) -> Result<String, ()> {
if logincode == "" {
return Err(());
}
let query = "SELECT id
FROM session
WHERE logincode = ?1";
......@@ -632,6 +636,10 @@ impl MedalConnection for Connection {
//TODO: use session
fn create_user_with_groupcode(&self, _session: Option<&str>, groupcode: &str) -> Result<String, ()> {
if groupcode == "" {
return Err(());
}
let query = "SELECT id
FROM usergroup
WHERE groupcode = ?1";
......
Markdown is supported
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