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

« back to all changes in this revision

Viewing changes to functions/db_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
 * db_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
25
25
 * Configuration of databasename, username and password is done
26
26
 * by using conf.pl or the administrator plugin
27
27
 *
28
 
 * $Id: db_prefs.php,v 1.32 2003/10/28 21:27:46 tassium Exp $
 
28
 * @version $Id: db_prefs.php,v 1.31.2.7 2004/12/27 15:03:43 kink Exp $
29
29
 * @package squirrelmail
30
30
 */
31
31
 
36
36
/** PostgreSQL */
37
37
define('SMDB_PGSQL', 2);
38
38
 
39
 
require_once('DB.php');
40
39
require_once(SM_PATH . 'config/config.php');
 
40
if (!include_once('DB.php')) {
 
41
    // same error also in abook_database.php
 
42
    require_once(SM_PATH . 'functions/display_messages.php');
 
43
    $error  = _("Could not include PEAR database functions required for the database backend.") . "<br />\n";
 
44
    $error .= sprintf(_("Is PEAR installed, and is the include path set correctly to find %s?"),
 
45
                        '<tt>DB.php</tt>') . "<br />\n";
 
46
    $error .= _("Please contact your system administrator and report this error.");
 
47
    error_box($error, $color);
 
48
    exit;
 
49
}
41
50
 
42
51
global $prefs_are_cached, $prefs_cache;
43
52
 
 
53
/**
 
54
 * @ignore
 
55
 */
44
56
function cachePrefValues($username) {
45
57
    global $prefs_are_cached, $prefs_cache;
46
58
 
 
59
    sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
47
60
    if ($prefs_are_cached) {
 
61
        sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
48
62
        return;
49
63
    }
50
64
 
278
292
} /* end class dbPrefs */
279
293
 
280
294
 
281
 
/* returns the value for the pref $string */
 
295
/**
 
296
 * returns the value for the pref $string
 
297
 * @ignore
 
298
 */
282
299
function getPref($data_dir, $username, $string, $default = '') {
283
300
    $db = new dbPrefs;
284
301
    if(isset($db->error)) {
290
307
    return $db->getKey($username, $string, $default);
291
308
}
292
309
 
293
 
/* Remove the pref $string */
 
310
/**
 
311
 * Remove the pref $string
 
312
 * @ignore
 
313
 */
294
314
function removePref($data_dir, $username, $string) {
295
315
    global $prefs_cache;
296
316
    $db = new dbPrefs;
308
328
    return;
309
329
}
310
330
 
311
 
/* sets the pref, $string, to $set_to */
 
331
/**
 
332
 * sets the pref, $string, to $set_to
 
333
 * @ignore
 
334
 */
312
335
function setPref($data_dir, $username, $string, $set_to) {
313
336
    global $prefs_cache;
314
337
 
335
358
    return;
336
359
}
337
360
 
338
 
/* This checks if the prefs are available */
 
361
/**
 
362
 * This checks if the prefs are available
 
363
 * @ignore
 
364
 */
339
365
function checkForPrefs($data_dir, $username) {
340
366
    $db = new dbPrefs;
341
367
    if(isset($db->error)) {
343
369
    }
344
370
}
345
371
 
346
 
/* Writes the Signature */
 
372
/**
 
373
 * Writes the Signature
 
374
 * @ignore
 
375
 */
347
376
function setSig($data_dir, $username, $number, $string) {
348
377
    if ($number == "g") {
349
378
        $key = '___signature___';
354
383
    return;
355
384
}
356
385
 
357
 
/* Gets the signature */
 
386
/**
 
387
 * Gets the signature
 
388
 * @ignore
 
389
 */
358
390
function getSig($data_dir, $username, $number) {
359
391
    if ($number == "g") {
360
392
        $key = '___signature___';
364
396
    return getPref($data_dir, $username, $key);
365
397
}
366
398
 
367
 
?>
 
399
// vim: et ts=4
 
400
?>
 
 
b'\\ No newline at end of file'