Overview
Comment:Utiliser les options du cookie directement
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: c1e0f2b273628b4581a7efd984d0db20f780b5de
User & Date: bohwaz on 2017-05-26 06:27:00
Other Links: branch diff | manifest | tags
Context
2017-05-26
06:32
Corrections et am√©liorations des formulaires de membres check-in: 01e8abeba8 user: bohwaz tags: dev
06:27
Utiliser les options du cookie directement check-in: c1e0f2b273 user: bohwaz tags: dev
06:23
Afficher l'URL otpauth:// pour permettre de configurer qqchose comme rockbox par exemple check-in: 4c2825a752 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Membres/Session.php from [482e8fcf9e] to [7059fac111].

187
188
189
190
191
192
193
194

195
196
197
198
199
200
201
...
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434

435
436
437
438
439
440
441
442

443
444
445
446
447
448
449
		]);

		$cookie = $selector . '|' . $verifier;

		$options = self::getSessionOptions();

		setcookie(self::PERMANENT_COOKIE_NAME, $cookie, $expire->getTimestamp(),
			$options['cookie_path'], $options['cookie_domain'], $options['cookie_secure'], true);


		return true;
	}

	static public function isOTPRequired()
	{
		self::start();
................................................................................
		self::createUserSession($this->id);

		return true;
	}

	public function logout()
	{
		$url = parse_url(\Garradin\WWW_URL);

		if ($cookie = $this->getPermanentCookie())
		{
			// Suppression de cette session permanente
			DB::getInstance()->delete('membres_sessions', 'selecteur = ?', $cookie->selector);

			setcookie(self::PERMANENT_COOKIE_NAME, null, -1, $url['path'], $url['host'], false, true);

			unset($_COOKIE[self::PERMANENT_COOKIE_NAME]);
		}

		self::start(true);
		session_destroy();
		$_SESSION = [];

		setcookie(self::SESSION_COOKIE_NAME, null, -1, $url['path'], $url['host'], false, true);


		unset($_COOKIE[self::SESSION_COOKIE_NAME]);
	
		return true;
	}

	public function editUser($data)







|
>







 







|






|
>







|
>







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
		]);

		$cookie = $selector . '|' . $verifier;

		$options = self::getSessionOptions();

		setcookie(self::PERMANENT_COOKIE_NAME, $cookie, $expire->getTimestamp(),
			$options['cookie_path'], $options['cookie_domain'], $options['cookie_secure'],
			$options['cookie_httponly']);

		return true;
	}

	static public function isOTPRequired()
	{
		self::start();
................................................................................
		self::createUserSession($this->id);

		return true;
	}

	public function logout()
	{
		$options = self::getSessionOptions();

		if ($cookie = $this->getPermanentCookie())
		{
			// Suppression de cette session permanente
			DB::getInstance()->delete('membres_sessions', 'selecteur = ?', $cookie->selector);

			setcookie(self::PERMANENT_COOKIE_NAME, null, -1, $options['cookie_path'],
				$options['cookie_domain'], $options['cookie_secure'], $options['cookie_httponly']);
			unset($_COOKIE[self::PERMANENT_COOKIE_NAME]);
		}

		self::start(true);
		session_destroy();
		$_SESSION = [];

		setcookie($options['name'], null, -1, $options['cookie_path'],
			$options['cookie_domain'], $options['cookie_secure'], $options['cookie_httponly']);

		unset($_COOKIE[self::SESSION_COOKIE_NAME]);
	
		return true;
	}

	public function editUser($data)