public function save(Doctrine_Connection $conn = null)
 {
     $cls_commonfunction = new CommonFunctions();
     $path = $cls_commonfunction->basepath();
     $file = $_FILES;
     if ($file['avatar']['name']['avt_image'] != '') {
         if (move_uploaded_file($file['avatar']['tmp_name']['avt_image'], $path . "uploads/avatar/" . time() . "_" . $file['avatar']['name']['avt_image'])) {
             $this->setAvtImage(time() . "_" . $file['avatar']['name']['avt_image']);
         }
     } else {
         $this->getAvtImage("");
     }
     return parent::save($conn);
 }
 public function save(Doctrine_Connection $conn = null)
 {
     $cls_commonfunction = new CommonFunctions();
     $path = $cls_commonfunction->basepath();
     $file = $_FILES;
     if ($file['book_series']['name']['series_icon'] != '') {
         if (move_uploaded_file($file['book_series']['tmp_name']['series_icon'], $path . "uploads/book_series/" . time() . "_" . $file['book_series']['name']['series_icon'])) {
             $this->setSeriesIcon(time() . "_" . $file['book_series']['name']['series_icon']);
         }
     } else {
         $this->getSeriesIcon("");
     }
     return parent::save($conn);
 }
 /**
  * read the data into an internal array and also call the parent constructor
  *
  * @param String $enc encoding
  */
 public function __construct($enc)
 {
     parent::__construct(__CLASS__, $enc);
     switch (strtolower(PSI_PLUGIN_UPDATENOTIFIER_ACCESS)) {
         case 'command':
             if (PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT === true) {
                 CommonFunctions::executeProgram("/usr/lib/update-notifier/apt-check", "--human-readable", $buffer_info);
             } else {
                 CommonFunctions::executeProgram("/usr/lib/update-notifier/apt-check", "2>&1", $buffer_info);
             }
             break;
         case 'data':
             if (defined('PSI_PLUGIN_UPDATENOTIFIER_FILE') && is_string(PSI_PLUGIN_UPDATENOTIFIER_FILE)) {
                 CommonFunctions::rfts(PSI_PLUGIN_UPDATENOTIFIER_FILE, $buffer_info);
             } else {
                 CommonFunctions::rfts("/var/lib/update-notifier/updates-available", $buffer_info);
             }
             break;
         default:
             $this->global_error->addConfigError("__construct()", "PSI_PLUGIN_UPDATENOTIFIER_ACCESS");
             break;
     }
     // Remove blank lines
     $this->_filecontent = preg_split("/\r?\n/", $buffer_info, -1, PREG_SPLIT_NO_EMPTY);
 }
 public function getAction()
 {
     $apiparameters = $this->view->apiparams();
     //print_r($apiparameters);
     if (!array_key_exists('apicall', $apiparameters)) {
         echo "{'error':'No method was called!'}";
     } elseif (!array_key_exists('apikey', $apiparameters)) {
         echo "{'error':'Api Key missing!'}";
     } else {
         $db = Zend_Registry::get('db');
         $sql = 'SELECT * FROM pclive_apikeys where apikey="' . $apiparameters['apikey'] . '"';
         $result = $db->query($sql);
         $record = $result->FetchAll();
         if (count($record) == 1) {
             $request = '[' . json_encode($apiparameters) . ']';
             $url = $this->view->serverUrl() . $this->view->baseUrl() . '/api/';
             //$url ='http://localhost/projects/evendor/api';
             $params = array('jsondata' => $request);
             // key value pairs
             $response = CommonFunctions::processRequest($url, $params);
             //$this->getResponse()->appendBody("From getAction() returning the requested article");
             echo "<pre>";
             print_r($response);
             //print_r(json_decode($response));
             echo "</pre>";
             //exit;
         } else {
             echo "{'apikey_error':'Invalide Apikey'}";
             //exit;
         }
     }
 }
