コード例 #1
0
ファイル: jeedom.ajax.php プロジェクト: saez0pub/core
     if (filesize($_FILES['file']['tmp_name']) > 100000000) {
         throw new Exception(__('Le fichier est trop gros (maximum 100mo)', __FILE__));
     }
     if (!move_uploaded_file($_FILES['file']['tmp_name'], $uploaddir . '/' . $_FILES['file']['name'])) {
         throw new Exception(__('Impossible de déplacer le fichier temporaire', __FILE__));
     }
     if (!file_exists($uploaddir . '/' . $_FILES['file']['name'])) {
         throw new Exception(__('Impossible d\'uploader le fichier (limite du serveur web ?)', __FILE__));
     }
     ajax::success();
 }
 if (init('action') == 'haltSystem') {
     ajax::success(jeedom::haltSystem());
 }
 if (init('action') == 'rebootSystem') {
     ajax::success(jeedom::rebootSystem());
 }
 if (init('action') == 'forceSyncHour') {
     ajax::success(jeedom::forceSyncHour());
 }
 if (init('action') == 'saveCustom') {
     $path = dirname(__FILE__) . '/../../';
     if (init('version') != 'desktop' && init('version') != 'mobile') {
         throw new Exception(__('La version ne peut etre que desktop ou mobile', __FILE__));
     }
     if (init('type') != 'js' && init('type') != 'css') {
         throw new Exception(__('La version ne peut etre que js ou css', __FILE__));
     }
     $path .= init('version') . '/custom/';
     if (!file_exists($path)) {
         mkdir($path);
コード例 #2
0
ファイル: reboot_end.php プロジェクト: GaelGRIFFON/core
<?php

require_once dirname(__FILE__) . '/../../core/php/core.inc.php';
if (!isConnect('admin')) {
    throw new Exception(__('401 - Accès non autorisé', __FILE__));
}
if ($_GET['shut'] == 1) {
    jeedom::haltSystem();
} else {
    jeedom::rebootSystem();
}