Browse Source

input the admin email address during install/setup.

tags/2.3beta1
Friendika 9 years ago
parent
commit
2d2b500639
11 changed files with 33 additions and 13 deletions
  1. +7
    -2
      mod/install.php
  2. +8
    -3
      mod/register.php
  3. +1
    -1
      view/de/htconfig.tpl
  4. +1
    -1
      view/en/htconfig.tpl
  5. +1
    -1
      view/es/htconfig.tpl
  6. +1
    -1
      view/fr/htconfig.tpl
  7. +4
    -0
      view/install_db.tpl
  8. +1
    -1
      view/it/htconfig.tpl
  9. +1
    -1
      view/sv/htconfig.tpl
  10. +4
    -1
      view/theme/duepuntozero/style.css
  11. +4
    -1
      view/theme/loozah/style.css

+ 7
- 2
mod/install.php 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;


+ 8
- 3
mod/register.php 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))
$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);



+ 1
- 1
view/de/htconfig.tpl 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



+ 1
- 1
view/en/htconfig.tpl 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



+ 1
- 1
view/es/htconfig.tpl 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



+ 1
- 1
view/fr/htconfig.tpl 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



+ 4
- 0
view/install_db.tpl 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>


+ 1
- 1
view/it/htconfig.tpl 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



+ 1
- 1
view/sv/htconfig.tpl 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



+ 4
- 1
view/theme/duepuntozero/style.css 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;
}


+ 4
- 1
view/theme/loozah/style.css 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;
}


Loading…
Cancel
Save