Merge commit 'origin/master' into fusionax
authorVincent Zanotti <vincent.zanotti@m4x.org>
Thu, 6 Aug 2009 17:11:55 +0000 (19:11 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Thu, 6 Aug 2009 17:11:55 +0000 (19:11 +0200)
Conflicts:
templates/search/adv.form.tpl

Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
14 files changed:
bin/cron/emails.check.php
core
htdocs/javascript/xorg.js
modules/admin.php
modules/axletter.php
modules/axletter/axletter.inc.php
modules/openid.php
modules/openid/openid.inc.php
templates/admin/utilisateurs.tpl
templates/lists/create.tpl
templates/lists/options.tpl
templates/search/adv.form.tpl
templates/survey/edit_root.tpl
upgrade/0.10.1/update.sh [new file with mode: 0755]

index 520bb6a..f2ebe14 100755 (executable)
@@ -129,7 +129,8 @@ if ($opt_verbose) {
         foreach ($result as $user) {
             echo '* ' . $user['email'] . ' pour ' . $user['hruid'] . "\n";
         }
-        echo "\n";
+    }
+    echo "\n";
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
diff --git a/core b/core
index 9f671b1..aa3f926 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 9f671b1782f8abbdf718b3cedb90f2b7ee81550d
+Subproject commit aa3f926f7f3e37d95872357c139dae4003670cb2
index 3ea7bec..2a4a19c 100644 (file)
@@ -167,11 +167,7 @@ var __goodies_rss = {
         {'url_prefix': 'http://add.my.yahoo.com/content?.intl=fr&url=',
          'img': 'images/goodies/add-yahoo.gif',
          'alt': 'Add to My Yahoo!',
-         'title': 'Ajouter à My Yahoo!'},
-        {'url_prefix': 'http://www.newsgator.com/ngs/subscriber/subext.aspx?url=',
-         'img': 'images/goodies/add-newsgator.gif',
-         'alt': 'Subscribe in NewsGator Online',
-         'title': 'Ajouter à Newsgator'}
+         'title': 'Ajouter à My Yahoo!'}
     ]
 };
 
@@ -323,7 +319,7 @@ function checkPassword(box, okLabel) {
                     }, 750)
            .parent().stop()
                     .animate({ backgroundColor: bgcolor }, 750);
-    var submitButton = $(":submit[@name='" + passwordprompt_submit + "']");
+    var submitButton = $(":submit[name='" + passwordprompt_submit + "']");
     if (ok && pass.length >= 6) {
         submitButton.attr("value", okLabel);
         submitButton.removeAttr("disabled");
index 775d4ff..53e3bf3 100644 (file)
@@ -465,6 +465,7 @@ class AdminModule extends PLModule
                     // Checks for alias' user validity.
                     if (!preg_match('/[-a-z0-9\.]+/s', $alias)) {
                         $page->trigError("'$alias' n'est pas un alias valide");
+                        break;
                     }
 
                     // Eventually adds the alias to the right domain.
index b1f3a86..b27dc7d 100644 (file)
@@ -102,7 +102,7 @@ class AXLetterModule extends PLModule
             $res = XDB::query("SELECT * FROM axletter WHERE FIND_IN_SET('new', bits)");
             if ($res->numRows()) {
                 extract($res->fetchOneAssoc(), EXTR_OVERWRITE);
-                $subset_to = explode("\n", $subset);
+                $subset_to = ($subset ? explode("\n", $subset) : null);
                 $subset = (count($subset_to) > 0);
                 $saved = true;
             } else  {
@@ -163,7 +163,7 @@ class AXLetterModule extends PLModule
                 XDB::execute("REPLACE INTO  axletter
                                        SET  id = {?}, short_name = {?}, subject = {?}, title = {?}, body = {?},
                                             signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}, subset = {?}",
-                             $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to): null);
+                             $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to) : null);
                 if (!$saved) {
                     global $globals;
                     $mailer = new PlMailer();
index e238c41..d85d25f 100644 (file)
@@ -60,7 +60,7 @@ class AXLetter extends MassMailer
         if ($this->_date == '0000-00-00') {
             $this->_date = 0;
         }
-        $this->_subset_to = explode("\n", $this->_subset_to);
+        $this->_subset_to = ($this->_subset_to ? explode("\n", $this->_subset_to) : null);
         $this->_subset = (count($this->_subset_to) > 0);
     }
 
@@ -205,7 +205,7 @@ class AXLetter extends MassMailer
             require_once("emails.inc.php");
             $ids = ids_from_mails($this->_subset_to);
             $ids_list = implode(',', $ids);
