exit; } //Check email address $user_added = false; if (!($xoopsUser =& xhelpEmailIsXoopsUser($_POST['email']))) { // Email is already used by a member switch ($xoopsConfigUser['activation_type']) { case 1: $level = 1; break; case 0: case 2: default: $level = 0; } if ($anon_user =& xhelpXoopsAccountFromEmail($_POST['email'], '', $password, $level)) { // If new user created $member_handler =& xoops_gethandler('member'); $xoopsUser =& $member_handler->loginUserMd5($anon_user->getVar('uname'), $anon_user->getVar('pass')); $user_added = true; } else { // User not created $message = _XHELP_MESSAGE_NEW_USER_ERR; redirect_header(XHELP_BASE_URL . '/user.php', 3, $message); } } $ticket =& $hTicket->create(); $ticket->setVar('uid', $xoopsUser->getVar('uid')); $ticket->setVar('subject', $_POST['subject']); $ticket->setVar('description', $_POST['description']); $ticket->setVar('department', $_POST['departments']);
if (_isDepartmentEmail($parsed->getEmail())) { $msg_logs[_XHELP_MAIL_CLASS3][] = sprintf(_XHELP_MESSAGE_EMAIL_DEPT_MBOX, $parsed->getEmail()); } else { //Create new user account if necessary if (!($xoopsUser =& xhelpEmailIsXoopsUser($parsed->getEmail()))) { if ($xoopsModuleConfig['xhelp_allowAnonymous']) { switch ($xoopsConfigUser['activation_type']) { case 1: $level = 1; break; case 0: case 2: default: $level = 0; } $xoopsUser =& xhelpXoopsAccountFromEmail($parsed->getEmail(), $parsed->getName(), $password, $level); $_eventsrv->trigger('new_user_by_email', array($password, $xoopsUser)); } else { $msg_logs[_XHELP_MAIL_CLASS3][] = sprintf(_XHELP_MESSAGE_NO_ANON, $parsed->getEmail()); $skip_msg = true; } } if ($skip_msg == false) { //Store Message In Server if ($obj =& $msgStore->storeMsg($parsed, $xoopsUser, $mbox, $errors)) { switch ($parsed->getMsgType()) { case _XHELP_MSGTYPE_TICKET: //Trigger New Ticket Events $_eventsrv->trigger('new_ticket', $obj); break; case _XHELP_MSGTYPE_RESPONSE: