Browse Source

input the admin email address during install/setup.

pull/1/head
Friendika 10 years ago
parent
commit
2d2b500639
  1. 9
      mod/install.php
  2. 11
      mod/register.php
  3. 2
      view/de/htconfig.tpl
  4. 2
      view/en/htconfig.tpl
  5. 2
      view/es/htconfig.tpl
  6. 2
      view/fr/htconfig.tpl
  7. 4
      view/install_db.tpl
  8. 2
      view/it/htconfig.tpl
  9. 2
      view/sv/htconfig.tpl
  10. 5
      view/theme/duepuntozero/style.css
  11. 5
      view/theme/loozah/style.css

9
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;

11
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);

2
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

2
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

2
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

2
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

4
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>

2
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

2
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

5
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;
}

5
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;
}

Loading…
Cancel
Save