Example #1
0
 public function output(PMDataNode $data)
 {
     $pm = new Pagemill($data->fork());
     //$pm->setVariableArray($this->settings);
     $db = Typeframe::Database();
     if (!isset($this->settings['driver'])) {
         //return '<div class="error"><p>Please provide a "driver" attribute on the pm:driver plugin.</p></div>';
         return '';
     }
     // Blank driver attributes count as nothing too.
     if (!$this->settings['driver']) {
         return '';
     }
     // I need to lookup this driver as a page and ensure it's a valid driver.
     $driver = (int) $this->settings['driver'];
     $rs = $db->prepare('SELECT uri, nickname, driver FROM #__page WHERE driver != "" AND pageid = ?');
     $rs->execute($driver);
     if (!$rs->recordcount()) {
         // No records found... just silently fail.
         return '';
     }
     $data = $rs->fetch_array();
     $pm->setVariable('link', TYPEF_WEB_DIR . $data['uri']);
     $pm->setVariable('title', $data['nickname']);
     $pm->setVariable('driver', $data['driver']);
     return $pm->writeText('<pm:include template="/plugins/driver.html" />');
 }
Example #2
0
File: index.php Project: ssrsfs/blg
     $mailer = new TypeframeMailer();
     $mailer->Configure();
     $mailer->IsHTML(true);
     foreach ($admins as $email) {
         $mailer->AddAddress($email);
     }
     $mailer->Subject = 'New User Registration at ' . TYPEF_TITLE;
     $mailer->Body = $body;
     $mailer->Send();
 }
 if (TYPEF_REQUIRE_APPROVAL) {
     // notify the user that admin approval is required
     if (TYPEF_REQUIRE_APPROVAL_NOTIFICATION) {
         // construct e-mail body
         $mm = new Pagemill($pm->root()->fork());
         $body = str_replace('&amp;', '&', $mm->writeText('<pm:include template="/users/register/pre-approval.eml" />'));
         // e-mail the user
         $mailer = new TypeframeMailer();
         $mailer->Configure();
         $mailer->IsHTML(true);
         $mailer->AddAddress($_POST['email']);
         $mailer->Subject = 'Your Account Pre-Approval from ' . TYPEF_TITLE;
         $mailer->Body = $body;
         $mailer->Send();
     }
     // set flag in template
     $pm->setVariable('typef_require_approval', true);
 } elseif (TYPEF_REQUIRE_CONFIRMATION) {
     // set flag in template
     $pm->setVariable('typef_require_confirmation', true);
     // get userid, confirmkey, and set to expire in 3 days