Merge commit 'origin/fusionax' into account
[platal.git] / modules / xnetgrp.php
index b361dac..7e32553 100644 (file)
@@ -173,12 +173,12 @@ class XnetGrpModule extends PLModule
             $page->assign('requests', $subs_valid->numRows());
         }
 
-        if (!S::has('core_rss_hash')) {
+        if (!S::hasAuthToken()) {
             $page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News publiques",
                               $platal->ns . "rss/rss.xml");
         } else {
             $page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News",
-                              $platal->ns . 'rss/'.S::v('hruid') .'/'.S::v('core_rss_hash').'/rss.xml');
+                              $platal->ns . 'rss/'.S::v('hruid') .'/'.S::v('token').'/rss.xml');
         }
 
         $page->assign('articles', $arts);
@@ -236,6 +236,15 @@ class XnetGrpModule extends PLModule
             if (Post::has('notif_unsub') && Post::i('notif_unsub') == 1) {
                 $flags->addFlag('notif_unsub');
             }
+            $site = trim(Post::v('site'));
+            if ($site && ($site != "http://")) {
+                $scheme = parse_url($site, PHP_URL_SCHEME);
+                if (!$scheme) {
+                    $site = "http://" . $site;
+                }
+            } else {
+                $site = "";
+            }
             if (S::has_perms()) {
                 if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
                     $page->trigError("le domaine doit ĂȘtre un FQDN (aucune modif effectuĂ©e) !!!");
@@ -251,7 +260,7 @@ class XnetGrpModule extends PLModule
                       WHERE  id={?}",
                       Post::v('nom'), Post::v('diminutif'),
                       Post::v('cat'), Post::i('dom'),
-                      Post::v('descr'), Post::v('site'),
+                      Post::v('descr'), $site,
                       Post::v('mail'), Post::v('resp'),
                       Post::v('forum'), Post::v('mail_domain'),
                       Post::has('ax'), Post::v('pub'),
@@ -268,7 +277,7 @@ class XnetGrpModule extends PLModule
                              forum={?}, ax={?}, pub= {?}, sub_url={?},
                              unsub_url={?},flags={?}
                       WHERE  id={?}",
-                      Post::v('descr'), Post::v('site'),
+                      Post::v('descr'), $site,
                       Post::v('mail'), Post::v('resp'),
                       Post::v('forum'), Post::has('ax'),
                       Post::v('pub'),
@@ -308,6 +317,7 @@ class XnetGrpModule extends PLModule
         $mmlist = new MMList(S::v('uid'), S::v('password'),
                            $globals->asso('mail_domain'));
         $page->assign('listes', $mmlist->get_lists());
+        $page->assign('user', S::user());
         $page->addJsLink('ajax.js');
 
         if (Post::has('send')) {
@@ -478,8 +488,9 @@ class XnetGrpModule extends PLModule
         $res = XDB::query('SELECT  uid
                              FROM  groupex.membres
                             WHERE  asso_id = {?}', $globals->asso('id'));
-        $vcard = new VCard($res->fetchColumn(), $photos == 'photos', 'Membre du groupe ' . $globals->asso('nom'));
-        $vcard->do_page($page);
+        $vcard = new VCard($photos == 'photos', 'Membre du groupe ' . $globals->asso('nom'));
+        $vcard->addUsers($res->fetchColumn());
+        $vcard->show();
     }
 
     function handler_csv(&$page, $filename = null)
@@ -692,7 +703,7 @@ class XnetGrpModule extends PLModule
 
     function handler_change_rights(&$page)
     {
-        if (Env::has('right') && (may_update() || S::has('suid'))) {
+        if (Env::has('right') && (may_update() || S::suid())) {
             switch (Env::v('right')) {
               case 'admin':
                 Platal::session()->stopSUID();