Revision dd415d52
Added by Scott Ullrich over 15 years ago
etc/inc/priv.inc | ||
---|---|---|
45 | 45 |
*/ |
46 | 46 |
|
47 | 47 |
/* Load and process custom privs. */ |
48 |
run_plugins("/etc/inc/priv/"); |
|
48 |
function load_custom_privs() { |
|
49 |
global $priv_list; |
|
50 |
$directory = "/etc/inc/priv"; |
|
51 |
$dir_array = array(); |
|
52 |
if(!is_dir($directory)) |
|
53 |
return; |
|
54 |
if ($dh = opendir($directory)) { |
|
55 |
while (($file = readdir($dh)) !== false) { |
|
56 |
$canadd = 0; |
|
57 |
if($file == ".") |
|
58 |
$canadd = 1; |
|
59 |
if($file == "..") |
|
60 |
$canadd = 1; |
|
61 |
if($canadd == 0) |
|
62 |
array_push($dir_array, $file); |
|
63 |
} |
|
64 |
closedir($dh); |
|
65 |
} |
|
66 |
if(!is_array($dir_array)) |
|
67 |
return; |
|
68 |
foreach ($dir_array as $file) |
|
69 |
if (!is_dir("{$directory}/{$file}") && stristr($file,".inc")) |
|
70 |
include("{$directory}/{$file}"); |
|
71 |
} |
|
49 | 72 |
|
73 |
// Load and sort privs |
|
74 |
load_custom_privs(); |
|
50 | 75 |
sort_privs($priv_list); |
51 | 76 |
|
52 | 77 |
function cmp_privkeys($a, $b) { |
Also available in: Unified diff
Roll custom run_plugins routine