示例#1
0
 private function processIMLogin($key, $msg)
 {
     $text = Core_Text::__getInstance();
     $db = Core_Database::__getInstance();
     $commands = explode(' ', $msg);
     $command = array_shift($commands);
     switch ($command) {
         case 'login':
             if (count($commands) == 1) {
                 $email = array_shift($commands);
                 // Search in the database for this user
                 $user = $db->select('players', array('plid', 'realname', 'email'), "email = '" . $db->escape($email) . "'");
                 if (count($user) == 1) {
                     // Invent a new key
                     $passkey = substr(md5(rand(0, 100000)), 0, 6);
                     $db->insert('im_users', array('im_user' => $key, 'im_player' => $user[0]['plid'], 'im_key' => $passkey));
                     // Send the secret key to this user
                     Core_Tools::sendMail($text->get('subject', 'bot', 'main'), Core_Tools::output_text(Core_Tools::putIntoText($text->getFile('mails/bot_activation'), array('name' => $user[0]['realname'], 'key' => $passkey))), $user[0]['email']);
                     echo 'We have found your account. We have sent an email containing a secret key.<br />Please show me the key here.';
                 } else {
                     echo 'This user (' . $username . ') is not found. Please try again, or register at http://www.1brood.be/';
                 }
             } else {
                 echo '"Login" should be followed by your email and password.';
             }
             break;
         default:
             echo 'Please login in 1Brood by typing "Login your_email".<br />';
             echo 'We will start sending out reminders as soon as you are logged in.';
             break;
     }
 }
示例#2
0
 public function sendReminder($company)
 {
     $text = Core_Text::__getInstance();
     $text->setFile('account');
     $text->setSection('reminder');
     $email = $this->getEmail();
     // Get company owner
     $owner = $company->getOwner();
     // Check for negative poefboek
     $poefboek = $company->getMemberPoefboek($this);
     if ($poefboek > 0) {
         $txt = Core_Tools::output_text($text->getFile('mails/reminder'));
     } else {
         $txt = Core_Tools::output_text(Core_Tools::putIntoText($text->getFile('mails/angry_reminder'), array('poefboek' => $poefboek, 'admin' => Core_Tools::output_varchar($owner->getFullname()))));
     }
     if ($owner) {
         Core_Tools::sendMail($text->get('subject'), $txt, $email, $this->getFullname(), $owner->getFullname(), $owner->getEmail(), false);
     }
     // Notify members by message:
     $db = Core_Database::__getInstance();
     $accounts = $db->select('im_users', array('im_user'), "im_player = " . $this->getId() . " AND im_activated = 1");
     $url = 'https://www.imified.com/api/bot/';
     foreach ($accounts as $v) {
         $data = array('botkey' => '53881418-A97D-9713-415C46EA2843C806', 'apimethod' => 'send', 'userkey' => $v['im_user'], 'msg' => 'Tijd voor broodjes! Ga snel naar http://www.1brood.be/ !');
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_HEADER, 0);
         curl_setopt($ch, CURLOPT_USERPWD, 'daedelson@gmail.com:aukv0006');
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_TIMEOUT, 100);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         $xml = curl_exec($ch);
         if (!$xml) {
             echo curl_error($ch);
         }
         curl_close($ch);
     }
 }
示例#3
0
 private function sendMail($id, $key, $email, $toName = "")
 {
     $text = Core_Text::__getInstance();
     $body = Core_Tools::putIntoText($text->get('text1', 'lostpass', 'main') . "\n\n" . $text->get('text2', 'lostpass', 'main') . "\n\n" . $text->get('text3', 'lostpass', 'main') . "\n\n" . $text->get('text4', 'lostpass', 'main'), array('key' => $key, 'name' => $toName, 'url' => self::getUrl('page=lostPassword&id=' . $id . '&key=' . $key, true)));
     Core_Tools::sendMail($text->get('subject', 'lostpass', 'main'), $body, $email, $toName, null, defined('MAILER_FROM') ? MAILER_FROM : null, false, false);
 }
示例#4
0
 private function sendMail($order, $email, $toName = "")
 {
     $myself = Profile_Member::getMyself();
     if (!$myself) {
         return;
     }
     Core_Tools::sendMail($this->getMailSubject($order), $this->getMailBody($order), $email, $toName, $myself->getFullname(), $myself->getEmail());
 }