A few typos.
[platal.git] / modules / xnetgrp.php
index a7a47e2..afe992d 100644 (file)
@@ -122,7 +122,7 @@ class XnetGrpModule extends PLModule
 
         if (S::logged()) {
             if (Env::has('read')) {
-                XDB::query('DELETE r.*
+                XDB::query('DELETE groupex.r.*
                               FROM groupex.announces_read AS r
                         INNER JOIN groupex.announces AS a ON a.id = r.announce_id
                              WHERE peremption < CURRENT_DATE()');
@@ -237,6 +237,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) !!!");
@@ -252,7 +261,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'),
@@ -269,7 +278,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'),
@@ -320,7 +329,7 @@ class XnetGrpModule extends PLModule
             $mls = array_keys(Env::v('ml', array()));
             $mbr = array_keys(Env::v('membres', array()));
 
-            require_once dirname(__FILE__) . '/xnetgrp/mail.inc.php';
+            $this->load('mail.inc.php');
             set_time_limit(120);
             $tos = get_all_redirects($mbr,  $mls, $mmlist);
             $upload = PlUpload::get($_FILES['uploaded'], S::v('forlife'), 'xnet.emails', true);
@@ -479,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)
@@ -735,7 +745,7 @@ class XnetGrpModule extends PLModule
     {
         global $globals;
 
-        require_once dirname(__FILE__) . '/xnetgrp/mail.inc.php';
+        $this->load('mail.inc.php');
         $page->changeTpl('xnetgrp/annuaire-admin.tpl');
         $mmlist = new MMList(S::v('uid'), S::v('password'),
                              $globals->asso('mail_domain'));
@@ -1185,7 +1195,7 @@ class XnetGrpModule extends PLModule
         global $globals;
         $page->assign('asso', $globals->asso());
 
-        require_once dirname(__FILE__) . '/xnetgrp/feed.inc.php';
+        $this->load('feed.inc.php');
         $feed = new XnetGrpEventFeed();
         return $feed->run($page, $user, $hash, false);
     }