From: Franck Villaume Date: Sun, 7 Apr 2013 17:38:28 +0000 (+0200) Subject: implement #350: skip project approval when submitter is forge administrator X-Git-Tag: v5.3-rc1~1505^2~43 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=fa6d64afbf44de38328a1bda493f4377aec3ce0e implement #350: skip project approval when submitter is forge administrator --- diff --git a/src/www/register/index.php b/src/www/register/index.php index 97a0badae7..3fc5a7c7fd 100644 --- a/src/www/register/index.php +++ b/src/www/register/index.php @@ -19,6 +19,7 @@ * Portions Copyright 2002-2009 (c) Roland Mas * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent * Copyright 2012, Jean-Christophe Masson - French National Education Department + * Copyright 2013, Franck Villaume - TrivialDev * http://fusionforge.org/ * * This file is part of FusionForge. FusionForge is free software; @@ -135,14 +136,18 @@ if (getStringFromRequest('submit')) { } else { site_user_header(array('title'=>_('Registation Complete'))); - if ( ! forge_get_config ('project_auto_approval') ) { + if ( !forge_get_config('project_auto_approval') && !forge_check_global_perm('forge_admin')) { printf(_('

Your project has been submitted to the %1$s administrators. Within 72 hours, you will receive notification of their decision and further instructions.

Thank you for choosing %1$s

'), forge_get_config ('forge_name')); } elseif ($group->isError()) { printf(_('
ERROR: %1$s
'), $group->getErrorMessage() ); } else { printf(_('Approving Project: %1$s'), $group->getUnixName()).'
'; - if (!$group->approve( user_get_object_by_name ( forge_get_config ('project_auto_approval_user') ) ) ) { + if (forge_get_config('project_auto_approval')) { + $u = user_get_object_by_name(forge_get_config('project_auto_approval_user')); + } + + if (!$group->approve($u)) { printf(_('
Approval ERROR: %1$s
'), $group->getErrorMessage() ); } else { printf(_('

Your project has been automatically approved. You should receive an email containing further information shortly.

Thank you for choosing %1$s

'), forge_get_config ('forge_name'));