plugins/SpecialUserFuncs.php
changeset 348 87e08a6e4fec
parent 345 4ccdfeee9a11
child 359 e0787bb6285b
equal deleted inserted replaced
347:299a90e28abc 348:87e08a6e4fec
   500   // form field trackers
   500   // form field trackers
   501   $username = '';
   501   $username = '';
   502   $email = '';
   502   $email = '';
   503   $realname = '';
   503   $realname = '';
   504   
   504   
       
   505   $terms = getConfig('register_tou');
       
   506   
   505   if(getConfig('account_activation') == 'disable' && ( ( $session->user_level >= USER_LEVEL_ADMIN && !isset($_GET['IWannaPlayToo']) ) || $session->user_level < USER_LEVEL_ADMIN || !$session->user_logged_in ))
   507   if(getConfig('account_activation') == 'disable' && ( ( $session->user_level >= USER_LEVEL_ADMIN && !isset($_GET['IWannaPlayToo']) ) || $session->user_level < USER_LEVEL_ADMIN || !$session->user_logged_in ))
   506   {
   508   {
   507     $s = ($session->user_level >= USER_LEVEL_ADMIN) ? '<p>' . $lang->get('user_reg_err_disabled_body_adminblurb', array( 'reg_link' => makeUrl($paths->page, 'IWannaPlayToo&coppa=no', true) )) . '</p>' : '';
   509     $s = ($session->user_level >= USER_LEVEL_ADMIN) ? '<p>' . $lang->get('user_reg_err_disabled_body_adminblurb', array( 'reg_link' => makeUrl($paths->page, 'IWannaPlayToo&coppa=no', true) )) . '</p>' : '';
   508     die_friendly($lang->get('user_reg_err_disabled_title'), '<p>' . $lang->get('user_reg_err_disabled_body') . '</p>' . $s);
   510     die_friendly($lang->get('user_reg_err_disabled_title'), '<p>' . $lang->get('user_reg_err_disabled_body') . '</p>' . $s);
   509   }
   511   }
   524     else
   526     else
   525     {
   527     {
   526       if ( getConfig('enable_coppa') == '1' && ( !isset($_POST['coppa']) || ( isset($_POST['coppa']) && !in_array($_POST['coppa'], array('yes', 'no')) ) ) )
   528       if ( getConfig('enable_coppa') == '1' && ( !isset($_POST['coppa']) || ( isset($_POST['coppa']) && !in_array($_POST['coppa'], array('yes', 'no')) ) ) )
   527       {
   529       {
   528         $s = 'Invalid COPPA input';
   530         $s = 'Invalid COPPA input';
       
   531       }
       
   532       else if ( !empty($terms) && !isset($_POST['tou_agreed']) )
       
   533       {
       
   534         $s = $lang->get('user_reg_err_accept_tou');
   529       }
   535       }
   530       else
   536       else
   531       {
   537       {
   532         $coppa = ( isset($_POST['coppa']) && $_POST['coppa'] == 'yes' );
   538         $coppa = ( isset($_POST['coppa']) && $_POST['coppa'] == 'yes' );
   533         $s = false;
   539         $s = false;
   721                 <input tabindex="6" name="captchacode" type="text" size="10" />
   727                 <input tabindex="6" name="captchacode" type="text" size="10" />
   722                 <input type="hidden" name="captchahash" value="<?php echo $captchacode; ?>" />
   728                 <input type="hidden" name="captchahash" value="<?php echo $captchacode; ?>" />
   723               </td>
   729               </td>
   724             </tr>
   730             </tr>
   725             
   731             
       
   732             <!-- FIELD: TOU -->
       
   733             
       
   734             <?php
       
   735             if ( !empty($terms) ):
       
   736             ?>
       
   737             
       
   738             <tr>
       
   739               <td class="row1" colspan="3">
       
   740                 <?php
       
   741                 echo $lang->get('user_reg_msg_please_read_tou');
       
   742                 ?>
       
   743               </td>
       
   744             </tr>
       
   745             
       
   746             <tr>
       
   747               <td class="row3" colspan="3">
       
   748                 <div style="border: 1px solid #000000; height: 75px; width: 60%; clip: rect(0px,auto,auto,0px); overflow: auto; background-color: #FFF; margin: 0 auto; padding: 4px;">
       
   749                   <?php
       
   750                   echo RenderMan::render($terms);
       
   751                   ?>
       
   752                 </div>
       
   753                 <p style="text-align: center;">
       
   754                   <label>
       
   755                     <input type="checkbox" name="tou_agreed" />
       
   756                     <b><?php echo $lang->get('user_reg_lbl_field_tou'); ?></b>
       
   757                   </label>
       
   758                 </p>
       
   759               </td>
       
   760             </tr>
       
   761             
       
   762             <?php
       
   763             endif;
       
   764             ?>
       
   765             
   726             <!-- FIELD: submit button -->
   766             <!-- FIELD: submit button -->
   727             <tr>
   767             <tr>
   728               <th class="subhead" colspan="3" style="text-align: center;">
   768               <th class="subhead" colspan="3" style="text-align: center;">
   729                 <input tabindex="7" type="submit" name="submit" value="Create my account" />
   769                 <input tabindex="7" type="submit" name="submit" value="<?php echo $lang->get('user_reg_btn_create_account'); ?>" />
   730               </td>
   770               </td>
   731             </tr>
   771             </tr>
   732             
   772             
   733           </table>
   773           </table>
   734         </div>
   774         </div>