Browse Source

More SM_PATH changes

indiri69 23 years ago
parent
commit
56f1d28aec

+ 2 - 2
functions/addressbook.php

@@ -37,12 +37,12 @@ global $addrbook_dsn;
 
 /* Use this if you wanna have a global address book */
 if (isset($address_book_global_filename)) {
-    include_once('../functions/abook_global_file.php');
+    include_once(SM_PATH . 'functions/abook_global_file.php');
 }
 
 /* Only load database backend if database is configured */
 if(isset($addrbook_dsn) && !empty($addrbook_dsn)) {
-  include_once('../functions/abook_database.php');
+  include_once(SM_PATH . 'functions/abook_database.php');
 }
 
 /*

+ 8 - 8
functions/file_prefs.php

@@ -35,7 +35,7 @@ function cachePrefValues($data_dir, $username) {
 
     /* Make sure that the preference file now DOES exist. */
     if (!file_exists($filename)) {
-        include_once( '../functions/display_messages.php' );
+        include_once(SM_PATH . 'functions/display_messages.php');
         logout_error( sprintf( _("Preference file, %s, does not exist. Log out, and log back in to create a default preference file."), $filename)  );
         exit;
     }
@@ -43,7 +43,7 @@ function cachePrefValues($data_dir, $username) {
     /* Open the file, or else display an error to the user. */
     if(!$file = @fopen($filename, 'r'))
     {
-        include_once( '../functions/display_messages.php' );
+        include_once(SM_PATH . 'functions/display_messages.php');
         logout_error( sprintf( _("Preference file, %s, could not be opened. Contact your system administrator to resolve this issue."), $filename) );
         exit;
     }
@@ -103,7 +103,7 @@ function savePrefValues($data_dir, $username) {
     /* Open the file for writing, or else display an error to the user. */
     if(!$file = @fopen($filename, 'w'))
     {
-        include_once( '../functions/display_messages.php' );
+        include_once(SM_PATH . 'functions/display_messages.php');
         logout_error( sprintf( _("Preference file, %s, could not be opened. Contact your system administrator to resolve this issue."), $filename) );
         exit;
     }
@@ -168,7 +168,7 @@ function checkForPrefs($data_dir, $username, $filename = '') {
 
         /* If it is not there, check the internal data directory. */
         if (!@file_exists($default_pref)) {
-            $default_pref = '../data/default_pref';
+            $default_pref = SM_PATH . 'data/default_pref';
         }
 
         /* Otherwise, report an error. */
@@ -177,7 +177,7 @@ function checkForPrefs($data_dir, $username, $filename = '') {
             $errString = $errTitle . "<br>\n" .
                          _("Default preference file not found!") . "<br>\n" .
                          _("Please contact your system administrator and report this error.") . "<br>\n";
-            include_once( '../functions/display_messages.php' );
+            include_once(SM_PATH . 'functions/display_messages.php' );
             logout_error( $errString, $errTitle );
             exit;
         } else if (!@copy($default_pref, $filename)) {
@@ -190,7 +190,7 @@ function checkForPrefs($data_dir, $username, $filename = '') {
                        _("Could not create initial preference file!") . "<br>\n" .
                        sprintf( _("%s should be writable by user %s"), $data_dir, $uid ) .
                        "<br>\n" . _("Please contact your system administrator and report this error.") . "<br>\n";
-            include_once( '../functions/display_messages.php' );
+            include_once(SM_PATH . 'functions/display_messages.php' );
             logout_error( $errString, $errTitle );
             exit;
         }
@@ -205,7 +205,7 @@ function setSig($data_dir, $username, $number, $value) {
     /* Open the file for writing, or else display an error to the user. */
     if(!$file = @fopen($filename, 'w'))
     {
-        include_once( '../functions/display_messages.php' );
+        include_once(SM_PATH . '/functions/display_messages.php' );
         logout_error( sprintf( _("Signature file, %s, could not be opened. Contact your system administrator to resolve this issue."), $filename) );
         exit;
     }
@@ -223,7 +223,7 @@ function getSig($data_dir, $username, $number) {
         /* Open the file, or else display an error to the user. */
         if(!$file = @fopen($filename, 'r'))
         {
-            include_once( '../functions/display_messages.php' );
+            include_once(SM_PATH . 'functions/display_messages.php');
             logout_error( sprintf( _("Signature file, %s, could not be opened. Contact your system administrator to resolve this issue."), $filename) );
             exit;
         }

+ 2 - 2
functions/imap_general.php

@@ -234,8 +234,8 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $
                  */
                 
                 set_up_language($squirrelmail_language, true);
-                include_once( '../functions/display_messages.php' );
-                logout_error( _("Unknown user or password incorrect.") );                
+                include_once(SM_PATH . 'functions/display_messages.php' );
+                logout_error( _("Unknown user or password incorrect.") );
                 session_destroy();
                 exit;
             }

+ 1 - 1
functions/mime.php

@@ -33,7 +33,7 @@ function mime_structure ($bodystructure, $flags=array()) {
     $res  = $msg->parseStructure($read);
     $msg  = $res[0];
     if (!is_object($msg)) {
-        include_once( '../functions/display_messages.php' );
+        include_once(SM_PATH . 'functions/display_messages.php');
         global $color, $mailbox;
         displayPageHeader( $color, urldecode($mailbox) );
         echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n\n" .

+ 2 - 2
functions/plugin.php

@@ -18,8 +18,8 @@ $squirrelmail_plugin_hooks = array();
 
 /* This function adds a plugin. */
 function use_plugin ($name) {
-    if (file_exists("../plugins/$name/setup.php")) {
-        include_once("../plugins/$name/setup.php");
+    if (file_exists(SM_PATH . "plugins/$name/setup.php")) {
+        include_once(SM_PATH . "plugins/$name/setup.php");
         $function = "squirrelmail_plugin_init_$name";
         if (function_exists($function)) {
             $function();

+ 1 - 1
functions/prefs.php

@@ -45,7 +45,7 @@ function getHashedFile($username, $dir, $datafile, $hash_search = true) {
     $real_hash_dir = getHashedDir($username, $dir, $hash_dirs);
 
     /* Set the value of our real data file. */
-    $result = "$real_hash_dir/$datafile";
+    $result = SM_PATH . "$real_hash_dir/$datafile";
 
     /* Check for this file in the real hash directory. */
     if ($hash_search && !@file_exists($result)) {

+ 2 - 2
functions/smtp.php

@@ -787,14 +787,14 @@ function errorCheck($line, $smtpConnection, $verbose = false) {
     }
 
     if ($status == 0) {
-        include_once('../functions/page_header.php');
+        include_once(SM_PATH . 'functions/page_header.php');
         if ($compose_new_win == '1') {
             compose_Header($color, 'None');
         }
         else {
             displayPageHeader($color, 'None');
         }
-        include_once('../functions/display_messages.php');
+        include_once(SM_PATH . 'functions/display_messages.php');
         $lines = nl2br(htmlspecialchars($lines));
         $msg  = $message . "<br>\nServer replied: $lines";
         plain_error_message($msg, $color);

+ 1 - 1
plugins/squirrelspell/modules/check_me.mod

@@ -90,7 +90,7 @@ $sqspell_command=$SQSPELL_APP[$sqspell_use_app];
  * QUITE remote.
  */
 do {
-  $floc = "$attachment_dir/" . md5($sqspell_new_text . microtime());
+  $floc = SM_PATH . "$attachment_dir/" . md5($sqspell_new_text . microtime());
 } while (file_exists($floc));
 /**
  * Write the contents to the file.

+ 3 - 3
plugins/squirrelspell/sqspell_options.php

@@ -30,8 +30,8 @@ require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'include/load_prefs.php');
 require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'functions/page_header.php');
-require_once($SQSPELL_DIR . 'sqspell_config.php');
-require_once($SQSPELL_DIR . 'sqspell_functions.php');
+require_once(SM_PATH . $SQSPELL_DIR . 'sqspell_config.php');
+require_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php');
 
 /**
  * $MOD is the name of the module to invoke.
@@ -45,6 +45,6 @@ if (!isset($MOD) || !$MOD){
 }
 
 /* Load the stuff already. */
-require_once($SQSPELL_DIR . "modules/$MOD.mod");
+require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod");
 
 ?>

+ 1 - 1
src/addressbook.php

@@ -175,7 +175,7 @@ if($REQUEST_METHOD == 'POST') {
                                       "\n". '<strong>' . _("Update address") . '</strong>' ."\n",
                                       'center', $color[0] )
                                    ),
-                             'center', '', 'width="100%" ' ) .
+                             'center', '', 'width="100%" ' );
                         address_form("editaddr", _("Update address"), $olddata);
                         echo '<INPUT TYPE=hidden NAME=oldnick VALUE="' . 
                              htmlspecialchars($olddata["nickname"]) . "\">\n" .