Commit 55df49ee authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Fix warnings

parent ca9970cb
...@@ -1030,6 +1030,7 @@ pub fn edit_profile<T: MedalConnection>(conn: &T, session_token: &str, user_id: ...@@ -1030,6 +1030,7 @@ pub fn edit_profile<T: MedalConnection>(conn: &T, session_token: &str, user_id:
Ok(result) Ok(result)
} }
pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str, pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str,
s_data: (Option<i32>, s_data: (Option<i32>,
Option<String>, Option<String>,
...@@ -1038,7 +1039,7 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str, ...@@ -1038,7 +1039,7 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str,
Option<String>)) Option<String>))
-> MedalValueResult -> MedalValueResult
{ {
let mut session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?; let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
if session.id != 35 { if session.id != 35 {
return Err(MedalError::AccessDenied); return Err(MedalError::AccessDenied);
} }
...@@ -1049,8 +1050,9 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str, ...@@ -1049,8 +1050,9 @@ pub fn admin_search_users<T: MedalConnection>(conn: &T, session_token: &str,
Ok(("admin_search_results".to_string(), data)) Ok(("admin_search_results".to_string(), data))
} }
pub fn admin_show_user<T: MedalConnection>(conn: &T, user_id: i32, session_token: &str) -> MedalValueResult { pub fn admin_show_user<T: MedalConnection>(conn: &T, user_id: i32, session_token: &str) -> MedalValueResult {
let mut session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?; let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
if session.id != 35 { if session.id != 35 {
return Err(MedalError::AccessDenied); return Err(MedalError::AccessDenied);
} }
...@@ -1078,13 +1080,16 @@ pub fn admin_show_user<T: MedalConnection>(conn: &T, user_id: i32, session_token ...@@ -1078,13 +1080,16 @@ pub fn admin_show_user<T: MedalConnection>(conn: &T, user_id: i32, session_token
Ok(("admin_user".to_string(), data)) Ok(("admin_user".to_string(), data))
} }
#[allow(unused_variables)]
pub fn admin_delete_user<T: MedalConnection>(conn: &T, user_id: i32, session_token: &str, csrf_token: &str) pub fn admin_delete_user<T: MedalConnection>(conn: &T, user_id: i32, session_token: &str, csrf_token: &str)
-> MedalValueResult { -> MedalValueResult {
let mut data = json_val::Map::new(); let data = json_val::Map::new();
Ok(("profile".to_string(), data)) Ok(("profile".to_string(), data))
} }
pub fn admin_show_group<T: MedalConnection>(conn: &T, group_id: i32, session_token: &str) -> MedalValueResult { pub fn admin_show_group<T: MedalConnection>(conn: &T, group_id: i32, session_token: &str) -> MedalValueResult {
let mut session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?; let session = conn.get_session(&session_token).ensure_logged_in().ok_or(MedalError::NotLoggedIn)?;
if session.id != 35 { if session.id != 35 {
return Err(MedalError::AccessDenied); return Err(MedalError::AccessDenied);
} }
...@@ -1115,21 +1120,27 @@ pub fn admin_show_group<T: MedalConnection>(conn: &T, group_id: i32, session_tok ...@@ -1115,21 +1120,27 @@ pub fn admin_show_group<T: MedalConnection>(conn: &T, group_id: i32, session_tok
Ok(("admin_group".to_string(), data)) Ok(("admin_group".to_string(), data))
} }
#[allow(unused_variables)]
pub fn admin_delete_group<T: MedalConnection>(conn: &T, group_id: i32, session_token: &str, csrf_token: &str) pub fn admin_delete_group<T: MedalConnection>(conn: &T, group_id: i32, session_token: &str, csrf_token: &str)
-> MedalValueResult { -> MedalValueResult {
let mut data = json_val::Map::new(); let data = json_val::Map::new();
Ok(("profile".to_string(), data)) Ok(("profile".to_string(), data))
} }
#[allow(unused_variables)]
pub fn admin_show_participation<T: MedalConnection>(conn: &T, participation_id: i32, session_token: &str) pub fn admin_show_participation<T: MedalConnection>(conn: &T, participation_id: i32, session_token: &str)
-> MedalValueResult { -> MedalValueResult {
let mut data = json_val::Map::new(); let data = json_val::Map::new();
Ok(("profile".to_string(), data)) Ok(("profile".to_string(), data))
} }
#[allow(unused_variables)]
pub fn admin_delete_participation<T: MedalConnection>(conn: &T, participation_id: i32, session_token: &str, pub fn admin_delete_participation<T: MedalConnection>(conn: &T, participation_id: i32, session_token: &str,
csrf_token: &str) csrf_token: &str)
-> MedalValueResult -> MedalValueResult
{ {
let mut data = json_val::Map::new(); let data = json_val::Map::new();
Ok(("profile".to_string(), data)) Ok(("profile".to_string(), data))
} }
......
...@@ -871,11 +871,11 @@ fn user_post<C>(req: &mut Request) -> IronResult<Response> ...@@ -871,11 +871,11 @@ fn user_post<C>(req: &mut Request) -> IronResult<Response>
//old: Ok(Response::with((status::Found, Redirect(url_for!(req, "user", "userid" => format!("{}",user_id)))))) //old: Ok(Response::with((status::Found, Redirect(url_for!(req, "user", "userid" => format!("{}",user_id))))))
} }
fn admin<C>(req: &mut Request) -> IronResult<Response> fn admin<C>(_req: &mut Request) -> IronResult<Response>
where C: MedalConnection + std::marker::Send + 'static { where C: MedalConnection + std::marker::Send + 'static {
let session_token = req.expect_session_token()?; //let session_token = req.expect_session_token()?;
let mut data = json_val::Map::new(); let data = json_val::Map::new();
let mut resp = Response::new(); let mut resp = Response::new();
resp.set_mut(Template::new("admin", data)).set_mut(status::Ok); resp.set_mut(Template::new("admin", data)).set_mut(status::Ok);
Ok(resp) Ok(resp)
......
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