input the admin email address during install/setup.

This commit is contained in:
Friendika 2011-07-07 19:12:35 -07:00
parent d99dfbe4ef
commit 2d2b500639
11 changed files with 33 additions and 13 deletions

View file

@ -12,6 +12,7 @@ function install_post(&$a) {
$dbdata = notags(trim($_POST['dbdata']));
$timezone = notags(trim($_POST['timezone']));
$phpath = notags(trim($_POST['phpath']));
$adminmail = notags(trim($_POST['adminmail']));
require_once("dba.php");
unset($db);
@ -45,8 +46,10 @@ function install_post(&$a) {
'$dbdata' => $dbdata,
'$timezone' => $timezone,
'$urlpath' => $urlpath,
'$phpath' => $phpath
'$phpath' => $phpath,
'$adminmail' => $adminmail
));
$result = file_put_contents('.htconfig.php', $txt);
if(! $result) {
$a->data = $txt;
@ -128,6 +131,7 @@ function install_content(&$a) {
'$lbl_08' => t('Database Login Password'),
'$lbl_09' => t('Database Name'),
'$lbl_10' => t('Please select a default timezone for your website'),
'$lbl_11' => t('Site administrator email address. Your account email address will need match this.'),
'$baseurl' => $a->get_baseurl(),
'$tzselect' => ((x($_POST,'timezone')) ? select_timezone($_POST['timezone']) : select_timezone()),
'$submit' => t('Submit'),
@ -135,7 +139,8 @@ function install_content(&$a) {
'$dbuser' => notags(trim($_POST['dbuser'])),
'$dbpass' => notags(trim($_POST['dbpass'])),
'$dbdata' => notags(trim($_POST['dbdata'])),
'$phpath' => $phpath
'$phpath' => $phpath,
'$adminemail' => notags(trim($_POST['adminemail']))
));
return $o;

View file

@ -103,10 +103,15 @@ function register_post(&$a) {
$err .= t('Not a valid email address.') . EOL;
// Disallow somebody creating an account using openid that uses the admin email address,
// since openid bypasses email verification.
// since openid bypasses email verification. We'll allow it if there is not yet an admin account.
if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0) && strlen($openid_url))
if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0) && strlen($openid_url)) {
$r = q("SELECT * FROM `user` WHERE `email` = '%s' LIMIT 1",
dbesc($email)
);
if(count($r))
$err .= t('Cannot use that email.') . EOL;
}
$nickname = $_POST['nickname'] = strtolower($nickname);

View file

@ -33,7 +33,7 @@ $a->config['sitename'] = "My Friend Network";
$a->config['register_policy'] = REGISTER_OPEN;
$a->config['register_text'] = '';
$a->config['admin_email'] = '';
$a->config['admin_email'] = '$adminmail';
// Maximum size of an imported message, 0 is unlimited

View file

@ -33,7 +33,7 @@ $a->config['sitename'] = "My Friend Network";
$a->config['register_policy'] = REGISTER_OPEN;
$a->config['register_text'] = '';
$a->config['admin_email'] = '';
$a->config['admin_email'] = '$adminmail';
// Maximum size of an imported message, 0 is unlimited

View file

@ -33,7 +33,7 @@ $a->config['sitename'] = "La Mia Rete di Amici";
$a->config['register_policy'] = REGISTER_OPEN;
$a->config['register_text'] = '';
$a->config['admin_email'] = '';
$a->config['admin_email'] = '$adminmail';
// Maximum size of an imported message, 0 is unlimited

View file

@ -33,7 +33,7 @@ $a->config['sitename'] = "My Friend Network";
$a->config['register_policy'] = REGISTER_OPEN;
$a->config['register_text'] = '';
$a->config['admin_email'] = '';
$a->config['admin_email'] = '$adminmail';
// Maximum size of an imported message, 0 is unlimited

View file

@ -26,6 +26,10 @@ $lbl_03 $lbl_04 $lbl_05
<input type="text" name="dbdata" id="install-dbdata" value="$dbdata" />
<div id="install-dbdata-end"></div>
<label for="install-admin" id="install-admin-label">$lbl_11</label>
<input type="text" name="adminemail" id="install-admin" value="$adminemail" />
<div id="install-admin-end"></div>
<div id="install-tz-desc">
$lbl_10
</div>

View file

@ -33,7 +33,7 @@ $a->config['sitename'] = "La Mia Rete di Amici";
$a->config['register_policy'] = REGISTER_OPEN;
$a->config['register_text'] = '';
$a->config['admin_email'] = '';
$a->config['admin_email'] = '$adminmail';
// Maximum size of an imported message, 0 is unlimited

View file

@ -33,7 +33,7 @@ $a->config['sitename'] = "My Friend Network";
$a->config['register_policy'] = REGISTER_OPEN;
$a->config['register_text'] = '';
$a->config['admin_email'] = '';
$a->config['admin_email'] = '$adminmail';
// Maximum size of an imported message, 0 is unlimited

View file

@ -1943,6 +1943,7 @@ a.mail-list-link {
#install-dbuser-label,
#install-dbpass-label,
#install-dbdata-label,
#install-admin-label,
#install-tz-desc {
float: left;
width: 250px;
@ -1954,7 +1955,8 @@ a.mail-list-link {
#install-dbhost,
#install-dbuser,
#install-dbpass,
#install-dbdata {
#install-dbdata,
#install-admin {
float: left;
width: 200px;
margin-left: 20px;
@ -1964,6 +1966,7 @@ a.mail-list-link {
#install-dbuser-end,
#install-dbpass-end,
#install-dbdata-end,
#install-admin-end,
#install-tz-end {
clear: both;
}

View file

@ -1979,6 +1979,7 @@ a.mail-list-link {
#install-dbuser-label,
#install-dbpass-label,
#install-dbdata-label,
#install-admin-label,
#install-tz-desc {
float: left;
width: 250px;
@ -1990,7 +1991,8 @@ a.mail-list-link {
#install-dbhost,
#install-dbuser,
#install-dbpass,
#install-dbdata {
#install-dbdata,
#install-admin {
float: left;
width: 200px;
margin-left: 20px;
@ -2000,6 +2002,7 @@ a.mail-list-link {
#install-dbuser-end,
#install-dbpass-end,
#install-dbdata-end,
#install-admin-end,
#install-tz-end {
clear: both;
}