plugins/SpecialAdmin.php
changeset 328 dc838fd61a06
parent 326 ab66d6d1f1f4
child 329 0437a7cf1acc
equal deleted inserted replaced
327:c2f4c900c507 328:dc838fd61a06
   217       setConfig('lockout_duration', $_POST['lockout_duration']);
   217       setConfig('lockout_duration', $_POST['lockout_duration']);
   218     
   218     
   219     if ( in_array($_POST['lockout_policy'], array('disable', 'captcha', 'lockout')) )
   219     if ( in_array($_POST['lockout_policy'], array('disable', 'captcha', 'lockout')) )
   220       setConfig('lockout_policy', $_POST['lockout_policy']);
   220       setConfig('lockout_policy', $_POST['lockout_policy']);
   221     
   221     
       
   222     // Avatar settings
       
   223     setConfig('avatar_enable', ( isset($_POST['avatar_enable']) ? '1' : '0' ));
       
   224     // for these next three values, set the config value if it's a valid integer; this is
       
   225     // done by using strval(intval($foo)) === $foo, which flattens $foo to an integer and
       
   226     // then converts it back to a string. This effectively verifies that var $foo is both
       
   227     // set and that it's a valid string representing an integer.
       
   228     setConfig('avatar_max_size', ( strval(intval($_POST['avatar_max_size'])) === $_POST['avatar_max_size'] ? $_POST['avatar_max_size'] : '10240' ));
       
   229     setConfig('avatar_max_width', ( strval(intval($_POST['avatar_max_width'])) === $_POST['avatar_max_width'] ? $_POST['avatar_max_width'] : '96' ));
       
   230     setConfig('avatar_max_height', ( strval(intval($_POST['avatar_max_height'])) === $_POST['avatar_max_height'] ? $_POST['avatar_max_height'] : '96' ));
       
   231     setConfig('avatar_enable_anim', ( isset($_POST['avatar_enable_anim']) ? '1' : '0' ));
       
   232     setConfig('avatar_upload_file', ( isset($_POST['avatar_upload_file']) ? '1' : '0' ));
       
   233     setConfig('avatar_upload_http', ( isset($_POST['avatar_upload_http']) ? '1' : '0' ));
       
   234     
       
   235     if ( is_dir(ENANO_ROOT . '/' . $_POST['avatar_directory']) )
       
   236     {
       
   237       if ( preg_match('/^([A-z0-9_-]+)(\/([A-z0-9_-]+))*$/', $_POST['avatar_directory']) )
       
   238       {
       
   239         setConfig('avatar_directory', $_POST['avatar_directory']);
       
   240       }
       
   241       else
       
   242       {
       
   243         echo '<div class="error-box">You have entered an invalid avatar directory.</div>';
       
   244       }
       
   245     }
       
   246     else
       
   247     {
       
   248       echo '<div class="error-box">You have entered an invalid avatar directory.</div>';
       
   249     }
       
   250     
   222     echo '<div class="info-box">Your changes to the site configuration have been saved.</div><br />';
   251     echo '<div class="info-box">Your changes to the site configuration have been saved.</div><br />';
   223     
   252     
   224   }
   253   }
   225   else if ( isset($_POST['submit']) && defined('ENANO_DEMO_MODE') )
   254   else if ( isset($_POST['submit']) && defined('ENANO_DEMO_MODE') )
   226   {
   255   {
   243       <tr><td class="row1" colspan="2">Hint: If you're using Windows, you can make a "&copy;" symbol by holding ALT and pressing 0169 on the numeric keypad.</td></tr>
   272       <tr><td class="row1" colspan="2">Hint: If you're using Windows, you can make a "&copy;" symbol by holding ALT and pressing 0169 on the numeric keypad.</td></tr>
   244       <tr><td class="row2">Contact e-mail<br /><small>All e-mail sent from this site will appear to have come from the address shown here.</small></td><td class="row2"><input name="contact_email" type="text" size="40" value="<?php echo htmlspecialchars(getConfig('contact_email')); ?>" /></td></tr>
   273       <tr><td class="row2">Contact e-mail<br /><small>All e-mail sent from this site will appear to have come from the address shown here.</small></td><td class="row2"><input name="contact_email" type="text" size="40" value="<?php echo htmlspecialchars(getConfig('contact_email')); ?>" /></td></tr>
   245       
   274       
   246     <!-- Wiki mode -->
   275     <!-- Wiki mode -->
   247       
   276       
   248       <tr><th colspan="2">Wiki mode</th></tr>
   277       <tr><th class="subhead" colspan="2">Wiki mode</th></tr>
   249       
   278       
   250       <tr>
   279       <tr>
   251         <td class="row3" rowspan="2">
   280         <td class="row3" rowspan="2">
   252           Enano can also act as a wiki, meaning anyone can edit and create pages. To enable Wiki Mode, check the box to the right.<br /><br />
   281           Enano can also act as a wiki, meaning anyone can edit and create pages. To enable Wiki Mode, check the box to the right.<br /><br />
   253           In Wiki Mode, certain HTML tags such as &lt;script&gt; and &lt;object&gt; are disabled, and all PHP code is disabled, except if the person editing the page is an administrator.<br /><br />
   282           In Wiki Mode, certain HTML tags such as &lt;script&gt; and &lt;object&gt; are disabled, and all PHP code is disabled, except if the person editing the page is an administrator.<br /><br />
   276         </td>
   305         </td>
   277       </tr>
   306       </tr>
   278       
   307       
   279     <!-- Site statistics -->
   308     <!-- Site statistics -->
   280     
   309     
   281       <tr><th colspan="2">Statistics and hit counting</th></tr>
   310       <tr><th class="subhead" colspan="2">Statistics and hit counting</th></tr>
   282       
   311       
   283       <tr>
   312       <tr>
   284         <td class="row1">Enano has the ability to show statistics for every page on the site. This allows you to keep very close track of who is visiting your site, and from where.<br /><br />Unfortunately, some users don't like being logged. For this reason, you should state clearly what is logged (usually the username or IP address, current time, page name, and referer URL) in your privacy policy. If your site is primarily geared towards children, and you are a United States citizen, you are required to have a privacy policy stating exactly what is being logged under the terms of the Childrens' Online Privacy Protection Act.</td>
   313         <td class="row1">Enano has the ability to show statistics for every page on the site. This allows you to keep very close track of who is visiting your site, and from where.<br /><br />Unfortunately, some users don't like being logged. For this reason, you should state clearly what is logged (usually the username or IP address, current time, page name, and referer URL) in your privacy policy. If your site is primarily geared towards children, and you are a United States citizen, you are required to have a privacy policy stating exactly what is being logged under the terms of the Childrens' Online Privacy Protection Act.</td>
   285         <td class="row1"><label><input type="checkbox" name="log_hits" <?php if(getConfig('log_hits') == '1') echo 'checked="checked" '; ?>/>  Log all page hits</label><br /><small>This excludes special and administration pages.</small></td>
   314         <td class="row1"><label><input type="checkbox" name="log_hits" <?php if(getConfig('log_hits') == '1') echo 'checked="checked" '; ?>/>  Log all page hits</label><br /><small>This excludes special and administration pages.</small></td>
   286       </tr>
   315       </tr>
   287       
   316       
   288     <!-- Comment options -->
   317     <!-- Comment options -->
   289       
   318       
   290       <tr><th colspan="2">Comment system</th></tr>
   319       <tr><th class="subhead" colspan="2">Comment system</th></tr>
   291       <tr><td class="row1"><label for="enable-comments"><b>Enable the comment system</b></label>                      </td><td class="row1"><input name="enable-comments"  id="enable-comments"  type="checkbox" <?php if(getConfig('enable_comments')=='1')  echo('CHECKED '); ?>/></td></tr>
   320       <tr><td class="row1"><label for="enable-comments"><b>Enable the comment system</b></label>                      </td><td class="row1"><input name="enable-comments"  id="enable-comments"  type="checkbox" <?php if(getConfig('enable_comments')=='1')  echo('CHECKED '); ?>/></td></tr>
   292       <tr><td class="row2"><label for="comment-approval">Require approval before article comments can be shown</label></td><td class="row2"><input name="comment-approval" id="comment-approval" type="checkbox" <?php if(getConfig('approve_comments')=='1') echo('CHECKED '); ?>/></td></tr>
   321       <tr><td class="row2"><label for="comment-approval">Require approval before article comments can be shown</label></td><td class="row2"><input name="comment-approval" id="comment-approval" type="checkbox" <?php if(getConfig('approve_comments')=='1') echo('CHECKED '); ?>/></td></tr>
   293       <tr><td class="row1">Guest comment posting allowed                                                              </td><td class="row1"><label><input name="comments_need_login" type="radio" value="0" <?php if(getConfig('comments_need_login')=='0') echo 'CHECKED '; ?>/> Yes</label>
   322       <tr><td class="row1">Guest comment posting allowed                                                              </td><td class="row1"><label><input name="comments_need_login" type="radio" value="0" <?php if(getConfig('comments_need_login')=='0') echo 'CHECKED '; ?>/> Yes</label>
   294                                                                                                                                             <label><input name="comments_need_login" type="radio" value="1" <?php if(getConfig('comments_need_login')=='1') echo 'CHECKED '; ?>/> Require visual confirmation</label>
   323                                                                                                                                             <label><input name="comments_need_login" type="radio" value="1" <?php if(getConfig('comments_need_login')=='1') echo 'CHECKED '; ?>/> Require visual confirmation</label>
   295     <!-- Default permissions -->                                                                                                            <label><input name="comments_need_login" type="radio" value="2" <?php if(getConfig('comments_need_login')=='2') echo 'CHECKED '; ?>/> No (require login)</label></td></tr>
   324     <!-- Default permissions -->                                                                                                            <label><input name="comments_need_login" type="radio" value="2" <?php if(getConfig('comments_need_login')=='2') echo 'CHECKED '; ?>/> No (require login)</label></td></tr>
   306         <td class="row1"><a href="#" onclick="ajaxOpenACLManager('__DefaultPermissions', 'Special'); return false;">Manage default permissions</a></td>
   335         <td class="row1"><a href="#" onclick="ajaxOpenACLManager('__DefaultPermissions', 'Special'); return false;">Manage default permissions</a></td>
   307       </tr>
   336       </tr>
   308       
   337       
   309       -->
   338       -->
   310       
   339       
       
   340     <!-- Site disablement -->
       
   341     
       
   342       <tr><th class="subhead" colspan="2">Disable all site access</th></tr>
       
   343       
       
   344       <tr>
       
   345         <td class="row3" rowspan="2">Disabling the site allows you to work on the site without letting non-administrators see or use it.</td>
       
   346         <td class="row1"><label><input onclick="if(this.checked) document.getElementById('site_disabled_notice').style.display='block'; else document.getElementById('site_disabled_notice').style.display='none';" type="checkbox" name="site_disabled" <?php if(getConfig('site_disabled') == '1') echo 'checked="checked" '; ?>/>  Disable this site</label></td>
       
   347       </tr>
       
   348       <tr>
       
   349         <td class="row2">
       
   350           <div id="site_disabled_notice"<?php if(getConfig('site_disabled')!='1') echo(' style="display:none"'); ?>>
       
   351             Message to show to users:<br />
       
   352             <textarea name="site_disabled_notice" rows="7" cols="30"><?php echo getConfig('site_disabled_notice'); ?></textarea>
       
   353           </div>
       
   354         </td>
       
   355       </tr>
       
   356       
       
   357     </table>
       
   358     </div>
       
   359         
       
   360     <div class="tblholder">
       
   361     <table border="0" width="100%" cellspacing="1" cellpadding="4">
       
   362     
       
   363     <tr>
       
   364       <th colspan="2">Users and communication</th>
       
   365     </tr>
       
   366     
       
   367     <!-- Account activation -->
       
   368       
       
   369       <tr><th class="subhead" colspan="2">User account activation</th></tr>
       
   370       
       
   371       <tr>
       
   372         <td class="row3" colspan="2">
       
   373           If you would like to require users to confirm their e-mail addresses by way of account activation, you can enable this behavior here. If this option is set to "None", users will be able to register and use this site without confirming their e-mail addresses. If this option is set to "User", users will automatically be sent e-mails upon registration with a link to activate their accounts. And lastly, if this option is set to "Admin", users' accounts will not be active until an administrator activates the account.<br /><br />
       
   374           You may also disable registration completely if needed.<br /><br />
       
   375           <b>Note: because of abuse by project administrators, sending account activation e-mails will not work on SourceForge.net servers.</b>
       
   376         </td>
       
   377       </tr>
       
   378       
       
   379       <tr>
       
   380       <td class="row1" style="width: 50%;">Account activation:</td><td class="row1">
       
   381           <?php
       
   382           echo '<label><input'; if(getConfig('account_activation') == 'disable') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="disable" /> Disable registration</label><br />';
       
   383           echo '<label><input'; if(getConfig('account_activation') != 'user' && getConfig('account_activation') != 'admin' && getConfig('account_activation') != 'disable') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="none" /> None</label>';
       
   384           echo '<label><input'; if(getConfig('account_activation') == 'user') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="user" /> User</label>';
       
   385           echo '<label><input'; if(getConfig('account_activation') == 'admin') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="admin" /> Admin</label>';
       
   386           ?>
       
   387         </td>
       
   388       </tr>
       
   389       
       
   390     <!-- Account lockout -->
       
   391     
       
   392       <tr><th class="subhead" colspan="2">Account lockouts</th></tr>
       
   393       
       
   394       <tr><td class="row3" colspan="2">Configure Enano to prevent or restrict logins for a specified period of time if a user enters an incorrect password a specific number of times.</td></tr>
       
   395       
       
   396       <tr>
       
   397         <td class="row2">Lockout threshold:<br />
       
   398           <small>How many times can a user enter wrong credentials before a lockout goes into effect?</small>
       
   399         </td>
       
   400         <td class="row2">
       
   401           <input type="text" name="lockout_threshold" value="<?php echo ( $_ = getConfig('lockout_threshold') ) ? $_ : '5' ?>" />
       
   402         </td>
       
   403       </tr>
       
   404       
       
   405       <tr>
       
   406         <td class="row1">Lockout duration:<br />
       
   407           <small>This is how long an account lockout should last, in minutes.</small>
       
   408         </td>
       
   409         <td class="row1">
       
   410           <input type="text" name="lockout_duration" value="<?php echo ( $_ = getConfig('lockout_duration') ) ? $_ : '15' ?>" />
       
   411         </td>
       
   412       </tr>
       
   413       
       
   414       <tr>
       
   415         <td class="row2">Lockout policy:<br />
       
   416           <small>What should be done when a lockout goes into effect?</small>
       
   417         </td>
       
   418         <td class="row2">
       
   419           <label><input type="radio" name="lockout_policy" value="disable" <?php if ( getConfig('lockout_policy') == 'disable' ) echo 'checked="checked"'; ?> /> Don't do anything</label><br />
       
   420           <label><input type="radio" name="lockout_policy" value="captcha" <?php if ( getConfig('lockout_policy') == 'captcha' ) echo 'checked="checked"'; ?> /> Require visual confirmation</label><br />
       
   421           <label><input type="radio" name="lockout_policy" value="lockout" <?php if ( getConfig('lockout_policy') == 'lockout' || !getConfig('lockout_policy') ) echo 'checked="checked"'; ?> /> Prevent all login attempts</label>
       
   422         </td>
       
   423       </tr>
       
   424       
       
   425     <!-- Password strength -->
       
   426       
       
   427       <tr><th class="subhead" colspan="2">Password strength</th></tr>
       
   428       
       
   429       <tr>
       
   430         <td class="row2">
       
   431           <b>Enable password strength analysis</b><br />
       
   432           <small>This should be enabled in most cases. When this is enabled, a strength meter and a numerical score will be displayed wherever a password can be changed.</small>
       
   433         </td>
       
   434         <td class="row2">
       
   435           <label><input type="checkbox" name="pw_strength_enable" <?php if ( getConfig('pw_strength_enable') == '1' ) echo 'checked="checked" '; ?>/> Enabled</label>
       
   436         </td>
       
   437       </tr>
       
   438       
       
   439       <tr>
       
   440         <td class="row1">
       
   441           <b>Minimum strength score</b><br />
       
   442           <small>This is the lowest score a password will be allowed to have. -10 will allow any password. A score of under -3 is considered weak, under 1 is fair, under 4 is good, under 10 is strong, and 10 and above are very strong. The scale is open-ended. This only has an effect if the meter is enabled above.</small>
       
   443         </td>
       
   444         <td class="row1">
       
   445           <input type="text" name="pw_strength_minimum" value="<?php echo ( $x = getConfig('pw_strength_minimum') ) ? $x : '-10'; ?>" />
       
   446         </td>
       
   447       </tr>
       
   448       
       
   449     <!-- E-mail options -->
       
   450     
       
   451       <tr><th class="subhead" colspan="2">E-mail sent from the site</th></tr>
       
   452       <tr><td class="row1">E-mail sending method:<br /><small>Try using the built-in e-mail method first. If that doesn't work, you will need to enter valid SMTP information here.</small></td>
       
   453           <td class="row1"><label><input <?php if(getConfig('smtp_enabled') != '1') echo 'checked="checked"'; ?> type="radio" name="emailmethod" value="phpmail" />PHP's built-in mail() function</label><br />
       
   454                            <label><input <?php if(getConfig('smtp_enabled') == '1') echo 'checked="checked"'; ?> type="radio" name="emailmethod" value="smtp" />Use an external SMTP server</label></td>
       
   455           </tr>
       
   456       <tr><td class="row2">SMTP hostname:<br /><small>This option only applies to the external SMTP mode.</small></td>
       
   457           <td class="row2"><input value="<?php echo getConfig('smtp_server'); ?>" name="smtp_host" type="text" size="30" /></td>
       
   458           </tr>
       
   459       <tr><td class="row1">SMTP credentials:<br /><small>This option only applies to the external SMTP mode.</small></td>
       
   460           <td class="row1">Username: <input value="<?php echo getConfig('smtp_user'); ?>" name="smtp_user" type="text" size="30" /><br />
       
   461               Password: <input value="<?php if(getConfig('smtp_password') != false) echo 'XXXXXXXXXXXX'; ?>" name="smtp_pass" type="password" size="30" /></td>
       
   462           </tr>
       
   463         
       
   464     <!-- Avatar support -->
       
   465     
       
   466       <tr>
       
   467         <th class="subhead" colspan="2">Avatars</th>
       
   468       </tr>
       
   469       
       
   470       <tr>
       
   471         <td class="row3" colspan="2">
       
   472           Avatars are small images that users can display on their profiles and in comments.
       
   473         </th>
       
   474       </tr>
       
   475       
       
   476       <tr>
       
   477         <td class="row1">
       
   478           Enable avatar support:<br />
       
   479           <small>Supported formats are JPEG, PNG, and GIF&trade;.</small>
       
   480         </td>
       
   481         <td class="row1">
       
   482           <label><input type="checkbox" name="avatar_enable" <?php if ( getConfig('avatar_enable') == '1' ) echo 'checked="checked" '; ?>/> Enabled</label>
       
   483         </td>
       
   484       </tr>
       
   485       
       
   486       <tr>
       
   487         <td class="row2">
       
   488           Maximum avatar file size:<br />
       
   489           <small>For smaller sites, the highest value for this should be about 50KB, 51200. Larger sites with more visitors will likely want to use something much smaller, such as 10KB.</small>
       
   490         </td>
       
   491         <td class="row2">
       
   492           <input type="text" name="avatar_max_size" size="7" <?php if ( ($x = getConfig('avatar_max_size')) !== false ) echo "value=\"$x\" "; else echo "value=\"10240\" "; ?>/> bytes
       
   493         </td>
       
   494       </tr>
       
   495       
       
   496       <tr>
       
   497         <td class="row1">
       
   498           Maximum avatar dimensions:<br />
       
   499           <small>The format is width &#215; height. Typically you want to have this square (the same width and height). These are only maximum dimensions; users are not prevented from having smaller images.</small>
       
   500         </td>
       
   501         <td class="row1">
       
   502           <input type="text" name="avatar_max_width" size="7" <?php if ( $x = getConfig('avatar_max_width') ) echo "value=\"$x\" "; else echo "value=\"150\" "; ?>/> &#215;
       
   503           <input type="text" name="avatar_max_height" size="7" <?php if ( $x = getConfig('avatar_max_height') ) echo "value=\"$x\" "; else echo "value=\"150\" "; ?>/> pixels
       
   504         </td>
       
   505       </tr>
       
   506       
       
   507       <tr>
       
   508         <td class="row2">
       
   509           Allow animated avatars:<br />
       
   510           <small>If this is checked, users can upload APNG and Animated GIF&trade; avatars. Sometimes such images can be specifically made to be distracting, like rapidly flashing images. If this is unchecked, these formats will be blocked, and only still PNGs and GIFs will be allowed.</small>
       
   511         </td>
       
   512         <td class="row2">
       
   513           <label><input type="checkbox" name="avatar_enable_anim" <?php if ( getConfig('avatar_enable_anim') == '1' ) echo 'checked="checked" '; ?>/> Don't block animated images</label>
       
   514         </td>
       
   515       </tr>
       
   516       
       
   517       <tr>
       
   518         <td class="row1">
       
   519           Allowed upload methods:<br />
       
   520           <small></small>
       
   521         </td>
       
   522         <td class="row1">
       
   523           <label><input type="checkbox" name="avatar_upload_file" <?php if ( getConfig('avatar_upload_file') == '1' || getConfig('avatar_upload_file') === false ) echo 'checked="checked" '; ?>/> Allow users to upload image files from their computers</label><br />
       
   524           <label><input type="checkbox" name="avatar_upload_http" <?php if ( getConfig('avatar_upload_http') == '1' || getConfig('avatar_upload_http') === false ) echo 'checked="checked" '; ?>/> Allow users to enter a URL to their desired avatar</label>
       
   525         </td>
       
   526       </tr>
       
   527       
       
   528       <tr>
       
   529         <td class="row2">
       
   530           Avatar storage directory:<br />
       
   531           <small>This should be relative to your Enano root and should contain only alphanumeric characters and forward slashes, even if your server runs Windows.</small>
       
   532         </td>
       
   533         <td class="row2">
       
   534           <input type="text" name="avatar_directory" size="30" <?php if ( $x = getConfig('avatar_directory') ) echo "value=\"$x\" "; else echo "value=\"files/avatars\" "; ?>/>
       
   535         </td>
       
   536       </tr>
       
   537         
       
   538     </table>
       
   539     </div>
       
   540         
       
   541     <div class="tblholder">
       
   542     <table border="0" width="100%" cellspacing="1" cellpadding="4">
       
   543     
       
   544     <tr>
       
   545       <th colspan="2">Sidebar links</th>
       
   546     </tr>
       
   547     
   311     <!-- enanocms.org link -->
   548     <!-- enanocms.org link -->
   312     
   549     
   313     <tr>
   550     <tr>
   314       <th colspan="2">Promote Enano</th>
   551       <th colspan="2" class="subhead">Promote Enano</th>
   315     </tr>
   552     </tr>
   316     <tr>
   553     <tr>
   317       <td class="row3">
   554     <td class="row3" style="width: 50%;">
   318         If you think Enano is nice, or if you want to show your support for the Enano team, you can do so by placing a link to the Enano
   555         If you think Enano is nice, or if you want to show your support for the Enano team, you can do so by placing a link to the Enano
   319         homepage in your Links sidebar block. You absolutely don't have to do this, and you won't get degraded support if you don't. Because
   556         homepage in your Links sidebar block. You absolutely don't have to do this, and you won't get degraded support if you don't. Because
   320         Enano is still relatively new in the CMS world, it needs all the attention it can get - and you can easily help to spread the word
   557         Enano is still relatively new in the CMS world, it needs all the attention it can get - and you can easily help to spread the word
   321         using this link.
   558         using this link.
   322       </td>
   559       </td>
   325           <input name="enano_powered_link" type="checkbox" <?php if(getConfig('powered_btn') == '1') echo 'checked="checked"'; ?> />&nbsp;&nbsp;Place a link to enanocms.org on the sidebar
   562           <input name="enano_powered_link" type="checkbox" <?php if(getConfig('powered_btn') == '1') echo 'checked="checked"'; ?> />&nbsp;&nbsp;Place a link to enanocms.org on the sidebar
   326         </label>
   563         </label>
   327       </td>
   564       </td>
   328     </tr>
   565     </tr>
   329       
   566       
   330     <!-- Site disablement -->
       
   331     
       
   332       <tr><th colspan="2">Disable all site access</th></tr>
       
   333       
       
   334       <tr>
       
   335         <td class="row3" rowspan="2">Disabling the site allows you to work on the site without letting non-administrators see or use it.</td>
       
   336         <td class="row1"><label><input onclick="if(this.checked) document.getElementById('site_disabled_notice').style.display='block'; else document.getElementById('site_disabled_notice').style.display='none';" type="checkbox" name="site_disabled" <?php if(getConfig('site_disabled') == '1') echo 'checked="checked" '; ?>/>  Disable this site</label></td>
       
   337       </tr>
       
   338       <tr>
       
   339         <td class="row2">
       
   340           <div id="site_disabled_notice"<?php if(getConfig('site_disabled')!='1') echo(' style="display:none"'); ?>>
       
   341             Message to show to users:<br />
       
   342             <textarea name="site_disabled_notice" rows="7" cols="30"><?php echo getConfig('site_disabled_notice'); ?></textarea>
       
   343           </div>
       
   344         </td>
       
   345       </tr>
       
   346     
       
   347     <!-- Account activation -->
       
   348       
       
   349       <tr><th colspan="2">User account activation</th></tr>
       
   350       
       
   351       <tr>
       
   352         <td class="row3" colspan="2">
       
   353           If you would like to require users to confirm their e-mail addresses by way of account activation, you can enable this behavior here. If this option is set to "None", users will be able to register and use this site without confirming their e-mail addresses. If this option is set to "User", users will automatically be sent e-mails upon registration with a link to activate their accounts. And lastly, if this option is set to "Admin", users' accounts will not be active until an administrator activates the account.<br /><br />
       
   354           You may also disable registration completely if needed.<br /><br />
       
   355           <b>Note: because of abuse by project administrators, sending account activation e-mails will not work on SourceForge.net servers.</b>
       
   356         </td>
       
   357       </tr>
       
   358       
       
   359       <tr>
       
   360         <td class="row1">Account activation:</td><td class="row1">
       
   361           <?php
       
   362           echo '<label><input'; if(getConfig('account_activation') == 'disable') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="disable" /> Disable registration</label><br />';
       
   363           echo '<label><input'; if(getConfig('account_activation') != 'user' && getConfig('account_activation') != 'admin' && getConfig('account_activation') != 'disable') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="none" /> None</label>';
       
   364           echo '<label><input'; if(getConfig('account_activation') == 'user') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="user" /> User</label>';
       
   365           echo '<label><input'; if(getConfig('account_activation') == 'admin') echo ' checked="checked"'; echo ' type="radio" name="account_activation" value="admin" /> Admin</label>';
       
   366           ?>
       
   367         </td>
       
   368       </tr>
       
   369       
       
   370     <!-- Account lockout -->
       
   371     
       
   372       <tr><th colspan="2">Account lockouts</th></tr>
       
   373       
       
   374       <tr><td class="row3" colspan="2">Configure Enano to prevent or restrict logins for a specified period of time if a user enters an incorrect password a specific number of times.</td></tr>
       
   375       
       
   376       <tr>
       
   377         <td class="row2">Lockout threshold:<br />
       
   378           <small>How many times can a user enter wrong credentials before a lockout goes into effect?</small>
       
   379         </td>
       
   380         <td class="row2">
       
   381           <input type="text" name="lockout_threshold" value="<?php echo ( $_ = getConfig('lockout_threshold') ) ? $_ : '5' ?>" />
       
   382         </td>
       
   383       </tr>
       
   384       
       
   385       <tr>
       
   386         <td class="row1">Lockout duration:<br />
       
   387           <small>This is how long an account lockout should last, in minutes.</small>
       
   388         </td>
       
   389         <td class="row1">
       
   390           <input type="text" name="lockout_duration" value="<?php echo ( $_ = getConfig('lockout_duration') ) ? $_ : '15' ?>" />
       
   391         </td>
       
   392       </tr>
       
   393       
       
   394       <tr>
       
   395         <td class="row2">Lockout policy:<br />
       
   396           <small>What should be done when a lockout goes into effect?</small>
       
   397         </td>
       
   398         <td class="row2">
       
   399           <label><input type="radio" name="lockout_policy" value="disable" <?php if ( getConfig('lockout_policy') == 'disable' ) echo 'checked="checked"'; ?> /> Don't do anything</label><br />
       
   400           <label><input type="radio" name="lockout_policy" value="captcha" <?php if ( getConfig('lockout_policy') == 'captcha' ) echo 'checked="checked"'; ?> /> Require visual confirmation</label><br />
       
   401           <label><input type="radio" name="lockout_policy" value="lockout" <?php if ( getConfig('lockout_policy') == 'lockout' || !getConfig('lockout_policy') ) echo 'checked="checked"'; ?> /> Prevent all login attempts</label>
       
   402         </td>
       
   403       </tr>
       
   404       
       
   405     <!-- Password strength -->
       
   406       
       
   407       <tr><th colspan="2">Password strength</th></tr>
       
   408       
       
   409       <tr>
       
   410         <td class="row2">
       
   411           <b>Enable password strength analysis</b><br />
       
   412           <small>This should be enabled in most cases. When this is enabled, a strength meter and a numerical score will be displayed wherever a password can be changed.</small>
       
   413         </td>
       
   414         <td class="row2">
       
   415           <label><input type="checkbox" name="pw_strength_enable" <?php if ( getConfig('pw_strength_enable') == '1' ) echo 'checked="checked" '; ?>/> Enabled</label>
       
   416         </td>
       
   417       </tr>
       
   418       
       
   419       <tr>
       
   420         <td class="row1">
       
   421           <b>Minimum strength score</b><br />
       
   422           <small>This is the lowest score a password will be allowed to have. -10 will allow any password. A score of under -3 is considered weak, under 1 is fair, under 4 is good, under 10 is strong, and 10 and above are very strong. The scale is open-ended. This only has an effect if the meter is enabled above.</small>
       
   423         </td>
       
   424         <td class="row1">
       
   425           <input type="text" name="pw_strength_minimum" value="<?php echo ( $x = getConfig('pw_strength_minimum') ) ? $x : '-10'; ?>" />
       
   426         </td>
       
   427       </tr>
       
   428       
       
   429     <!-- E-mail options -->
       
   430     
       
   431     <tr><th colspan="2">E-mail sent from the site</th></tr>
       
   432     <tr><td class="row1">E-mail sending method:<br /><small>Try using the built-in e-mail method first. If that doesn't work, you will need to enter valid SMTP information here.</small></td>
       
   433         <td class="row1"><label><input <?php if(getConfig('smtp_enabled') != '1') echo 'checked="checked"'; ?> type="radio" name="emailmethod" value="phpmail" />PHP's built-in mail() function</label><br />
       
   434                          <label><input <?php if(getConfig('smtp_enabled') == '1') echo 'checked="checked"'; ?> type="radio" name="emailmethod" value="smtp" />Use an external SMTP server</label></td>
       
   435         </tr>
       
   436     <tr><td class="row2">SMTP hostname:<br /><small>This option only applies to the external SMTP mode.</small></td>
       
   437         <td class="row2"><input value="<?php echo getConfig('smtp_server'); ?>" name="smtp_host" type="text" size="30" /></td>
       
   438         </tr>
       
   439     <tr><td class="row1">SMTP credentials:<br /><small>This option only applies to the external SMTP mode.</small></td>
       
   440         <td class="row1">Username: <input value="<?php echo getConfig('smtp_user'); ?>" name="smtp_user" type="text" size="30" /><br />
       
   441             Password: <input value="<?php if(getConfig('smtp_password') != false) echo 'XXXXXXXXXXXX'; ?>" name="smtp_pass" type="password" size="30" /></td>
       
   442         </tr>
       
   443       
       
   444     <!-- SourceForge.net logo -->
   567     <!-- SourceForge.net logo -->
   445       
   568       
   446       <tr><th colspan="2">SourceForge.net logo</th></tr>
   569       <tr><th class="subhead" colspan="2">SourceForge.net logo</th></tr>
   447       
   570       
   448       <tr>
   571       <tr>
   449         <td colspan="2" class="row3">
   572         <td colspan="2" class="row3">
   450           All projects hosted by SourceForge.net are required to display an official SourceForge.net logo on their pages.  If you want
   573           All projects hosted by SourceForge.net are required to display an official SourceForge.net logo on their pages.  If you want
   451           to display a SourceForge.net logo on the sidebar, check the box below, enter your group ID, and select an image type.
   574           to display a SourceForge.net logo on the sidebar, check the box below, enter your group ID, and select an image type.
   486         </td>
   609         </td>
   487       </tr>
   610       </tr>
   488       
   611       
   489     <!-- W3C validator buttons -->
   612     <!-- W3C validator buttons -->
   490       
   613       
   491       <tr><th colspan="2">W3C compliance logos</th></tr>
   614       <tr><th class="subhead" colspan="2">W3C compliance logos</th></tr>
   492       <tr><th colspan="2" class="subhead">Enano generates (by default) Valid XHTML 1.1 code, plus valid CSS.  If you want to show this off, check the appropriate boxes below.</th></tr>
   615       <tr><td colspan="2" class="row3">Enano generates (by default) Valid XHTML 1.1 code, plus valid CSS.  If you want to show this off, check the appropriate boxes below.</th></tr>
   493       
   616       
   494       <tr><td class="row1"><label for="w3c-vh32">HTML 3.2</label>     </td><td class="row1"><input type="checkbox" <?php if(getConfig('w3c_vh32')=='1')     echo('CHECKED '); ?> id="w3c-vh32"     name="w3c-vh32"     /></td></tr>
   617       <tr><td class="row1"><label for="w3c-vh32">HTML 3.2</label>     </td><td class="row1"><input type="checkbox" <?php if(getConfig('w3c_vh32')=='1')     echo('CHECKED '); ?> id="w3c-vh32"     name="w3c-vh32"     /></td></tr>
   495       <tr><td class="row2"><label for="w3c-vh40">HTML 4.0</label>     </td><td class="row2"><input type="checkbox" <?php if(getConfig('w3c_vh40')=='1')     echo('CHECKED '); ?> id="w3c-vh40"     name="w3c-vh40"     /></td></tr>
   618       <tr><td class="row2"><label for="w3c-vh40">HTML 4.0</label>     </td><td class="row2"><input type="checkbox" <?php if(getConfig('w3c_vh40')=='1')     echo('CHECKED '); ?> id="w3c-vh40"     name="w3c-vh40"     /></td></tr>
   496       <tr><td class="row1"><label for="w3c-vh401">HTML 4.01</label>   </td><td class="row1"><input type="checkbox" <?php if(getConfig('w3c_vh401')=='1')    echo('CHECKED '); ?> id="w3c-vh401"    name="w3c-vh401"    /></td></tr>
   619       <tr><td class="row1"><label for="w3c-vh401">HTML 4.01</label>   </td><td class="row1"><input type="checkbox" <?php if(getConfig('w3c_vh401')=='1')    echo('CHECKED '); ?> id="w3c-vh401"    name="w3c-vh401"    /></td></tr>
   497       <tr><td class="row2"><label for="w3c-vxhtml10">XHTML 1.0</label></td><td class="row2"><input type="checkbox" <?php if(getConfig('w3c_vxhtml10')=='1') echo('CHECKED '); ?> id="w3c-vxhtml10" name="w3c-vxhtml10" /></td></tr>
   620       <tr><td class="row2"><label for="w3c-vxhtml10">XHTML 1.0</label></td><td class="row2"><input type="checkbox" <?php if(getConfig('w3c_vxhtml10')=='1') echo('CHECKED '); ?> id="w3c-vxhtml10" name="w3c-vxhtml10" /></td></tr>
   498       <tr><td class="row1"><label for="w3c-vxhtml11">XHTML 1.1</label></td><td class="row1"><input type="checkbox" <?php if(getConfig('w3c_vxhtml11')=='1') echo('CHECKED '); ?> id="w3c-vxhtml11" name="w3c-vxhtml11" /></td></tr>
   621       <tr><td class="row1"><label for="w3c-vxhtml11">XHTML 1.1</label></td><td class="row1"><input type="checkbox" <?php if(getConfig('w3c_vxhtml11')=='1') echo('CHECKED '); ?> id="w3c-vxhtml11" name="w3c-vxhtml11" /></td></tr>
   499       <tr><td class="row2"><label for="w3c-vcss">CSS</label>          </td><td class="row2"><input type="checkbox" <?php if(getConfig('w3c_vcss')=='1')     echo('CHECKED '); ?> id="w3c-vcss"     name="w3c-vcss"     /></td></tr>
   622       <tr><td class="row2"><label for="w3c-vcss">CSS</label>          </td><td class="row2"><input type="checkbox" <?php if(getConfig('w3c_vcss')=='1')     echo('CHECKED '); ?> id="w3c-vcss"     name="w3c-vcss"     /></td></tr>
   500 
   623 
   501     <!-- DefectiveByDesign.org ad -->      
   624     <!-- DefectiveByDesign.org ad -->      
   502       
   625       
   503       <tr><th colspan="2">Defective By Design Anti-DRM button</th></tr>
   626       <tr><th class="subhead" colspan="2">Defective By Design Anti-DRM button</th></tr>
   504       <tr><td colspan="2" class="row3"><b>The Enano project is strongly against Digital Restrictions Management.</b> DRM removes the freedoms that every consumer should have: to freely copy and use digital media items they legally purchased to their own devices. Showing your opposition to DRM is as easy as checking the box below to place a link to <a href="http://www.defectivebydesign.org">DefectiveByDesign.org</a> on your sidebar.</td></tr>
   627       <tr><td colspan="2" class="row3"><b>The Enano project is strongly against Digital Restrictions Management.</b> DRM removes the freedoms that every consumer should have: to freely copy and use digital media items they legally purchased to their own devices. Showing your opposition to DRM is as easy as checking the box below to place a link to <a href="http://www.defectivebydesign.org">DefectiveByDesign.org</a> on your sidebar.</td></tr>
   505       <tr><td class="row1"><label for="dbdbutton">Help stop DRM by placing a link to DBD on the sidebar!</label></td><td class="row1"><input type="checkbox" name="dbdbutton" id="dbdbutton" <?php if(getConfig('dbd_button')=='1')  echo('checked="checked" '); ?>/></td></tr>
   628       <tr><td class="row1"><label for="dbdbutton">Help stop DRM by placing a link to DBD on the sidebar!</label></td><td class="row1"><input type="checkbox" name="dbdbutton" id="dbdbutton" <?php if(getConfig('dbd_button')=='1')  echo('checked="checked" '); ?>/></td></tr>
   506       
   629       
   507     <!-- Save button -->
   630     <!-- Save button -->
   508       
   631     
   509       <tr><th style="text-align: right" class="subhead" colspan="2"><input type=submit name=submit value="Save changes" /></th></tr>
   632     </table>
       
   633     </div>
       
   634         
       
   635     <div class="tblholder">
       
   636     <table border="0" width="100%" cellspacing="1" cellpadding="4">
       
   637       
       
   638       <tr><th colspan="2"><input type="submit" name="submit" value="Save changes" /></th></tr>
   510       
   639       
   511     </table>
   640     </table>
   512   </div>
   641   </div>
   513 </form>
   642 </form>
   514   <?php
   643   <?php