| 5 | | $outdated = array( |
|---|
| 6 | | $amp_conf['AMPWEBROOT']."/admin/cdr/css", |
|---|
| 7 | | $amp_conf['AMPWEBROOT']."/admin/cdr/encrypt.js", |
|---|
| 8 | | $amp_conf['AMPWEBROOT']."/admin/cdr/graph_hourdetail.php", |
|---|
| 9 | | $amp_conf['AMPWEBROOT']."/admin/cdr/graph_pie.php", |
|---|
| 10 | | $amp_conf['AMPWEBROOT']."/admin/cdr/graph_stat.php", |
|---|
| 11 | | $amp_conf['AMPWEBROOT']."/admin/cdr/graph_statbar.php", |
|---|
| 12 | | $amp_conf['AMPWEBROOT']."/admin/cdr/images/print.css", |
|---|
| 13 | | ); |
|---|
| 14 | | |
|---|
| 15 | | out("Cleaning up deprecated or moved files:"); |
|---|
| 16 | | |
|---|
| 17 | | foreach ($outdated as $file) { |
|---|
| 18 | | outn("Checking $file.."); |
|---|
| 19 | | if (!is_dir($file)) { |
|---|
| 20 | | if (file_exists($file) && !is_link($file)) { |
|---|
| 21 | | unlink($file) ? out(_("Removed")) : out(_("Failed to Remove")); |
|---|
| 22 | | } else { |
|---|
| 23 | | out(_("Not Required")); |
|---|
| 24 | | } |
|---|
| 25 | | } else { |
|---|
| 26 | | exec("rm -rf $file",$outarr,$ret); |
|---|
| 27 | | if ($ret == 0) { |
|---|
| 28 | | out(_("Removed directory")); |
|---|
| 29 | | } else { |
|---|
| 30 | | out(_("Failed to Remove directory")); |
|---|
| 31 | | } |
|---|
| 32 | | } |
|---|
| 33 | | } |
|---|
| 34 | | |
|---|
| | 4 | /* fix manager.conf settings for older manager.conf files being upgraded as new permissions are needed for later releases of Asterisk |
|---|
| | 5 | * in english, this is limited to everything between the AMPMGRUSER section and any new section the user may have edited. It replaces |
|---|
| | 6 | * everything to the right of a 'read =' or 'write =' permission line with the full set of permissoins Asterisk offers. |
|---|
| | 7 | */ |
|---|
| | 8 | exec('sed -i.2.6.0.bak "/^\['.$amp_conf['AMPMGRUSER'].'\]/,/^\[.*\]/s/^\(\s*read\s*=\|\s*write\s*=\).*/\1 system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate/" '.$amp_conf['ASTETCDIR'].'/manager.conf',$outarr,$ret); |
|---|