Beispiel #5
0
 /**
  *	@author Anthony Boutinov
  */
 public function protectPageForbidSuperadmin()
 {
     if ($this->database->is_superadmin()) {
         Notification::addNextPage('Вы не имеете право доступа к странице, на которую пытались перейти.', 'warning');
         CommonFunctions::redirect($this->adminMainPage);
     }
 }
 public function __construct()
 {
     parent::__construct();
     switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS') ? strtolower(PSI_SENSOR_SPEEDFAN_ACCESS) : 'command') {
         case 'command':
             if (CommonFunctions::executeProgram("SpeedFanGet.exe", "", $buffer, PSI_DEBUG) && strlen($buffer) > 0) {
                 if (preg_match("/^Temperatures:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["temp"] = $out[1];
                 }
                 if (preg_match("/^Fans:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["fans"] = $out[1];
                 }
                 if (preg_match("/^Voltages:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["volt"] = $out[1];
                 }
             }
             break;
         case 'data':
             if (CommonFunctions::rfts(APP_ROOT . '/data/speedfan.txt', $buffer) && strlen($buffer) > 0) {
                 if (preg_match("/^Temperatures:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["temp"] = $out[1];
                 }
                 if (preg_match("/^Fans:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["fans"] = $out[1];
                 }
                 if (preg_match("/^Voltages:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["volt"] = $out[1];
                 }
             }
             break;
         default:
             $this->error->addConfigError('__construct()', 'PSI_SENSOR_SPEEDFAN_ACCESS');
             break;
     }
 }
 /**
  * get network information
  *
  * @return void
  */
 private function _network()
 {
     if (CommonFunctions::executeProgram('netstat', '-nibd | grep Link', $netstat, PSI_DEBUG)) {
         $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
         foreach ($lines as $line) {
             $ar_buf = preg_split("/\\s+/", $line);
             if (!empty($ar_buf[0])) {
                 $dev = new NetDevice();
                 $dev->setName($ar_buf[0]);
                 if (strlen($ar_buf[3]) < 15) {
                     $dev->setTxBytes($ar_buf[8]);
                     $dev->setRxBytes($ar_buf[5]);
                     $dev->setDrops($ar_buf[10]);
                     $dev->setErrors($ar_buf[4] + $ar_buf[7]);
                 } else {
                     $dev->setTxBytes($ar_buf[9]);
                     $dev->setRxBytes($ar_buf[6]);
                     $dev->setErrors($ar_buf[5] + $ar_buf[8]);
                     $dev->setDrops($ar_buf[11]);
                 }
                 $this->sys->setNetDevices($dev);
             }
         }
     }
 }
 public function __construct()
 {
     global $configEtude;
     //Controleur d'instanciation
     $this->m_ctrl = new instanciation();
     CommonFunctions::__construct($configEtude, $this->m_ctrl);
 }
 /**
  * fill the private content var through command or data access
  */
 public function __construct()
 {
     parent::__construct();
     switch (defined('PSI_SENSOR_LMSENSORS_ACCESS') ? strtolower(PSI_SENSOR_LMSENSORS_ACCESS) : 'command') {
         case 'command':
             if (CommonFunctions::executeProgram("sensors", "", $lines)) {
                 // Martijn Stolk: Dirty fix for misinterpreted output of sensors,
                 // where info could come on next line when the label is too long.
                 $lines = str_replace(":\n", ":", $lines);
                 $lines = str_replace("\n\n", "\n", $lines);
                 $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             }
             break;
         case 'data':
             if (CommonFunctions::rfts(APP_ROOT . '/data/lmsensors.txt', $lines)) {
                 $lines = str_replace(":\n", ":", $lines);
                 $lines = str_replace("\n\n", "\n", $lines);
                 $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             }
             break;
         default:
             $this->error->addConfigError('__construct()', 'PSI_SENSOR_LMSENSORS_ACCESS');
             break;
     }
 }
Beispiel #10
0
 /**
  * read the data into an internal array and also call the parent constructor
  *
  * @param String $enc encoding
  */
 public function __construct($enc)
 {
     $buffer = "";
     parent::__construct(__CLASS__, $enc);
     switch (strtolower(PSI_PLUGIN_DMRAID_ACCESS)) {
         case 'command':
             if (PSI_OS == 'FreeBSD') {
                 CommonFunctions::executeProgram("graid", "list", $buffer);
             } else {
                 CommonFunctions::executeProgram("dmraid", "-s -vv 2>&1", $buffer);
             }
             break;
         case 'data':
             CommonFunctions::rfts(APP_ROOT . "/data/dmraid.txt", $buffer);
             break;
         default:
             $this->global_error->addConfigError("__construct()", "PSI_PLUGIN_DMRAID_ACCESS");
             break;
     }
     if (trim($buffer) != "") {
         if (PSI_OS == 'FreeBSD') {
             $this->_filecontent = preg_split("/Consumers:\r?\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
         } else {
             $this->_filecontent = preg_split("/(\r?\n\\*\\*\\* )|(\r?\n--> )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
         }
     } else {
         $this->_filecontent = array();
     }
 }
 /**
  * read the data into an internal array and also call the parent constructor
  *
  * @param String $enc encoding
  */
 public function __construct($enc)
 {
     parent::__construct(__CLASS__, $enc);
     CommonFunctions::rfts(PSI_PLUGIN_UPDATENOTIFIER_FILE, $buffer_info);
     // Remove blank lines
     $this->_filecontent = preg_split("/\n/", $buffer_info, -1, PREG_SPLIT_NO_EMPTY);
 }
Beispiel #12
0
 /**
  * get all information from all configured ups and store output in internal array
  */
 public function __construct()
 {
     parent::__construct();
     if (defined('PSI_UPS_NUT_LIST') && is_string(PSI_UPS_NUT_LIST)) {
         if (preg_match(ARRAY_EXP, PSI_UPS_NUT_LIST)) {
             $upses = eval(PSI_UPS_NUT_LIST);
         } else {
             $upses = array(PSI_UPS_NUT_LIST);
         }
         foreach ($upses as $ups) {
             CommonFunctions::executeProgram('upsc', '-l ' . trim($ups), $output, PSI_DEBUG);
             $ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY);
             foreach ($ups_names as $ups_name) {
                 CommonFunctions::executeProgram('upsc', trim($ups_name) . '@' . trim($ups), $temp, PSI_DEBUG);
                 if (!empty($temp)) {
                     $this->_output[trim($ups_name) . '@' . trim($ups)] = $temp;
                 }
             }
         }
     } else {
         //use default if address and port not defined
         CommonFunctions::executeProgram('upsc', '-l', $output, PSI_DEBUG);
         $ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY);
         foreach ($ups_names as $ups_name) {
             CommonFunctions::executeProgram('upsc', trim($ups_name), $temp, PSI_DEBUG);
             if (!empty($temp)) {
                 $this->_output[trim($ups_name)] = $temp;
             }
         }
     }
 }
 /**
  * call the parent constructor and check for needed extensions
  */
 public function __construct()
 {
     CommonFunctions::checkForSVN();
     CommonFunctions::checkForExtensions();
     $this->error = Error::singleton();
     $this->_checkConfig();
 }
 /**
  * fill the private content var through tcp or file access
  */
 public function __construct()
 {
     parent::__construct();
     switch (strtolower(PSI_SENSOR_ACCESS)) {
         case 'tcp':
             $fp = fsockopen("localhost", 411, $errno, $errstr, 5);
             if ($fp) {
                 $lines = "";
                 while (!feof($fp)) {
                     $lines .= fread($fp, 1024);
                 }
                 $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             } else {
                 $this->error->addError("fsockopen()", $errno . " " . $errstr);
             }
             break;
         case 'command':
             CommonFunctions::executeProgram('mbmon', '-c 1 -r', $lines, PSI_DEBUG);
             $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             break;
         default:
             $this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS');
             break;
     }
 }
 function socdiscoo($tblConfig, $SubjectKey)
 {
     CommonFunctions::__construct($tblConfig, null);
     $this->addLog("socdiscoo->socdiscoo(,{$SubjectKey})", INFO);
     $this->m_tblLocks = array();
     $this->initContext($SubjectKey);
 }
 /**
  * fill the private content var through command
  */
 public function __construct()
 {
     parent::__construct();
     $lines = "";
     //        CommonFunctions::executeProgram('sysctl', '-w hw.sensors', $lines);
     CommonFunctions::executeProgram('sysctl', 'hw.sensors', $lines);
     $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
 }
 /**
  * get all information from all configured ups in config.php and store output in internal array
  */
 public function __construct()
 {
     parent::__construct();
     CommonFunctions::executeProgram('powersoftplus', '-p', $temp);
     if (!empty($temp)) {
         $this->_output[] = $temp;
     }
 }
 /**
  * get all information from all configured ups and store output in internal array
  */
 public function __construct()
 {
     parent::__construct();
     CommonFunctions::executeProgram('pmset', '-g batt', $temp);
     if (!empty($temp)) {
         $this->_output[] = $temp;
     }
 }
 static function isAdminUser($name)
 {
     if (CommonFunctions::isSuperUser($name) || in_array($name, array('admin2', 'genband'))) {
         return true;
     } else {
         return false;
     }
 }
 /**
  * get temperature information
  *
  * @return void
  */
 private function _temperature()
 {
     if (PSI_OS == 'Linux') {
         $hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT);
         if (($totalh = count($hwpaths)) > 0) {
             $buf = "";
             for ($h = 0; $h < $totalh; $h++) {
                 $tempsensor = glob($hwpaths[$h] . "temp*_input", GLOB_NOSORT);
                 if (($total = count($tempsensor)) > 0) {
                     $buf = "";
                     for ($i = 0; $i < $total; $i++) {
                         if (CommonFunctions::rfts($tempsensor[$i], $buf, 1, 4096, false) && trim($buf) != "") {
                             $dev = new SensorDevice();
                             $dev->setValue(trim($buf) / 1000);
                             $label = preg_replace("/_input\$/", "_label", $tempsensor[$i]);
                             $crit = preg_replace("/_input\$/", "_crit", $tempsensor[$i]);
                             $max = preg_replace("/_input\$/", "_max", $tempsensor[$i]);
                             $crit_alarm = preg_replace("/_input\$/", "_crit_alarm", $tempsensor[$i]);
                             if (CommonFunctions::fileexists($label) && CommonFunctions::rfts($label, $buf, 1, 4096, false) && trim($buf) != "") {
                                 $dev->setName(trim($buf));
                             } else {
                                 $labelname = trim(preg_replace("/_input\$/", "", pathinfo($tempsensor[$i], PATHINFO_BASENAME)));
                                 if ($labelname !== "") {
                                     $dev->setName($labelname);
                                 } else {
                                     $dev->setName('unknown');
                                 }
                             }
                             if (CommonFunctions::fileexists($crit) && CommonFunctions::rfts($crit, $buf, 1, 4096, false) && trim($buf) != "") {
                                 $dev->setMax(trim($buf) / 1000);
                                 if (CommonFunctions::fileexists($crit_alarm) && CommonFunctions::rfts($crit_alarm, $buf, 1, 4096, false) && trim($buf) === "1") {
                                     $dev->setEvent("Critical Alarm");
                                 }
                             } elseif (CommonFunctions::fileexists($max) && CommonFunctions::rfts($max, $buf, 1, 4096, false) && trim($buf) != "") {
                                 $dev->setMax(trim($buf) / 1000);
                             }
                             $this->mbinfo->setMbTemp($dev);
                         }
                     }
                 }
             }
         }
     } else {
         $smp = 1;
         CommonFunctions::executeProgram('sysctl', '-n kern.smp.cpus', $smp);
         for ($i = 0; $i < $smp; $i++) {
             $temp = 0;
             if (CommonFunctions::executeProgram('sysctl', '-n dev.cpu.' . $i . '.temperature', $temp)) {
                 $temp = preg_replace('/C/', '', $temp);
                 $dev = new SensorDevice();
                 $dev->setName("CPU " . ($i + 1));
                 $dev->setValue($temp);
                 //                    $dev->setMax(70);
                 $this->mbinfo->setMbTemp($dev);
             }
         }
     }
 }
Beispiel #21
0
 public function addAction()
 {
     $this->view->messages = $this->_flashMessenger->getMessages();
     $this->_helper->layout->disableLayout();
     $formData = array();
     $formErrors = array();
     $formData = $this->getRequest()->getPost();
     if ($this->getRequest()->isPost() && isset($formData['add_author']) && $formData['add_author'] == 'Add Author') {
         $formData = $this->getRequest()->getPost();
         if (!isset($formData['first_name']) || trim($formData['first_name']) == "") {
             $formErrors['first_name'] = "Please enter first name";
         }
         if (!isset($formData['last_name']) || trim($formData['last_name']) == "") {
             $formErrors['last_name'] = "Please enter last name";
         }
         if (isset($formData['emailid']) && trim($formData['emailid']) != "") {
             if (!CommonFunctions::isValidEmail($formData['emailid'])) {
                 if (!array_key_exists('emailid', $formErrors)) {
                     $formErrors['emailid'] = "Please enter valid email";
                 }
             }
         }
         if ($formData['emailid'] != '') {
             if ($this->modelAuthor->isExist('emailid="' . $formData['emailid'] . '" and parent_id!="0"')) {
                 if (!array_key_exists('emailid', $formErrors)) {
                     $formErrors['emailid'] = "Email already exist";
                 }
             }
         }
         if (count($formErrors) == 0) {
             if ($this->getRequest()->isPost()) {
                 $activationCode = CommonFunctions::generateGUID();
                 $add_time = date('Y-m-d H:i:s');
                 //$formData['password']=CommonFunctions::getRandomNumberPassword(8);
                 $enc_password = md5($formData['password']);
                 $formData['parent_publisher_id'] = !empty($this->sessPublisherInfo->id) ? $this->sessPublisherInfo->id : 0;
                 $username_array = explode("@", $formData['emailid']);
                 $formData['username'] = $username_array[0];
                 $authorData = array('user_type' => 'author', 'parent_id' => $formData['parent_publisher_id'], 'username' => $formData['username'], 'emailid' => $formData['emailid'], 'password' => $enc_password, 'first_name' => $formData['first_name'], 'last_name' => $formData['last_name'], 'phone' => $formData['phone'], 'profile_status' => '1', 'updated_date' => date("Y-m-d H:i:s"), 'add_time' => $add_time);
                 $lastId = $this->modelAuthor->insert($authorData);
                 if ($lastId > 0) {
                     $this->_flashMessenger->addMessage('<div class="div-success">Author Added successfully</div>');
                     $this->_redirect('publisher/author/index/tab_ajax/author/');
                 }
             }
         } else {
             $this->view->errorMessage = '<div class="div-error">Please enter required fields to register.</div>';
         }
     } else {
         $formData['user_type'] = "";
         $formData['first_name'] = "";
         $formData['last_name'] = "";
         $formData['emailid'] = "";
         $formData['password'] = "";
     }
     $this->view->formData = $formData;
     $this->view->formErrors = $formErrors;
 }
 /**
  * Validates current session at Registry side
  * 
  * @return json
  */
 public function validate($cltrid = false)
 {
     $json = ApiRequest::GET('/auth', $cltrid ?: ApiRequest::defaultClientTransactionID(), $this->getAuthToken());
     $response = CommonFunctions::fromJSON($json);
     if ($response->code == 1000) {
         $this->_sessionData['expires'] = $response->result['expires'];
     }
     return $json;
 }
 /**
  * get all information from all configured ups and store output in internal array
  */
 public function __construct()
 {
     parent::__construct();
     CommonFunctions::executeProgram('upsc', '-l', $output);
     $ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY);
     foreach ($ups_names as $value) {
         CommonFunctions::executeProgram('upsc', $value, $temp);
         $this->_output[$value] = $temp;
     }
 }
Beispiel #24
0
 /**
  * get all information from all configured ups in config.php and store output in internal array
  */
 public function __construct()
 {
     parent::__construct();
     $upses = preg_split('/,/', PSI_UPS_APCUPSD_LIST, -1, PREG_SPLIT_NO_EMPTY);
     foreach ($upses as $ups) {
         CommonFunctions::executeProgram('apcaccess', 'status ' . trim($ups), $temp);
         if (!empty($temp)) {
             $this->_output[] = $temp;
         }
     }
 }
 /**
  * get svn version info
  *
  * @return  none
  */
 public static function checkForSVN()
 {
     if (file_exists(dirname(__FILE__) . '/.svn/entries')) {
         restore_error_handler();
         $contents = file_get_contents(dirname(__FILE__) . '/.svn/entries');
         set_error_handler('errorHandlerPsi');
         if ($contents && preg_match("/dir\n(.+)/", $contents, $matches)) {
             self::$PSI_VERSION_STRING = self::PSI_VERSION . "-r" . $matches[1];
         }
     }
 }
 public function parseEditData($postArr)
 {
     $tmpArr = null;
     $duplicateArr = array();
     $durationArr = array();
     for ($i = 0; $i < count($postArr['cmbActivity']); $i++) {
         $tmpObj = new TimeEvent();
         $projectId = $postArr['cmbProject'][$i];
         if (!CommonFunctions::isValidId($projectId)) {
             continue;
         }
         $tmpObj->setActivityId($postArr['cmbActivity'][$i]);
         $tmpObj->setProjectId($projectId);
         $txtReportedDate = trim($postArr['txtReportedDate'][$i]);
         $tmpObj->setReportedDate(LocaleUtil::getInstance()->convertToStandardDateFormat($txtReportedDate));
         if (isset($postArr['txtDuration'][$i])) {
             $txtDuration = trim($postArr['txtDuration'][$i]);
             if (!empty($txtDuration) || $txtDuration == 0) {
                 $tmpObj->setDuration($txtDuration * 3600);
             }
         }
         $tmpObj->setDescription(stripslashes($postArr['txtDescription'][$i]));
         if (isset($postArr['txtTimeEventId'][$i])) {
             $tmpObj->setTimeEventId(trim($postArr['txtTimeEventId'][$i]));
         }
         $tmpObj->setEmployeeId(trim($postArr['txtEmployeeId']));
         $tmpObj->setTimesheetId(trim($postArr['txtTimesheetId']));
         $tmpArr[] = $tmpObj;
         /* Checking duplicate rows: Begins */
         $row = $postArr['cmbProject'][$i] . '-' . $postArr['cmbActivity'][$i] . '-' . $postArr['txtReportedDate'][$i];
         if (!in_array($row, $duplicateArr) && !$this->detailedDuplicate) {
             $duplicateArr[] = $row;
         } else {
             $this->detailedDuplicate = true;
         }
         /* Checking duplicate rows: Ends */
         /* Checking for invalid durations: Begins */
         if (!$this->detailedInvalidDuration) {
             $key = trim($postArr['txtReportedDate'][$i]);
             $value = (double) $postArr['txtDuration'][$i];
             if (array_key_exists($key, $durationArr)) {
                 if ($durationArr[$key] + $value > 24) {
                     $this->detailedInvalidDuration = true;
                 } else {
                     $durationArr[$key] = $durationArr[$key] + $value;
                 }
             } else {
                 $durationArr[$key] = $value;
             }
         }
         /* Checking for invalid durations: Ends */
     }
     return $tmpArr;
 }
 /**
  * read the MBM5.csv file and fill the private arrays
  */
 public function __construct()
 {
     parent::__construct();
     $delim = "/;/";
     CommonFunctions::rfts(APP_ROOT . "/data/MBM5.csv", $buffer);
     if (strpos($buffer, ";") === false) {
         $delim = "/,/";
     }
     $buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
     $this->_buf_label = preg_split($delim, substr($buffer[0], 0, -2), -1, PREG_SPLIT_NO_EMPTY);
     $this->_buf_value = preg_split($delim, substr($buffer[1], 0, -2), -1, PREG_SPLIT_NO_EMPTY);
 }
 function __construct()
 {
     // are we called via xmlrpc?
     if (!is_object($GLOBALS['server']) || !$GLOBALS['server']->last_method) {
         die('not called via xmlrpc');
     } else {
         global $configEtude;
         CommonFunctions::__construct($configEtude, null);
         //Instance controler
         $this->m_ctrl = new instanciation();
     }
 }
 public function __construct()
 {
     global $configEtude;
     //Controler for instanciation
     $this->m_ctrl = new instanciation();
     CommonFunctions::__construct($configEtude, $this->m_ctrl);
     //Blocking access if maintenance
     if (file_exists(EGW_SERVER_ROOT . "/" . $GLOBALS['egw_info']['flags']['currentapp'] . "/maintenance.true") && !$GLOBALS['egw_info']['user']['apps']['admin']) {
         session_destroy();
         die("MAINTENANCE");
     }
 }
Beispiel #30
-1
 private function _current()
 {
     $current = null;
     if (CommonFunctions::rfts('/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/current_now', $current, 0, 4096, false) && !is_null($current) && trim($current) != "") {
         // Banana Pi
         $dev = new SensorDevice();
         $dev->setName("Current 1");
         $dev->setValue($current / 1000000);
         $this->mbinfo->setMbCurrent($dev);
     }
 }