mirror of https://github.com/BOINC/boinc.git
web: add switch to choose which type of account delete should be
performed
This commit is contained in:
parent
da81c49e4d
commit
65c7cfda65
|
@ -16,6 +16,10 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
// along with BOINC. If not, see <https://www.gnu.org/licenses/>.
|
// along with BOINC. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Constants for
|
||||||
|
define("DELETE_ACCOUNT_METHOD_OBFUSCATE", 1);
|
||||||
|
define("DELETE_ACCOUNT_METHOD_WIPE", 2);
|
||||||
|
|
||||||
$config = get_config();
|
$config = get_config();
|
||||||
if ( !parse_bool($config, "enable_delete_account") ) {
|
if ( !parse_bool($config, "enable_delete_account") ) {
|
||||||
error_page(
|
error_page(
|
||||||
|
@ -31,3 +35,31 @@ function check_delete_account_token($userid, $token) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This method selects which delete method to utilize. Projects can implement their own method
|
||||||
|
* and make that a third mechanism if they have a need to
|
||||||
|
*/
|
||||||
|
function delete_account($userid) {
|
||||||
|
$enable_delete_account = parse_int($config, "enable_delete_account");
|
||||||
|
if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_OBFUSCATE ) {
|
||||||
|
return obfuscate_account($userid);
|
||||||
|
} else if ( $enable_delete_account == DELETE_ACCOUNT_METHOD_WIPE ) {
|
||||||
|
return wipe_account($userid);
|
||||||
|
} else {
|
||||||
|
error_page(
|
||||||
|
tra("This feature is configured incorrectly. Please contact the project administrator.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method obfuscates all personal information but
|
||||||
|
// leaves critical db records in place
|
||||||
|
function obfuscate_account($userid) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method deletes all rows from the database associated with the user
|
||||||
|
function wipe_account($userid) {
|
||||||
|
|
||||||
|
}
|
|
@ -57,7 +57,7 @@ function delete_account_confirm_action() {
|
||||||
$passwd = post_str("passwd");
|
$passwd = post_str("passwd");
|
||||||
check_passwd_ui($user, $passwd);
|
check_passwd_ui($user, $passwd);
|
||||||
|
|
||||||
//do account delete
|
delete_account($user->id);
|
||||||
|
|
||||||
page_head(tra("Account Deleted"));
|
page_head(tra("Account Deleted"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue