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

45 lines
1.1 KiB
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
2011-05-23 10:01:27 +00:00
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
2011-03-03 23:06:18 +00:00
*/
class TSM {
2012-11-26 05:57:18 +00:00
static $_online = FALSE;
2011-03-03 23:06:18 +00:00
public function set($username,$password,Database_TSM_Result $server) {
// @todo Consider encrypting this
2012-11-26 05:57:18 +00:00
Session::instance()->set(Kohana::$config->load('auth')->session_key,$username);
2011-03-03 23:06:18 +00:00
Session::instance()->set('password',$password);
Session::instance()->set('SERVER',$server);
2012-11-26 05:57:18 +00:00
return TSM::$_online = TRUE;
}
public static function online() {
return TSM::$_online;
2011-03-03 23:06:18 +00:00
}
public static function instance() {
return new TSM;
}
public static function name() {
2012-11-26 05:57:18 +00:00
return Session::instance()->get('SERVER')->get('SERVER_NAME');
2011-03-03 23:06:18 +00:00
}
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']);
}
}
?>