first commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
class Backend_model extends CI_Model {
|
||||
|
||||
var $thisUser = 'oameye';
|
||||
var $USER = '';
|
||||
var $wrenchboard;
|
||||
|
||||
function __construct() {
|
||||
|
||||
$this->USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$this->USER = str_replace('/home', '', $this->USER);
|
||||
$this->USER = strtok($this->USER, '/');
|
||||
if ($this->USER == 'opt') {
|
||||
$this->USER = 'root';
|
||||
}
|
||||
$this->thisUser = $this->USER;
|
||||
}
|
||||
|
||||
public function wrenchboard_api($in, $out = array()) {
|
||||
$this->wrenchboard_load();
|
||||
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function cfgReadChar($str) {
|
||||
$this->wrenchboard_load();
|
||||
$ret = $this->wrenchboard->cfgReadChar($str);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
private function wrenchboard_load() {
|
||||
// $this->$USER = $_SERVER['SCRIPT_FILENAME'];
|
||||
$wrenchboard_class = 'wrenchboard_api_' . $this->USER . '\\WrenchBoard';
|
||||
if (!is_object($this->wrenchboard)) {
|
||||
$this->wrenchboard = new $wrenchboard_class();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user