From: Kyle J. McKay Date: Wed, 7 Aug 2013 17:34:22 +0000 (-0700) Subject: *.cgi: allow administration of any does_exist project X-Git-Url: https://repo.or.cz/w/girocco.git/commitdiff_plain/8c8525eacbebcccbbeb42c5d5387605ce87f9156 *.cgi: allow administration of any does_exist project The valid_name check may reject some projects that actually do exist. Instead allow any project that does_exist to be administered. --- diff --git a/cgi/delproj.cgi b/cgi/delproj.cgi index 3ec8bd2..d4cb44a 100755 --- a/cgi/delproj.cgi +++ b/cgi/delproj.cgi @@ -21,12 +21,12 @@ unless (defined $name) { exit; } -if (!Girocco::Project::valid_name($name)) { +if (!Girocco::Project::does_exist($name,1) && !Girocco::Project::valid_name($name)) { print "

Invalid project name. Go away, sorcerer.

\n"; exit; } -if (!Girocco::Project::does_exist($name)) { +if (!Girocco::Project::does_exist($name,1)) { print "

Sorry but this project does not exist. Now, how did you get here?!

\n"; exit; } diff --git a/cgi/editproj.cgi b/cgi/editproj.cgi index ff052ab..a8fbe12 100755 --- a/cgi/editproj.cgi +++ b/cgi/editproj.cgi @@ -38,12 +38,12 @@ unless (defined $name) { exit; } -if (!Girocco::Project::valid_name($name)) { +if (!Girocco::Project::does_exist($name,1) && !Girocco::Project::valid_name($name)) { print "

Invalid project name. Go away, sorcerer.

\n"; exit; } -if (!Girocco::Project::does_exist($name)) { +if (!Girocco::Project::does_exist($name,1)) { print "

Sorry but the project $name does not exist. Now, how did you get here?!

\n"; exit; } diff --git a/cgi/mirrorproj.cgi b/cgi/mirrorproj.cgi index 2a164ca..e2b368d 100755 --- a/cgi/mirrorproj.cgi +++ b/cgi/mirrorproj.cgi @@ -22,12 +22,12 @@ unless (defined $name) { exit; } -if (!Girocco::Project::valid_name($name)) { +if (!Girocco::Project::does_exist($name,1) && !Girocco::Project::valid_name($name)) { print "

Invalid project name. Go away, sorcerer.

\n"; exit; } -if (!Girocco::Project::does_exist($name)) { +if (!Girocco::Project::does_exist($name,1)) { print "

Sorry but the project $name does not exist. Now, how did you get here?!

\n"; exit; } diff --git a/cgi/pwproj.cgi b/cgi/pwproj.cgi index f46c9f5..e3cc1a7 100755 --- a/cgi/pwproj.cgi +++ b/cgi/pwproj.cgi @@ -28,12 +28,12 @@ unless (defined $name) { exit; } -if (!Girocco::Project::valid_name($name)) { +if (!Girocco::Project::does_exist($name,1) && !Girocco::Project::valid_name($name)) { print "

Invalid project name. Go away, sorcerer.

\n"; exit; } -if (!Girocco::Project::does_exist($name)) { +if (!Girocco::Project::does_exist($name,1)) { print "

Sorry but this project does not exist. Now, how did you get here?!

\n"; exit; } diff --git a/cgi/regproj.cgi b/cgi/regproj.cgi index 50d9c7c..1f49c57 100755 --- a/cgi/regproj.cgi +++ b/cgi/regproj.cgi @@ -28,7 +28,7 @@ if ($cgi->param('mode') && $y0 eq 'Register' && $cgi->request_method eq 'POST') # submitted, let's see # FIXME: racy, do a lock Girocco::Project::valid_name($name) - and Girocco::Project::does_exist($name) + and Girocco::Project::does_exist($name,1) and $gcgi->err("Project with the name '$name' already exists."); $name =~ /\.git$/ and $gcgi->err("Project name should not end with .git - I'll add that automagically.");