Main Page | Directories | File List | File Members

projectname.php

Go to the documentation of this file.
00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: projectname.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 # The Savane project is free software; you can redistribute it and/or
00014 # modify it under the terms of the GNU General Public License
00015 # as published by the Free Software Foundation; either version 2
00016 # of the License, or (at your option) any later version.
00017 #
00018 # The Savane project is distributed in the hope that it will be useful,
00019 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021 # GNU General Public License for more details.
00022 #
00023 # You should have received a copy of the GNU General Public License
00024 # along with the Savane project; if not, write to the Free Software
00025 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00026 
00027 require "../include/pre.php";    
00028 
00029 session_require(array('isloggedin'=>'1'));
00030 
00031 require $GLOBALS['sys_www_topdir']."/include/account.php";
00032 
00033 # push received vars
00034 if ($insert_purpose && $form_purpose) { 
00035 
00036         mt_srand((double)microtime()*1000000);
00037         $random_num=mt_rand(0,1000000);
00038 
00039         # make group entry
00040         $result = db_query("INSERT INTO groups (group_name,is_public,unix_group_name,status,license,register_purpose,required_software,other_comments,register_time,license_other,rand_hash) VALUES ("
00041                 . "'__$random_num',"
00042                 . "1," # public
00043                 . "'__$random_num',"
00044                 . "'I'," # status set to inactive until the registration is complete
00045                 . "'__$random_num',"
00046                 . "'".htmlspecialchars($form_purpose)."',"
00047                 . "'".htmlspecialchars($form_required_sw)."',"
00048                 . "'".htmlspecialchars($form_comments)."',"
00049                 . time() . ","
00050                 . "'__$random_num','__".md5($random_num)."')");
00051 
00052         if (!$result) {
00053                 exit_error('ERROR','INSERT QUERY FAILED. Please notify '.$GLOBALS['sys_mail_admin'].'@'.$GLOBALS['sys_mail_domain']);
00054         } else {
00055                 $group_id=db_insertid($result);
00056         }
00057 
00058 } elseif (!$form_full_name && !$form_unix_name) {
00059         exit_error('Error','Missing Information. <strong>PLEASE</strong> fill in all required information.');
00060 }
00061 
00062 # FIXME: begin
00063 # we test project name
00064 #if ($form_full_name && $form_unix_name) {
00065 #  utils_get_content("register/projectname_test");
00066 #  #  print 'debug '.projectname_do_the_test($test_on_name=$test_on_name, $form_unix_name=$form_unix_name, $form_full_name=$form_full_name).' debug';
00067 #  if (projectname_do_the_test($test_on_name=$test_on_name, $form_unix_name=$form_unix_name, $form_full_name=$form_full_name) == "0") {
00068 #    # if we get here, test has been done, we go to the next step
00069 #    Header("Location: license.php?group_id=$group_id&insert_group_name=$insert_group_name&form_full_name=$form_full_name&form_unix_name=$form_unix_name&no_redirection=$no_redirection&re_license_other=$re_license_other&rand_hash=$rand_hash");
00070 #  } else {
00071 #    # if we get here, test was not ok
00072 #    $need_to_print_warning = "1";
00073 #    $test_on_name = "1";
00074 #    $re_unix_name = $form_unix_name;
00075 #    $re_full_name = $form_full_name;
00076 #  }
00077 #}
00078 # FIXME: end
00079 
00080 $HTML->header(array('title'=>_("Project Name")));
00081 
00082 print '<h2>'._("Step 3: Project Name").'</h2>';
00083 
00084 # get site-specific content
00085 utils_get_content("register/projectname");
00086 
00087 # FIXME: begin
00088 #if ($need_to_print_warning) {
00089 #  print '<p><span class="error">'.projectname_test_error_message().'</span>';
00090 #}
00091 # FIXME: end
00092 
00093 
00094 print '<p>'._("Please complete both fields").'.</p>';
00095 
00096 print '<form action="license.php" method="post">';
00097 
00098 # avoid pre.php looking for group_type info
00099 print '<input type="hidden" name="no_redirection" value="1" />';
00100 
00101 
00102 #FIXME
00103 #if (isset($test_on_name)) { echo '<input type="hidden" name="test_on_name" value="'.$test_on_name.'" />'; }
00104 
00105 if (isset($re_license_other)) { echo '<input type="hidden" name="re_license_other" value="'.$re_license_other.'" />'; }
00106 
00107 print '<input type="hidden" name="insert_group_name" value="y" />';
00108 print '<input type="hidden" name="group_id" value="'.$group_id.'" />';
00109 print '<input type="hidden" name="rand_hash" value="'.(isset($rand_hash) ? $rand_hash : md5($random_num)).'" />';
00110 
00111 # If we are creating the local admin project, system unix group name cannot be
00112 # changed and we make a proposal for the full name
00113 if (!group_getid($GLOBALS['sys_unix_group_name']))
00114 {
00115   print '<h3>'._("Full Name").' :</h3>';
00116   print '<input size="60" maxlength="254" type="text" name="form_full_name" value="Site Administration" />';
00117 
00118   print '<h3>'._("System Name").' :</h3>';
00119   print '<input type="hidden" name="form_unix_name" value="'.$GLOBALS['sys_unix_group_name'].'" /><strong>'.$GLOBALS['sys_unix_group_name'].'</strong>';
00120 }
00121 else
00122 {
00123   print '<h3>'._("Full Name").' :</h3>';
00124   print '<input size="60" maxlength="254" type="text" name="form_full_name"'.(isset($re_full_name) ? " value=\"$re_full_name\"":"").' />';
00125   
00126   print '<h3>'._("System Name").' :</h3>';
00127   print '<input type="text" maxlength="16" size="15" name="form_unix_name"'.(isset($re_unix_name) ? " value=\"$re_unix_name\"":"").' /><br /><br />';
00128 }
00129   
00130 print '<div align="center">';
00131 print '<input type=submit name="Submit" value="'._("Step 4: License").'" />';
00132 
00133 print '</div>';
00134 print '</form>';
00135 print '<div align="center"><span class="error">'._("Do not click back button after this point (unless asked to).").'</span></div>';
00136 
00137 $HTML->footer(array());
00138 ?>

Generated on Sun Feb 26 13:23:04 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4