Esempio n. 1
0
 /**
  * Singleton
  * @var string $appId nastavení appId (nepovinné)
  * @var bool $testMode funguje v testovacím provozu? - výchozí je testovací mode (nepovinné)
  * @var bool $profiler ma uchovavat data pro profilovani?
  *
  * @return SkautIS
  * @throws InvalidArgumentException
  */
 public static function getInstance($appId = NULL, $testMode = FALSE, $profiler = FALSE, $wsFactory = NULL)
 {
     if (!is_bool($testMode)) {
         throw new InvalidArgumentException('Argument $testMode ma spatnou hodnotu: ' . print_r($testMode, TRUE));
     }
     if (!is_bool($profiler)) {
         throw new InvalidArgumentException('Argument $profiler ma spatnou hodnotu: ' . print_r($profiler, TRUE));
     }
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     if ($appId !== NULL) {
         self::$instance->setAppId($appId);
     }
     self::$instance->setTestMode($testMode);
     self::$instance->profiler = $profiler;
     if ($wsFactory !== NULL) {
         self::$instance->wsFactory = $wsFactory;
     }
     return self::$instance;
 }
 /**
  * Sets variable for view of "Default" page
  */
 public function renderLogin()
 {
     $this->template->loginUrl = $this->skautIS->getLoginUrl();
 }
Esempio n. 3
0
 public function isLoggedIn()
 {
     return $this->client->getUser()->isLoggedIn();
 }
Esempio n. 4
0
 /**
  * @param string $appId
  * @param \Nette\Http\Session $session
  */
 public function __construct(\SkautIS\SkautIS $skautIS, \Nette\Http\Session $session)
 {
     $this->session = $session->getSection(__CLASS__ . "/" . $skautIS->getConfig()->getAppId());
 }