Advertisement
| 09.30.2008 at 06:43AM PDT, ID: 23774536 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: |
include('maccfg.class.php');
//Loop throught he directory for config files that relate to phones.
if($handle = opendir('/srv/tftp'))
{
while (false !== ($file = readdir($handle)))
{
//Check to see if it is a config file
$pattern = "/^[a-fA-F0-9]{12}\.cfg/";
//echo $file;
if(preg_match($pattern,$file) && $file !== '000000000000.cfg')
{
echo "Found config file: " . $file. '<br>';
$mc = new maccfg($file);
}
}
===============maccfg.class.php=========================
class maccfg
{
public $path = '';
public $mac = '';
public function __construct($f)
{
$this->path ='/srv/tftp/'.$f;
$this->mac = substr($f,1,12);
echo $this-mac;
}
|
Advertisement