<?php require_once('includes/validation.inc.php'); function mailcertify_generate_code($dbconn,$mb_id,$email) { $info=array('mb_id'=>$mb_id,'email'=>$email); $info+=validation_generate_code($dbconn,crc32($mb_id.','.$email)); return base64_encode(serialize($info)); } function mailcertify_use_code($dbconn,$code) { $info=@unserialize(base64_decode($code)); if (!$info) return false; if (validation_use_code($dbconn,$info['vc_id'],crc32($info['mb_id'].','.$info['email']),$info['vc_seed'])) return array('mb_id'=>$info['mb_id'],'email'=>$info['email']); return false; } function mailcertify_send_request_email($dbconn,$mb_id,$mb_nickname,$email) { global $Config,$dataset; $maildata=array( 'USER-NICKNAME'=>$mb_nickname, 'ROOT-URL'=>$dataset['ROOT-URL'], 'ACTIVATION-CODE'=>mailcertify_generate_code($dbconn,$mb_id,$email), 'DAYS-EXIPRE'=>$Config->VALIDATION_LIFE_DAYS ); $mail=prepare_email_from_templates('mailcertify.email.subject','mailcertify.email.content',$maildata); return sendmail($Config->MailerAddress,$email,$mail['subject'],$mail['body']); } ?>