[ Index ]

PHP Cross Reference of Nucleus CMS v3.51 code documentation

title

Body

[close]

/ -> createaccount.php (source)

   1  <?php
   2      include  "./config.php";
   3      include $DIR_LIBS."ACTION.php";
   4      
   5      if (isset ($_POST['showform'])&&$_POST['showform']==1) {
   6          $showform = 1;
   7      }
   8      else {
   9          $showform = 0;
  10      }
  11  ?>
  12  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  13  <html>
  14  <head>
  15      <title>Create Member Account</title>
  16      <style type="text/css">@import url(nucleus/styles/manual.css);</style>
  17  </head>
  18  <body>
  19  
  20      <h1>Create Account</h1>
  21  
  22  <?php
  23      // show form only if Visitors are allowed to create a Member Account

  24      if ($CONF['AllowMemberCreate']==1) { 
  25          // if the form is shown the first time no POST data 

  26          // will be added as value for the input fields

  27          if ($showform==0) {
  28  ?>
  29  
  30      <form method="post" action="createaccount.php">
  31  
  32      <div>
  33      <input type="hidden" name="showform" value="1" />
  34      <input type="hidden" name="action" value="createaccount" />
  35      
  36          Login Name (required): 
  37          <br />
  38          <input name="name" size="32" maxlength="32" /> <small>(only a-z, 0-9)</small>
  39          <br />
  40          <br />        
  41          Real Name (required): 
  42          <br />
  43          <input name="realname" size="40" />
  44          <br />
  45          <br />        
  46          Email (required):
  47          <br />
  48          <input name="email" size="40" /> <small>(must be valid, because an activation link will be sent over there)</small>
  49          <br />
  50          <br />        
  51          URL: 
  52          <br />
  53          <input name="url" size="60" />
  54          <br />
  55          <?php
  56          // add extra fields from Plugins, like NP_Profile

  57          $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
  58          // add a Captcha challenge or something else

  59          global $manager;
  60          $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
  61          ?>
  62          <br />
  63          <br />                        
  64          <input type="submit" value="Create Account" />
  65      </div>
  66  
  67      </form>
  68  <?php
  69          } // close if showfrom ...

  70          else {
  71          // after the from is sent it will be validated

  72          // POST data will be added as value to treat the user with care (;-))

  73      
  74          $a = new ACTION();
  75  
  76          // if createAccount fails it returns an error message 

  77          $message = $a->createAccount();
  78  
  79          echo '<span style="font-weight:bold; color:red;">'.$message.'</span><br /><br />'; 
  80  ?>
  81      
  82          <form method="post" action="createaccount.php">
  83  
  84      <div>
  85      <input type="hidden" name="showform" value="1" />
  86      <input type="hidden" name="action" value="createaccount" />
  87      
  88          Login Name (required): 
  89          <br />
  90          <input name="name" size="32" maxlength="32" <?php if(isset($_POST['name'])){echo 'value="'.$_POST['name'].'"';}?>/> <small>(only a-z, 0-9)</small>
  91          <br />
  92          <br />        
  93          Real Name (required): 
  94          <br />
  95          <input name="realname" size="40" <?php if(isset($_POST['realname'])){echo 'value="'.$_POST['realname'].'"';}?>/>
  96          <br />
  97          <br />        
  98          Email (required):
  99          <br />
 100          <input name="email" size="40" <?php if(isset($_POST['email'])){echo 'value="'.$_POST['email'].'"';}?>/> <small>(must be valid, because an activation link will be sent over there)</small>
 101          <br />
 102          <br />        
 103          URL: 
 104          <br />
 105          <input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.$_POST['url'].'"';}?>/>
 106          <br />
 107          <?php
 108          // add extra fields from plugin, like NP_Profile

 109          $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
 110          // add a Captcha challenge or something else

 111          global $manager;
 112          $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
 113          ?>
 114          <br />
 115          <br />
 116          <input type="submit" value="Create Account" />
 117      </div>
 118  
 119      </form>
 120  <?php
 121          }    // close else showform ...

 122  
 123  }
 124  else { 
 125      echo 'Visitors are not allowed to create a Member Account.<br /><br />';
 126      echo 'Please contact the website administrator for more information.';
 127  }
 128  ?>
 129      
 130      
 131  </body>
 132  </html>


Generated: Sun Aug 1 03:56:06 2010
Open Source related documentation for developers.