Index: /extensions/header_manager/admin/add.php
===================================================================
--- /extensions/header_manager/admin/add.php	(revision 28842)
+++ /extensions/header_manager/admin/add.php	(revision 28843)
@@ -15,5 +15,5 @@
   
   $conf['header_manager']['keep_ratio'] = isset($_POST['keep_ratio']);
-  conf_update_param('header_manager', serialize($conf['header_manager']));
+  conf_update_param('header_manager', $conf['header_manager']);
   
   $banner = get_banner($_POST['picture_file']);
@@ -113,5 +113,5 @@
   $conf['header_manager']['width'] = intval($_POST['width']);
   $conf['header_manager']['height'] = intval($_POST['height']);
-  conf_update_param('header_manager', serialize($conf['header_manager']));
+  conf_update_param('header_manager', $conf['header_manager']);
 
   $picture['banner_src'] = HEADER_MANAGER_DIR . $picture['filename'];
Index: /extensions/header_manager/admin/config.php
===================================================================
--- /extensions/header_manager/admin/config.php	(revision 28842)
+++ /extensions/header_manager/admin/config.php	(revision 28843)
@@ -6,5 +6,5 @@
 {
   $conf['header_manager']['image'] = pwg_get_session_var('added_banner');
-  conf_update_param('header_manager', serialize($conf['header_manager']));
+  conf_update_param('header_manager', $conf['header_manager']);
   pwg_unset_session_var('added_banner');
 }
@@ -16,6 +16,5 @@
   if ($_POST['display'] == 'with_text')
   {
-    $conf['page_banner'] = $_POST['conf_page_banner'];
-    conf_update_param('page_banner', $conf['page_banner']);
+    conf_update_param('page_banner', $_POST['conf_page_banner'], true);
   }
   
@@ -27,5 +26,5 @@
     'banner_on_picture' => isset($_POST['banner_on_picture']),
     );
-  conf_update_param('header_manager', serialize($conf['header_manager']));
+  conf_update_param('header_manager', $conf['header_manager']);
   
   $page['infos'][] = l10n('Information data registered in database');
@@ -44,5 +43,5 @@
     {
       $conf['header_manager']['image'] = 'random';
-      conf_update_param('header_manager', serialize($conf['header_manager']));
+      conf_update_param('header_manager', $conf['header_manager']);
     }
     
Index: /extensions/header_manager/main.inc.php
===================================================================
--- /extensions/header_manager/main.inc.php	(revision 28842)
+++ /extensions/header_manager/main.inc.php	(revision 28843)
@@ -11,13 +11,17 @@
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
-global $prefixeTable;
+global $prefixeTable, $conf;
+
 define('HEADER_MANAGER_PATH',    PHPWG_PLUGINS_PATH . 'header_manager/');
 define('HEADER_MANAGER_ADMIN',   get_root_url() . 'admin.php?page=plugin-header_manager');
 define('HEADER_MANAGER_DIR',     PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners/');
 define('HEADER_MANAGER_TABLE',   $prefixeTable . 'category_banner');
-define('HEADER_MANAGER_VERSION', 'auto');
+
+include_once(HEADER_MANAGER_PATH . 'include/functions.inc.php');
+include_once(HEADER_MANAGER_PATH . 'include/header_manager.inc.php');
 
 
-add_event_handler('init', 'header_manager_init');
+$conf['header_manager'] = safe_unserialize($conf['header_manager']);
+
   
 if (defined('IN_ADMIN'))
@@ -32,21 +36,4 @@
 }
 
