[ Index ]

PHP Cross Reference of Nucleus CMS 3.32

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="20" /> <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 a Captcha challenge or something else
  57          global $manager;
  58          $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
  59          ?>
  60          <br />
  61          <br />                        
  62          <input type="submit" value="Create Account" />
  63      </div>
  64  
  65      </form>
  66  <?php
  67          } // close if showfrom ...
  68          else {
  69          // after the from is sent it will be validated
  70          // POST data will be added as value to treat the user with care (;-))
  71      
  72          $a = new ACTION();
  73  
  74          // if createAccount fails it returns an error message 
  75          $message = $a->createAccount();
  76  
  77          echo '<span style="font-weight:bold; color:red;">'.$message.'</span><br /><br />'; 
  78  ?>
  79      
  80          <form method="post" action="createaccount.php">
  81  
  82      <div>
  83      <input type="hidden" name="showform" value="1" />
  84      <input type="hidden" name="action" value="createaccount" />
  85      
  86          Login Name (required): 
  87          <br />
  88          <input name="name" size="20" <?php if(isset($_POST['name'])){echo 'value="'.$_POST['name'].'"';}?>/> <small>(only a-z, 0-9)</small>
  89          <br />
  90          <br />        
  91          Real Name (required): 
  92          <br />
  93          <input name="realname" size="40" <?php if(isset($_POST['realname'])){echo 'value="'.$_POST['realname'].'"';}?>/>
  94          <br />
  95          <br />        
  96          Email (required):
  97          <br />
  98          <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>
  99          <br />
 100          <br />        
 101          URL: 
 102          <br />
 103          <input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.$_POST['url'].'"';}?>/>
 104          <br />
 105          <?php
 106          // add a Captcha challenge or something else
 107          global $manager;
 108          $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
 109          ?>
 110          <br />
 111          <br />
 112          <input type="submit" value="Create Account" />
 113      </div>
 114  
 115      </form>
 116  <?php
 117          }    // close else showform ...
 118  
 119  }
 120  else { 
 121      echo 'Visitors are not allowed to create a Member Account.<br /><br />';
 122      echo 'Please contact the website administrator for more information.';
 123  }
 124  ?>
 125      
 126      
 127  </body>
 128  </html>


Generated: Tue Feb 12 15:34:36 2008 Cross-referenced by PHPXref 0.7