Index: update_status_aggregator.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/update_status_aggregator/update_status_aggregator.info,v
retrieving revision 1.1
diff -u -r1.1 update_status_aggregator.info
--- update_status_aggregator.info	5 Mar 2008 17:44:10 -0000	1.1
+++ update_status_aggregator.info	8 Jul 2008 15:05:54 -0000
@@ -2,3 +2,5 @@
 name = "update_status_aggregator"
 description = "Send a list of the updates available on remote sites."
 package = "Update"
+core = "6.x"
+project = "update_status_aggregator"
Index: update_status_aggregator.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/update_status_aggregator/update_status_aggregator.install,v
retrieving revision 1.6
diff -u -r1.6 update_status_aggregator.install
--- update_status_aggregator.install	25 Mar 2008 18:49:13 -0000	1.6
+++ update_status_aggregator.install	8 Jul 2008 15:05:54 -0000
@@ -1,82 +1,108 @@
 <?php
 // $Id: update_status_aggregator.install,v 1.6 2008/03/25 18:49:13 yrocq Exp $
 /**
+ * @file
  * Implementation of hook_install().
  */
+
+function update_status_aggregator_schema() {
+  $schema['update_status_aggregator'] = array(
+    'description' => t('The base table for update_status_aggregator nodes.'),
+    'fields' => array(
+      'nid' => array(
+        'description' => t('The primary identifier for a node.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
+      'vid' => array(
+        'description' => t('The current {node_revisions}.vid version identifier.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
+      'module' => array(
+        'short_name' => t('The module name.'),
+        'type' => 'text',
+        'not null' => TRUE),
+      'site' => array(
+        'description' => t('The reporting site node.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE),
+      'status' => array(
+        'description' => t('The status of the module.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => '0'),
+      ),
+     'indexes' => array(
+      'vid'     => array('vid'),
+      ),
+      'primary key' => array('nid', 'vid'),
+    );
+
+  $schema['update_status_aggregator_keys'] = array(
+    'fields' => array(
+      'nid' => array(
+        'description' => t('The primary identifier for a node.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
+      'vid' => array(
+        'description' => t('The current {node_revisions}.vid version identifier.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
+      'drupal_key' => array(
+        'type' => 'varchar',
+        'length' => '32'),
+      ),
+      'indexes' => array(
+      'vid'     => array('vid'),
+      ),
+      'primary key' => array('nid', 'vid'),
+  );
+  return $schema;
+
+  variable_set('node_options_update_status_aggregator_site', array('status'));
+}
+
 function update_status_aggregator_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {update_status_aggregator} (
-        nid int unsigned NOT NULL default '0',
-        vid int unsigned NOT NULL default '0',
-        module text NOT NULL,
-        site INT UNSIGNED NOT NULL,
-        status int unsigned NOT NULL default '0',
-        PRIMARY KEY (nid,vid),
-        UNIQUE KEY vid (vid),
-        KEY nid (nid)
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      db_query("CREATE TABLE {update_status_aggregator_keys} (
-        nid int unsigned NOT NULL default '0',
-        vid int unsigned NOT NULL default '0',
-        drupal_key varchar(32),
-        PRIMARY KEY (nid,vid),
-        UNIQUE KEY vid (vid),
-        KEY nid (nid)
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      break;
-    case 'pgsql':
-      db_query("CREATE TABLE {update_status_aggregator} (
-        nid int unsigned NOT NULL default '0',
-        vid int unsigned NOT NULL default '0',
-        module text NOT NULL,
-        site INT UNSIGNED NOT NULL,
-        status int unsigned NOT NULL default '0',
-        PRIMARY KEY (nid,vid),
-        UNIQUE KEY vid (vid),
-        KEY nid (nid)
-        )");
-      db_query("CREATE TABLE {update_status_aggregator_keys} (
-        nid int unsigned NOT NULL default '0',
-        vid int unsigned NOT NULL default '0',
-        drupal_key varchar(32),
-        PRIMARY KEY (nid,vid),
-        UNIQUE KEY vid (vid),
-        KEY nid (nid)
-        )");
-      break;
-  }
-  
-    variable_set('node_options_update_status_aggregator_site', array('status'));
+  // Create my tables.
+  drupal_install_schema('update_status_aggregator');
 }
 
-function update_status_aggregator_update_1()
-{
+/**
+ * Implementation of hook_uninstall().
+ */
+function update_status_aggregator_uninstall() {
+  // Drop my tables.
+  drupal_uninstall_schema('update_status_aggregator');
+
   $items = array();
-  
-  $items[] = update_sql("ALTER TABLE {update_status_aggregator} CHANGE site site INT UNSIGNED NOT NULL");
-  $items[] = update_sql("TRUNCATE TABLE {update_status_aggregator}");
-  
-  
+
+  $items[] = update_sql("DELETE FROM {node} WHERE type='update_status_aggregator_module' OR type='update_status_aggregator_site'");
   return $items;
 }
 
-function update_status_aggregator_update_2()
-{
+function update_status_aggregator_update_1() {
   $items = array();
-  
+
+  $items[] = update_sql("ALTER TABLE {update_status_aggregator} CHANGE site site INT UNSIGNED NOT NULL");
   $items[] = update_sql("TRUNCATE TABLE {update_status_aggregator}");
-  $items[] = update_sql("DELETE FROM node WHERE type='update_status_aggregator_module'");
-  
+
   return $items;
 }
 
-/**
- * Implementation of hook_uninstall().
- */
-function update_status_aggregator_uninstall() {
-  db_query('DROP TABLE {update_status_aggregator}');
-  db_query('DROP TABLE {update_status_aggregator_keys}');
-  db_query('DELETE FROM node WHERE type="update_status_aggregator_module" OR type="update_status_aggregator_site"');
+function update_status_aggregator_update_2() {
+  $items = array();
+
+  $items[] = update_sql("TRUNCATE TABLE {update_status_aggregator}");
+  $items[] = update_sql("DELETE FROM {node} WHERE type='update_status_aggregator_module'");
+
+  return $items;
 }
Index: update_status_aggregator.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/update_status_aggregator/update_status_aggregator.module,v
retrieving revision 1.14
diff -u -r1.14 update_status_aggregator.module
--- update_status_aggregator.module	28 Mar 2008 19:53:00 -0000	1.14
+++ update_status_aggregator.module	8 Jul 2008 15:05:54 -0000
@@ -1,19 +1,10 @@
 <?php
-// $Id: update_status_aggregator.module,v 1.14 2008/03/28 19:53:00 yrocq Exp $
+// $Id: update_status_aggregator.module,v 1.13.2.3 2008/05/02 19:21:41 yrocq Exp $
 
 /**
  * @file
  * Lets users check a remote site if some module are not up-to-date.
  *
- * Adds a text field when a node is displayed
- * so that authenticated users may make notes.
-
- TODO:
-   * add filter question related to the view
-   * export view definition to be included with the release
-   * make views of list of sites that use any particular module
-   * make it so that it runs cron on the remote site when config page is saved.
-   * Add permission
  */
 
 /**
@@ -32,8 +23,10 @@
   */
 function update_status_aggregator_perm() {
   return array(
+    'view update status aggregator module',
     'create update status aggregator module',
     'edit own update status aggregator module',
+    'view update status aggregator site',
     'create update status aggregator site',
     'edit own update status aggregator site',
   );
@@ -42,10 +35,14 @@
 /**
   * Drupal access Hook
   */
-function update_status_aggregator_access($op, $node) {
+function update_status_aggregator_access($op, $node, $account) {
   global $user;
 
   if ($node->type == "update_status_aggregator_module") {
+    if ($op == 'view') {
+      return user_access('view update status aggregator module');
+    }
+
     if ($op == 'create') {
       return user_access('create update status aggregator module');
     }
@@ -57,6 +54,10 @@
     }
   }
   elseif ($node->type == "update_status_aggregator_site") {
+    if ($op == 'view') {
+      return user_access('view update status aggregator site');
+    }
+
     if ($op == 'create') {
       return user_access('create update status aggregator site');
     }
@@ -237,11 +238,11 @@
         'single' => '1',
       ),
     );
-    $view->requires = array(update_status_aggregator);
+    $view->requires = array('update_status_aggregator');
     $views[$view->name] = $view;
 
     $view->disabled = TRUE;
-    
+
     return $views;
 }
 
@@ -290,10 +291,10 @@
 /**
  * Implementation of hook_load().
  */
- 
+
 function update_status_aggregator_load($node) {
   if ($node->type == "update_status_aggregator_module") {
-    return db_fetch_object(db_query('SELECT module, usa.status, n.title as site FROM {update_status_aggregator} usa INNER JOIN {node} n ON n.nid = usa.site WHERE usa.vid = %d', $node->vid));
+    return db_fetch_object(db_query('SELECT module, usa.status, n.title AS site, n.nid AS site_id FROM {update_status_aggregator} usa INNER JOIN {node} n ON n.nid = usa.site WHERE usa.vid = %d', $node->vid));
   }
   elseif ($node->type == "update_status_aggregator_site") {
     return db_fetch_object(db_query('SELECT drupal_key FROM {update_status_aggregator_keys} WHERE vid = %d', $node->vid));
@@ -414,7 +415,7 @@
       '#title' => t("Remote Drupal website's name"),
       '#size' => 60,
       '#maxlength' => 128,
-      '#default_value' => $node->site,
+      '#default_value' => $node->site_id,
       '#required' => TRUE,
     );
     $form['status'] = array(
@@ -450,17 +451,17 @@
   $key = $pack['key'];
   $site = db_fetch_object(
     db_query("SELECT usak.nid from {update_status_aggregator_keys} usak LEFT JOIN {node} n on n.vid = usak.vid WHERE drupal_key = '%s'" , $key));
-    
+
     // Site key has not been added to the server
-    
+
     if (!$site) {
       return xmlrpc_error(1, t("You are not allowed to post module updates on this site"));
     }
-    
-    watchdog('update_status_aggregator', t('Fetching key : !key', array('key' => $key)));
-  
+
+    watchdog('update_status_aggregator', 'Fetching key : !key', array('key' => $key));
+
    // Fetching module informations
-  
+
     foreach ($pack['modules'] as $module => $status) {
     /*
      * skip unknow modules
@@ -474,13 +475,13 @@
         'uid' => 1,
         'status' => 1
       );
-  
+
       $sql = "SELECT nid FROM {update_status_aggregator} WHERE module='%s' AND site='%d'";
       $nid = db_result(db_query($sql, $module, $site->nid));
       if ($nid) {
         $pre['nid'] = $nid;
       }
-  
+
       $pre['short_name'] = $module;
       $pre['site'] = $site->nid;
       $pre['status'] = $status;
@@ -499,20 +500,20 @@
 
 function update_status_aggregator_status_list() {
   return array(
-    UPDATE_STATUS_NOT_SECURE => t('Need security update'),
-    UPDATE_STATUS_REVOKED => t('Revoked'),
-    UPDATE_STATUS_NOT_SUPPORTED => t('Not supported'),
-    UPDATE_STATUS_NOT_CURRENT => t('New release available'),
-    UPDATE_STATUS_CURRENT => t('Up to date'),
-    UPDATE_STATUS_NOT_CHECKED => t('Not checked'),
-    UPDATE_STATUS_UNKNOWN => t('Unknown'),
+    UPDATE_NOT_SECURE => t('Need security update'),
+    UPDATE_REVOKED => t('Revoked'),
+    UPDATE_NOT_SUPPORTED => t('Not supported'),
+    UPDATE_NOT_CURRENT => t('New release available'),
+    UPDATE_CURRENT => t('Up to date'),
+    UPDATE_NOT_CHECKED => t('Not checked'),
+    UPDATE_UNKNOWN => t('Unknown'),
     );
 }
 
 function update_status_aggregator_sites_list() {
   $site = array();
   $result = db_query("SELECT nid, title FROM {node} WHERE type='update_status_aggregator_site'");
-  
+
   while ($row = db_fetch_array($result)) {
     $site[$row['nid']] = $row['title'];
   }
@@ -523,7 +524,7 @@
 function update_status_aggregator_modules_list() {
   $modules = array();
   $result = db_query("SELECT module FROM {update_status_aggregator} GROUP BY module");
-  
+
   while ($row = db_fetch_array($result)) {
     $modules[$row['module']] = $row['module'];
   }
@@ -537,10 +538,10 @@
 
 function views_handler_site($fieldinfo, $fielddata, $value, $data) {
   static $site = array();
-  
+
   if (!$site[$value]) {
     $site[$value] = db_result(db_query("SELECT title FROM {node} WHERE nid='%d'", $value));
   }
-  
+
   return $site[$value];
-}
+}
\ No newline at end of file
Index: update_status_notifier.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/update_status_aggregator/update_status_notifier.info,v
retrieving revision 1.2
diff -u -r1.2 update_status_notifier.info
--- update_status_notifier.info	8 Mar 2008 21:32:42 -0000	1.2
+++ update_status_notifier.info	8 Jul 2008 15:05:54 -0000
@@ -2,4 +2,5 @@
 name = "update_status_notifier"
 description = "List the update to do on remote site."
 package = "Update"
-dependencies = update_status
+core = "6.x"
+project = "update_status_aggregator"
Index: update_status_notifier.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/update_status_aggregator/update_status_notifier.module,v
retrieving revision 1.5
diff -u -r1.5 update_status_notifier.module
--- update_status_notifier.module	25 Mar 2008 19:05:13 -0000	1.5
+++ update_status_notifier.module	8 Jul 2008 15:05:54 -0000
@@ -28,18 +28,15 @@
 /**
   * Drupal menu Hook
   */
-function update_status_notifier_menu($may_cache) {
+function update_status_notifier_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/update_status_notifier',
-      'title' => t('Update status notifier'),
-      'description' => t('Set the remote site where to send update module.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('update_status_notifier_settings'),
-      'access' => user_access('administer site configuration')
+    $items['admin/settings/update_status_notifier'] = array(
+      'title' => 'Update status notifier',
+      'description' => 'Set the remote site where to send update module.',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('update_status_notifier_settings'),
+      'access callback' => user_access('administer site configuration')
     );
-  }
   return $items;
 }
 
@@ -68,13 +65,13 @@
   return system_settings_form($form);
 }
 
-function update_status_notifier_settings_client_submit($form_id, $form_values) {
-  variable_set('update_notifier_server', $form_values['update_notifier_server']);
+function update_status_notifier_settings_client_submit($form, &$form_state) {
+  variable_set('update_notifier_server', $form_state['values']['name']);
 }
 
 function update_status_notifier_xml_status() {
-  if ($available = update_status_get_available(TRUE)) {
-    $data = update_status_calculate_project_data($available);
+  if ($available = update_get_available(TRUE)) {
+    $data = update_calculate_project_data($available);
     $pack = array();
     $pack['key'] = md5(variable_get('drupal_private_key', 0));
     foreach ($data as $project) {
@@ -84,12 +81,12 @@
     $url = variable_get('update_notifier_server', 'localhost');
     $method_name = 'update_status_aggregator.notify';
     $result = xmlrpc($url, $method_name, $pack);
-    
+
     if (xmlrpc_error()) {
-      watchdog('update_status_aggregator', t('Error %errorno : %errormsg', array('%errorno' => xmlrpc_errno(), '%errormsg' => xmlrpc_error_msg())));
+      watchdog('update_status_aggregator', 'Error %errorno : %errormsg', array('%errorno' => xmlrpc_errno(), '%errormsg' => xmlrpc_error_msg()));
     }
     else {
-      watchdog('update_status_aggregator', t('Update informations sent to server'));
+      watchdog('update_status_aggregator', 'Update informations sent to server');
     }
   }
 }

