00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: license.php 5429 2006-02-17 22:59:20Z toddy $
00006 #
00007 # Copyright 1999-2000 (c) The SourceForge Crew
00008 # Copyright 2000-2003 (c) Free Software Foundation
00009 # Mathieu Roy <yeupou--at--gnu.org>
00010 #
00011 # Copyright 2004 (c) Mathieu Roy <yeupou--at--gnu.org>
00012 #
00013 #
00014 # The Savane project is free software; you can redistribute it and/or
00015 # modify it under the terms of the GNU General Public License
00016 # as published by the Free Software Foundation; either version 2
00017 # of the License, or (at your option) any later version.
00018 #
00019 # The Savane project is distributed in the hope that it will be useful,
00020 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00022 # GNU General Public License for more details.
00023 #
00024 # You should have received a copy of the GNU General Public License
00025 # along with the Savane project; if not, write to the Free Software
00026 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00027
00028
00029 require "../include/pre.php";
00030 require "../include/vars.php";
00031 require "../include/account.php";
00032 session_require(array('isloggedin'=>'1'));
00033
00034 if ($insert_group_name && $group_id && $rand_hash && $form_full_name && $form_unix_name)
00035 {
00036 # check the validity of the project's name, only if we are not creating
00037 # the local admin group
00038 if (group_getid($GLOBALS['sys_unix_group_name']))
00039 {
00040 if (!account_groupnamevalid($form_unix_name))
00041 {
00042 exit_error(_("Invalid Group Name"), $register_error);
00043 }
00044 }
00045 # make sure the name is not already taken, ignoring incomplete
00046 # registrations: risks of a name clash seems near 0, while not doing that
00047 # require maintainance, since some people interrupt registration and
00048 # try to redoit later with another name.
00049 # And even if a name clash happens, admins will notice it during approval
00050 if (db_numrows(db_query("SELECT group_id FROM groups WHERE unix_group_name LIKE '$form_unix_name' AND status <> 'I'")) > 0)
00051 {
00052 exit_error("Project Name Taken","A project with that name already exists. Use the back button.");
00053 }
00054 # hash to prevent modification of a existing project
00055 $sql="UPDATE groups SET unix_group_name='". strtolower($form_unix_name)
00056 . "', group_name='$form_full_name' "
00057 . " WHERE group_id='$group_id' AND rand_hash='__$rand_hash'";
00058 $result=db_query($sql);
00059 }
00060 else
00061 {
00062 exit_error(_("Some required fields were left empty. Use the back button."));
00063 }
00064
00065 $HTML->header(array('title'=>_("License")));
00066
00067 print '<h2>'._("Step 4: License").'</h2>';
00068
00069 # site-specific content
00070 utils_get_content("register/license");
00071
00072
00073 print '<h3>'._("Licenses compatible with our policies").' :</h3>';
00074 print '<p><ul>';
00075
00076 while (list($l,$w) = each($LICENSE)) {
00077 print '<li>';
00078 if ($LICENSE_URL[$l] != "0") {
00079 print '<a href="'.$LICENSE_URL[$l].'" target="_blank">'.$w.'</a>';
00080 } else {
00081 print $w;
00082 }
00083 print "</li>\n";
00084 }
00085 print '</ul></p>';
00086
00087
00088 print '<h3>'._("License for This Project").' :</h3>';
00089
00090 print '
00091 <form action="projecttype.php" method="post">
00092 <input type="hidden" name="no_redirection" value="1" />
00093 <input type="hidden" name="insert_license" value="y" />
00094 <input type="hidden" name="group_id" value="'.$group_id.'" />
00095 <input type="hidden" name="rand_hash" value="'.$rand_hash.'" />';
00096
00097 print '<p>'._("Choose your project's license").'.</p>';
00098
00099 print '<select name="form_license">';
00100 reset($LICENSE);
00101 while (list($k,$v) = each($LICENSE)) {
00102 print "<option value=\"$k\">$v</option>\n";
00103 }
00104 print '</select>';
00105 print '<p>'._("If you selected \"other\", please provide an explanation along with a description of your license").'. ';
00106 print _("Remember that other licenses are subject to approval").'.</p>';
00107 print '<p><textarea name="form_license_other" wrap="virtual" cols="60" rows="10">';
00108 if (isset($re_license_other)) { echo $re_license_other; }
00109 print '</textarea><br /></p>';
00110
00111
00112 print '<div align="center">';
00113
00114 if (db_numrows(db_query("SELECT type_id FROM group_type")) != 1) {
00115 print '<input type=submit name="Submit" value="'._("Step 5: Project Type").'" />';
00116 } else {
00117 # if only one project_type available, skip step 5
00118 print '<input type=submit name="Submit" value="'._("Next Step: Confirmation").'" />';
00119 }
00120 print '</div>';
00121 print '</form>';
00122
00123 print '<div align="center"><span class="error">'._("Do not click back button (unless asked to).").'</span></div>';
00124
00125 $HTML->footer(array());
00126
00127 ?>
00128