Merge branch 'xorg/maint' into xorg/master
authorStéphane Jacob <sj@m4x.org>
Tue, 29 Mar 2011 19:35:10 +0000 (21:35 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 29 Mar 2011 19:35:10 +0000 (21:35 +0200)
Makefile
classes/xnetpage.php
classes/xorgpage.php
core
htdocs/javascript/.gitignore
include/emails.inc.php

index 90a3713..d63ab9b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ htdocs/.htaccess: htdocs/.htaccess.in Makefile
 ##
 ## static content
 ##
-static: htdocs/javascript/core.js htdocs/javascript@VERSION
+static: htdocs/javascript/core.js htdocs/javascript@VERSION htdocs/javascript/json2.js
 
 htdocs/javascript/core.js:
        cd htdocs/javascript/ && ln -s ../../core/htdocs/javascript/core.js
@@ -84,6 +84,10 @@ htdocs/javascript/core.js:
 %@VERSION: % Makefile ChangeLog
        cd $< && rm -f $(VERSION) && ln -sf . $(VERSION)
 
+htdocs/javascript/json2.js: DOWNLOAD_SRC = https://github.com/douglascrockford/JSON-js/raw/master/json2.js --no-check-certificate
+htdocs/javascript/json2.js:
+       @$(download)
+
 ##
 ## wiki
 ##
index e2075b0..0f1a1cd 100644 (file)
@@ -41,6 +41,9 @@ class XnetPage extends PlPage
             $this->assign('is_admin', may_update());
             $this->assign('is_member', is_member());
         }
+        if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
+            $this->addJsLink('json2.js');
+        }
         $this->addJsLink('jquery.xorg.js');
         $this->addJsLink('overlib.js');
         $this->addJsLink('core.js');
index 83824d8..852b842 100644 (file)
@@ -27,6 +27,9 @@ class XorgPage extends PlPage
 
         // Set the default page
         $this->changeTpl('platal/index.tpl');
+        if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
+            $this->addJsLink('json2.js');
+        }
         $this->addJsLink('jquery.xorg.js');
         $this->addJsLink('overlib.js');
         $this->addJsLink('core.js');
diff --git a/core b/core
index 277bb52..23947d1 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 277bb52765efb79e31092f5555a750146d379987
+Subproject commit 23947d18803b48cc6c235cdd3c304ca52fd6763c
index 85fe6a4..47ad449 100644 (file)
@@ -4,4 +4,5 @@
 # jQuery and its plugins are downloaded by the Makefile
 /jquery*.*js
 /core.js
+/json2.js
 !/jquery.autocomplete.js
index 6abdede..1e8a323 100644 (file)
@@ -26,7 +26,7 @@ define('ERROR_LOOP_EMAIL', 4);
 
 function add_to_list_alias(User $user, $local_part, $domain, $type = 'alias')
 {
-    Platal::assert($user !== null);
+    Platal::assert($user !== null, 'User should not be null.');
 
     XDB::execute('INSERT IGNORE INTO  email_virtual (email, domain, redirect, type)
                               SELECT  {?}, id, {?}, {?}
@@ -37,7 +37,7 @@ function add_to_list_alias(User $user, $local_part, $domain, $type = 'alias')
 
 function delete_from_list_alias(User $user, $local_part, $domain, $type = 'alias')
 {
-    Platal::assert($user !== null);
+    Platal::assert($user !== null, 'User should not be null.');
 
     XDB::execute('DELETE  v
                     FROM  email_virtual         AS v
@@ -49,7 +49,7 @@ function delete_from_list_alias(User $user, $local_part, $domain, $type = 'alias
 
 function update_list_alias(User $user, $former_email, $local_part, $domain, $type = 'alias')
 {
-    Platal::assert($user !== null);
+    Platal::assert($user !== null, 'User should not be null.');
 
     XDB::execute('UPDATE  email_virtual         AS v
               INNER JOIN  email_virtual_domains AS d ON (v.domain = d.id)
@@ -591,7 +591,7 @@ class Email
 
     static public function activate_storage(User $user, $storage)
     {
-        Platal::assert(in_array($storage, self::get_allowed_storages($user)));
+        Platal::assert(in_array($storage, self::get_allowed_storages($user)), 'Unknown storage.');
 
         if (!self::is_active_storage($user, $storage)) {
             global $globals;