Exemple #1
0
 public function RenderDiscoveryPage($page, User $user)
 {
     $page->changeTpl('openid/openid.tpl');
     $page->setTitle($user->fullName());
     $page->addLink('openid.server openid2.provider', $this->base_url);
     $page->addLink('openid.delegate openid2.local_id', $user->login());
     $page->assign_by_ref('user', $user);
     // Include the X-XRDS-Location header for Yadis discovery.
     header('X-XRDS-Location: ' . $this->GetUserXrdsUrl($user));
 }
Exemple #2
0
 /**
  * Sets default variables for db and chainable messages
  * 
  * @param array $vars
  *   Variables to set for chainable messages
  */
 public function setDefaultVars($vars = null)
 {
     /*
      * If there's no 'message' variable set, it's a custom message, 
      * so we don't replace any variables except custom ones.
      */
     if (!empty($this->message_id)) {
         $tracking_image = Tracker::getTrackerImage('Email Opened', $this->message_id, $this->user->id);
         // Replace standard variables.
         $this->defaultVariables = ['USER_ID' => $this->user->id, 'MESSAGE_ID' => $this->message_id, 'FULL_NAME' => !empty($this->user->first) ? $this->user->fullName() : $this->default_name, 'URL_KEY' => !empty($this->user->id) ? User::urlKey($this->user->id, $this->user->salt) : '', 'EMAIL' => $this->user->email, 'UNSUBSCRIBE' => $this->unsubscribe && !empty($this->user->user_id) ? $this->getUnsubscribeString() : '', 'TRACKING_IMAGE' => $tracking_image];
     } else {
         $this->defaultVariables = ['UNSUBSCRIBE' => $this->unsubscribe && !empty($this->user->user_id) ? $this->getUnsubscribeString() : '', 'TRACKING_IMAGE' => ''];
         if (!empty($vars)) {
             $this->defaultVariables += $vars;
         }
     }
 }