7004cc32 |
1 | <?php |
2 | |
2d977280 |
3 | /* |
4 | * This function tell other modules what users have access |
5 | * to the plugin. |
6 | * |
7 | * Philippe Mingo |
8 | * |
9 | * $Id$ |
10 | */ |
7004cc32 |
11 | function adm_check_user() { |
12 | |
2d977280 |
13 | GLOBAL $username, $PHP_SELF; |
7004cc32 |
14 | |
2d977280 |
15 | if ( substr( $PHP_SELF, -11 ) <> 'options.php' ) { |
71bf4974 |
16 | $auth = FALSE; |
2d977280 |
17 | } else if ( file_exists( '../plugins/administrator/admins' ) ) { |
0bde8324 |
18 | $auths = file( '../plugins/administrator/admins' ); |
1f9d9ce4 |
19 | $auth = in_array( "$username\n", $auths ); |
2d977280 |
20 | } else if ( $adm_id = fileowner('../config/config.php') ) { |
7004cc32 |
21 | $adm = posix_getpwuid( $adm_id ); |
2d977280 |
22 | $auth = ( $username == $adm['name'] ); |
7004cc32 |
23 | } |
24 | |
25 | return( $auth ); |
26 | |
27 | } |
28 | |
29 | ?> |