Announcement

#16 2009-06-12 01:26:37

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Trying to improve duplication authorizations, I put in config_local.inc.php :

Code:

// Pour le plugin personnel Event Cats, autoriser la duplication de compte :
// 0 : aucun compte ne peut dupliquer (toute autre valeur que 1 ou 2, en fait) ;
// 1 : seuls les comptes déclarés dans $conf['duplication_allowed'] peuvent dupliquer ;
// 2 : tous les comptes peuvent dupliquer ;
$conf['allow_user_registration'] = 1;

// Pour le plugin personnel Event Cats, comptes autorisés à dupliquer :
$conf['duplication_allowed'] = array(
  'Piwigo' => true,
  'Duplication autorisée' => true,
  'Duplication refusée' => false,
);

And modified P@t's function duplicate_account_url() this way :

Code:

function duplicate_account_url()
{
  global $conf, $lang, $template;

  if ((($conf['allow_user_registration'] == 2) or
    (($conf['allow_user_registration'] == 1) and $conf['duplication_allowed'][$userid]))
    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');
  }
}

But it never works, $conf['allow_user_registration'] being on 0, or being on 1 together with logging in as "Duplication refusée" always shows link "Duplicate".
What did I do wrong ? Account "Piwigo" is adviser in this gallery, if it can help.

But first thing : go to bed...

See you not later than next Monday night :-) !


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#17 2009-06-12 11:01:27

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Personal plugin Event Cats published in french only sorry in the wiki, waiting for a plain plugin normally next week.


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#18 2009-06-12 17:51:35

P@t
Piwigo Team
Nice
2007-06-13
4098

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

I think that we need an admin page for this plugin...
It's too diffiicult to use config_local file to configure it...


P@t

Offline

 

#19 2009-06-12 18:37:07

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6759

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

P@t wrote:

I think that we need an admin page for this plugin...
It's too diffiicult to use config_local file to configure it...

+1


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#20 2009-06-12 22:11:19

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

P@t wrote:

I think that we need an admin page for this plugin...
It's too diffiicult to use config_local file to configure it...

I don't agree : I'm able to configure it this way... ;-)

Yes I agree of course. This will be my hotel nights next week (three or four nights so far away from home, great... :-(( but at least the plugin should be improved). Will it be possible to have support ? As, if the biggest part is described in the wiki, I will probably need some details to be explained.

By the way, any idea on what is wrong with the modification I made to be able to choose accounts allowed to be duplicated ?

Many thanks for your help :-)

Luc

Last edited by LucMorizur (2009-06-12 22:31:25)


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#21 2009-06-17 00:21:45

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Hi ;

I'm painfully trying to translate in an admin page, the modification of $conf['auto_log'], $conf['outdated_page'], $conf['prior_page'], and $conf['allow_user_registration'].

This is ridiculous as
  _ only reproducing these modifications would hardly be an admin page, as it would be very dirty and not comfortable at all ;
  _ an essential feature, now that plg gave us the whish to have it :-) , would be the button in a category managing page, processing in one click all the adjustments to perform, when creating a so-called "event" category. And this is far away from my current priority, when I'm just trying to add -- in a PWG way -- a control to set if yes or no users will be allowed to duplicate :=| !

This is the problem of reverse engineering. Well.

Anyway currently I'm persisting, as this is interesting for me. But this way only the most dirty version of the plugin will be ready in a couple of weeks. That's a pity.

In case a kind progammer can code that much faster than me (cause here this will take months, provided I manage to keep on until the end), I think the plugin should have a table with following fields :

integer   user_id      ->      the account concerned in following values
boolean duplic_OK  ->      whether this account is allowed to be duplicated or not
string     code          ->      the code used as "autolog" argument
integer   action       ->      0 : code disabled <=> account not logged in, visitor (guest) redirected to an explaining Additional Page (arg1 field)
                                         1 : code OK, without any other specification <=> account logged in, visitor (registered) redirected to gallery home page
                                         2 : code OK, category specified <=> account logged in, visitor (registered) redirected to specified category (arg1 field)
                                         3 : code OK, Additional Page specified <=> account logged in, visitor (registered) redirected to specified Additional Page (arg1 field)
                                         (n : opened to new ideas)

integer   arg1          ->       gives the identifier of the category (case action is 2), or of the Additional Page (case action is 3), the visitor must be redirected to ; or any argument needed by any new idea

A configuration variable is needed too (integer 0, 1, 2), telling whether all, none, or only specified accounts, are allowed to be duplicated. (Best : 0 : none ; 1 : all ; 2 : no account but those specified "yes" in this table ; 3 : all accounts but those specified "no" in this table.)

I think that neither the first field, user_id, neither the third one, code, should be a primary key, so that
  _ a user_id can be linked to more than one code ;
  _ no code is absolutely required to append a user_id in this table.
This way :
  _ an account can be automatically logged in following several ways, for instance for navigating through an Additional Page or not ;
  _ an account can be specified whether it is allowed to be duplicated or not, without being an account which can log in automatically.

An admin page representing this table and allowing its modification would be necessary too, of course.

:-/

Once I have managed to code my dirty admin page, I will head on such a one, and will then be able to provide an update... when PHP and MySQL are replaced by improved systems...

Many thanks for your comments. :-)

EDIT : tomorrow evening I shall first open an entry for this plugin in SVN, so that things are started from the beginning :-\ ...

Have a nice night ; talk to you soon !

EDIT : user_id was qualified string. It is not, of course ! Probably is it an integer.

EDIT : action was called status. I bloody don't know why... :o/

Last edited by LucMorizur (2009-07-02 22:30:48)


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#22 2009-10-03 00:53:41

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Hi;

A presentation of the features:

