Ignore:
Timestamp:
Jan 28, 2011, 8:56:39 AM (13 years ago)
Author:
LucMorizur
Message:

Fix bug:2135

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/event_cats/maintain.inc.php

    r7098 r8956  
    2323// +-----------------------------------------------------------------------+
    2424
    25 // Keeps file coded in UTF-8 without BOM: é
     25// Keeps file coded in UTF-8 without BOM : é
    2626
    2727// ***********************************************************************
    28 // ** maintain.inc.php: Installation page for Piwigo plugin Event Cats **
     28// ** maintain.inc.php : Installation page for Piwigo plugin Event Cats **
    2929// ***********************************************************************
    3030
     
    4242  global $prefixeTable;
    4343
    44         pwg_query("
    45    DELETE IGNORE FROM `".CONFIG_TABLE."` WHERE `param` = 'event_cats' LIMIT 1;
    46   ");
     44        pwg_query("DELETE FROM `".CONFIG_TABLE."` WHERE `param` = 'event_cats' LIMIT 1;");
    4745        return pwg_query('DROP TABLE IF EXISTS `'.$prefixeTable.'event_cats`;');
    4846}
     
    7472
    7573/*
    76 Explanations on table structure:
     74Explanations on table structure :
    7775
    78 code   : the code used as "autolog" argument. If thie code provided by the
    79          visitor does not exist in the table, the administrator can choose
    80          whether the visitor is redirected to the home page (nothing
    81          happens) or to the "access denied" page;
    82 user_id: the account concerned in following values;
    83 action : the action to perform:
    84    ec_nok: code disabled: account not logged in, visitor (guest) redirected
    85            to an explaining Additional Page (arg2 field). If Additional Page
    86            plugin is not activated, redirection to the "access denied" page;
    87    ec_ok : code OK, account logged in. Redirection depends on arg1 and arg2
    88            values. There are four cases:
    89      arg1 and arg2 are both NULL: home page;
    90      arg1 not NULL and arg2 NULL: category;
    91      arg1 NULL and arg2 not NULL: Additional Page;
    92      arg1 and arg2 both not NULL: Image page.
    93            If arg1 is a valid category id, and arg2 is not a valid image id,
    94            redirection to category. In all other cases where the arg1 or arg2
    95            is not valid, redirection to home page.
    96 arg1   : (described above);
    97 arg2   : (described above);
    98 forced : allows the administrator to impose that, for certain codes, the
    99          settings specified in the database ("action", "arg1", "arg2") are
    100          applied, whatever can be the arguments given in the URL;
    101 comment: a reminder for the webmaster.
     76code    : the code used as "autolog" argument. If thie code provided by the
     77          visitor does not exist in the table, the administrator can choose
     78          whether the visitor is redirected to the home page (nothing
     79          happens) or to the "access denied" page ;
     80user_id : the account concerned in following values ;
     81action  : the action to perform :
     82   ec_nok : code disabled : account not logged in, visitor (guest) redirected
     83            to an explaining Additional Page (arg2 field). If Additional Page
     84            plugin is not activated, redirection to the "access denied" page ;
     85   ec_ok  : code OK, account logged in. Redirection depends on arg1 and arg2
     86            values. There are four cases :
     87     arg1 and arg2 are both NULL : home page ;
     88     arg1 not NULL and arg2 NULL : category ;
     89     arg1 NULL and arg2 not NULL : Additional Page ;
     90     arg1 and arg2 both not NULL : Image page.
     91            If arg1 is a valid category id, and arg2 is not a valid image id,
     92            redirection to category. In all other cases where the arg1 or arg2
     93            is not valid, redirection to home page.
     94arg1    : (described above) ;
     95arg2    : (described above) ;
     96forced  : allows the administrator to impose that, for certain codes, the
     97          settings specified in the database ("action", "arg1", "arg2") are
     98          applied, whatever can be the arguments given in the URL.
    10299           
    103 * As a precision:
     100* As a precision :
    104101    in the PHP code, the "action" can also have the following values, so to
    105     display accurate messages in the admin page:
    106   ec_nok_action_pb  : the same "code" is used in more than one entries in the
    107                       DB (which is allowed) and is not always associated to
    108                       the same action ('ec_ok' in one or more entries, and
    109                       'ec_nok' in one or more other entries). This is
    110                       confusing and makes impossible to log in using this
    111                       code;
    112   ec_nok_userid_pb  : the same "code" is used in more than one entries in the
    113                       DB (which is allowed) and is not always associated to
    114                       the same user id. This is confusing and makes
    115                       impossible to log in using this code;
    116   ec_nok_userid_miss: the user id associated to this code does not exist in
    117                       the user ids table;
    118   ec_nok_ap_pb      : not valid Additional Page id -> access denied;
    119   ec_ok_ap_pb       : not valid Additional Page id -> home page;
    120   ec_ok_cat_pb      : not valid category id -> home page;
    121   ec_ok_img_pb      : not valid image id -> category page;
     102    display accurate messages in the admin page :
     103  ec_nok_action_pb   : the same "code" is used in more than one entries in the
     104                       DB (which is allowed) and is not always associated to
     105                       the same action ('ec_ok' in one or more entries, and
     106                       'ec_nok' in one or more other entries). This is
     107                       confusing and makes impossible to log in using this
     108                       code ;
     109  ec_nok_userid_pb   : the same "code" is used in more than one entries in the
     110                       DB (which is allowed) and is not always associated to
     111                       the same user id. This is confusing and makes
     112                       impossible to log in using this code ;
     113  ec_nok_userid_miss : the user id associated to this code does not exist in
     114                       the user ids table ;
     115  ec_nok_ap_pb       : not valid Additional Page id -> access denied ;
     116  ec_ok_ap_pb        : not valid Additional Page id -> home page ;
     117  ec_ok_cat_pb       : not valid category id -> home page ;
     118  ec_ok_img_pb       : not valid image id -> category page ;
    122119
    123120_ the two main fields are "user_id" and "code", as the main purpose of the
     
    127124_ though, even if "action", "user_id" and "code" are important, all of them
    128125  can be omitted (thus can be NULL), and both "user_id" and "code" can be
    129   repeated (thus are not UNIQUE). This because:
     126  repeated (thus are not UNIQUE). This because :
    130127  _ the same code can automatically log in ("autolog") the same account
    131128    following several ways, depending on "cat", "img", and "ap" arguments of
    132     the URL; and thus different ways can be stored in the DB;
     129    the URL ; and thus different ways can be stored in the DB ;
    133130  _ a "disabled" code (the user tries to "autolog", but (s)he's not allowed
    134     to) does not need a corresponding "user_id", thus "user_id" can be NULL;
     131    to) does not need a corresponding "user_id", thus "user_id" can be NULL ;
    135132  _ "user_id" field is used to store groups ids when "code" is NULL, to
    136     identify groups authorized to duplication;
     133    identify groups authorized to duplication ;
    137134_ "code" does not have the MySQL UNIQUE attribute, but it has to be unique
    138135  when the "forced" Event Cats parameter is true, which is the case when this
Note: See TracChangeset for help on using the changeset viewer.