Changeset 219 for trunk/global.php
- Timestamp:
- May 27, 2009, 1:17:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/global.php
r208 r219 37 37 $this->Modules[get_class($Module)] = $Module; 38 38 } 39 40 function AddEmailToQueue($Address, $Subject, $Content, $Headers = '') 41 { 42 $this->Database->insert('EmailQueue', array('Address' => $Address, 'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()', 'Headers' => $Headers)); 43 } 44 45 function MailUTF8($To, $Subject = '(No subject)', $Message = '', $Header = '') 46 { 47 $Header = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=UTF-8' . "\r\n".$Header; 48 mail($To, '=?UTF-8?B?'.base64_encode($Subject).'?=', $Message, $Header); 49 } 50 51 function ProcessEmailQueue() 52 { 53 $DbResult = $this->Database->select('EmailQueue', '*', 'Archive=0'); 54 while($DbRow = $DbResult->fetch_assoc()) 55 { 56 $this->MailUTF8($DbRow['Address'], $DbRow['Subject'], $DbRow['Content'], $DbRow['Headers']); 57 //echo('mail('.$DbRow['Address'].', '.$DbRow['Subject'].', '.$DbRow['Content'].', FromUTF8('.$DbRow['Headers'].', \'iso2\'));'); 58 $this->Database->update('EmailQueue', 'Id='.$DbRow['Id'], array('Archive' => 1)); 59 $this->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']); 60 } 61 } 39 62 } 40 63 41 64 $System = new System(); 42 65 $System->Config = $Config; 66 $System->Database = &$Database; 43 67 include_once('log.php'); 44 68 $System->AddModule(new Log()); … … 119 143 function ToCzfreeIp($Host) 120 144 { 121 122 123 145 $Parts = explode('.', $Host['external_ip']); 146 if($Host['name'] == 'CENTRALA') return('10.144.1.1'); 147 else return('10.144.200.'.$Parts[3]); 124 148 } 125 149
Note:
See TracChangeset
for help on using the changeset viewer.