X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_person_signup.php;h=51afc1e44bffa11447167d0493f27ee9bd22492e;hb=f96afdd63e8565aabe57b190180b03f8e72767c3;hp=fb58c66d345c56d17524e344508842acaf9b57d1;hpb=7325a6e33a798838cc84be1804e1814d2e2249f7;p=Pman.Core diff --git a/DataObjects/Core_person_signup.php b/DataObjects/Core_person_signup.php index fb58c66d..51afc1e4 100644 --- a/DataObjects/Core_person_signup.php +++ b/DataObjects/Core_person_signup.php @@ -22,6 +22,8 @@ class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject public $verify_key; // int(11) public $verified; public $created_dt; // datetime(19) binary + public $company_name; + public $person_type; // function verify($key) // { @@ -93,11 +95,32 @@ class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject // } // } - function sendVerification($roo) + function convertTo($target = false) + { + if(!$target){ + return false; + } + + $roo = HTML_FlexyFramework::get()->page; + + if($target->get('email', $this->email)){ + return $target; + } + + $target->setFrom($this->toArray()); + + $target->insert(); + + $this->delete(); + + return $target; + } + + function sendVerification($template, $roo) { $content = array( - 'template' => 'CORE_PERSON_SIGNUP_VERIFICATION', + 'template' => $template, 'person' => $this, 'serverName' => $_SERVER['SERVER_NAME'], 'baseURL' => $roo->baseURL @@ -111,5 +134,13 @@ class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject return false; } + + function getEmailFrom() + { + if (empty($this->name)) { + return $this->email; + } + return '"' . addslashes($this->name) . '" <' . $this->email . '>'; + } }