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

« back to all changes in this revision

Viewing changes to plugins/administrator/auth.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:
1
1
<?php
2
 
 
3
2
/**
4
 
 *  This function tell other modules what users have access
5
 
 *  to the plugin.
6
 
 *  
7
 
 *  Philippe Mingo
8
 
 *  
9
 
 *  $Id: auth.php,v 1.11 2003/10/27 22:24:38 tassium Exp $
 
3
 * Administrator plugin - Authentication routines
 
4
 *
 
5
 * This function tell other modules what users have access
 
6
 * to the plugin.
 
7
 *
 
8
 * @version $Id: auth.php,v 1.10.2.3 2004/12/27 15:03:48 kink Exp $
 
9
 * @author Philippe Mingo
 
10
 * @copyright (c) 1999-2005 The SquirrelMail Project Team
 
11
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10
12
 * @package plugins
11
13
 * @subpackage administrator
12
14
 */
13
15
 
14
16
/**
15
 
*
16
 
*/
 
17
 * Check if user has access to administrative functions
 
18
 *
 
19
 * @return boolean
 
20
 * @access private
 
21
 */
17
22
function adm_check_user() {
18
23
    global $PHP_SELF;
19
24
    require_once(SM_PATH . 'functions/global.php');
31
36
    } else if (file_exists(SM_PATH . 'config/admins')) {
32
37
        $auths = file(SM_PATH . 'config/admins');
33
38
        $auth = in_array("$username\n", $auths);
34
 
    } else if ($adm_id = fileowner(SM_PATH . 'config/config.php')) {
 
39
    } else if ($adm_id = fileowner(SM_PATH . 'config/config.php') &&
 
40
               function_exists('posix_getpwuid')) {
35
41
        $adm = posix_getpwuid( $adm_id );
36
42
        $auth = ($username == $adm['name']);
37
43
    } else {
41
47
    return ($auth);
42
48
}
43
49
 
44
 
?>
 
50
?>
 
 
b'\\ No newline at end of file'