Merge remote branch 'origin/platal-1.0.1'
[platal.git] / modules / admin.php
index 567895a..e16538e 100644 (file)
@@ -691,6 +691,7 @@ class AdminModule extends PLModule
 
 
         $page->addJsLink('jquery.ui.core.js');
+        $page->addJsLink('jquery.ui.widget.js');
         $page->addJsLink('jquery.ui.tabs.js');
         $page->addJsLink('password.js');
 
@@ -756,7 +757,7 @@ class AdminModule extends PLModule
             return false;
         }
 
-        array_map('trim', $infos);
+        $infos = array_map('trim', $infos);
         $hrid = self::getHrid($infos[1], $infos[0], $promo);
         $res1 = XDB::query('SELECT  COUNT(*)
                               FROM  accounts
@@ -787,7 +788,9 @@ class AdminModule extends PLModule
 
     private static function formatBirthDate($birthDate)
     {
-        return date("Y-m-d", strtotime($birthDate));
+        // strtotime believes dd/mm/yyyy to be an US date (i.e mm/dd/yyyy), and
+        // dd-mm-yyyy to be a normal date (i.e dd-mm-yyyy)...
+        return date("Y-m-d", strtotime(str_replace('/', '-', $birthDate)));
     }
 
     function handler_add_accounts(&$page, $action = null, $promo = null)
@@ -876,7 +879,7 @@ class AdminModule extends PLModule
                             XDB::execute('INSERT INTO  account_profiles (uid, pid, perms)
                                                VALUES  ({?}, {?}, {?})',
                                          $uid, $pid, 'owner');
-                            Profile::rebuildSearchTokens($pid);
+                            Profile::rebuildSearchTokens($pid, false);
                         }
                     }
                 }