Fix signature checking of ListTasks request.
authorJan Schneider <jan@horde.org>
Mon, 16 Nov 2009 15:15:24 +0000 (16:15 +0100)
committerJan Schneider <jan@horde.org>
Mon, 16 Nov 2009 15:15:24 +0000 (16:15 +0100)
kronolith/ajax.php
kronolith/js/kronolith.js

index 5754212..b003776 100644 (file)
@@ -142,6 +142,7 @@ try {
         $result = new stdClass;
         $result->list = $tasklist;
         $result->type = $tasktype;
+        $result->sig = Horde_Util::getFormData('sig');
         if (count($tasks)) {
             $result->tasks = $tasks;
         }
index 9342c05..0ad8dc0 100644 (file)
@@ -1507,10 +1507,11 @@ KronolithCore = {
                 if (Object.isUndefined(this.tcache.get(type)) ||
                     Object.isUndefined(this.tcache.get(type).get(list))) {
                     loading = true;
-                    this.startLoading('tasks:' + list, type, '');
+                    this.startLoading('tasks:' + type + list, tasktype, '');
                     this._storeTasksCache($H(), type, list);
                     this.doAction('ListTasks',
                                   { 'type': type,
+                                    'sig' : tasktype,
                                     'list': list },
                                   function(r) {
                                       this._loadTasksCallback(r, tasktype);
@@ -1543,7 +1544,7 @@ KronolithCore = {
 
         // Check if this is the still the result of the most current request.
         if (this.view != 'tasks' ||
-            this.eventsLoading['tasks:' + r.response.list] != r.response.type) {
+            this.eventsLoading['tasks:' + r.response.type + r.response.list] != r.response.sig) {
             return;
         }
         this._insertTasks(tasktype, r.response.list);
@@ -1708,7 +1709,7 @@ KronolithCore = {
     },
 
     /**
-     * Toggles the CSS class to show that a tasks is completed/uncompleted.
+     * Toggles the CSS class to show that a task is completed/uncompleted.
      *
      * @param string taskid  The id of the task.
      */