This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/application/classes/tsm.php

38 lines
958 B
PHP
Raw Normal View History

2011-03-03 23:06:18 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class contains our TSM information
*
* @package PTA
* @subpackage Core
* @category Helpers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class TSM {
public function set($username,$password,Database_TSM_Result $server) {
// @todo Consider encrypting this
Session::instance()->set('admin_name',$username);
Session::instance()->set('password',$password);
Session::instance()->set('SERVER',$server);
}
public static function instance() {
return new TSM;
}
public static function name() {
return Session::instance()->get('SERVER')->rewind()->get('SERVER_NAME');
}
public static function version() {
$s = Session::instance()->get('SERVER')->rewind()->as_array();
$s = array_pop($s);
return sprintf('%s.%s.%s.%s',$s['VERSION'],$s['RELEASE'],$s['LEVEL'],$s['SUBLEVEL']);
}
}
?>