-            if(count($ids_list) > 0) {
+            if(count($ids) > 0) {
                 $where[] = "ni.user_id IN ($ids_list)";
             } else {
                 // No valid email
index 6b8f031..574b1bf 100644 (file)
@@ -197,8 +197,7 @@ class OpenidModule extends PLModule
 
         // Finally answers the request.
         if ($server->IsUserAuthorized($user) && $trusted) {
-            $server->AnswerRequest(
-                true, $user, Post::b('trust_sreg') ? $sreg_response : null);
+            $server->AnswerRequest(true, Post::b('trust_sreg') ? $sreg_response : null);
         } else {
             $server->AnswerRequest(false);
         }
index 455e9df..c8c5bf7 100644 (file)
@@ -106,10 +106,11 @@ class OpenId
 
     // Answers the current request, and renders the response. Appends the |sreg|
     // data when not null.
-    public function AnswerRequest($is_authorized, $user = null, $sreg_data = null)
+    public function AnswerRequest($is_authorized, $sreg_data = null)
     {
         // Creates the response.
-        if ($is_authorized && $this->request->idSelect() && $user) {
+        if ($is_authorized && $this->request->idSelect()) {
+            $user = S::user();
             $response = $this->request->answer(
                 $is_authorized, null, $user->login(), $this->GetUserUrl($user));
         } else {
@@ -203,12 +204,16 @@ class OpenId
             header(sprintf('%s %d', $_SERVER['SERVER_PROTOCOL'], $web_response->code),
                    true, $web_response->code);
 
-            foreach ($web_response->headers as $key => $value) {
-                header(sprintf('%s: %s', $key, $value));
-            }
+            if (is_a($response, 'Auth_OpenID_ServerError')) {
+                print "Erreur lors de l'authentification OpenId: " . $response->toString();
+            } else {
+                foreach ($web_response->headers as $key => $value) {
+                    header(sprintf('%s: %s', $key, $value));
+                }
 
-            header('Connection: close');
-            print $web_response->body;
+                header('Connection: close');
+                print $web_response->body;
+            }
         }
         exit;
     }
index 8d709af..f1aaa63 100644 (file)
@@ -140,7 +140,7 @@ function ban_read()
       </td>
       <td>
         <div style="float: left">
-          <input type="text" name="newpass_clair" size="10" maxlength="10" value="********" />
+          <input type="text" name="newpass_clair" size="10" maxlength="256" value="********" />
           <input type="hidden" name="passw" size="32" maxlength="32" value="{$mr.password}" />
           <input type="hidden" name="hashpass" value="" />
         </div>
index af6a2bb..2f3f935 100644 (file)
@@ -86,8 +86,8 @@ liste&nbsp;:
     <script type="text/javascript">//<![CDATA[
       {literal}
       $(function() {
-        $(":radio[@name=asso]").change(function() {
-          var asso = $(":radio[@name=asso]:checked").val();
+        $(":radio[name=asso]").change(function() {
+          var asso = $(":radio[name=asso]:checked").val();
           if ((asso == "binet") || (asso == "alias")) {
             $(".groupex").hide();
             $(".promo").show();
@@ -101,8 +101,8 @@ liste&nbsp;:
         }).change();
       });
       $(function() {
-        $(":text[@name=promo]").change(function () {
-          var str = $(":text[@name=promo]").val();
+        $(":text[name=promo]").change(function () {
+          var str = $(":text[name=promo]").val();
           $("span#promotion").text(str);
         }).change();
       });
index dcaa134..55615d2 100644 (file)
@@ -148,8 +148,8 @@ Tu n'es pas administrateur de la liste, mais du site.
         <script type="text/javascript">//<![CDATA[
           {literal}
           $(function() {
-            $(":radio[@name=bogo_level]").change(function() {
-              if ($(":radio[@name=bogo_level]:checked").val() == 0) {
+            $(":radio[name=bogo_level]").change(function() {
+              if ($(":radio[name=bogo_level]:checked").val() == 0) {
                 $("#unsurelevel").hide();
               } else {
                 $("#unsurelevel").show();
index 82fd654..28d9624 100644 (file)
 
   // when changing country, open up region choice
   function changeCountry(a2) {
-    $(".autocompleteTarget[@name='country']").attr('value',a2);
+    $(".autocompleteTarget[name='country']").attr('value',a2);
 
     if (a2) {
-      $(".autocomplete[@name='countryTxt']").addClass('hidden_valid');
+      $(".autocomplete[name='countryTxt']").addClass('hidden_valid');
 
-      $("[@name='region']").parent().load(baseurl + 'list/region/', { country:a2 }, function() {
-          if ($("select[@name='region']").children("option").size() > 1) {
-            $("select[@name='region']").attr('value', '{/literal}{$smarty.request.region}{literal}');
+      $("[name='region']").parent().load(baseurl + 'list/region/', { country:a2 }, function() {
+          if ($("select[name='region']").children("option").size() > 1) {
+            $("select[name='region']").attr('value', '{/literal}{$smarty.request.region}{literal}');
 
             $("tr#region_ln").show();
           } else {
-            $("select[@name='region']").attr('value', '');
+            $("select[name='region']").attr('value', '');
 
             $("tr#region_ln").hide();
           }
         });
     } else {
-      $(".autocomplete[@name='countryTxt']").removeClass('hidden_valid');
+      $(".autocomplete[name='countryTxt']").removeClass('hidden_valid');
 
-      $("select[@name='region']").attr('value', '');
+      $("select[name='region']").attr('value', '');
 
       $("tr#region_ln").hide();
     }
 
   // when changing school, open diploma choice
   function changeSchool(schoolId) {
-    $(".autocompleteTarget[@name='school']").attr('value',schoolId);
+    $(".autocompleteTarget[name='school']").attr('value',schoolId);
 
     if (schoolId) {
-      $(".autocomplete[@name='schoolTxt']").addClass('hidden_valid');
+      $(".autocomplete[name='schoolTxt']").addClass('hidden_valid');
     } else {
-      $(".autocomplete[@name='schoolTxt']").removeClass('hidden_valid');
+      $(".autocomplete[name='schoolTxt']").removeClass('hidden_valid');
     }
 
-    $("[@name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
-        $("select[@name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
+    $("[name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
+        $("select[name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
       });
   }
 
       return function(i) {
         nameRealField = this.field.replace(/Txt$/, '');
 
-        $(".autocompleteTarget[@name='"+nameRealField+"']").attr('value',i.extra[1]);
+        $(".autocompleteTarget[name='"+nameRealField+"']").attr('value',i.extra[1]);
 
-        $(".autocomplete[@name='"+this.field+"']").addClass('hidden_valid');
+        $(".autocomplete[name='"+this.field+"']").addClass('hidden_valid');
       }
     }
 
 
       $(".autocomplete").change(function() { $(this).removeClass('hidden_valid'); });
 
-      $(".autocomplete[@name='countryTxt']").change(function() { changeCountry(''); });
+      $(".autocomplete[name='countryTxt']").change(function() { changeCountry(''); });
 
       changeCountry({/literal}'{$smarty.request.country}'{literal});
 
-      $(".autocomplete[@name='schoolTxt']").change(function() { changeSchool(''); });
+      $(".autocomplete[name='schoolTxt']").change(function() { changeSchool(''); });
 
       changeSchool({/literal}'{$smarty.request.school}'{literal});
 
           var fieldName = $(this).attr('href');
 
           $(this).attr('href', baseurl + 'list/'+fieldName).click(function() {
-              var oldval = $("input.autocompleteTarget[@name='"+fieldName+"']")[0].value;
+              var oldval = $("input.autocompleteTarget[name='"+fieldName+"']")[0].value;
 
-              $(".autocompleteTarget[@name='"+fieldName+"']").parent().load(baseurl + 'list/'+fieldName,{},
+              $(".autocompleteTarget[name='"+fieldName+"']").parent().load(baseurl + 'list/'+fieldName,{},
                 function(selectBox) {
-                  $(".autocompleteTarget[@name='"+fieldName+"']").remove();
-                  $(".autocomplete[@name='"+fieldName+"Txt']").remove();
-                  $("select[@name='"+fieldName+"']").attr('value', oldval);
+                  $(".autocompleteTarget[name='"+fieldName+"']").remove();
+                  $(".autocomplete[name='"+fieldName+"Txt']").remove();
+                  $("select[name='"+fieldName+"']").attr('value', oldval);
                 });
 
               return false;
index 7e3fd89..aa1c88d 100644 (file)
@@ -54,7 +54,7 @@
             $("#ln_promo_exp").show();
           } 
         }
-        $("[@name='survey_question[mode]']").change(function() { hidePromo(this.value); });
+        $("[name='survey_question[mode]']").change(function() { hidePromo(this.value); });
         hidePromo({/literal}"{$survey_current.mode}"{literal});
       });
       {/literal}
diff --git a/upgrade/0.10.1/update.sh b/upgrade/0.10.1/update.sh
new file mode 100755 (executable)
index 0000000..ec3f93b
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+mailman_stop
+mailman_templates
+mailman_start
+
+###########################################################
+for sql in *.sql
+do
+    echo -n $sql
+    $MYSQL x4dat < $sql &>/dev/null || echo -n " ERROR"
+    echo .
+done