[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/ -> signup.php (source)

   1  <?php
   2  /**
   3   * $Horde: horde/signup.php,v 1.17.10.8 2006/01/01 21:28:04 jan Exp $
   4   *
   5   * Copyright 2002-2006 Marko Djukic <marko@oblo.com>
   6   *
   7   * See the enclosed file COPYING for license information (LGPL). If you
   8   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
   9   */
  10  
  11  @define('AUTH_HANDLER', true);
  12  @define('HORDE_BASE', dirname(__FILE__));
  13  require_once  HORDE_BASE . '/lib/base.php';
  14  require_once 'Horde/Auth/Signup.php';
  15  require_once 'Horde/Variables.php';
  16  
  17  $auth = &Auth::singleton($conf['auth']['driver']);
  18  
  19  // Make sure signups are enabled before proceeding
  20  if ($conf['signup']['allow'] !== true ||
  21      !$auth->hasCapability('add')) {
  22      $notification->push(_("User Registration has been disabled for this site."), 'horde.error');
  23      header('Location: ' . Auth::getLoginScreen());
  24      exit;
  25  }
  26  
  27  $vars = &Variables::getDefaultVariables();
  28  $signup = &Auth_Signup::singleton();
  29  $renderer = &new Horde_Form_Renderer();
  30  
  31  $formsignup = &Horde_Form::singleton('HordeSignupForm', $vars);
  32  $formsignup->validate($vars);
  33  
  34  if ($vars->get('formname') != 'hordesignupform') {
  35      /* Not yet submitted. */
  36      $formsignup->clearValidation();
  37  }
  38  
  39  if ($formsignup->isValid() && $vars->get('formname') == 'hordesignupform') {
  40      $formsignup->getInfo($vars, $info);
  41  
  42      if (!$conf['signup']['approve']) {
  43          /* User can sign up directly, no intervention necessary. */
  44          $success = $signup->addSignup($info);
  45          $success_message = sprintf(_("Added \"%s\" to the system. You can log in now."), $info['user_name']);
  46      } elseif ($conf['signup']['approve']) {
  47          /* Insert this user into a queue for admin approval. */
  48          $success = $signup->queueSignup($info);
  49          $success_message = sprintf(_("Submitted request to add \"%s\" to the system. You cannot log in until your request has been approved."), $info['user_name']);
  50      }
  51  
  52      if (is_a($success, 'PEAR_Error')) {
  53          $notification->push(sprintf(_("There was a problem adding \"%s\" to the system: %s"), $info['user_name'], $success->getMessage()), 'horde.error');
  54      } else {
  55          $notification->push($success_message, 'horde.success');
  56          $url = Auth::getLoginScreen('', $info['url']);
  57          header('Location: ' . $url);
  58          exit;
  59      }
  60  }
  61  
  62  $title = _("User Registration");
  63  require  HORDE_TEMPLATES . '/common-header.inc';
  64  $notification->notify(array('listeners' => 'status'));
  65  $formsignup->renderActive($renderer, $vars, 'signup.php', 'post');
  66  require  HORDE_TEMPLATES . '/common-footer.inc';


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7