aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/install.php9
-rw-r--r--mod/register.php11
2 files changed, 15 insertions, 5 deletions
diff --git a/mod/install.php b/mod/install.php
index b9deb6114..301630528 100644
--- a/mod/install.php
+++ b/mod/install.php
@@ -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;
diff --git a/mod/register.php b/mod/register.php
index 7aaf74792..5fac9d79c 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -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))
- $err .= t('Cannot use that email.') . EOL;
+ 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);