From 83ea2bc9ecaebfb1f6fa080574c8d9d6e0adf94d Mon Sep 17 00:00:00 2001 From: Kevin Reed Date: Thu, 17 May 2018 09:58:03 -0500 Subject: [PATCH] web: fixing spacing identified by scruitinizer --- html/inc/email.inc | 2 +- html/inc/user.inc | 8 ++++---- html/inc/user_util.inc | 4 ++-- html/ops/delete_user.php | 4 ++-- html/ops/test_token.php | 4 ++-- html/user/delete_account_confirm.php | 14 +++++++------- html/user/delete_account_request.php | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/html/inc/email.inc b/html/inc/email.inc index f24fcb6e18..a0e2342586 100644 --- a/html/inc/email.inc +++ b/html/inc/email.inc @@ -156,7 +156,7 @@ function is_valid_email_addr($addr) { function send_confirm_delete_email($user) { $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY); - if ( $token === null ) { + if ($token === null) { error_page("Error creating token. Please try again later."); } diff --git a/html/inc/user.inc b/html/inc/user.inc index 528b37e6b6..72533aa65e 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -39,7 +39,7 @@ function get_other_projects($user) { // Check the cache for that URL // $cacheddata = get_cached_data(REMOTE_PROJECTS_TTL, $url); - if ($cacheddata){ + if ($cacheddata) { $remote = unserialize($cacheddata); } else { // Fetch the XML, use curl if fopen() is disallowed @@ -110,7 +110,7 @@ function show_project($project) { function cmp($a, $b) { if ($a->expavg_credit == $b->expavg_credit) return 0; - return ($a->expavg_credit < $b->expavg_credit)? 1 : -1; + return ($a->expavg_credit < $b->expavg_credit) ? 1 : -1; } function show_other_projects($user, $personal) { @@ -133,7 +133,7 @@ function show_other_projects($user, $personal) { ), array("", ALIGN_RIGHT, ALIGN_RIGHT, ALIGN_RIGHT) ); - foreach($user->projects as $project) { + foreach ($user->projects as $project) { show_project($project); } end_table(); @@ -262,7 +262,7 @@ function show_user_info_private($user) { } else { $delete_account_str = ""; $config = get_config(); - if ( parse_bool($config, "enable_delete_account") ) { + if (parse_bool($config, "enable_delete_account")) { $delete_account_str = " · ".tra("delete account").""; } diff --git a/html/inc/user_util.inc b/html/inc/user_util.inc index aa9c5fe30d..8c7add1b78 100644 --- a/html/inc/user_util.inc +++ b/html/inc/user_util.inc @@ -55,8 +55,8 @@ function check_passwd_hash($user, $passwd_hash) { } function check_passwd_ui($user, $passwd) { - $passwd_hash = md5($passwd.$user->email_addr); - if( !check_passwd_hash($user, $passwd_hash) ) { + $passwd_hash = md5($passwd.$user->email_addr); + if(!check_passwd_hash($user, $passwd_hash)) { sleep(LOGIN_FAIL_SLEEP_SEC); page_head("Password incorrect"); echo "The password you entered is incorrect. Please go back and try again.\n"; diff --git a/html/ops/delete_user.php b/html/ops/delete_user.php index 5f1849073c..5c6ad6a3f7 100755 --- a/html/ops/delete_user.php +++ b/html/ops/delete_user.php @@ -27,7 +27,7 @@ require_once("../inc/boinc_db.inc"); die("Delete this line first\n"); $config = get_config(); -if ( !parse_bool($config, "enable_delete_account") ) { +if (!parse_bool($config, "enable_delete_account")) { die(tra("This feature is disabled. Please enable it in the config.xml.")); } @@ -37,7 +37,7 @@ $user = BoincUser::lookup_id($id); if (!$user) die("no such user\n"); $retval = delete_account($user); -if ( $retval ) { +if ($retval) { echo tra("User deleted"); } else { echo tra("Failed to delete user"); diff --git a/html/ops/test_token.php b/html/ops/test_token.php index 0f6174db94..5f483919bb 100755 --- a/html/ops/test_token.php +++ b/html/ops/test_token.php @@ -30,13 +30,13 @@ echo $boincToken->expire_time . "\n"; echo "---------------\n"; $boincToken = BoincToken::lookup_valid_token(0, $token, 'T'); if ( $boincToken != null ) { - echo "Found valid token\n"; + echo "Found valid token\n"; } echo "---------------\n"; $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T'); if ( $boincToken == null ) { - echo "Successfully didn't find invalid token\n"; + echo "Successfully didn't find invalid token\n"; } echo "---------------\n"; diff --git a/html/user/delete_account_confirm.php b/html/user/delete_account_confirm.php index 923b4852b1..ba9dda83f3 100644 --- a/html/user/delete_account_confirm.php +++ b/html/user/delete_account_confirm.php @@ -24,7 +24,7 @@ require_once("../inc/boinc_db.inc"); require_once("../inc/user_util.inc"); $config = get_config(); -if ( !parse_bool($config, "enable_delete_account") ) { +if (!parse_bool($config, "enable_delete_account")) { error_page( tra("This feature is disabled. Please contact the project administrator.") ); @@ -35,7 +35,7 @@ function delete_account_confirm_form() { $userid = get_int("id"); $token = get_str("token"); $retval = check_delete_account_token($userid, $token); - if ( !$retval ) { + if (!$retval) { error_page( tra("The token you used has expired or is otherwise not valid. Please request a new one here") ); @@ -49,9 +49,9 @@ function delete_account_confirm_form() { ."
"; form_start(secure_url_base()."delete_account_confirm.php", "post"); - form_input_hidden("token",$token); - form_input_hidden("id",$userid); - form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); + form_input_hidden("token", $token); + form_input_hidden("id", $userid); + form_input_text(tra("Password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")); form_submit(tra("Delete Account")); form_end(); @@ -63,7 +63,7 @@ function delete_account_confirm_action() { $userid = post_int("id"); $token = post_str("token"); $retval = check_delete_account_token($userid, $token); - if ( !$retval ) { + if (!$retval) { error_page( tra("The token you used has expired or is otherwise not valid. Please request a new one here") ); @@ -74,7 +74,7 @@ function delete_account_confirm_action() { $passwd = post_str("passwd"); check_passwd_ui($user, $passwd); - if ( !delete_account($user) ) { + if (!delete_account($user)) { error_page( tra("Failed to delete your account. Please contact the project administrator.") ); diff --git a/html/user/delete_account_request.php b/html/user/delete_account_request.php index 69ce5a4943..605756d986 100644 --- a/html/user/delete_account_request.php +++ b/html/user/delete_account_request.php @@ -23,7 +23,7 @@ require_once("../inc/user_util.inc"); require_once("../inc/email.inc"); $config = get_config(); -if ( !parse_bool($config, "enable_delete_account") ) { +if (!parse_bool($config, "enable_delete_account")) { error_page( tra("This feature is disabled. Please contact the project administrator.") ); @@ -48,7 +48,7 @@ function delete_account_request_form($user) { ."
"; form_start(secure_url_base()."delete_account_request.php", "post"); - form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); + form_input_text(tra("Password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")); form_submit(tra("Send Confirmation Email")); form_end();