summaryrefslogtreecommitdiff
path: root/nocc
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2003-03-11 07:24:27 +0000
committerJonas Smedegaard <dr@jones.dk>2003-03-11 07:24:27 +0000
commit930e8cf54a0456a3d9ed6b0510fc69f6d5902d26 (patch)
tree43466c5e11329753dbe18b94e3dcfdce92cdf7d8 /nocc
parenta53310d5a611a3bb774ec323be2a43cb2f6e9938 (diff)
Update to newer syntax.
Diffstat (limited to 'nocc')
-rw-r--r--nocc/conf.php212
1 files changed, 116 insertions, 96 deletions
diff --git a/nocc/conf.php b/nocc/conf.php
index f5c087d..61873c0 100644
--- a/nocc/conf.php
+++ b/nocc/conf.php
@@ -1,9 +1,10 @@
<?php
/*
- * $Header: /var/local/cvs/local-COMMON/nocc/conf.php,v 1.2 2002-11-11 02:33:09 jonas Exp $
+ * $Header: /var/local/cvs/local-COMMON/nocc/conf.php,v 1.3 2003-03-11 07:24:27 jonas Exp $
*
* Copyright 2001 Nicolas Chalanset <nicocha@free.fr>
* Copyright 2001 Olivier Cahagne <cahagn_o@epita.fr>
+ * Copyright 2002 Mike Rylander <mrylander@mail.com>
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
@@ -17,16 +18,16 @@
// If a domain has no smtp server, this one will be used
// If no smtp server is provided, Nocc will default to the mail() function,
// and try to use Sendmail or any other MTA (Postfix)
-$default_smtp_server = 'localhost';
-$default_smtp_port = 25;
+$conf->default_smtp_server = 'localhost';
+$conf->default_smtp_port = 25;
// List of domains people can log in
// You can have as many domains as you need
-// $domains[0]->domain = 'sourceforge.net';
+// $conf->domains[$i]->domain = 'sourceforge.net';
// domain name e.g 'sourceforge.net'. This field is used when sending message
//
-// $domains[0]->in = 'mail.sourceforge.net:110/pop3';
+// $conf->domains[$i]->in = 'mail.sourceforge.net:110/pop3';
// imap or pop3 server name + port + protocol (only if not imap)
// [server_name]:[port number]/[protocol]
// ex for an imap server : mail.sourceforge.net:143
@@ -37,33 +38,48 @@ $default_smtp_port = 25;
// ex for an ssl pop3 server with a self-signed certificate : mail.sourceforge.net:995/pop3/ssl/novalidate-cert
// protocol can only be pop3
//
-// $domains[0]->smtp = 'smtp.isp.com';
+// $conf->domains[$i]->smtp = 'smtp.isp.com';
// Optional: smtp server name or IP address
// Leave empty to send mail via sendmail
//
-// $domains[0]->smtp_port = 25;
+// $conf->domains[$i]->smtp_port = 25;
// Port number to connect to smtp server (usually 25)
-$domains[0]->domain = 'jones.dk';
-$domains[0]->in = 'mail.jones.dk';
-$domains[0]->smtp = '';
-$domains[0]->smtp_port = 25;
-
-$domains[1]->domain = 'homebase.dk';
-$domains[1]->in = 'mail.homebase.dk';
-$domains[2]->domain = '107b.dk';
-$domains[2]->in = '107b.dk';
-$domains[3]->domain = '107b.dk';
-$domains[3]->in = 'bitbase.dk';
-$domains[4]->domain = 'bitbase.dk';
-$domains[4]->in = 'mail2.a-host.dk';
-$domains[5]->domain = 'macvaerk.com';
-$domains[5]->in = 'mail.macvaerk.com';
+$i = 0;
+
+$conf->domains[$i]->domain = 'bitbase.dk';
+$conf->domains[$i]->in = 'mail.bitbase.dk';
+//$conf->domains[$i]->smtp = '';
+//$conf->domains[$i]->smtp_port = 25;
+// Uncomment for 'user@domain.com' style logins
+//$conf->domains[$i]->login_with_domain = 1;
+
+// If you want to add more domains, uncomment the following
+// lines and fill them in
+
+$i++;
+$conf->domains[$i]->domain = 'jones.dk';
+$conf->domains[$i]->in = 'mail.jones.dk';
+$i++;
+$conf->domains[$i]->domain = 'homebase.dk';
+$conf->domains[$i]->in = 'mail.homebase.dk';
+$i++;
+$conf->domains[$i]->domain = '107b.dk';
+$conf->domains[$i]->in = 'mail.107b.dk';
+//$i++;
+//$conf->domains[$i]->domain = 'bitbase.dk';
+//$conf->domains[$i]->in = 'mail.bitbase.dk';
+$i++;
+$conf->domains[$i]->domain = 'vega.dk';
+$conf->domains[$i]->in = 'mail.vega.dk';
+
+// Is the user allowed to change his "From:" address? (true/false)
+$conf->allow_address_change = true;
// Default tmp directory (where to store temporary uploaded files)
// This should be something like '/tmp' on Unix System
// And 'c:\\temp' on Win32 (note that we must escape "\")
-$tmpdir = '/tmp';
+$conf->tmpdir = '/var/lib/nocc/tmp';
// Preferences data directory
// IMPORTANT: This directory must exist and be writable by the user
@@ -73,137 +89,141 @@ $tmpdir = '/tmp';
// This should be something like 'profiles/' on Unix System
// or 'prefs\\' on Win32 (note that we must escape "\")
// If left empty, preferences will be disabled.
-$prefs_dir = '';
+$conf->prefs_dir = '/var/lib/nocc/profiles';
// Default folder to go first
-$default_folder = 'INBOX';
+$conf->default_folder = 'INBOX';
// ===> End of required parameters
+
// The following parameters can be changed but it's not necessary to
// get a working version of nocc
// if browser has no preferred language, we use the default language
// This is only needed for browsers that don't send any preferred
// language such as W3 Amaya
-$default_lang = 'en';
+$conf->default_lang = 'en';
// How many messages to display in the inbox (devel only)
-$max_msg_num = 1;
+$conf->max_msg_num = 1;
// let user see the header of a message
-$use_verbose = true;
+$conf->use_verbose = true;
// the user can logout or not (if nocc is used within your website
// enter 'false' here else leave 'true')
-$enable_logout = true;
+$conf->enable_logout = true;
+
+// the user can change their 'reply leadin' string
+$conf->enable_reply_leadin = false;
// Whether or not to display attachment part number
-$display_part_no = true;
+$conf->display_part_no = true;
// Whether or not to display the Message/RFC822 into the attachments
// (the attachments of that part are still available even if false is set
-$display_rfc822 = true;
+$conf->display_rfc822 = true;
// If you don't want to display images (GIF, JPEG and PNG) sent as attachements
// set it to 'false'
-$display_img_attach = true;
+$conf->display_img_attach = true;
// If you don't want to display text/plain attachments set it to 'false'
-$display_text_attach = true;
+$conf->display_text_attach = true;
// By default the messages are sorted by date
-$default_sort = '1';
+$conf->default_sort = '1';
// By default the most recent is in top ('1' --> sorting top to bottom,
// '0' --> bottom to top)
-$default_sortdir = '1';
+$conf->default_sortdir = '1';
// For old UCB POP server, change this setting to 1 to enable
// new mail detection. Recommended: leave it to 0 for any other POP or
// IMAP server.
// See FAQ for more details.
-$have_ucb_pop_server = false;
+$conf->have_ucb_pop_server = false;
// If you wanna make your own theme and force people to use that one,
-// set $use_theme to false and fill in the $default_theme to the theme name
-// you want to use
+// set $conf->use_theme to false and fill in the $conf->default_theme to
+// the theme name you want to use
// Theme handling: allows users to choose a theme on the login page
-$use_theme = true;
+$conf->use_theme = true;
// Default theme
-$default_theme = 'standard';
+$conf->default_theme = 'standard';
// Error reporting
-// Display error but no notice
-$debug_level = E_ALL & ~E_NOTICE;
-
-// Display delete button as icon (true) or as an HTML button (false)
-$delete_button_icon = true;
+// Display all errors (including IMAP connection errors, such as
+// 'host not found' or 'invalid login')
+$conf->debug_level = E_ALL;
// Base URL where NOCC is hosted (only needed for Xitami servers, see #463390)
-$base_uri = '';
+// (NOTE: should end in a slash). Leave blank to prevent warnings if not used.
+//$conf->base_url = 'http://www.yoursite.com/webmail/';
+$conf->base_url = '';
+
+// Another tip for Xitami users, whose $_SERVER['PHP_SELF'] is broken
+// (see http://sourceforge.net/tracker/index.php?func=detail&aid=505194&group_id=12177&atid=112177)
+//$_SERVER['PHP_SELF'] = 'action.php';
+
+// Use old-style forwarding (quote original message, and attach original attachments).
+// This is discouraged, because it mangles the original message, removing important headers etc.
+$conf->broken_forwarding = false;
+
+// This sets the number of messages per page to display from a imap folder or pop mailbox
+$conf->msg_per_page = '25';
+
+// Set this to '1' to enable the status line for folders at the bottom of the inbox page.
+// If you get slow page loads, set it to '0' to disable this (rather slow) function.
+$conf->status_line = '1';
// ################### Messages Signature ################### //
// This message is added to every message, the user cannot delete it
// Be careful if you modify this, do not forget to write '\r\n' to switch
// to the next line !
-$ad = "___________________________________\r\nNOCC, http://nocc.sourceforge.net";
-
+$conf->ad = "___________________________________\r\nNOCC, http://nocc.sourceforge.net";
-/*
-################### End of Configuration ####################
-*********************************************************************
-################### Do not modify below this line ###################
-*/
-$nocc_version = '0.9.5';
-$nocc_name = 'NOCC';
+// PHP error reporting for this application
+error_reporting($conf->debug_level);
-session_register('domainnum', 'user', 'passwd', 'server', 'servtype', 'port', 'theme');
+// Prevent mangling of uploaded attachments
+set_magic_quotes_runtime(0);
-if (isset($domainnum))
-{
- $domain = $domains[$domainnum]->domain;
- $servr = $domains[$domainnum]->in;
- $smtp_server = $domains[$domainnum]->smtp;
- $smtp_port = $domains[$domainnum]->smtp_port;
-}
-if (empty($smtp_server))
- $smtp_server = $default_smtp_server;
-if (empty($smtp_port))
- $smtp_port = $default_smtp_port;
-if (empty($servr) && !empty($server) && !empty($servtype) && !empty($port))
-{
- $servtype = strtolower($servtype);
- if ($servtype != 'imap')
- $servr = $server.'/'.$servtype.':'.$port;
- else
- $servr = $server.':'.$port;
- $domain = $server;
-}
+/*
+################### End of Configuration ####################
+*/
-if (!isset($folder))
- $folder = $default_folder;
-if (!isset($sort))
- $sort = $default_sort;
-if (!isset($sortdir))
- $sortdir = $default_sortdir;
-if ($use_theme == true)
-{
- if (!isset($theme))
- $theme = $default_theme;
+require_once './user_prefs.php';
+require_once './user_filters.php';
+require_once './functions.php';
+
+// This function allows you to customise the default e-mail address
+function get_default_from_address() {
+ if(!isset($_SESSION['nocc_user_prefs']))
+ return '';
+
+ $user_prefs = $_SESSION['nocc_user_prefs'];
+ $from_address = "";
+
+ // Determine e-mail address
+ if(!empty($user_prefs->email_address))
+ $from_address = $user_prefs->email_address;
+ else {
+ $from_address = $_SESSION['nocc_user'].'@'.$_SESSION['nocc_domain'];
+ if($from_address == '@') {
+ return '';
+ }
+ }
+
+ // Append name if known
+ if(!empty($user_prefs->full_name))
+ $from_address = $user_prefs->full_name . ' <' . $from_address . '>';
+
+ return $from_address;
}
-else
- $theme = $default_theme;
-$php_session = ini_get('session.name');
-$action = isset($action) ? $action : '';
-error_reporting($debug_level);
-
-// Prevent mangling of uploaded attachments
-set_magic_quotes_runtime(0);
-require_once ('./conf_lang.php');
-require ('./themes/'.$theme.'/colors.php');
?>