Esempio n. 1
0
                    $this->mail->SetOptions($options);
                    $status = $this->mail->SendMail($this->pdh->get('user', 'email', array($user_id)), $this->user->data['user_email'], $this->in->get('subject'), $this->in->get('body'));
                    if ($status) {
                        $this->core->message($this->user->lang('adduser_send_mail_suc'), $this->user->lang('success'), 'green', true);
                        $this->tpl->add_js("jQuery.FrameDialog.closeDialog();");
                    } else {
                        $this->core->message($this->user->lang('error_email_send'), $this->user->lang('error'), 'red');
                    }
                } else {
                    $this->core->message($this->user->lang('fv_invalid_email'), $this->user->lang('error'), 'red');
                }
            } else {
                message_die($this->user->lang('noauth'), $this->user->lang('noauth_default_title'), 'access_denied');
            }
        }
    }
    public function display()
    {
        $user_id = $this->in->get('user', 0);
        if ($user_id < 1) {
            $this->core->message($this->user->lang('error_user_not_found'), $this->user->lang('error'), 'red');
        } else {
            $this->tpl->assign_vars(array('USER_ID' => $user_id, 'USERNAME' => $this->pdh->get('user', 'name', array($user_id)), 'BODY' => $this->in->get('body', ''), 'SUBJECT' => $this->in->get('subject', '')));
        }
        $this->core->set_vars(array('page_title' => $this->user->lang('adduser_send_mail'), 'template_file' => 'email.html', 'header_format' => 'simple', 'display' => true));
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_email', email::__shortcuts());
}
registry::register('email');