~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to functions/prefs.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2005-02-06 21:41:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050206214151-z4n1o8mnttgzuj0y
Tags: 2:1.4.4-3
* Move default_pref config file from /var to /etc, as per Debian policy
  (Closes: #293281)
* [JvW] (finally) override two lintian warnings about nonstandard
  permissions that are intentional (Closes: #293366)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * prefs.php
5
5
 *
6
 
 * Copyright (c) 1999-2003 The SquirrelMail Project Team
 
6
 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7
7
 * Licensed under the GNU GPL. For full terms see the file COPYING.
8
8
 *
9
9
 * This contains functions for manipulating user preferences
10
10
 *
11
 
 * $Id: prefs.php,v 1.66 2004/01/02 16:58:04 avel Exp $
 
11
 * @version $Id: prefs.php,v 1.62.2.7 2005/01/14 06:15:23 cigamit Exp $
12
12
 * @package squirrelmail
13
13
 */
14
14
 
15
15
/** Include global.php */
16
16
require_once(SM_PATH . 'functions/global.php');
 
17
require_once(SM_PATH . 'functions/plugin.php');
17
18
 
18
19
sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
19
20
sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
31
32
    $prefs_cache = array();
32
33
}
33
34
 
34
 
if (isset($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) {
 
35
$prefs_backend = do_hook_function('prefs_backend');
 
36
if (isset($prefs_backend) && !empty($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) {
35
37
    require_once(SM_PATH . $prefs_backend);
36
38
} elseif (isset($prefs_dsn) && !empty($prefs_dsn)) {
37
39
    require_once(SM_PATH . 'functions/db_prefs.php');
58
60
    if (substr($dir, -1) == '/') {
59
61
        $dir = substr($dir, 0, strlen($dir) - 1);
60
62
    }
61
 
    
 
63
 
62
64
    /* Compute the hash for this user and extract the hash directories. */
63
65
    $hash_dirs = computeHashDirs($username);
64
66
 
87
89
            }
88
90
        }
89
91
    }
90
 
     
 
92
 
91
93
    /* Return the full hashed datafile path. */
92
94
    return ($result);
93
95
}
108
110
    if (substr($dir, -1) == '/') {
109
111
        $dir = substr($dir, 0, strlen($dir) - 1);
110
112
    }
111
 
    
 
113
 
112
114
    /* If necessary, populate the hash dir variable. */
113
115
    if ($hash_dirs == '') {
114
116
        $hash_dirs = computeHashDirs($username);
120
122
        $real_hash_dir .= '/' . $hash_dirs[$h];
121
123
        if (!@is_dir($real_hash_dir)) {
122
124
            if (!@mkdir($real_hash_dir, 0770)) {
123
 
                echo sprintf(_("Error creating directory %s."), $real_hash_dir) . '<br>' .
124
 
                     _("Could not create hashed directory structure!") . "<br>\n" .
125
 
                     _("Please contact your system administrator and report this error.") . "<br>\n";
 
125
                echo sprintf(_("Error creating directory %s."), $real_hash_dir) . '<br />' .
 
126
                     _("Could not create hashed directory structure!") . "<br />\n" .
 
127
                     _("Please contact your system administrator and report this error.") . "<br />\n";
126
128
                exit;
127
129
            }
128
130
        }
150
152
    return ($hash_dirs);
151
153
}
152
154
 
153
 
?>
 
155
?>
 
 
b'\\ No newline at end of file'