فهرست منبع

Fix issue #238: possibilité d'actualiser avec token

En précisant le token il est possible maintenant d'actualiser les flux
sans avoir besoin de se connecter
Marien Fressinaud 12 سال پیش
والد
کامیت
602230ec53
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      app/controllers/feedController.php

+ 8 - 1
app/controllers/feedController.php

@@ -2,7 +2,14 @@
 
 class feedController extends ActionController {
 	public function firstAction () {
-		if (login_is_conf ($this->view->conf) && !is_logged ()) {
+		$token = $this->view->conf->token();
+		$token_param = Request::param ('token', '');
+		$token_is_ok = ($token != '' && $token == $token_param);
+		$action = Request::actionName ();
+
+		if (login_is_conf ($this->view->conf) &&
+				!is_logged () &&
+				!($token_is_ok && $action == 'actualize')) {
 			Error::error (
 				403,
 				array ('error' => array (Translate::t ('access_denied')))