Don't use the domain part in login anymore.
[platal.git] / modules / admin.php
index 81c0182..ad07d0e 100644 (file)
@@ -1161,7 +1161,7 @@ class AdminModule extends PLModule
         $table_editor = new PLTableEditor('admin/validate/answers','requests_answers','id');
         $table_editor->describe('category','catégorie',true);
         $table_editor->describe('title','titre',true);
-        $table_editor->describe('answer','texte',false);
+        $table_editor->describe('answer','texte',false, true);
         $table_editor->apply($page, $action, $id);
     }
 
@@ -1172,10 +1172,10 @@ class AdminModule extends PLModule
         $table_editor = new PLTableEditor('admin/skins','skins','id');
         $table_editor->describe('name','nom',true);
         $table_editor->describe('skin_tpl','nom du template',true);
-        $table_editor->describe('auteur','auteur',false);
+        $table_editor->describe('auteur','auteur',false, true);
         $table_editor->describe('comment','commentaire',true);
-        $table_editor->describe('date','date',false);
-        $table_editor->describe('ext','extension du screenshot',false);
+        $table_editor->describe('date','date',false, true);
+        $table_editor->describe('ext','extension du screenshot',false, true);
         $table_editor->apply($page, $action, $id);
     }
 
@@ -1205,7 +1205,7 @@ class AdminModule extends PLModule
         $table_editor = new PLTableEditor('admin/mx/broken', 'mx_watch', 'host', true);
         $table_editor->describe('host', 'Masque', true);
         $table_editor->describe('state', 'Niveau', true);
-        $table_editor->describe('text', 'Description du problème', false);
+        $table_editor->describe('text', 'Description du problème', false, true);
         $table_editor->apply($page, $action, $id);
     }
 
@@ -1225,10 +1225,10 @@ class AdminModule extends PLModule
         $page->assign('title', 'Gestion des coupures');
         $table_editor = new PLTableEditor('admin/downtime','downtimes','id');
         $table_editor->describe('debut','date',true);
-        $table_editor->describe('duree','durée',false);
+        $table_editor->describe('duree','durée',false, true);
         $table_editor->describe('resume','résumé',true);
         $table_editor->describe('services','services affectés',true);
-        $table_editor->describe('description','description',false);
+        $table_editor->describe('description','description',false, true);
         $table_editor->apply($page, $action, $id);
     }
 
@@ -1972,10 +1972,12 @@ class AdminModule extends PLModule
                 $pids = array_unique($new_pids);
 
                 // Updates years.
-                XDB::execute('UPDATE  profile_education
-                                 SET  entry_year = {?}, grad_year = {?}, promo_year = {?}
-                               WHERE  pid IN {?} AND eduid = {?} AND degreeid = {?}',
-                             $entry_year, $promotion, $promotion, $old_pids, $edu_id, $degree_id);
+                if (count($old_pids)) {
+                    XDB::execute('UPDATE  profile_education
+                                     SET  entry_year = {?}, grad_year = {?}, promo_year = {?}
+                                   WHERE  pid IN {?} AND eduid = {?} AND degreeid = {?}',
+                                 $entry_year, $promotion, $promotion, $old_pids, $edu_id, $degree_id);
+                }
             }
 
             // Precomputes values common to all users.
@@ -1986,7 +1988,8 @@ class AdminModule extends PLModule
                 XDB::execute('INSERT INTO  profile_education (id, pid, eduid, degreeid, entry_year, grad_year, promo_year, flags)
                                    SELECT  ' . $select . '
                                      FROM  profile_education
-                                    WHERE  pid = {?}',
+                                    WHERE  pid = {?}
+                                 GROUP BY  pid',
                              $pid);
             }
             XDB::commit();