first, the home page of the demonstration site, one can see some public categories, and not the private ones of course:
http://lucmorizur.free.fr

Auto id, redirection to home page (private categories authorized to this account are now reachable):
The Piwigo_EN account is generic, the link "Register" is displayed in the Identification menu block to duplicate the account.
Also, the link "Connection" is displayed too, so to allow people already having an account on this gallery, to log in and be redirected to the same page, whatever it is.

autolog=code_04FKx_for_Piwigo_EN

Auto id, redirection to an "Additionnal Pages":
The account Duplication refusée ("Duplication forbidden" in french) cannot be duplicated.
autolog=add_p_duplic_refusee&ap=3

Auto id, redirection to a category:
The account Duplication autorisée ("Duplication allowed" in french) can be duplicated. As it is not generic, the link is displayed "Duplicate".
autolog=duplic_OK&cat=15

Auto id, redirection to an image (in a private category of course):
autolog=code_04FKx_for_Piwigo_EN&cat=15&img=157

Auto id refused (code "outdated"), redirection to an "Additionnal Pages":
autolog=Code_perime_pour_Piwigo03

Auto id, redirection forced to an "Additionnal Pages" ("forced" = even though parameter "&cat=1" is given):
autolog=prior_page_pour_Piwigo03&cat=1

Auto id, redirection to a category as this category does not contain the requested image:
autolog=code_04FKx_for_Piwigo_EN&cat=15&img=1550

Auto id, redirection to home page as the requested category doesn't exist:
autolog=code_04FKx_for_Piwigo_EN&cat=150

Auto id, redirection to home page as the requested "Additionnal Pages" doesn't exist:
autolog=code_04FKx_for_Piwigo_EN&ap=40

Once identified thanks to one of these links, it is possible to "duplicate" the current account, ie create a new account, and continue to surf on the gallery with same access rights than the duplicated account, thus without having to wait that the admin has validated the account just created.

The files currently used on this test gallery are those recently posted at last commit.

Last edited by LucMorizur (2011-08-01 17:29:09)


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#23 2009-10-12 09:03:16

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Hi Piwigo team ;

in this plugin, I am currently coding the creation of an autolog code.

plg wrote:

I like the idea of the autoid, but one step further would be even better : in the administration screen of a private category, you have form to send the category URL by email to a list of email addresses. In the email, you find something like index.php?/123&autoid=abcdef1234. If anyone follow the link, Piwigo creates a generic account with permission to see the category. What I mean is to simplify the permission management system.

The notification is something else currently for me, but already what I can do is managing a POST message to create a generic account linked to an autoid code, with a certain page to display. This way from the administration screen of a private category, the admin can create an autolog code simply by clicking on a button.

What I miss is the way to insert a button in the category management page (cat_modify.tpl offhand). I looked a little bit how Extended Descriptions inserts its help button in many administration pages, but for the moment I have not catched completely how it is done. And anyway the need for Extended Descriptions is far much more complicated than Event Cats' one, as Event Cats needs to insert only one button in only one admin page.

Can you explain me how to insert this button from Event Cats plugin management, please ? Then I need to make it submit a form with POST method so to send the category id information and the type of autolog code creation, and normally it's done.


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#24 2013-12-28 11:11:07

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Hello...

So... I'm trying to make [extension by LucMorizur] Event Cats 2.6 compatible, and of course it is not that easy :-/ ... the difficulty being increased by the fact that I have forgotten a lot about Piwigo these last months, I was not at all programming any more, and the gallery I hardly use is still a version 2.0.10. Well.

I have read technical changes in 2.6, but I didn't find the reasons why I had the following notices on the test gallery I started with 2.6.0RC2 version, when I tried to use Event Cats (look at screen copy attached): "Undefined property: SmartyBC::$_tpl_vars in C:\wamp\www\piwigoRC\include\smarty\libs\Smarty.class.php on line 671".

I will really need help to make the changes in Event Cats, many thanks in advance.


Uploaded Images

Last edited by LucMorizur (2013-12-28 11:13:37)


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#25 2013-12-28 18:07:43

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Oops, I forgot also good practices on the forum...

So I found [Forum, post 147766 by flop25 in topic 22981] [Stripped] compatibility with User Tags, but it didn't help me...


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#26 2013-12-28 18:11:20

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

You should also read the release notes of Smarty 3

Code:

$template->smarty->_tpl_vars[]

was never a good way to get registered vars, use this

Code:

$template->get_template_vars()

Offline

 

#27 2013-12-28 19:32:08

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Many thanks mistic100, that was the source of the issue :-) .

I take this opportunity to ask your opinion: the change with register_user() is breaking the compatibility with Piwigo versions smaller than 2.6. Would you advise to create a trunk/branch/tags folder tree, or just update the plugin, and tag it as compatible with only Piwigo 2.6?


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

#28 2013-12-28 19:43:04

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

well personnally I don't plan updates of old versions of my plugins, so I only have a "trunk" and tag revisions "2.6 only" as soon as it's needed

but Eric for example creates a "tag" for each new version and manages complete branches

Offline

 

#29 2013-12-28 23:02:14

LucMorizur
Member
Vienne (Isère) - France
2009-04-30
169

Re: Preparation of plugin Event Cats (Event categories) (Auto Id)

Well I knew that already, it doesn't help me to choose :-D !

Anyway obviously I shall not manage to maintain different revisions of this plugin, it's not realistic at all to choose this solution.

OK, let's go for revision 1.3 of Event Cats – maybe it could be the opportunity to at last name it properly?...


Our gallery : Le Site à Nous (a silly name in french, but here I don't care ;-) ! )
An event, a new gallery ? Plugin Event Cats
My test gallery : Tests Piwigo de Luc
Thanksalot for this beautiful project.

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact