Index: tensions/event_cats/event_cats/main.inc.php
===================================================================
--- /extensions/event_cats/event_cats/main.inc.php	(revision 3956)
+++ 	(revision )
@@ -1,297 +1,0 @@
-﻿<?php
-
-/*
-Plugin Name: Event Cats
-Version: 1.0.0
-Description: A single URL can be enough to be identified, and a user can duplicate his account to create a new one getting immediately the same properties. / On peut être identifié grâce à un simple URL, et on peut dupliquer son compte pour créer un nouveau compte ayant immédiatement les mêmes propriétés.
-Plugin URI: (Doesn't exist for the moment)
-Author: P@t, LucMorizur
-Author URI: http://www.gauchon.fr, http://lucmorizur.free.fr
-*/
-
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
-// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
-// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
-// +-----------------------------------------------------------------------+
-// | This program is free software; you can redistribute it and/or modify  |
-// | it under the terms of the GNU General Public License as published by  |
-// | the Free Software Foundation                                          |
-// |                                                                       |
-// | This program is distributed in the hope that it will be useful, but   |
-// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
-// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
-// | General Public License for more details.                              |
-// |                                                                       |
-// | You should have received a copy of the GNU General Public License     |
-// | along with this program; if not, write to the Free Software           |
-// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
-// | USA.                                                                  |
-// +-----------------------------------------------------------------------+
-
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-// pour faciliter le debug - make debug easier :o)
-//ini_set('error_reporting', E_ALL);
-//ini_set('display_errors', true);
-
-global
-  $conf, $prefixeTable, $ec_conf,
-  $ec_ap_ok;   // whether Additional Pages is installed and activated
-
-define('EVNTCATS_INFO_VERSION','1.0.0');
-define('EVNTCATS_PATH',PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)). '/');
-define('EVNTCATS_TABLE',$prefixeTable.'event_cats');
-define('ROOT_URL',get_absolute_root_url());
-
-$ec_ap_ok = defined('AP_DIR');
-
-if (!isset($ec_lists)) {
-  $ec_lists = array();
-}
-
-// $ec_conf initalization / check
-if ($t = mysql_fetch_row(pwg_query("
- SELECT `value`
- FROM `".CONFIG_TABLE."`
- WHERE `param` = 'event_cats';
-"))) {
-  $ec_conf = explode(',' , $t[0]);
-}
-else {
-  $ec_conf = array();
-}
-
-include_once(EVNTCATS_PATH.'include/evntcats_funcs.inc.php');
-
-class event_cats {
-// Sets the administration panel of the plugin
-  function plugin_admin_menu($menu) {
-    array_push($menu,
-      array(
-        'NAME' => 'Event Cats',
-        'URL'  => get_admin_plugin_menu_link(dirname(__FILE__).
-                  '/admin/evntcats_admin.php')
-      )
-    );
-    return $menu;
-  }
-} // End class
-
-$obj = new event_cats();
-
-// Admin help management
-add_event_handler('get_popup_help_content', 'ec_popup_help_content',
- EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
-
-function ec_popup_help_content($popup_help_content, $page) {
-  return (
-   $help_content = ($page == 'event_cats' and is_admin()) ?
-    load_language('help.html', EVNTCATS_PATH, array('return' => true)) : false
-  ) ? $popup_help_content.$help_content : $popup_help_content;
-}
-                                                                                     // Mettre en place l'autoid, qu'on voie si ça marche !
-
-//----------------------------------
-
-/**
- *
- * auto_log_user()
- * the function uses the value of the argument "autolog" of the posted URL, as a code
- * to know which username has to be logged in.
- *
- * @param no parameter
- * @return no return value
- */
-
-add_event_handler('init', 'auto_log_user');
-
-function auto_log_user() {
-  global $ec_conf, $ec_lists;
-
-  $ec_ap  = NULL;
-  $ec_cat = NULL;
-  $ec_img = NULL;
-
-  if (isset($_GET['autolog']) and ($ec_conf['activated'] == 1)) {
-    if (!is_a_guest()) logout_user();
-    build_ec_lists();
-    foreach ($ec_lists['ec_table'] as $ec_entry) {
-      if ($code_exists = ($ec_entry['code'] == $_GET['autolog'])) break;
-    }
-    if ($code_exists) {
-      if (isset($_GET['ap'])) $ec_ap = $_GET['ap'];
-      if (strpos($ec_entry['action'], 'ec_ok') !== false) {
-        log_user($ec_entry['user_id'], false);
-        if (isset($_GET['cat'])) $ec_cat = $_GET['cat'];
-        if (isset($_GET['img'])) $ec_img = $_GET['img'];
-        if (
-         $ec_entry['forced'] == 'true' and
-         $ec_entry['action'] != 'ec_forced_pb'
-        ) {
-          if (empty($ec_entry['arg1']) and !empty($ec_entry['arg2'])) {
-            $ec_ap = $ec_entry['arg2'];
-          }
-          elseif (!empty($ec_entry['arg1'])) {
-            $ec_cat = $ec_entry['arg1'];
-            if (!empty($ec_entry['arg2'])) $ec_img = $ec_entry['arg2'];
-          }
-        }
-        if (isset($ec_ap)) {
-          if (array_key_exists($ec_ap,$ec_lists['add_pages'])) {
-            redirect(
-             PHPWG_ROOT_PATH.'index.php?/additional_page/'.$ec_ap);
-          }
-        }
-        elseif (isset($ec_cat)) {
-          if (array_key_exists($ec_cat, $ec_lists['categories'])) {
-            if (isset($ec_img)) {
-              if (mysql_fetch_row(pwg_query('
-               SELECT *
-               FROM `'.IMAGE_CATEGORY_TABLE.'` 
-               WHERE `category_id` = '.$ec_cat.'
-                AND `image_id` = '.$ec_img
-              ))) {
-                redirect(PHPWG_ROOT_PATH.'picture.php?/'.$ec_img.'/category/'.$ec_cat);
-              }
-            }
-            redirect(PHPWG_ROOT_PATH.'index.php?/category/'.$ec_cat);
-          }
-        }
-        else {
-          redirect(make_index_url());
-        }
-      }
-      else {
-        if ($ec_entry['action'] == 'ec_nok') {
-          if (isset($ec_ap)) {
-            if (array_key_exists($ec_ap,$ec_lists['add_pages'])) {
-              redirect(
-               PHPWG_ROOT_PATH.'index.php?/additional_page/'.$ec_ap);
-            }
-          }
-          access_denied();
-        }
-        else {
-          redirect(make_index_url());
-        }
-      }
-    }
-    else {
-      if (
-       $ec_conf['unknown_code'] == 2 and
-        array_key_exists(
-         $ec_conf['unknown_code_ap_id'], $ec_lists['add_pages']
-        )
-       ) {
-        redirect(
-         PHPWG_ROOT_PATH.
-         'index.php?/additional_page/'.$ec_conf['unknown_code_ap_id']
-        );
-      }
-      elseif ($ec_conf['unknown_code'] == 1 or
-       $ec_conf['unknown_code'] == 2) {
-        access_denied();
-      }
-      else {
-        redirect(make_index_url());
-      }
-    }
-  }
-}
-
-/**
- *
- * assign_perm_for_new_user()
- * copies/paste groups+access+properties associations of previously connected
- * username, to newly created username.
- *
- * @param no parameter
- * @return no return value
- */
-
-add_event_handler('register_user', 'assign_perm_for_new_user');
-
-function assign_perm_for_new_user($new_user)
-{ /*
-  global $user;
-
-  if (!is_a_guest() and !is_admin())
-  {
-    // User access
-    $query = 'SELECT cat_id FROM '.USER_ACCESS_TABLE.' WHERE user_id = '.$user['id'].';';
-    $result = pwg_query($query);
-    $insert = array();
-    while ($row = mysql_fetch_assoc($result))
-    {
-      $insert[] = '('.$new_user['id'].','.$row['cat_id'].')';
-    }
-    if (!empty($insert))
-    {
-      pwg_query('INSERT INTO '.USER_ACCESS_TABLE.' VALUES '.implode(',', $insert).';');
-    }
-
-    // User groups
-    $query = 'SELECT group_id FROM '.USER_GROUP_TABLE.' WHERE user_id = '.$user['id'].';';
-    $result = pwg_query($query);
-    $insert = array();
-    while ($row = mysql_fetch_assoc($result))
-    {
-      $insert[] = '('.$new_user['id'].','.$row['group_id'].')';
-    }
-    if (!empty($insert))
-    {
-      pwg_query('INSERT INTO '.USER_GROUP_TABLE.' VALUES '.implode(',', $insert).';');
-    }
-
-    // User infos
-    $query = 'SELECT level FROM '.USER_INFOS_TABLE.' WHERE user_id = '.$user['id'].';';
-    $result = pwg_query($query);
-    $insert = array();
-    while ($row = mysql_fetch_assoc($result))
-    {
-      $insert[] = '('.$new_user['id'].','.$row['level'].')';
-    }
-    if (!empty($insert))
-    {
-      $query = 'UPDATE '.USER_INFOS_TABLE.' SET level = '.$user['level'].' WHERE user_id = '.$new_user['id'].';';
-      pwg_query($query);
-    }
-  }  */
-}
-
-/**
- *
- * duplicate_account_url()
- * adds a link "Duplicate" in Identification block menu.
- *
- * @param no parameter
- * @return no return value
- */
-
-add_event_handler('blockmanager_apply', 'duplicate_account_url');
-
-function duplicate_account_url()
-{ /*
-  global $conf, $lang, $template;
-
-  if ($conf['allow_user_registration'] and !is_admin() and !is_a_guest())
-    and !is_admin() and !is_a_guest())
-  {
-    $template->assign( 'U_REGISTER', get_root_url().'register.php');
-    $lang['Create a new account'] = l10n('Duplicate account');
-    $lang['Register'] = l10n('Duplicate');
-  } */
-}
-
-// copying/pasting the following lines from same file in plugin LLGBO2,
-// because it looks like it's useful :-/ .....   
-               /*
-add_event_handler('render_element_content',
-  array(&$obj,'MyPictureOptions'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1,  2  );   */
-add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
-set_plugin_data($plugin['id'], $obj);
-
-?>
Index: tensions/event_cats/event_cats/maintain.inc.php
===================================================================
--- /extensions/event_cats/event_cats/maintain.inc.php	(revision 3956)
+++ 	(revision )
@@ -1,157 +1,0 @@
-﻿<?php
-
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
-// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
-// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
-// +-----------------------------------------------------------------------+
-// | This program is free software; you can redistribute it and/or modify  |
-// | it under the terms of the GNU General Public License as published by  |
-// | the Free Software Foundation                                          |
-// |                                                                       |
-// | This program is distributed in the hope that it will be useful, but   |
-// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
-// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
-// | General Public License for more details.                              |
-// |                                                                       |
-// | You should have received a copy of the GNU General Public License     |
-// | along with this program; if not, write to the Free Software           |
-// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
-// | USA.                                                                  |
-// +-----------------------------------------------------------------------+
-
-// ***********************************************************************
-// ** maintain.inc.php : Installation page for Piwigo plugin Event Cats **
-// ***********************************************************************
-
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-global $ec_conf;
-
-if (!defined('EVNTCATS_PATH'))
- define('EVNTCATS_PATH',PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)). '/');
-
-include_once(EVNTCATS_PATH.'include/ec_conf.inc.php');
-
-function plugin_uninstall() {
-
-  global $prefixeTable, $conf, $ec_conf;
-
-  unset($ec_conf);
-	pwg_query("DELETE FROM `".CONFIG_TABLE."` WHERE `param` = 'event_cats' LIMIT 1;");
-	return pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats`;');
-}
-
-function plugin_install() {
-
-  global $prefixeTable;
-  
-  plugin_uninstall();
-  // create table for plugin, if it doesn't exist yet
-  $q = pwg_query("
-    CREATE TABLE `".$prefixeTable."event_cats` (
-      `id`      SMALLINT(5)             UNSIGNED NOT NULL     AUTO_INCREMENT ,
-      `code`    VARCHAR(32)                               DEFAULT NULL ,
-      `user_id` SMALLINT(5)             UNSIGNED          DEFAULT NULL ,
-      `action`  ENUM('ec_ok', 'ec_nok')                   DEFAULT NULL ,
-      `arg1`    SMALLINT(5)             UNSIGNED          DEFAULT NULL ,
-      `arg2`    SMALLINT(5)             UNSIGNED          DEFAULT NULL ,
-      `forced`  ENUM('true', 'false')            NOT NULL DEFAULT 'false' ,
-      PRIMARY KEY (`id`),
-      INDEX (`code`) ,
-      INDEX (`user_id`)
-    )
-    DEFAULT CHARACTER SET utf8;
-  ");
-
-/*
-Explanations on table structure :
-
-code    : the code used as "autolog" argument. If thie code provided by the
-          visitor does not exist in the table, the administrator can choose
-          whether the visitor is redirected to the home page (nothing
-          happens) or to the "access denied" page ;
-user_id : the account concerned in following values ;
-action  : the action to perform :
-   ec_nok : code disabled : account not logged in, visitor (guest) redirected
-            to an explaining Additional Page (arg2 field). If Additional Page
-            plugin is not activated, redirection to the "access denied" page ;
-   ec_ok  : code OK, account logged in. Redirection depends on arg1 and arg2
-            values. There are four cases :
-     arg1 and arg2 are both NULL : home page ;
-     arg1 not NULL and arg2 NULL : category ;
-     arg1 NULL and arg2 not NULL : Additional Page ;
-     arg1 and arg2 both not NULL : Image page.
-            If arg1 is a valid category id, and arg2 is not a valid image id,
-            redirection to category. In all other cases where the arg1 or arg2
-            is not valid, redirection to home page.
-arg1    : (described above) ;
-arg2    : (described above) ;
-forced  : allows the administrator to impose that, for certain codes, the
-          settings specified in the database ("action", "arg1", "arg2") are
-          applied, whatever can be the arguments given in the URL.
-           
-* As a precision :
-    in the PHP code, the "action" can also have the following values, so to
-    display accurate messages in the admin page :
-  ec_nok_action_pb   : the same "code" is used in more than one entries in the
-                       DB (which is allowed) and is not always associated to
-                       the same action ('ec_ok' in one or more entries, and
-                       'ec_nok' in one or more other entries). This is
-                       confusing and makes impossible to log in using this
-                       code ;
-  ec_nok_userid_pb   : the same "code" is used in more than one entries in the
-                       DB (which is allowed) and is not always associated to
-                       the same user id. This is confusing and makes
-                       impossible to log in using this code ;
-  ec_nok_userid_miss : the user id associated to this code does not exist in
-                       the user ids table ;
-  ec_nok_ap_pb       : not valid Additional Page id -> access denied ;
-  ec_ok_forced_pb    : the same "code" is used in more than one entries in the
-                       DB (which is allowed) and the "forced" argument is
-                       "true" for at least one of these entries, which should
-                       not be possible, as a "forced" code can occur only once
-                       in the DB. User is logged in and the code behaves as a
-                       not "forced" code ;
-  ec_ok_ap_pb        : not valid Additional Page id -> home page ;
-  ec_ok_cat_pb       : not valid category id -> home page ;
-  ec_ok_img_pb       : not valid image id -> category page ;
-
-_ the two main fields are "user_id" and "code", as the main purpose of the
-  plugin, and thus of the table, is to establish a relationship between a
-  code and an account on the gallery -- a user_id. "action" is an important
-  field too, as it tells which action to perform.
-_ though, even if "action", "user_id" and "code" are important, all of them
-  can be omitted (thus can be NULL), and both "user_id" and "code" can be
-  repeated (thus are not UNIQUE). This because :
-  _ the same code can automatically log in ("autolog") the same account
-    following several ways, depending on "cat", "img", and "ap" arguments of
-    the URL ; and thus different ways can be stored in the DB ;
-  _ a "disabled" code (the user tries to "autolog", but (s)he's not allowed
-    to) does not need a corresponding "user_id", thus "user_id" can be NULL ;
-  _ "user_id" field is used to store groups ids when "code" is NULL, to
-    identify groups authorized to duplication ;
-_ "code" does not have the MySQL UNIQUE attribute, but it has to be unique
-  when the "forced" Event Cats parameter is true, which is the case when this
-  code is disabled (outdated).
-
-*/
-  pwg_query('
-   INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
-   VALUES ("event_cats","0,1,0,0","Paramètres du plugin Event Cats");
-  ');
-  change_ec_conf('activated', 0);
-  return $q;
-}
-
-function plugin_activate() {
-  change_ec_conf('activated', 1);
-}
-
-function plugin_deactivate() {
-  change_ec_conf('activated', 0);
-}
-
-?>
