[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> signup.php (source)

   1  <?php
   2  # Mantis - a php based bugtracking system
   3  
   4  # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   5  # Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   6  
   7  # Mantis is free software: you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation, either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Mantis is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
  19  
  20      # --------------------------------------------------------
  21      # $Id: signup.php,v 1.41.2.1 2007-10-13 22:34:30 giallu Exp $
  22      # --------------------------------------------------------
  23  
  24      require_once ( 'core.php' );
  25  
  26      $t_core_path = config_get( 'core_path' );
  27  
  28      require_once( $t_core_path.'email_api.php' );
  29      require_once( $t_core_path . 'disposable' . DIRECTORY_SEPARATOR . 'disposable.php' );
  30  
  31      $f_username        = strip_tags( gpc_get_string( 'username' ) );
  32      $f_email        = strip_tags( gpc_get_string( 'email' ) );
  33      $f_captcha        = gpc_get_string( 'captcha', '' );
  34      $f_public_key    = gpc_get_int( 'public_key', '' );
  35  
  36      $f_username = trim( $f_username );
  37      $f_email = email_append_domain( trim( $f_email ) );
  38      $f_captcha = strtolower( trim( $f_captcha ) );
  39  
  40      # forse logout on the current user if already authenticated
  41      if( auth_is_user_authenticated() ) {
  42          auth_logout();
  43      }
  44  
  45      # Check to see if signup is allowed
  46      if ( OFF == config_get( 'allow_signup' ) ) {
  47          print_header_redirect( 'login_page.php' );
  48          exit;
  49      }
  50  
  51      if( ON == config_get( 'signup_use_captcha' ) && get_gd_version() > 0     &&
  52                  helper_call_custom_function( 'auth_can_change_password', array() ) ) {
  53          # captcha image requires GD library and related option to ON
  54          $t_key = strtolower( substr( md5( config_get( 'password_confirm_hash_magic_string' ) . $f_public_key ), 1, 5) );
  55  
  56          if ( $t_key != $f_captcha ) {
  57              trigger_error( ERROR_SIGNUP_NOT_MATCHING_CAPTCHA, ERROR );
  58          }
  59      }
  60  
  61      email_ensure_not_disposable( $f_email );
  62  
  63      # notify the selected group a new user has signed-up
  64      if( user_signup( $f_username, $f_email ) ) {
  65          email_notify_new_account( $f_username, $f_email );
  66      }
  67  
  68      html_page_top1();
  69      html_page_top2a();
  70  ?>
  71  
  72  <br />
  73  <div align="center">
  74  <table class="width50" cellspacing="1">
  75  <tr>
  76      <td class="center">
  77          <b><?php echo lang_get( 'signup_done_title' ) ?></b><br/>
  78          <?php echo "[$f_username - $f_email] " ?>
  79      </td>
  80  </tr>
  81  <tr>
  82      <td>
  83          <br/>
  84          <?php echo lang_get( 'password_emailed_msg' ) ?>
  85          <br /><br/>
  86          <?php echo lang_get( 'no_reponse_msg') ?>
  87          <br/><br/>
  88      </td>
  89  </tr>
  90  </table>
  91  <br />
  92  <?php print_bracket_link( 'login_page.php', lang_get( 'proceed' ) ); ?>
  93  </div>
  94  
  95  <?php html_page_bottom1a( __FILE__ ) ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics