Пример #1
0
 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;
 }
Пример #2
0
 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;
 }
Пример #3
0
 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;
 }