commit
f1e42b73a8
3 changed files with 11 additions and 4 deletions
|
@ -23,12 +23,15 @@ function notification($params) {
|
||||||
$site_admin = sprintf( t('%s Administrator'), $sitename);
|
$site_admin = sprintf( t('%s Administrator'), $sitename);
|
||||||
$nickname = "";
|
$nickname = "";
|
||||||
|
|
||||||
$sender_name = $product;
|
$sender_name = $sitename;
|
||||||
$hostname = $a->get_hostname();
|
$hostname = $a->get_hostname();
|
||||||
if(strpos($hostname,':'))
|
if(strpos($hostname,':'))
|
||||||
$hostname = substr($hostname,0,strpos($hostname,':'));
|
$hostname = substr($hostname,0,strpos($hostname,':'));
|
||||||
|
|
||||||
$sender_email = t('noreply') . '@' . $hostname;
|
$sender_email = $a->config['sender_email'];
|
||||||
|
if (empty($sender_email)) {
|
||||||
|
$sender_email = t('noreply') . '@' . $hostname;
|
||||||
|
}
|
||||||
|
|
||||||
$user = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($params['uid']));
|
$user = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($params['uid']));
|
||||||
if ($user)
|
if ($user)
|
||||||
|
|
|
@ -278,7 +278,7 @@ function admin_page_site_post(&$a){
|
||||||
$q = sprintf("UPDATE %s SET %s;", $table_name, $upds);
|
$q = sprintf("UPDATE %s SET %s;", $table_name, $upds);
|
||||||
$r = q($q);
|
$r = q($q);
|
||||||
if (!$r) {
|
if (!$r) {
|
||||||
notice( "Falied updating '$table_name': " . $db->error );
|
notice( "Failed updating '$table_name': " . $db->error );
|
||||||
goaway($a->get_baseurl(true) . '/admin/site' );
|
goaway($a->get_baseurl(true) . '/admin/site' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,6 +309,7 @@ function admin_page_site_post(&$a){
|
||||||
|
|
||||||
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
|
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
|
||||||
$hostname = ((x($_POST,'hostname')) ? notags(trim($_POST['hostname'])) : '');
|
$hostname = ((x($_POST,'hostname')) ? notags(trim($_POST['hostname'])) : '');
|
||||||
|
$sender_email = ((x($_POST,'sender_email')) ? notags(trim($_POST['sender_email'])) : '');
|
||||||
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
|
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
|
||||||
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
|
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
|
||||||
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
||||||
|
@ -415,6 +416,7 @@ function admin_page_site_post(&$a){
|
||||||
set_config('system','maxloadavg',$maxloadavg);
|
set_config('system','maxloadavg',$maxloadavg);
|
||||||
set_config('config','sitename',$sitename);
|
set_config('config','sitename',$sitename);
|
||||||
set_config('config','hostname',$hostname);
|
set_config('config','hostname',$hostname);
|
||||||
|
set_config('config','sender_email', $sender_email);
|
||||||
set_config('system','suppress_language',$suppress_language);
|
set_config('system','suppress_language',$suppress_language);
|
||||||
if ($banner==""){
|
if ($banner==""){
|
||||||
// don't know why, but del_config doesn't work...
|
// don't know why, but del_config doesn't work...
|
||||||
|
@ -605,6 +607,7 @@ function admin_page_site(&$a) {
|
||||||
// name, label, value, help string, extra data...
|
// name, label, value, help string, extra data...
|
||||||
'$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), 'UTF-8'),
|
'$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), 'UTF-8'),
|
||||||
'$hostname' => array('hostname', t("Host name"), $a->config['hostname'], ""),
|
'$hostname' => array('hostname', t("Host name"), $a->config['hostname'], ""),
|
||||||
|
'$sender_email' => array('sender_email', t("Sender Email"), $a->config['sender_email'], "The email address your server shall use to send notification emails from.", "", "", "email"),
|
||||||
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
|
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
|
||||||
'$info' => array('info',t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at dir.friendica.com/siteinfo.')),
|
'$info' => array('info',t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at dir.friendica.com/siteinfo.')),
|
||||||
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
|
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
{{include file="field_input.tpl" field=$sitename}}
|
{{include file="field_input.tpl" field=$sitename}}
|
||||||
{{include file="field_input.tpl" field=$hostname}}
|
{{include file="field_input.tpl" field=$hostname}}
|
||||||
|
{{include file="field_input.tpl" field=$sender_email}}
|
||||||
{{include file="field_textarea.tpl" field=$banner}}
|
{{include file="field_textarea.tpl" field=$banner}}
|
||||||
{{include file="field_textarea.tpl" field=$info}}
|
{{include file="field_textarea.tpl" field=$info}}
|
||||||
{{include file="field_select.tpl" field=$language}}
|
{{include file="field_select.tpl" field=$language}}
|
||||||
|
|
Loading…
Reference in a new issue