/* Decoded by unphp.net */ isLogged() ) { $_do = ( isset($_REQUEST["do"]) and $_REQUEST["do"] == "set" ) ? "set":"old"; if ( $_do == 'set' and $l2cfg["chmail_activate"] ) { $hash = ( isset($_REQUEST["hash"]) ) ? urldecode( $_REQUEST["hash"] ):""; if ( empty($hash) ) { $_do = 'old'; } else { $hash = explode( '|', base64_decode($hash) ); if ( count($hash) != 5 or md5($hash[0].$hash[1].$hash[2].$hash[3].$l2cfg['salt']) != $hash[4] ) { $profile = "
'.$lang["chmail_2"].'
',false); } else { $tpl->ShowError( $lang["error"], ''.$lang["err_db"].'
',false); } } } } if ( $_do == 'old' ) { $profile = <<< HTML'.$lang["chmail_1"].'
'); } elseif ( !filter_var($mailnew, FILTER_VALIDATE_EMAIL) ) { $tpl->ShowError( $lang["error"], ''.$lang["err_mail"].'
'); } else { $db->ldb( $_lid ); if ( $l2cfg['chmail_activate'] ) { $email = $ldb[$_lid]->result( $ldb[$_lid]->query("SELECT l2email FROM accounts WHERE login='{$controller->GetName()}'"), 0 ); $time = time(); $hash = urlencode( base64_encode($controller->GetName().'|'.$mailnew.'|'.$email.'|'.$time.'|'.md5($controller->GetName().$mailnew.$email.$time.$l2cfg['salt'])) ); $host = HTTP_HOME_URL; $activation_url = HTTP_HOME_URL."/index.php?f=cp&opt=chmail&do=set&hash={$hash}"; $mail_message = <<< HTML ��������� {$controller->GetName()}, �� ��������������� �������� '����� e-mail' ��� ����� ������� ������. ��� ����, ����� ������������ ����� e-mail ����������� �� ������: {$activation_url} ------------------------------------------------ ��� ����� � ����� e-mail: ------------------------------------------------ �����: {$controller->GetName()} E-mail: {$mailnew} � ���������, ������������� ������� {$host} HTML; $mail = new Email( $l2cfg ); $mail->send( $email, '����� e-mail', $mail_message ); if ( $mail->send_error ) { $tpl->ShowError( $lang["error"], $mail->smtp_msg ); } else { $tpl->ShowError( $lang["error"], ''.$lang["chmail_4"].'
',false); } } else { $ldb[$_lid]->query( "UPDATE `accounts` SET `l2email`='{$mailnew}' WHERE `login`='{$controller->GetName()}'" ); if ( $ldb[$_lid]->affected() > 0 ) { $tpl->ShowError( $lang["error"], ''.$lang["chmail_2"].'
',false); } else { $tpl->ShowError( $lang["error"], ''.$lang["err_db"].'
',false); } } } } } } else exit; ?>