Merge branch 'xorg/maint' into xorg/master
authorStéphane Jacob <sj@m4x.org>
Sat, 9 Apr 2011 15:31:19 +0000 (17:31 +0200)
committerStéphane Jacob <sj@m4x.org>
Sat, 9 Apr 2011 15:31:19 +0000 (17:31 +0200)
27 files changed:
ChangeLog
Makefile
README [new file with mode: 0644]
banana
configs/platal.ini
core
htdocs/url_redirect.php [new file with mode: 0644]
include/emails.inc.php
modules/admin.php
modules/lists.php
modules/profile.php
modules/urlshortener.php
modules/xnet.php
modules/xnetgrp.php
modules/xnetlists.php
templates/admin/index.tpl
templates/googleapps/admin.user.tpl
templates/lists/admin_aliases.tpl [new file with mode: 0644]
templates/lists/admin_edit_alias.tpl [new file with mode: 0644]
templates/urlshortener/admin.tpl
templates/xnetgrp/mail.tpl
upgrade/1.1.1/01_languages.sql [new file with mode: 0644]
upgrade/1.1.1/02_emails.sql [new file with mode: 0644]
upgrade/1.1.1/03_url.sql [new file with mode: 0644]
upgrade/1.1.1/README [new file with mode: 0644]
upgrade/1.1.1/connect.db.inc.php [new symlink]
upgrade/1.1.1/update.sh [new file with mode: 0755]

index 5f77a84..8fb9376 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,17 @@
 ================================================================================
+VERSION 1.1.1                                                         XX XX XXXX
+
+Bug/Wish:
+
+    * Emails:
+        - #1459: Lists and administrates aliases on main domain            -JAC
+
+From 1.1.0 branch:
+
+    * Search:
+        - #1449: Load json2 on IE because IE<=7 do not implement JSON      -FRU
+
+================================================================================
 VERSION 1.1.0                                                         26 03 2011
 
 New:
index d63ab9b..84edd6f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -139,25 +139,8 @@ get-wiki:
 ## openid
 ##
 
-openid: get-openid spool/openid/store
-
-# There is no obvious way to automatically use the latest version
-OPENID_VERSION = 2.2.2
-OPENID_COMMIT  = 782224d
-get-openid:
-       @if ! test -d include/Auth; then                                  \
-               wget --no-check-certificate                                   \
-                       https://github.com/openid/php-openid/tarball/$(OPENID_VERSION) \
-                       -O php-openid-$(OPENID_VERSION).tar.gz; \
-               tar -xzf php-openid-$(OPENID_VERSION).tar.gz;                \
-               mv openid-php-openid-$(OPENID_COMMIT)/Auth include/;                \
-               rm php-openid-$(OPENID_VERSION).tar.gz;                      \
-               rm -r openid-php-openid-$(OPENID_COMMIT);                           \
-       fi
-
-spool/openid/store:
-       mkdir -p $@
-       chmod o+w $@
+openid:
+       -rm -rf include/Auth
 
 ##
 ## banana
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..8c46db2
--- /dev/null
+++ b/README
@@ -0,0 +1,34 @@
+Deps
+====
+
+Debian
+------
+* php5-cli
+* php5-tidy
+* php5-mysql
+* php5-xmlrpc
+* php5-curl
+* php5-gd
+* php-date
+* php-fpdf
+* php-mail
+* php-mail-mime
+* smarty
+* apache2
+* libapache2-mod-php5
+* python
+* mysql-server
+* mysql-client
+* phpunit
+
+Recommended
+-----------
+* php5-xdebug
+* php5-xcache
+
+Languages and countries administration
+--------------------------------------
+* pkg-isocodes
+* isoquery
+
+// vim:ft=asciidoc:
diff --git a/banana b/banana
index de2d442..212ada1 160000 (submodule)
--- a/banana
+++ b/banana
@@ -1 +1 @@
-Subproject commit de2d442deb5be66b2bbe677b490588e470cfce8c
+Subproject commit 212ada1babbd46d48b44e47f24bb129370c24b6a
index c7e159e..a057415 100644 (file)
@@ -104,6 +104,9 @@ secure_domain = ""
 ; command line. The value is computed automatically when php serves a web page.
 baseurl = "https://www.example.org/"
 
