3 * Table Definition for Person
5 require_once 'DB/DataObject.php';
8 class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject
11 /* the code below is auto generated do not remove the above tag */
13 public $__table = 'core_person_signup'; // table name
14 public $id; // int(11) not_null primary_key auto_increment
15 public $email; // string(128) not_null
17 public $name; // string(128) not_null
18 public $firstname; // string(128) not_null
19 public $lastname; // string(128) not_null
20 public $firstname_alt; // string(128) not_null
21 public $lastname_alt; // string(128) not_null
24 public $honor; // string(128) not_null
25 public $verify_key; // int(11)
29 public $created_dt; // datetime(19) binary
37 // if key matches verify_key
38 // copy into person or other entity...
40 //$this->whereAdd("verify_key = '".$key."'");
41 if(!$this->get("verify_key",$key)){
44 $p = DB_DataObject::factory('person');
45 $p->honor = $this->honor;
46 $p->name = $this->name;
47 $p->email = $this->email;
48 $p->firstname = $this->firstname;
49 $p->lastname = $this->lastname;
50 $p->firstname_alt = $this->firstname_alt;
51 $p->lastname_alt = $this->lastname_alt;
52 $temp_pwd = $p->generatePassword();
53 //$temp_pwd = mt_rand(100000,999999);
54 //$p->passwd = $temp_pwd;
62 $_SESSION['Hydra']['authUser'] = $p ? serialize($p) : false;
66 $htmlStr .= "Dear ".$p->honor.".".$p->lastname."<br /><br />";
67 $htmlStr .= "Congratulations on Joining HydRa.<br /><br />";
68 $htmlStr .= "If you need to access the system again please log in using the password ";
69 $htmlStr .= $temp_pwd;
72 $email_sender = "no-reply@roojs.com";
73 $subject = "Congratulations";
74 $recipient_email = $p->email;
79 $headers = "MIME-Version: 1.0\r\n";
80 $headers .= "Content-type: text/html; charset=utf-8\r\n";
81 $headers .= "From: {$name} ";
83 $headers .= $email_sender;
87 if(!mail($recipient_email, $subject, $body, $headers)){
88 error_log("Sending failed.");
91 error_log("db insert error");