Exemplo n.º 1
0
 public function auth()
 {
     //Get the client for transient
     $client = get_transient('goToWebinarClient');
     //Check if transient exists
     if (false === $client) {
         //If not - create new client and store it
         $client = new \Citrix\Authentication\Direct($this->getApiKey());
         $client->auth($this->getUsername(), $this->getPassword());
         if ($client->hasErrors()) {
             if (WP_DEBUG == true) {
                 throw new \Exception($client->getError());
             } else {
                 new WP_Error($client->getError());
             }
         }
         set_transient('goToWebinarClient', $client, DAY_IN_SECONDS);
     }
     // dd($client);
     return $client;
 }