+; The base url of the url shortener.
+baseurl_shortener = ""
+
 ; $globals->sitename
 ; The name of the site
 ;
diff --git a/core b/core
index cab6c1c..13cec5a 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit cab6c1c15dfa75c04b433447e608edb59171c376
+Subproject commit 13cec5adcabc015959a87a75ef67cc354242a6bd
diff --git a/htdocs/url_redirect.php b/htdocs/url_redirect.php
new file mode 100644 (file)
index 0000000..f4e25bd
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+require_once 'xorg.inc.php';
+
+$platal = new Xorg('core');
+
+global $globals;
+$alias = ltrim($platal->pl_self(), '/');
+
+if (preg_match('/^[a-zA-Z0-9\-\/]+$/i', $alias)) {
+    $url = XDB::fetchOneCell('SELECT  url
+                                FROM  url_shortener
+                               WHERE  alias = {?}',
+                             $alias);
+    if ($url) {
+        http_redirect($url);
+    }
+}
+
+header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
+?>
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html>
+  <head>
+    <title>404 Not Found</title>
+  </head>
+  <body>
+    <h1>Not Found</h1>
+    The requested URL <?php echo $_SERVER['REQUEST_URI'] ?> was not found on this server.<p>
+    <hr>
+    <address><?php echo $_SERVER['SERVER_SIGNATURE'] ?></address>
+  </body>
+</html>
+<?php
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index b2ddb4b..19c172e 100644 (file)
@@ -24,6 +24,15 @@ define('ERROR_INACTIVE_REDIRECTION', 2);
 define('ERROR_INVALID_EMAIL', 3);
 define('ERROR_LOOP_EMAIL', 4);
 
