diff options
author | Friendika <info@friendika.com> | 2011-07-07 19:12:35 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-07 19:12:35 -0700 |
commit | 2d2b5006397bb6ac90f7e33e6022000ec836e86e (patch) | |
tree | 9a22d508d848ab02bff88fd24a592f686ea75ac1 | |
parent | d99dfbe4ef50c2928cd2a45bf0b2cf62bba5b1e9 (diff) | |
download | volse-hubzilla-2d2b5006397bb6ac90f7e33e6022000ec836e86e.tar.gz volse-hubzilla-2d2b5006397bb6ac90f7e33e6022000ec836e86e.tar.bz2 volse-hubzilla-2d2b5006397bb6ac90f7e33e6022000ec836e86e.zip |
input the admin email address during install/setup.
-rw-r--r-- | mod/install.php | 9 | ||||
-rw-r--r-- | mod/register.php | 11 | ||||
-rw-r--r-- | view/de/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/en/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/es/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/fr/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/install_db.tpl | 4 | ||||
-rw-r--r-- | view/it/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/sv/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/theme/duepuntozero/style.css | 5 | ||||
-rw-r--r-- | view/theme/loozah/style.css | 5 |
11 files changed, 33 insertions, 13 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); diff --git a/view/de/htconfig.tpl b/view/de/htconfig.tpl index 0ce28b4a0..6eb950130 100644 --- a/view/de/htconfig.tpl +++ b/view/de/htconfig.tpl @@ -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 diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl index 0ce28b4a0..6eb950130 100644 --- a/view/en/htconfig.tpl +++ b/view/en/htconfig.tpl @@ -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 diff --git a/view/es/htconfig.tpl b/view/es/htconfig.tpl index 4de266112..ea8439ebb 100644 --- a/view/es/htconfig.tpl +++ b/view/es/htconfig.tpl @@ -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 diff --git a/view/fr/htconfig.tpl b/view/fr/htconfig.tpl index c65114a68..13ddab07f 100644 --- a/view/fr/htconfig.tpl +++ b/view/fr/htconfig.tpl @@ -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 diff --git a/view/install_db.tpl b/view/install_db.tpl index 1c59dbdb9..6a4d1e2a2 100644 --- a/view/install_db.tpl +++ b/view/install_db.tpl @@ -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> diff --git a/view/it/htconfig.tpl b/view/it/htconfig.tpl index 4de266112..ea8439ebb 100644 --- a/view/it/htconfig.tpl +++ b/view/it/htconfig.tpl @@ -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 diff --git a/view/sv/htconfig.tpl b/view/sv/htconfig.tpl index 0ce28b4a0..6eb950130 100644 --- a/view/sv/htconfig.tpl +++ b/view/sv/htconfig.tpl @@ -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 diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index fccbe16d9..bbaa43b57 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -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; } diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index d905b988b..11ccab8ff 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -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; } |