git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: nguyenki <nguyenki@ensibm.imag.fr>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCHv1] Export file in git-remote-mediawiki
Date: Sun, 10 Jun 2012 15:01:27 +0200	[thread overview]
Message-ID: <vpqehpnnwwo.fsf@bauges.imag.fr> (raw)
In-Reply-To: <c23d4a113c735e093e3e9b06e4f16a70@ensibm.imag.fr> (nguyenki@ensibm.imag.fr's message of "Sat, 09 Jun 2012 00:59:22 +0200")

nguyenki <nguyenki@ensibm.imag.fr> writes:

>>> +	my %hashFiles = get_file_extensions_maybe($complete_file_name);
>>
>> What does this function do? My first understanding was that it
>> queried
>> the wiki for allowed file extensions, but why does it need the file
>> name? It does nothing if $complete_file_name ends with .mw, but then
>> why
>> do you run it before entering the following if() statement?
>>
>>>  	if (substr($complete_file_name,-3) eq ".mw") {
>>>  		my $title = substr($complete_file_name,0,-3);
>>
>  This function will get a list of allowed file extensions. It need the
> file name to verify if this name begins with .mw or not. If not, it
> does nothing like
> you said. But if $complete_file_name is not a wiki page (end with
> .mw), the function will return the list of file extensions %hashFiles
> to verify if this file is allowed in this condition:

If $complete_file_name is not a wiki page, you basically don't need to
call this function. As I said, move the call to the function within the
next "if" statement, and you won't need this extra complexity.

> Yes, i'll correct it in the next patch.
> For the moment, i added these lines to deal with the case similar -
> the case when an user tries to upload a file or pages but he doesn't
> have sufficient rights or he failed to login.
>
> +sub error_insufficient_right {
> +       print STDERR "Can not delete or upload file and wiki pages\n";
> +       print STDERR "You don't have right to do it\n";
> +       print STDOUT "error $_[0]\"right insufficient\"\n";
> +       return 0;
> +}

This is still a regression. The previous version was propagating page
deletion as "replace content with [[Category:Deleted]]", which did work
with insufficient priviledge.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

      reply	other threads:[~2012-06-10 13:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 13:27 [PATCHv1] Export file in git-remote-mediawiki Kim Thuat NGUYEN
2012-06-08 14:07 ` Matthieu Moy
2012-06-08 22:59   ` nguyenki
2012-06-10 13:01     ` Matthieu Moy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqehpnnwwo.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=nguyenki@ensibm.imag.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).