+// Checks if an email update is required in MLs and aliases.
+// This occurs when the user don't have email permissions and her email has changed.
+function require_email_update(User $user, $new_email)
+{
+    Platal::assert(!is_null($user), 'User cannot be null.');
+
+    return !$user->checkPerms(User::PERM_MAIL) && $new_email != $user->forlifeEmail();
+}
+
 function format_email_alias($email)
 {
     if ($user = User::getSilent($email)) {
@@ -81,6 +90,15 @@ function update_list_alias($email, $former_email, $local_part, $domain, $type =
     return true;
 }
 
+// Updates an email in all aliases (groups and events).
+function update_alias_user($former_email, $new_email)
+{
+    XDB::execute('UPDATE  email_virtual
+                     SET  redirect = {?}
+                   WHERE  redirect = {?} AND (type = \'alias\' OR type = \'event\')',
+                 $new_email, $former_email);
+}
+
 function list_alias_members($local_part, $domain)
 {
     $emails = XDB::fetchColumn('SELECT  DISTINCT(redirect)
index f63a6e2..a8e62eb 100644 (file)
@@ -444,6 +444,7 @@ class AdminModule extends PLModule
         }
 
         // Account Form {{{
+        require_once 'emails.inc.php';
         $to_update = array();
         if (Post::has('disable_weak_access')) {
             $to_update['weak_password'] = null;
@@ -504,9 +505,10 @@ class AdminModule extends PLModule
             if (Post::t('comment') != $user->comment) {
                 $to_update['comment'] = Post::blank('comment') ? null : Post::t('comment');
             }
-            if (!$user->checkPerms(User::PERM_MAIL) && Post::t('email') != $user->forlifeEmail()) {
+            if (require_email_update($user, Post::t('email'))) {
                 $to_update['email'] = Post::t('email');
                 $listClient->change_user_email($user->forlifeEmail(), Post::t('email'));
+                update_alias_user($user->forlifeEmail(), Post::t('email'));
             }
         }
         if (!empty($to_update)) {
@@ -574,7 +576,6 @@ class AdminModule extends PLModule
         // }}}
 
         // Email forwards form {{{
-        require_once("emails.inc.php");
         $redirect = ($registered ? new Redirect($user) : null);
         if (Post::has('add_fwd')) {
             $email = Post::t('email');
index e1bfb11..eec6fa2 100644 (file)
@@ -44,6 +44,7 @@ class ListsModule extends PLModule
             'lists/soptions'     => $this->make_hook('soptions',  AUTH_MDP),
             'lists/check'        => $this->make_hook('check',     AUTH_MDP),
             'admin/lists'        => $this->make_hook('admin_all', AUTH_MDP,    'admin'),
+            'admin/aliases'      => $this->make_hook('aaliases',  AUTH_MDP,    'admin')
         );
     }
 
@@ -886,6 +887,62 @@ class ListsModule extends PLModule
         $listes = $this->client->get_all_lists();
         $page->assign_by_ref('listes', $listes);
     }
+
+    function handler_aaliases($page, $alias = null)
+    {
+        global $globals;
+        require_once 'emails.inc.php';
+        $page->setTitle('Administration - Aliases');
+
+        if (Post::has('new_alias')) {
+            pl_redirect('admin/aliases/' . Post::t('new_alias') . '@' . $globals->mail->domain);
+        }
+
+        // If no alias, list them all.
+        if (is_null($alias)) {
+            $page->changeTpl('lists/admin_aliases.tpl');
+            $page->assign('aliases', array_merge(iterate_list_alias($globals->mail->domain), iterate_list_alias($globals->mail->domain2)));
+            return;
+        }
+
+        list($local_part, $domain) = explode('@', $alias);
+        if (!($globals->mail->domain == $domain || $globals->mail->domain2 == $domain)
+              || !preg_match("/^[a-zA-Z0-9\-\.]*$/", $local_part)) {
+            $page->trigErrorRedirect('Le nom de l\'alias est erroné.', $globals->asso('diminutif') . 'admin/aliases');
+        }
+
+        // Now we can perform the action.
+        if (Post::has('del_alias')) {
+            S::assert_xsrf_token();
+
+            delete_list_alias($local_part, $domain);
+            $page->trigSuccessRedirect($alias . ' supprimé.', 'admin/aliases');
+        }
+
+        if (Post::has('add_member')) {
+            S::assert_xsrf_token();
+
+            if (add_to_list_alias(Post::t('add_member'), $local_part, $domain)) {
+                $page->trigSuccess('Ajout réussit.');
+            } else {
+                $page->trigError('Ajout infructueux.');
+            }
+        }
+
+        if (Get::has('del_member')) {
+            S::assert_xsrf_token();
+
+            if (delete_from_list_alias(Get::t('del_member'), $local_part, $domain)) {
+                $page->trigSuccess('Suppression réussie.');
+            } else {
+                $page->trigError('Suppression infructueuse.');
+            }
+        }
+
+        $page->changeTpl('lists/admin_edit_alias.tpl');
+        $page->assign('members', list_alias_members($local_part, $domain));
+        $page->assign('alias', $alias);
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index b0092a7..4209f19 100644 (file)
@@ -285,7 +285,7 @@ class ProfileModule extends PLModule
 
         // Determines and displays the virtual alias.
         if (!is_null($owner) && $profile->alias_pub == 'public') {
-            $page->assign('virtualalias', $owner->emailAliases());
+            $page->assign('virtualalias', $owner->emailAlias());
         }
 
         $page->assign_by_ref('profile', $profile);
index 0e7f3a1..33b5153 100644 (file)
@@ -24,22 +24,14 @@ class UrlShortenerModule extends PLModule
     function handlers()
     {
         return array(
-            'url'       => $this->make_hook('url',       AUTH_COOKIE),
+            'url'       => $this->make_hook('url',       AUTH_PUBLIC),
             'admin/url' => $this->make_hook('admin_url', AUTH_MDP, 'admin')
         );
     }
 
     function handler_url($page, $alias)
     {
-        $url = XDB::fetchOneCell('SELECT  url
-                                    FROM  url_shortener
-                                   WHERE  alias = {?}',
-                                 $alias);
-
-        if (is_null($url)) {
-            return PL_NOT_FOUND;
-        }
-        http_redirect($url);
+        http_redirect(Platal::globals()->core->base_url_shortener . $alias);
     }
 
     function handler_admin_url($page)
@@ -54,17 +46,21 @@ class UrlShortenerModule extends PLModule
         $alias = Post::t('alias');
 
         $url_regex = '{^(https?|ftp)://[a-zA-Z0-9._%#+/?=&~-]+$}i';
-        if (!preg_match($url_regex, $url)) {
+        if (strlen($url) > 255 || !preg_match($url_regex, $url)) {
             $page->trigError("L'url donnée n'est pas valide.");
             return;
         }
         $page->assign('url', $url);
 
         if ($alias != '') {
-            if (!preg_match('/^[a-zA-Z0-9\-]{6}$/i', $alias)) {
+            if (!preg_match('/^[a-zA-Z0-9\-\/]+$/i', $alias)) {
                 $page->trigError("L'alias proposé n'est pas valide.");
                 return;
             }
+            if (preg_match('/^a\//i', $alias)) {
+                $page->trigError("L'alias commence par le préfixe 'a/' qui est réservé et donc non autorisé.");
+                return;
+            }
             $page->assign('alias', $alias);
 
             $used = XDB::fetchOneCell('SELECT  COUNT(*)
@@ -77,7 +73,7 @@ class UrlShortenerModule extends PLModule
             }
         } else {
             do {
-                $alias = rand_token(6);
+                $alias = 'a/' . rand_token(6);
                 $used = XDB::fetchOneCell('SELECT  COUNT(*)
                                              FROM  url_shortener
                                             WHERE  alias = {?}',
@@ -89,7 +85,7 @@ class UrlShortenerModule extends PLModule
         XDB::execute('INSERT INTO  url_shortener (url, alias)
                            VALUES  ({?}, {?})',
                      $url, $alias);
-        $page->trigSuccess("L'url « " . $url . ' » est maintenant accessible depuis « ' . Platal::globals()->baseurl . '/url/' . $alias . ' ».');
+        $page->trigSuccess("L'url « " . $url . ' » est maintenant accessible depuis « http://u.w4x.org/' . $alias . ' ».');
     }
 }
 
index dcb6d61..880d404 100644 (file)
@@ -402,6 +402,12 @@ Email envoyé à " . Post::t('login'));
                        Post::t('full_name'), Post::t('directory_name'), Post::t('display_name'),
                        (Post::t('sex') == 'male') ? 'male' : 'female', Post::t('email'), $user->id());
             if (XDB::affectedRows()) {
+                require_once 'emails.inc.php';
+                if (require_email_update($user, Post::t('email'))) {
+                    $listClient = new MMList(S::user());
+                    $listClient->change_user_email($user->forlifeEmail(), Post::t('email'));
+                    update_alias_user($user->forlifeEmail(), Post::t('email'));
+                }
                 $user = User::getWithUID($user->id());
                 S::set('user', $user);
                 $page->trigSuccess('Données mises à jour.');
index 90a905f..25871a8 100644 (file)
@@ -993,6 +993,7 @@ class XnetGrpModule extends PLModule
         $mmlist = new MMList(S::user(), $globals->asso('mail_domain'));
 
         if (Post::has('change')) {
+            require_once 'emails.inc.php';
             S::assert_xsrf_token();
 
             // Convert user status to X
@@ -1020,6 +1021,11 @@ class XnetGrpModule extends PLModule
                              WHERE  uid = {?}',
                            Post::t('email'), $user->id());
             }
+            if (require_email_update($user, Post::t('email'))) {
+                $listClient = new MMList(S::user());
+                $listClient->change_user_email($user->forlifeEmail(), Post::t('email'));
+                update_alias_user($user->forlifeEmail(), Post::t('email'));
+            }
             if (XDB::affectedRows()) {
                 $page->trigSuccess('Données de l\'utilisateur mises à jour.');
             }
index a502f02..8217776 100644 (file)
@@ -105,6 +105,9 @@ class XnetListsModule extends ListsModule
         $page->assign('listes', $listes);
         $page->assign('aliases', iterate_list_alias($globals->asso('mail_domain')));
         $page->assign('may_update', may_update());
+        if (S::suid()) {
+            $page->trigWarning("Attention&nbsp;: l'affichage des listes de diffusion ne tient pas compte de l'option « Voir le site comme&hellip; ».");
+        }
 
         if (count($listes) > 0 && !$globals->asso('has_ml')) {
             XDB::execute("UPDATE  groups
index e491163..fbb6ad3 100644 (file)
@@ -51,6 +51,8 @@
     <td>
       <a href="admin/lists">MLs</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="admin/aliases">aliases</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/mx/broken">MX défaillants</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/emails/lost">Perdus de vue</a>
index 65f5fb2..a93804a 100644 (file)
         {/if}
       </td>
     </tr>
-  </table><br />
-</form>
+  </table>
+</form><br />
 
 <table class="bicol" style="text-align: center">
   <tr>
diff --git a/templates/lists/admin_aliases.tpl b/templates/lists/admin_aliases.tpl
new file mode 100644 (file)
index 0000000..8e9dfd6
--- /dev/null
@@ -0,0 +1,50 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h1>Aliases</h1>
+
+<table cellspacing="0" cellpadding="0" class="tinybicol">
+  <tr>
+    <th>Aliases</th>
+  </tr>
+  {if $aliases|@count}
+  {foreach from=$aliases item=alias}
+  <tr>
+    <td><a href="admin/aliases/{$alias}">{$alias}</a></td>
+  </tr>
+  {/foreach}
+  {else}
+  <tr>
+    <td>Aucun alias</td>
+  </tr>
+  {/if}
+</table>
+
+<form method="post" action="admin/aliases">
+  {xsrf_token_field}
+  <p class="center">
+    <input type="text" name="new_alias" />
+    <input type="submit" value="Créer l'alias" />
+  </p>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/lists/admin_edit_alias.tpl b/templates/lists/admin_edit_alias.tpl
new file mode 100644 (file)
index 0000000..1ec1f16
--- /dev/null
@@ -0,0 +1,92 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<p>[<a href="admin/aliases">Retour à la liste des aliases</a>]</p>
+
+<h1>Membres de {$alias}</h1>
+
+<table class="tinybicol">
+  {if $members.users|@count}
+  {foreach from=$members.users item=member}
+  <tr>
+    <td>
+      {if $member->hasProfile()}
+      <a href="https://www.polytechnique.org/profile/{$member->hruid}" class="popup2">{$member->fullName()}</a>
+      {else}
+      {$member->fullName()}
+      {/if}
+    </td>
+    <td class="right">{$member->promo()}</td>
+    <td class="center">
+      <a href="admin/aliases/{$alias}?del_member={$member->id()}&amp;token={xsrf_token}">
+      {icon name=delete title="retirer membre"}
+      </a>
+    </td>
+  </tr>
+  {/foreach}
+  {/if}
+  {if $members.nonusers|@count}
+  {foreach from=$members.nonusers item=member}
+  <tr>
+    <td>{$member}</td>
+    <td></td>
+    <td class="center">
+      <a href="admin/aliases/{$alias}?del_member={$member}&amp;token={xsrf_token}">
+      {icon name=delete title="retirer membre"}
+      </a>
+    </td>
+  </tr>
+  {/foreach}
+  {/if}
+  {if $members.users|@count eq 0 && $members.nonusers|@count eq 0}
+  <tr>
+    <td colspan="3">
+      <em>aucun membre&hellip;</em>
+    </td>
+  </tr>
+  {/if}
+  <tr>
+    <th colspan="3">Ajouter</th>
+  </tr>
+  <tr>
+    <td colspan="3" class="center">
+      <form method="post" action="admin/aliases/{$alias}">
+        {xsrf_token_field}
+        <div>
+        <input type="text" name="add_member" />
+        &nbsp;
+        <input type="submit" value="ajouter" />
+        </div>
+      </form>
+    </td>
+  </tr>
+</table>
+
+
+<form method="post" action="admin/aliases/{$alias}">
+  {xsrf_token_field}
+  <p class="center">
+    <input type="submit" name="del_alias" value="Supprimer l'alias" onclick="return confirm('ES tu sûr de vouloir supprimer cet alias.')" />
+  </p>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index e9d1dea..ec11de8 100644 (file)
       <td><input type="text" name="url" value="{if t($url)}{$url}{/if}" /></td>
     </tr>
     <tr>
-      <th>Alias (6 caractères, optionnel)&nbsp;:</th>
+      <th>Alias (optionnel)&nbsp;:</th>
       <td>
-        <input type="text" name="alias" size="6" maxlength="6" value="{if t($alias)}{$alias}{/if}" />
-        <small>(peut contenir lettres, chiffres et tirets)</small>
+        <input type="text" name="alias" size="42" maxlength="255" value="{if t($alias)}{$alias}{/if}" />
+        <small>(peut contenir lettres, chiffres, tirets et /)</small>
       </td>
     </tr>
   </table>
   <p class="center"><input type="submit" value="Raccourcir" /></p>
 </form>
 
+<h3>Explications</h3>
+<p>
+  L'alias peut être demandé. Dans ce cas, sa longueur maximal autorisée est
+  de 255 lettres, chiffres, tirets ou /. Ce dernier permet de définir des
+  domaines pour regrouper des raccourcis liés. Par exemple, « nl-04-04/ »
+  pourrait être utilisé comme base pour les urls de la lettre mensuelle d'avril
+  2004.<br />
+  Si aucun alias n'est fournit, le site en génère un de 6 caractères aléatoires
+  accolés à la la base «&nbsp;a/&nbsp;» (par exemple&nbsp;: « a/azerty ». Ce
+  préfixe «&nbsp;a/&nbsp;» et réservé à cet usage et ne peut être utilisé pour
+  former une url choisie.
+</p>
+
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 1818280..44431ad 100644 (file)
@@ -96,7 +96,7 @@ masculin ou féminin, par son prénom, ou son nom.
       <td>
         <label><input type="checkbox" name="ml[{$l.list}]" value="1" {if $smarty.request.ml[$l.list]}checked="checked"{/if} />
         {$l.addr}</label>
-        <a href="{$platal->ns}lists/admin/{$l.list}" class="popup">(voir composition)</a>
+        <a href="{$platal->ns}lists/members/{$l.list}" class="popup">(voir composition)</a>
       </td>
     </tr>
     {/foreach}
diff --git a/upgrade/1.1.1/01_languages.sql b/upgrade/1.1.1/01_languages.sql
new file mode 100644 (file)
index 0000000..b6529a7
--- /dev/null
@@ -0,0 +1,8 @@
+-- Updates serbian iso code.
+UPDATE  profile_langskills
+   SET  lid = 'srp'
+ WHERE  lid = 'scc';
+DELETE FROM  profile_langskill_enum
+      WHERE  iso_639_2b = 'scc';
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/1.1.1/02_emails.sql b/upgrade/1.1.1/02_emails.sql
new file mode 100644 (file)
index 0000000..6903518
--- /dev/null
@@ -0,0 +1,10 @@
+    DELETE  e2
+      FROM  email_virtual AS e1
+INNER JOIN  email_virtual AS e2
+     WHERE  e1.email = e2.email AND e1.domain = e2.domain AND e1.redirect != e2.redirect
+            AND e1.redirect = REPLACE(e2.redirect, '@m4x.org', '@polytechnique.org');
+UPDATE  email_virtual
+   SET  redirect = REPLACE(redirect, '@m4x.org', '@polytechnique.org')
+ WHERE  redirect LIKE '%@m4x.org';
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/1.1.1/03_url.sql b/upgrade/1.1.1/03_url.sql
new file mode 100644 (file)
index 0000000..14810a1
--- /dev/null
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS tmp_url_shortener;
+CREATE TEMPORARY TABLE tmp_url_shortener LIKE url_shortener;
+INSERT INTO tmp_url_shortener SELECT * FROM url_shortener;
+DROP TABLE url_shortener;
+CREATE TABLE url_shortener (
+  alias VARCHAR(255) NOT NULL DEFAULT '',
+  url TEXT NOT NULL,
+  PRIMARY KEY (alias)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO  url_shortener (alias, url)
+     SELECT  alias, url
+       FROM  tmp_url_shortener;
+DROP TABLE IF EXISTS tmp_url_shortener;
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/1.1.1/README b/upgrade/1.1.1/README
new file mode 100644 (file)
index 0000000..936e205
--- /dev/null
@@ -0,0 +1,3 @@
+The following variable should be set:
+[Core]
+baseurl_shortener = "http://u.w4x.org/"
diff --git a/upgrade/1.1.1/connect.db.inc.php b/upgrade/1.1.1/connect.db.inc.php
new file mode 120000 (symlink)
index 0000000..442fab7
--- /dev/null
@@ -0,0 +1 @@
+../../bin/connect.db.inc.php
\ No newline at end of file
diff --git a/upgrade/1.1.1/update.sh b/upgrade/1.1.1/update.sh
new file mode 100755 (executable)
index 0000000..9230e34
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+###########################################################
+[ "$DATABASE" != "x4dat" ] || die "Cannot target x4dat"
+
+confirm "* Running database upgrade scripts"
+mysql_run_directory .