-
- ?>
-
- <p><?php printf(_('Your project has been submitted to the %1$s administrators. Within 72 hours, you will receive notification of their decision and further instructions.<p/>Thank you for choosing %1$s'), $GLOBALS['sys_name'])?>
- </p>
-
- <?php
-
+
+ if ( $sys_project_reg_autoapprove != true ) {
+ printf(_('<p>Your project has been submitted to the %1$s administrators. Within 72 hours, you will receive notification of their decision and further instructions.<p/>Thank you for choosing %1$s</p>'), forge_get_config ('forge_name'));
+ } else if ($group->isError()) {
+ printf(_('<p>ERROR: %1$s</p>'), $group->getErrorMessage() );
+ } else {
+ printf(_('Approving Project: %1$s'), $group->getUnixName()).'<br />';
+
+ if (!$group->approve( user_get_object_by_name ( $sys_project_reg_autoapprove_user ) ) ) {
+ printf(_('<p>Approval ERROR: %1$s</p>'), $group->getErrorMessage() );
+ } else {
+ $hook_params = array () ;
+ $hook_params['group_id'] = $group_id ;
+ plugin_hook ("group_approved", $hook_params) ;
+
+ plugin_hook('add_cal_group',$group_id);
+
+ printf(_('<p>Your project has been automatically approved. You should receive an email containing further information shortly.<p/>Thank you for choosing %1$s</p>'), forge_get_config ('forge_name'));
+ }
+ }
+