Subversion Repositories ALCASAR

Rev

Rev 3100 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3100 Rev 3287
Line 84... Line 84...
84
            $this->error->addError("__construct()", "OS ".$this->_ostype. " is not supported via SSH");
84
            $this->error->addError("__construct()", "OS ".$this->_ostype. " is not supported via SSH");
85
            break;
85
            break;
86
        case 'GNU':
86
        case 'GNU':
87
        case 'Linux':
87
        case 'Linux':
88
            break;
88
            break;
-
 
89
        case 'SSH':
-
 
90
            $this->error->addError("__construct()", "SSH connection error");
-
 
91
            break;
89
        default:
92
        default:
90
            if ($this->getSystemStatus() !== '') {
93
            if ($this->getSystemStatus() !== '') {
91
                $this->_ostype = 'FortiOS';
94
                $this->_ostype = 'FortiOS';
92
                $this->sys->setOS('Linux');
95
                $this->sys->setOS('Linux');
93
            } elseif ($this->getSysVerSysteminfo() !== '') {
96
            } elseif ($this->getSysVerSysteminfo() !== '') {
Line 632... Line 635...
632
     * @return void
635
     * @return void
633
     */
636
     */
634
    protected function _distro()
637
    protected function _distro()
635
    {
638
    {
636
        switch ($this->_ostype) {
639
        switch ($this->_ostype) {
-
 
640
        case 'SSH':
-
 
641
            $this->sys->setOS('Unknown');
-
 
642
            $this->sys->setDistributionIcon('Unknown.png');
-
 
643
            break;
637
        case 'FortiOS':
644
        case 'FortiOS':
638
            if (preg_match("/^Version: \S+ (v[^\n]+)\n/", $this->getSystemStatus(), $buf)) {
645
            if (preg_match("/^Version: \S+ (v[^\n]+)\n/", $this->getSystemStatus(), $buf)) {
639
                $this->sys->setDistribution('FortiOS '.trim($buf[1]));
646
                $this->sys->setDistribution('FortiOS '.trim($buf[1]));
640
            }
647
            }
641
            $this->sys->setDistributionIcon('FortiOS.png');
648
            $this->sys->setDistributionIcon('FortiOS.png');
Line 781... Line 788...
781
     */
788
     */
782
    public function build()
789
    public function build()
783
    {
790
    {
784
        $this->error->addWarning("The SSH version of phpSysInfo is a work in progress, some things currently don't work");
791
        $this->error->addWarning("The SSH version of phpSysInfo is a work in progress, some things currently don't work");
785
        switch ($this->_ostype) {
792
        switch ($this->_ostype) {
-
 
793
        case 'SSH':
-
 
794
                $this->_distro();
-
 
795
                break;
786
        case 'FortiOS':
796
        case 'FortiOS':
787
            if (!$this->blockname || $this->blockname==='vitals') {
797
            if (!$this->blockname || $this->blockname==='vitals') {
788
                $this->_distro();
798
                $this->_distro();
789
                $this->_hostname();
799
                $this->_hostname();
790
                $this->_kernel();
800
                $this->_kernel();
Line 837... Line 847...
837
            }
847
            }
838
            if (!$this->blockname || $this->blockname==='network') {
848
            if (!$this->blockname || $this->blockname==='network') {
839
                $this->_network();
849
                $this->_network();
840
            }
850
            }
841
            break;
851
            break;
842
 
-
 
843
        case 'GNU':
852
        case 'GNU':
844
        case 'Linux':
853
        case 'Linux':
845
            parent::build();
854
            parent::build();
846
        }
855
        }
847
    }
856
    }