<?php require_once('includes/requirelogin.inc.php'); require_once('includes/requirepost.inc.php'); require_once('includes/mailcertify.inc.php'); require_once('includes/memberinfo.inc.php'); if ($_SESSION['uniwits.inputcache.domain']!='member') { purge_array_by_key_prefix($_SESSION,"uniwits.inputcache"); header("Location: ./"); } $micache=$_SESSION['uniwits.inputcache.data']; $mbinfo=$micache; unset($mbinfo['passwd']); $mbinfo['mb_pswdhash']=password_hash($micache['passwd']); $mbinfo['mb_timestamp']=db_date(); $mbinfo['mb_status']='VALID'; if ($_SESSION['uniwits.inputcache.okas']=='update') { $inputables=select_displayed_member_info_sections($_SESSION['uniwits.memberinfo.fields.displayed'],false,true); $mbinfo=filter_member_info_by_selected_section($mbinfo,$inputables); $mb_id=current_mb_id(); $DBConn->connect(); $DBConn->begin(true); $old_emails=array_projection(db_load_member_emails($DBConn,$mb_id,true),'mb_email'); if ($micache['passwd']) db_update_password($DBConn,$mb_id,$mbinfo['mb_pswdhash']); unset($mbinfo['mb_nickname']); db_update_member($DBConn,$mb_id,$mbinfo); db_update_member_info($DBConn,$mb_id,$mbinfo); if ($inputables['SECTION-EMAIL']) db_set_member_emails($DBConn,$mb_id,$mbinfo['EMAIL']); if ($inputables['SECTION-PHONE']) db_set_member_phones($DBConn,$mb_id,$mbinfo['PHONE']); $certifyemailsent=false; if ($mbinfo['EMAIL']) { $savedmbinfo=db_load_member($DBConn,$mb_id); foreach ($mbinfo['EMAIL'] as $em) { if (!in_array($em,$old_emails)) { mailcertify_send_request_email($DBConn,$mb_id,$savedmbinfo['mb_nickname'],$em); $certifyemailsent=true; } } } $DBConn->commit(); purge_array_by_key_prefix($_SESSION,"uniwits.inputcache"); if ($certifyemailsent) header("Location: ./member.info?op=saved.ok.cert"); else header("Location: ./member.info?op=saved.ok"); } else { purge_array_by_key_prefix($_SESSION,"uniwits.inputcache."); header("Location: ./"); } ?>