* leads to creation of new group with Pending status, suitable for approval.
*
* Portions Copyright 1999-2001 (c) VA Linux Systems
- * The rest Copyright 2002-2004 (c) GForge Team
+ * Portions Copyright 2002-2004 (c) GForge Team
+ * Portions Copyright 2002-2009 (c) Roland Mas
* http://gforge.org/
*
- * @version $Id$
- *
* This file is part of GForge.
*
* GForge is free software; you can redistribute it and/or modify
require_once('../env.inc.php');
-require_once('pre.php');
-require_once('common/include/license.php');
-require_once('common/scm/SCMFactory.class.php');
+require_once $gfwww.'include/pre.php';
+require_once $gfcommon.'scm/SCMFactory.class.php';
//
// Test if restricted project registration
//
$full_name = trim(getStringFromRequest('full_name'));
$purpose = trim(getStringFromRequest('purpose'));
- $license = trim(getStringFromRequest('license'));
- $license_other = trim(getStringFromRequest('license_other'));
$description = trim(getStringFromRequest('description'));
$unix_name = strtolower(getStringFromRequest('unix_name'));
$scm = getStringFromRequest('scm');
+ $is_public = getIntFromRequest('is_public');
$feedback = "";
if ($sys_use_scm && !$scm) {
form_release_key(getStringFromRequest("form_key"));
// $feedback .= _('Site has SCM enabled, but no SCM was chosen.');
} else {
- $scm_host = $sys_cvs_host;
- if ($sys_use_scm && $scm) {
+ $scm_host = '';
+ $plugin = false ;
+ if ($sys_use_scm && $scm && $scm != 'noscm') {
$plugin = plugin_get_object($scm);
- $scm_host = $plugin->getDefaultServer();
- } else if ($sys_use_scm && isset($sys_cvs_host)) {
- $scm_host = $sys_cvs_host;
- } else {
- $scm_host = '';
+ if ($plugin) {
+ $scm_host = $plugin->getDefaultServer();
+ }
}
$group = new Group();
$full_name,
$unix_name,
$description,
- $license,
- $license_other,
$purpose,
'shell1',
- $scm_host
+ $scm_host,
+ $is_public
);
- if ($res && $sys_use_scm) {
- $res = $group->setPluginUse($scm,true);
+ if ($res && $sys_use_scm && $plugin) {
+ $group->setUsesSCM (true) ;
+ $res = $group->setPluginUse ($scm, true);
+ } else {
+ $group->setUsesSCM (false) ;
}
+
if (!$res) {
form_release_key(getStringFromRequest("form_key"));
$feedback .= $group->getErrorMessage();
} else {
$full_name = '';
$purpose = '';
- $license = '';
- $license_other = '';
$description = '';
$unix_name = '';
$scm = '';
<?php echo htmlspecialchars(stripslashes($purpose)); ?>
</textarea>
-<?php printf(_('<h3>3. License</h3>'), $GLOBALS['sys_name']) ?>
-
-<?php
-echo license_selectbox('license',$license);
-?>
-<?php echo _('<p>If you selected "other", please provide an explanation along with a description of your license. Realize that other licenses may not be approved. Also, it may take additional time to make a decision for such project, since we will need to check that license is compatible with the OpenSource definition.</p>') ?>
+<?php echo _('<h3>3. Project Public Description</h3><p>This is the description of your project which will be shown on the Project Summary page, in search results, etc. It should not be as comprehensive and formal as Project Purpose description (step 2), so feel free to use concise and catchy wording. Maximum length is 255 chars.</p>')?>
+<br />
<br />
-<textarea name="license_other" cols="60" rows="5">
-<?php echo htmlspecialchars(stripslashes($license_other)); ?>
-</textarea>
-
-<?php echo _('<h3>4. Project Public Description</h3><p>This is the description of your project which will be shown on the Project Summary page, in search results, etc. It should not be as comprehensive and formal as Project Purpose description (step 2), so feel free to use concise and catchy wording. Maximum length is 255 chars.</p>')?>
<textarea name="description" cols="70" rows="5">
<?php echo htmlspecialchars(stripslashes($description)); ?>
</textarea>
-<?php printf(_('<h3>5. Project Unix Name</h3>In addition to full project name, you will need to choose short,"Unix" name for your project.<p/> The "Unix Name" has several restrictions because it is used in so many places around the site. They are:<ul><li>Cannot match the unix name of any other project</li><li>Must be between 3 and 15 characters in length</li><li>Must be in lower case</li><li>Can only contain characters, numbers, and dashes</li><li>Must be a valid unix username</li><li>Cannot match one of our reserved domains</li><li>Unix name will never change for this project</li></ul><p/>Your unix name is important, however, because it will be used for many things, including:<ul><li>A web site at <tt>unixname.%1$s</tt></li><li>A CVS Repository root of <tt>/cvsroot/unixname</tt> at <tt>cvs.unixname.%1$s</tt></li><li>Shell access to <tt>unixname.%1$s</tt></li><li>Search engines throughout the site</li></ul><p/>Unix Name:<br/>'), $GLOBALS['sys_default_domain']) ?>
+<?php printf(_('<h3>4. Project Unix Name</h3>In addition to full project name, you will need to choose short,"Unix" name for your project.<p/> The "Unix Name" has several restrictions because it is used in so many places around the site. They are:<ul><li>Cannot match the unix name of any other project</li><li>Must be between 3 and 15 characters in length</li><li>Must be in lower case</li><li>Can only contain characters, numbers, and dashes</li><li>Must be a valid unix username</li><li>Cannot match one of our reserved domains</li><li>Unix name will never change for this project</li></ul><p/>Your unix name is important, however, because it will be used for many things, including:<ul><li>A web site at <tt>unixname.%1$s</tt></li><li>A CVS Repository root of <tt>/cvsroot/unixname</tt> at <tt>cvs.unixname.%1$s</tt></li><li>Shell access to <tt>unixname.%1$s</tt></li><li>Search engines throughout the site</li></ul><p/>Unix Name:<br/>'), $GLOBALS['sys_default_domain']) ?>
<input type="text" maxlength="15" size="15" name="unix_name" value="<?php echo htmlspecialchars(stripslashes($unix_name)); ?>"/>
<?php
- if ($sys_use_scm) {
- $SCMFactory=new SCMFactory();
- $scm_plugins=$SCMFactory->getSCMs();
- if (count($scm_plugins)!=0) {
- if (count($scm_plugins)==1) {
- printf(_('As there is only one SCM system, then this will be selected automatically. <strong>%1$s</strong> will be selected.'), $scm_plugins[0]).'<br /><br />';
- echo '<input type="hidden" name="scm" value="'. $scm_plugins[0].'">';
- } else {
- echo _('<h3>6. SCM</h3><p>You can choose among different SCM for your project, but just one. Please select the SCM system you want to use.</p>')."\n";
- echo '<table><tbody><tr><td><strong>'._('SCM Repository').':</strong></td>';
- $checked=true;
- foreach($scm_plugins as $plugin) {
- $myPlugin= plugin_get_object($plugin);
- echo '<td><input type="radio" name="scm" ';
- echo 'value="'.$myPlugin->name.'"';
- if (isset($scm) && strcmp($scm, $myPlugin->name) == 0) {
- echo ' checked="checked"';
- } elseif (!isset($scm) && $checked) {
- echo ' checked="checked"';
- $checked = false;
- }
- echo '>'.$myPlugin->text.'</td>';
- }
- echo '</tr></tbody></table>'."\n";
- }
- } else {
- echo 'Error - Site has SCM but no plugins registered';
- }
+ $SCMFactory = new SCMFactory() ;
+$scm_plugins=$SCMFactory->getSCMs() ;
+if ($sys_use_scm && count($scm_plugins) > 0) {
+ echo _('<h3>6. SCM</h3><p>You can choose among different SCM for your project, but just one (or none at all). Please select the SCM system you want to use.</p>')."\n";
+ echo '<table><tbody><tr><td><strong>'._('SCM Repository').':</strong></td>';
+ echo '<td><input type="radio" name="scm" value="noscm" checked="checked">'._('No SCM').'</td>';
+ foreach($scm_plugins as $plugin) {
+ $myPlugin= plugin_get_object($plugin);
+ echo '<td><input type="radio" name="scm" value="'.$myPlugin->name.'">'.$myPlugin->text.'</td>';
}
+ echo '</tr></tbody></table>'."\n";
+}
?>
+<?php
+ if ($sys_use_private_project) {
+ echo "<p><input type=\"radio\" name=\"is_public\" value=\"1\" ";
+ if (!isset($is_public) || $is_public) {
+ echo ' checked';
+ }
+ echo ">". _('Public')."</p>";
+ echo "<p><input type=\"radio\" name=\"is_public\" value=\"0\" ";
+ if (isset ($is_public) && !$is_public) {
+ echo ' checked';
+ }
+ echo ">". _('Private')."</p>";
+ } else {
+ echo "<input type=\"hidden\" name=\"is_public\" value=\"1\">";
+ }
+?>
<div align="center">
<input type="submit" name="submit" value="<?php echo _('Submit') ?>"/> <input type="submit" name="i_disagree" value="<?php echo _('Cancel') ?>"/>
site_footer(array());
-?>
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+?>