mirror of https://github.com/BOINC/boinc.git
web: fixing spacing identified by scruitinizer
This commit is contained in:
parent
0c2b0bc88a
commit
83ea2bc9ec
|
@ -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.");
|
||||
}
|
||||
|
||||
|
|
|
@ -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 = " · <a href=\"delete_account_request.php\">".tra("delete account")."</a>";
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 <a href=\"delete_account_request.php\">here</a>")
|
||||
);
|
||||
|
@ -49,9 +49,9 @@ function delete_account_confirm_form() {
|
|||
."<br/>";
|
||||
|
||||
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 <a href=\"delete_account_request.php\">here</a>")
|
||||
);
|
||||
|
@ -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.")
|
||||
);
|
||||
|
|
|
@ -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) {
|
|||
."</ul><br/>";
|
||||
|
||||
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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue