public function addMessage($emailObj) { Trace::output($this->traceID, "addMessage"); //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'function' => "addMessage"); $array; //---------------------------------------------------------- if (gettype($emailObj) == "object") { $emailObj = (array) $emailObj; } //---------------------------------------------------------- $chk = ValidateEmail::go($emailObj['emailFrom']); //---------------------------------------------------------- $chk = $chk["bool"] ? $this->_addMessage($emailObj) : $chk; //---------------------------------------------------------- $chk['output'] = Trace::$output; //---------------------------------------------------------- return $chk; }
public function send($emailObj) { Trace::output($this->traceID, "send", func_get_args()); //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, "func" => $this->traceID . ": send_email"); //---------------------------------------------------------- if (gettype($emailObj) == "object") { $emailObj = (array) $emailObj; } //---------------------------------------------------------- $chk = SetPublicProp::go($this, $emailObj); //---------------------------------------------------------- if ($this->emailTo == NULL) { $chk['bool'] = false; $chk['message'] = "property 'emailTo' must be given a value"; } //---------------------------------------------------------- $chk = $this->emailFrom != NULL ? ValidateEmail::go($this->emailFrom) : $chk; //---------------------------------------------------------- $chk = $chk["bool"] ? $this->_send() : $chk; //---------------------------------------------------------- $chk['output'] = Trace::$output; //---------------------------------------------------------- return $this->chk = $chk; }
public function _registerUser($set, $addRowFunction = NULL, $sendConfirmationFunction = NULL, $reDirect = NULL) { Trace::output($this->traceID, "_registerUser", func_get_args()); //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'traceID' => "registerUser"); //---------------------------------------------------------- $this->set = $set; $this->set['accountType'] = 3; //---------------------------------------------------------- $this->password = $this->set['password']; $this->email = $this->set['email']; //---------------------------------------------------------- $chk = GenFun::error_CHK(array($this->email, $this->password)); //---------------------------------------------------------- $this->set['password'] = $this->password = GenFun::encrypt($this->password . $this->salt); //---------------------------------------------------------- $chk = ValidateEmail::go($this->email); //---------------------------------------------------------- if (!$chk["bool"]) { return $chk; } //---------------------------------------------------------- $this->confirmLinkType = "1"; //---------------------------------------------------------- is_null($addRowFunction) ? $this->addRowFunction = array($this, "addAccountRow") : ($this->addRowFunction = $addRowFunction); //---------------------------------------------------------- //$this->tblName = Accounts_const::TBL; //---------------------------------------------------------- is_null($sendConfirmationFunction) ? $this->sendConfirmationFunction = array($this, "registerConfirmationLink") : ($this->sendConfirmationFunction = $sendConfirmationFunction); //---------------------------------------------------------- if (!$chk["bool"]) { return $chk; } //---------------------------------------------------------- /*if(!$this->character_CHK($this->email)) { $chk['bool'] = false; $chk['message'] = "email must only contain numbers, upper, and lowercase characters!!!"; }*/ //---------------------------------------------------------- if (!$this->character_CHK($this->password)) { $chk['bool'] = false; $chk['message'] = "Password must only contain numbers, upper, and lowercase characters!!!"; } //---------------------------------------------------------- if ($chk['bool']) { $chk = $this->chkForEmail($this->email); } else { return $chk; } //---------------------------------------------------------- if (!$chk['bool'] || $chk['error']) { return $chk; } //---------------------------------------------------------- if (sizeof($chk['result']) != 0) { $chk['bool'] = false; $chk['message'] = "email has already been registered!!!"; } //---------------------------------------------------------- if ($chk['bool']) { $chk = $this->start($chk['result'][0], 1, $this->sendConfirmationFunction, $reDirect); } //---------------------------------------------------------- return $chk; }
$dept = _XHELP_TEXT_NO_DEPT; $hasUrl = false; } $aLastTickets[] = array('id' => $ticket->getVar('id'), 'subject' => $ticket->getVar('subject'), 'status' => xhelpGetStatus($ticket->getVar('status')), 'department' => $dept, 'dept_url' => $hasUrl ? XOOPS_URL . '/modules/xhelp/index.php?op=staffViewAll&dept=' . $ticket->getVar('department') : '', 'url' => XOOPS_URL . '/modules/xhelp/ticket.php?id=' . $ticket->getVar('id')); } $has_lastTickets = count($lastTickets); unset($lastTickets); } switch ($op) { case "addEmail": if ($_POST['newEmail'] == '') { $message = _XHELP_MESSAGE_NO_EMAIL; redirect_header(XHELP_BASE_URL . "/ticket.php?id={$xhelp_id}", 3, $message); } //Check if email is valid $validator = new ValidateEmail($_POST['newEmail']); if (!$validator->isValid()) { redirect_header(xhelpMakeURI('ticket.php', array('id' => $xhelp_id), false), 3, _XHELP_MESSAGE_NO_EMAIL); } if (!($newUser = xhelpEmailIsXoopsUser($_POST['newEmail']))) { // If a user doesn't exist with this email $user_id = 0; } else { $user_id = $newUser->getVar('uid'); } // Check that the email doesn't already exist for this ticket $hTicketEmails =& xhelpGetHandler('ticketEmails'); $crit = new CriteriaCompo(new Criteria('ticketid', $xhelp_id)); $crit->add(new Criteria('email', $_POST['newEmail'])); $existingUsers =& $hTicketEmails->getObjects($crit); if (count($existingUsers) > 0) {