diff --git a/checkin_notes b/checkin_notes index 7c8548e95d..4096b0cc18 100755 --- a/checkin_notes +++ b/checkin_notes @@ -18451,3 +18451,16 @@ Lana 15 Oct 2004 sched/ transitioner.C + +David 15 Oct 2004 + - debugged "clone account" feature + + html/ + inc/ + result.inc + user.inc + user/ + account_setup_first.php + account_setup_nonfirst_action.php + create_account_action.php + create_account_form.php diff --git a/html/inc/result.inc b/html/inc/result.inc index c1c770f23e..af71c72152 100644 --- a/html/inc/result.inc +++ b/html/inc/result.inc @@ -22,7 +22,7 @@ function result_granted_credit_string($result, $string_to_show) { return $string_to_show; } case 2: return "---"; //Couldn't send - case 3: return "-!-"; //Client error + case 3: return "---"; //Client error case 4: return "---"; //No reply case 5: return "---"; //Didn't need default: return $string_to_show; @@ -46,6 +46,7 @@ function result_outcome_string($s) { case 3: return "Client error"; case 4: return "No reply"; case 5: return "Didn't need"; + case 6: return "Couldn't validate - missing file"; } return "Unknown"; } diff --git a/html/inc/user.inc b/html/inc/user.inc index 949014bc3f..db9a327a09 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -108,6 +108,10 @@ function show_user_info_private($user) { ); } +function show_clone_url($user) { + $url = URL_BASE."create_account_form.php?userid=$user->id"; + row2("Clone account URL
create accounts with the same team and project preferences as this account", "$url"); +} // show summary of dynamic and static info (public) function show_user_summary_public($user) { row1("Account data for $user->name"); @@ -136,6 +140,7 @@ function show_user_summary_public($user) { if ($user->has_profile) { row2("Profile", "id>view"); } + show_clone_url($user); } // show a summary of the user. @@ -150,6 +155,7 @@ function show_user_page_private($user) { row2("", "Log out"); row2("Account number
Used in URLs", $user->id); row2("Cross-project ID", $user->cross_project_id); + show_clone_url($user); end_table(); } diff --git a/html/user/account_setup_first.php b/html/user/account_setup_first.php index d6c6dd9fb0..e1ae9d0460 100644 --- a/html/user/account_setup_first.php +++ b/html/user/account_setup_first.php @@ -25,8 +25,11 @@ echo " "; $global_prefs = default_prefs_global(); global_prefs_update($user, $global_prefs); -$project_prefs = default_prefs_project(); -project_prefs_update($user, $project_prefs); + +if (strlen($user->project_prefs) == 0) { + $project_prefs = default_prefs_project(); + project_prefs_update($user, $project_prefs); +} echo "
diff --git a/html/user/account_setup_nonfirst_action.php b/html/user/account_setup_nonfirst_action.php index 31a2d7126e..55f5390b20 100644 --- a/html/user/account_setup_nonfirst_action.php +++ b/html/user/account_setup_nonfirst_action.php @@ -8,7 +8,7 @@ db_init(); $user = get_logged_in_user(); -$prefs = prefs_parse_global($user->global_prefs); +$prefs = prefs_parse_project($user->project_prefs); prefs_resource_parse_form($prefs); venue_parse_form($user); project_prefs_update($user, $prefs); diff --git a/html/user/create_account_action.php b/html/user/create_account_action.php index daa1f36ae3..737c8ee887 100644 --- a/html/user/create_account_action.php +++ b/html/user/create_account_action.php @@ -28,9 +28,7 @@ function show_error($str) { $userid = $_POST["userid"]; if ($userid) { - $result = mysql_query("select * from user where id=$userid"); - $clone_user = mysql_fetch_object($result); - mysql_free_result($result); + $clone_user = lookup_user_id($userid); if (!$clone_user) { echo "User $userid not found"; exit(); diff --git a/html/user/create_account_form.php b/html/user/create_account_form.php index ea79037891..b5faf3fbcf 100644 --- a/html/user/create_account_form.php +++ b/html/user/create_account_form.php @@ -30,9 +30,19 @@ echo " "; if ($userid) { - echo " - - "; + $user = lookup_user_id($userid); + if (!$user) { + echo "No such user"; + } else { + echo "This account will have + the same team and project preferences as + $user->name. +

+ "; + echo " + + "; + } } start_table(); row2(