-include_once(HEADER_MANAGER_PATH . 'include/functions.inc.php');
-include_once(HEADER_MANAGER_PATH . 'include/header_manager.inc.php');
-
-
-/**
- * initialization
- */
-function header_manager_init()
-{
-  global $conf, $pwg_loaded_plugins, $page;
-  
-  include_once(HEADER_MANAGER_PATH . 'maintain.inc.php');
-  $maintain = new header_manager_maintain('header_manager');
-  $maintain->autoUpdate(HEADER_MANAGER_VERSION, 'install');
-  
-  $conf['header_manager'] = unserialize($conf['header_manager']);
-}
 
 /**
Index: /extensions/header_manager/maintain.class.php
===================================================================
--- /extensions/header_manager/maintain.class.php	(revision 28843)
+++ /extensions/header_manager/maintain.class.php	(revision 28843)
@@ -0,0 +1,79 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class header_manager_maintain extends PluginMaintain
+{
+  private $default_conf = array(
+      'width' => 1000,
+      'height' => 150,
+      'image' => 'random',
+      'display' => 'image_only',
+      'banner_on_picture' => true,
+      'keep_ratio' => true
+    );
+    
+  private $table;
+  
+  function __construct($plugin_id)
+  {
+    global $prefixeTable;
+    
+    parent::__construct($plugin_id);
+    $this->table = $prefixeTable . 'category_banner';
+  }
+
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf, $prefixeTable;
+
+    // configuration
+    if (empty($conf['header_manager']))
+    {
+      conf_update_param('header_manager', $this->default_conf, true);
+    }
+    else
+    {
+      $new_conf = safe_unserialize($conf['header_manager']);
+      
+      if (!isset($new_conf['banner_on_picture']))
+      {
+        $new_conf['banner_on_picture'] = true;
+      }
+      else if (!isset($new_conf['keep_ratio']))
+      {
+        $new_conf['keep_ratio'] = true;
+      }
+      
+      conf_update_param('header_manager', $new_conf, true);
+    }
+
+    // banners directory
+    if (!file_exists(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners')) 
+    {
+      mkdir(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners', 0755);
+    }
+
+    // banners table
+    $query = '
+CREATE TABLE IF NOT EXISTS `' .$this->table . '` (
+  `category_id` smallint(5) unsigned NOT NULL,
+  `image` varchar(255) NOT NULL,
+  `deep` tinyint(1) DEFAULT 1,
+  PRIMARY KEY (`category_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+;';
+    pwg_query($query);
+  }
+
+  function update($old_version, $new_version, &$errors=array())
+  {
+    $this->install($new_version, $errors);
+  }
+
+  function uninstall()
+  {
+    conf_delete_param('header_manager');
+
+    pwg_query('DROP TABLE `' .$this->table . '`;');
+  }
+}
Index: tensions/header_manager/maintain.inc.php
===================================================================
--- /extensions/header_manager/maintain.inc.php	(revision 28842)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
-
-class header_manager_maintain extends PluginMaintain
-{
-  private $installed = false;
-  
-  private $default_conf = array(
-      'width' => 1000,
-      'height' => 150,
-      'image' => 'random',
-      'display' => 'image_only',
-      'banner_on_picture' => true,
-      'keep_ratio' => true
-    );
-
-  function install($plugin_version, &$errors=array())
-  {
-    global $conf, $prefixeTable;
-
-    // configuration
-    if (empty($conf['header_manager']))
-    {
-      $conf['header_manager'] = serialize($this->default_conf);
-      conf_update_param('header_manager', $conf['header_manager']);
-    }
-    else
-    {
-      $new_conf = is_string($conf['header_manager']) ? unserialize($conf['header_manager']) : $conf['header_manager'];
-      
-      if (!isset($new_conf['banner_on_picture']))
-      {
-        $new_conf['banner_on_picture'] = true;
-      }
-      else if (!isset($new_conf['keep_ratio']))
-      {
-        $new_conf['keep_ratio'] = true;
-      }
-      
-      $conf['header_manager'] = serialize($new_conf);
-      conf_update_param('header_manager', $conf['header_manager']);
-    }
-
-    // banners directory
-    if (!file_exists(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners')) 
-    {
-      mkdir(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'banners', 0755);
-    }
-
-    // banners table
-    $query = '
-CREATE TABLE IF NOT EXISTS `' .$prefixeTable . 'category_banner` (
-  `category_id` smallint(5) unsigned NOT NULL,
-  `image` varchar(255) NOT NULL,
-  `deep` tinyint(1) DEFAULT 1,
-  PRIMARY KEY (`category_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8
-;';
-    pwg_query($query);
-
-    $this->installed = true;
-  }
-
-  function activate($plugin_version, &$errors=array())
-  {
-    if (!$this->installed)
-    {
-      $this->install($plugin_version, $errors);
-    }
-  }
-
-  function deactivate()
-  {
-  }
-
-  function uninstall()
-  {
-    global $prefixeTable;
-
-    conf_delete_param('header_manager');
-
-    pwg_query('DROP TABLE `' .$prefixeTable . 'category_banner`;');
-  }
-}
