From fca8a23265413dadc384ce0239ce5bcd56a39201 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 17 Feb 2013 08:20:29 +0100 Subject: [PATCH 1/3] use enotify to send CC mails --- mod/item.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mod/item.php b/mod/item.php index d04ab71dea..4fd4a23dc0 100644 --- a/mod/item.php +++ b/mod/item.php @@ -872,14 +872,20 @@ function item_post(&$a) { } else { $subject = email_header_encode('[Friendica]' . ' ' . sprintf( t('%s posted an update.'),$a->user['username']),'UTF-8'); } - $headers = 'From: ' . email_header_encode($a->user['username'],'UTF-8') . ' <' . $a->user['email'] . '>' . "\n"; - $headers .= 'MIME-Version: 1.0' . "\n"; - $headers .= 'Content-Type: text/html; charset=UTF-8' . "\n"; - $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n"; $link = '' . $a->user['username'] . '

'; $html = prepare_body($datarray); $message = '' . $link . $html . $disclaimer . ''; - @mail($addr, $subject, $message, $headers); + include_once('include/html2plain.php'); + $params = array ( + 'fromName' => $a->user['username'], + 'fromEmail' => $a->user['email'], + 'toEmail' => $addr, + 'replyTo' => $a->user['email'], + 'messageSubject' => $subject, + 'htmlVersion' => $message, + 'textVersion' => html2plain($html.$disclaimer), + ); + enotify::send($params); } } } From aa2f1c38e95b53e47bba0f7372e8e4e62fc5b232 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 17 Feb 2013 12:37:45 +0100 Subject: [PATCH 2/3] add 'hide_help' to admin panel --- mod/admin.php | 3 +++ view/admin_site.tpl | 1 + view/smarty3/admin_site.tpl | 1 + 3 files changed, 5 insertions(+) diff --git a/mod/admin.php b/mod/admin.php index 8a79fb108c..6e18ec5c86 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -274,6 +274,7 @@ function admin_page_site_post(&$a){ $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False); $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); $new_share = ((x($_POST,'new_share')) ? True : False); + $hide_help = ((x($_POST,'hide_help')) ? True : False); $use_fulltext_engine = ((x($_POST,'use_fulltext_engine')) ? True : False); $itemcache = ((x($_POST,'itemcache')) ? notags(trim($_POST['itemcache'])) : ''); $itemcache_duration = ((x($_POST,'itemcache_duration')) ? intval($_POST['itemcache_duration']) : 0); @@ -380,6 +381,7 @@ function admin_page_site_post(&$a){ set_config('system','diaspora_enabled', $diaspora_enabled); set_config('system','new_share', $new_share); + set_config('system','hide_help', $hide_help); set_config('system','use_fulltext_engine', $use_fulltext_engine); set_config('system','itemcache', $itemcache); set_config('system','itemcache_duration', $itemcache_duration); @@ -474,6 +476,7 @@ function admin_page_site(&$a) { '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$new_share' => array('new_share', t("'Share' element"), get_config('system','new_share'), t("Activates the bbcode element 'share' for repeating items.")), + '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$maximagelength' => array('maximagelength', t("Maximum image length"), get_config('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")), '$jpegimagequality' => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")), diff --git a/view/admin_site.tpl b/view/admin_site.tpl index e8fdd42589..1a2a83339b 100644 --- a/view/admin_site.tpl +++ b/view/admin_site.tpl @@ -51,6 +51,7 @@ {{ inc field_select.tpl with $field=$theme_mobile }}{{ endinc }} {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$new_share }}{{ endinc }} + {{ inc field_checkbox.tpl with $field=$hide_help }}{{ endinc }}
diff --git a/view/smarty3/admin_site.tpl b/view/smarty3/admin_site.tpl index f033b52eef..af78ca734b 100644 --- a/view/smarty3/admin_site.tpl +++ b/view/smarty3/admin_site.tpl @@ -56,6 +56,7 @@ {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} {{include file="field_checkbox.tpl" field=$new_share}} + {{include file="field_checkbox.tpl" field=$hide_help}}
From 8e65e95d17035a222e52da153790ea6d91102138 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 17 Feb 2013 17:42:32 +0100 Subject: [PATCH 3/3] add multi vs. single user config to the admin panel --- mod/admin.php | 20 +++++++++++++++++--- view/admin_site.tpl | 1 + view/smarty3/admin_site.tpl | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/mod/admin.php b/mod/admin.php index 6e18ec5c86..9400a28e04 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -281,6 +281,7 @@ function admin_page_site_post(&$a){ $lockpath = ((x($_POST,'lockpath')) ? notags(trim($_POST['lockpath'])) : ''); $temppath = ((x($_POST,'temppath')) ? notags(trim($_POST['temppath'])) : ''); $basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : ''); + $singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : ''); if($ssl_policy != intval(get_config('system','ssl_policy'))) { if($ssl_policy == SSL_POLICY_FULL) { @@ -342,7 +343,12 @@ function admin_page_site_post(&$a){ del_config('system','mobile-theme'); } else { set_config('system','mobile-theme', $theme_mobile); - } + } + if ( $singleuser === '---' ) { + del_config('system','singleuser'); + } else { + set_config('system','singleuser', $singleuser); + } set_config('system','maximagesize', $maximagesize); set_config('system','max_image_length', $maximagelength); set_config('system','jpeg_quality', $jpegimagequality); @@ -428,12 +434,19 @@ function admin_page_site(&$a) { if (file_exists($file . '/mobile')) { $theme_choices_mobile[$f] = $theme_name; } - else { + else { $theme_choices[$f] = $theme_name; } } } - + + /* get user names to make the install a personal install of X */ + $user_names = array(); + $user_names['---'] = t('Multi user instance'); + $users = q("SELECT username, nickname FROM `user`"); + foreach ($users as $user) { + $user_names[$user['nickname']] = $user['username']; + } /* Banner */ $banner = get_config('system','banner'); @@ -477,6 +490,7 @@ function admin_page_site(&$a) { '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$new_share' => array('new_share', t("'Share' element"), get_config('system','new_share'), t("Activates the bbcode element 'share' for repeating items.")), '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")), + '$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$maximagelength' => array('maximagelength', t("Maximum image length"), get_config('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")), '$jpegimagequality' => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")), diff --git a/view/admin_site.tpl b/view/admin_site.tpl index 1a2a83339b..a6fe2d789c 100644 --- a/view/admin_site.tpl +++ b/view/admin_site.tpl @@ -52,6 +52,7 @@ {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$new_share }}{{ endinc }} {{ inc field_checkbox.tpl with $field=$hide_help }}{{ endinc }} + {{ inc field_select.tpl with $field=$singleuser }}{{ endinc }}
diff --git a/view/smarty3/admin_site.tpl b/view/smarty3/admin_site.tpl index af78ca734b..bad0f52756 100644 --- a/view/smarty3/admin_site.tpl +++ b/view/smarty3/admin_site.tpl @@ -52,11 +52,12 @@ {{include file="field_input.tpl" field=$sitename}} {{include file="field_textarea.tpl" field=$banner}} {{include file="field_select.tpl" field=$language}} - {{include file="field_select.tpl" field=$theme}} + {{include file="field_select.tpl" field=$theme}} {{include file="field_select.tpl" field=$theme_mobile}} {{include file="field_select.tpl" field=$ssl_policy}} {{include file="field_checkbox.tpl" field=$new_share}} {{include file="field_checkbox.tpl" field=$hide_help}} + {{include file="field_select.tpl" field=$singleuser}}