** $Id$
**/
- require_once( '../plugins/mail_fetch/functions.php' );
+ define('SM_PATH','../../');
+ require_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
function squirrelmail_plugin_init_mail_fetch() {
global $squirrelmail_plugin_hooks;
- global $mailbox, $imap_stream, $imapConnection;
$squirrelmail_plugin_hooks['menuline']['mail_fetch'] = 'mail_fetch_link';
$squirrelmail_plugin_hooks['loading_prefs']['mail_fetch'] = 'mail_fetch_load_pref';
function mail_fetch_load_pref() {
- global $username,$data_dir;
+ global $data_dir;
global $mailfetch_server_number;
global $mailfetch_cypher;
global $mailfetch_server_,$mailfetch_alias_,$mailfetch_user_,$mailfetch_pass_;
global $mailfetch_lmos_, $mailfetch_uidl_, $mailfetch_login_, $mailfetch_fref_;
global $PHP_SELF;
+ if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+ global $_SESSION;
+ }
+ $username = $_SESSION['username'];
if( stristr( $PHP_SELF, 'mail_fetch' ) ) {
$mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number', 0);
function mail_fetch_login() {
- require_once ('../src/validate.php');
+ require_once ('../include/validate.php');
require_once ('../functions/imap.php');
require_once ('../plugins/mail_fetch/class.POP3.php');
require_once ('../plugins/mail_fetch/functions.php');
- require_once('../functions/i18n.php');
+ require_once ('../functions/i18n.php');
- global $username, $data_dir, $key,$imapServerAddress,$imapPort;
+ global $data_dir, $imapServerAddress, $imapPort;
+ if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+ global $_SESSION, $_COOKIE;
+ }
+ $username = $_SESSION['username'];
+ $key = $_COOKIE['key'];
$mailfetch_newlog = getPref($data_dir, $username, 'mailfetch_newlog');
function mail_fetch_setnew() {
- global $data_dir,$username;
- // require_once ('../src/load_prefs.php');
- // require_once ('../src/validate.php');
- require_once('../functions/prefs.php');
+ global $data_dir;
+ require_once(SM_PATH . 'functions/prefs.php');
+
+ if (isset($_SESSION['username'])) {
+ $username = $_SESSION['username'];
+ } else {
+ $username = '';
+ }
if( $username <> '' ) {
// Creates the pref file if it does not exist.