|
From: Benjamin C. <bc...@us...> - 2001-11-06 08:40:13
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv21386
Modified Files:
upgrade.php newaccount.php
Log Message:
New option for disabling newaccount.php
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- upgrade.php 2001/11/06 04:03:28 1.1
+++ upgrade.php 2001/11/06 04:40:18 1.2
@@ -22,10 +22,15 @@
$q->Halt_On_Error = 'yes'; // Stop ignoring errors
}
- // New configuration option
+ // New configuration options
$q->query('insert into '. TBL_CONFIGURATION.
" (varname, varvalue, description, vartype) values ('STRICT_UPDATING', '0',
'Only the bug reporter, bug owner, managers, and admins can change a bug',
+ 'bool')");
+ $q->query('insert into '. TBL_CONFIGURATION.
+ " (varname, varvalue, description, vartype) values
+ ('NEW_ACCOUNTS_DISABLED', '0',
+ 'Only admins can create new user accounts - newaccount.php is disabled',
'bool')");
}
include 'templates/default/upgrade-finished.html';
Index: newaccount.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- newaccount.php 2001/10/24 03:03:58 1.19
+++ newaccount.php 2001/11/06 04:40:18 1.20
@@ -27,6 +27,11 @@
function do_form() {
global $q, $t, $_pv, $STRING, $now, $u;
+ if (NEW_ACCOUNTS_DISABLED) {
+ $t->set_file('content', 'newaccount-disabled');
+ return;
+ }
+
if (!EMAIL_IS_LOGIN && !$_pv['login'] = trim($_pv['login']))
$error = $STRING['givelogin'];
elseif (!$_pv['email'] or !valid_email($_pv['email']))
@@ -63,6 +68,11 @@
function show_form($error = '') {
global $q, $t, $_pv;
+ if (NEW_ACCOUNTS_DISABLED) {
+ $t->set_file('content', 'newaccount-disabled.html');
+ return;
+ }
+
$t->set_file('content','newaccount.html');
$t->set_block('content', 'loginentryarea', 'loginarea');
$t->set_var(array(
|