*/ try { require_once dirname(__FILE__) . '/../../core/php/core.inc.php'; include_file('core', 'authentification', 'php'); if (!isConnect('admin')) { throw new Exception(__('401 - Accès non autorisé', __FILE__), -1234); } if (init('action') == 'all') { ajax::success(utils::o2a(update::all(init('filter')))); } if (init('action') == 'checkAllUpdate') { update::checkAllUpdate(); ajax::success(); } if (init('action') == 'update') { log::clear('update'); $update = update::byId(init('id')); if (!is_object($update)) { throw new Exception(__('Aucune correspondance pour l\'ID : ' . init('id'), __FILE__)); } try { if ($update->getType() != 'core') { log::add('update', 'update', __("[START UPDATE]\n", __FILE__)); } $update->doUpdate(); if ($update->getType() != 'core') { log::add('update', 'update', __("[END UPDATE SUCCESS]\n", __FILE__)); } } catch (Exception $e) { if ($update->getType() != 'core') { log::add('update', 'update', $e->getMessage());
public static function update($_mode = '', $_level = -1, $_version = '', $__onlyThisVersion = '') { log::clear('update'); $cmd = 'php ' . dirname(__FILE__) . '/../../install/install.php mode=' . $_mode . ' level=' . $_level . ' version=' . $_version . ' onlyThisVersion=' . $__onlyThisVersion; $cmd .= ' >> ' . log::getPathToLog('update') . ' 2>&1 &'; exec($cmd); }
} $jsonrpc = $jeeNetwork->getJsonRpc(); if (!$jsonrpc->sendRequest('runDeamon', array('plugin' => 'openzwave', 'debug' => init('debug', 0)))) { throw new Exception($jsonrpc->getError(), $jsonrpc->getErrorCode()); } } else { config::save('allowStartDeamon', 1, 'openzwave'); $port = config::byKey('port', 'openzwave', 'none'); if ($port == 'none') { ajax::success(); } openzwave::stopDeamon(); if (openzwave::deamonRunning()) { throw new Exception(__('Impossible d\'arrêter le démon', __FILE__)); } log::clear('openzwave'); openzwave::runDeamon(init('debug', 0)); } ajax::success(); } if (init('action') == 'rewriteNginxAndRestartCron') { openzwave::removeNginxRedirection(); openzwave::listServerZwave(); $cron = cron::byClassAndFunction('openzwave', 'pull'); if (is_object($cron)) { $cron->stop(); } ajax::success(); } if (init('action') == 'syncEqLogicWithOpenZwave') { foreach (openzwave::listServerZwave() as $serverID => $server) {
if (init('action') == 'changeIncludeState') { zwave::changeIncludeState(init('mode'), init('state'), init('serverID')); ajax::success(); } if (init('action') == 'showNotification') { ajax::success(zwave::showNotification(init('serverID'))); } if (init('action') == 'updateZwayServer') { zwave::updateZwayServer(init('version')); ajax::success(); } if (init('action') == 'getCommandClassInfo') { ajax::success(zwave::getCommandClassInfo(init('class'))); } if (init('action') == 'launchInDebug') { log::clear('zwavecmd'); zwave::restartZwayServer(true); ajax::success(); } if (init('action') == 'restartZwayServer') { zwave::restartZwayServer(); ajax::success(); } if (init('action') == 'restartDeamon') { $cron = cron::byClassAndFunction('zwave', 'pull'); if (is_object($cron)) { $cron->stop(); } ajax::success(); } if (init('action') == 'autoDetectModule') {
public static function updateSystem() { log::clear('update'); $cmd = 'sudo chown wwww-data:www-data ' . dirname(__FILE__) . '/../../install/update_system.sh;'; $cmd .= 'sudo chmod +x ' . dirname(__FILE__) . '/../../install/update_system.sh;'; $cmd .= 'sudo ' . dirname(__FILE__) . '/../../install/update_system.sh'; $cmd .= ' >> ' . log::getPathToLog('update') . ' 2>&1 &'; exec($cmd); }
jeedom::restore($uploadfile, true); $jsonrpc->makeSuccess('ok'); } if ($jsonrpc->getMethod() == 'jeeNetwork::backup') { jeedom::backup(true); $jsonrpc->makeSuccess('ok'); } /* * ************************Log*************************** */ if ($jsonrpc->getMethod() == 'log::get') { $jsonrpc->makeSuccess(log::get($params['log'], $params['start'], $params['nbLine'])); } if ($jsonrpc->getMethod() == 'log::list') { $jsonrpc->makeSuccess(log::liste()); } if ($jsonrpc->getMethod() == 'log::empty') { $jsonrpc->makeSuccess(log::clear($params['log'])); } if ($jsonrpc->getMethod() == 'log::remove') { $jsonrpc->makeSuccess(log::remove($params['log'])); } /* * ************************Messages*************************** */ if ($jsonrpc->getMethod() == 'message::removeAll') { message::removeAll(); $jsonrpc->makeSuccess('ok'); } if ($jsonrpc->getMethod() == 'message::all') { $jsonrpc->makeSuccess(utils::o2a(message::all())); } /* * ************************Interact*************************** */ if ($jsonrpc->getMethod() == 'interact::tryToReply') { $jsonrpc->makeSuccess(interactQuery::tryToReply($params['query']));
* Jeedom is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jeedom. If not, see <http://www.gnu.org/licenses/>. */ try { require_once dirname(__FILE__) . '/../../core/php/core.inc.php'; include_file('core', 'authentification', 'php'); if (!isConnect('admin')) { throw new Exception(__('401 - Accès non autorisé', __FILE__)); } if (init('action') == 'clear') { log::clear(init('logfile')); ajax::success(); } if (init('action') == 'remove') { log::remove(init('logfile')); ajax::success(); } if (init('action') == 'removeAll') { log::removeAll(); ajax::success(); } if (init('action') == 'get') { if (init('jeeNetwork_id') != '') { $jeeNetwork = jeeNetwork::byId(init('jeeNetwork_id')); if (is_object($jeeNetwork)) { $jeeNetwork->getLog(init('log'), init('start', 0), init('nbLine', 99999));