diff --git a/core/ajax/cmd.ajax.php b/core/ajax/cmd.ajax.php index 7a1b94ff83..dc9c003878 100644 --- a/core/ajax/cmd.ajax.php +++ b/core/ajax/cmd.ajax.php @@ -69,7 +69,7 @@ foreach ($cmds as $id) { $cmd = cmd::byId($id); if (!is_object($cmd)) { - throw new Exception(__('Commande inconnue. Vérifiez l\'ID', __FILE__) . ' ' . $id); + throw new Exception(__('Cmd inconnu. Vérifiez l\'ID', __FILE__) . ' ' . $id); } $cmd->setIsVisible(init('isVisible')); $cmd->save(true); @@ -80,7 +80,7 @@ if (init('action') == 'execCmd') { $cmd = cmd::byId(init('id')); if (!is_object($cmd)) { - throw new Exception(__('ID de commande inconnu :', __FILE__) . ' ' . init('id')); + throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id')); } $eqLogic = $cmd->getEqLogic(); if ($cmd->getType() == 'action' && !$eqLogic->hasRight('x')) { @@ -105,7 +105,7 @@ if (init('action') == 'getByObjectNameEqNameCmdName') { $cmd = cmd::byObjectNameEqLogicNameCmdName(init('object_name'), init('eqLogic_name'), init('cmd_name')); if (!is_object($cmd)) { - throw new Exception(__('Commande inconnue :', __FILE__) . ' ' . init('object_name') . '/' . init('eqLogic_name') . '/' . init('cmd_name')); + throw new Exception(__('Cmd inconnu :', __FILE__) . ' ' . init('object_name') . '/' . init('eqLogic_name') . '/' . init('cmd_name')); } ajax::success($cmd->getId()); } @@ -113,7 +113,7 @@ if (init('action') == 'getByObjectNameCmdName') { $cmd = cmd::byObjectNameCmdName(init('object_name'), init('cmd_name')); if (!is_object($cmd)) { - throw new Exception(__('Commande inconnue :', __FILE__) . ' ' . init('object_name') . '/' . init('cmd_name'), 9999); + throw new Exception(__('Cmd inconnu :', __FILE__) . ' ' . init('object_name') . '/' . init('cmd_name'), 9999); } ajax::success(utils::o2a($cmd)); } @@ -405,7 +405,7 @@ if (is_numeric(init('id'))) { $cmd = cmd::byId(init('id')); if (!is_object($cmd)) { - throw new Exception(__('ID de commande inconnu :', __FILE__) . ' ' . init('id')); + throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id')); } $usage = $cmd->getCache('usage::history', 0); $cmd->setCache('usage::history', $usage + 1); @@ -494,15 +494,16 @@ ajax::success($return); } - if (init('action') == 'getLastHistory') { - $cmd = cmd::byId(init('id')); - $_time = date('Y-m-d H:i:s', strtotime(init('time'))); - if(is_object($cmd)){ - ajax::success($cmd->getLastHistory($_time)); - } else { - throw new Exception(__('Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens', __FILE__) . ' ' . init('id')); - } - } + if (init('action') == 'getLastHistory') { + $cmd = cmd::byId(init('id')); + $_time = date('Y-m-d H:i:s', strtotime(init('time'))); + if(is_object($cmd)){ + ajax::success($cmd->getLastHistory($_time)); + } + else{ + throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id')); + } + } if (init('action') == 'emptyHistory') { if (!isConnect('admin')) { @@ -511,7 +512,7 @@ unautorizedInDemo(); $cmd = cmd::byId(init('id')); if (!is_object($cmd)) { - throw new Exception(__('Nombre maximum de niveaux d’éléments affichés dans les graphiques de liens', __FILE__) . ' ' . init('id')); + throw new Exception(__('Commande ID inconnu :', __FILE__) . ' ' . init('id')); } $cmd->emptyHistory(init('date')); ajax::success(); diff --git a/core/api/jeeApi.php b/core/api/jeeApi.php index a7bb165c0d..d304bad2f0 100644 --- a/core/api/jeeApi.php +++ b/core/api/jeeApi.php @@ -65,10 +65,10 @@ } if(config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), init('type'))){ - throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp()); + throw new Exception(__('Cette demande n\'est autorisée', __FILE__) . ' ' . getClientIp()); } if(config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), init('type'))){ - throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp()); + throw new Exception(__('Cette demande n\'est autorisée', __FILE__) . ' ' . getClientIp()); } $type = init('type'); log::add('api', 'debug', __('Demande sur l\'api http venant de :', __FILE__) . ' ' . getClientIp() . ' => ' . json_encode($_GET)); @@ -282,10 +282,10 @@ } if(config::byKey('api::forbidden::method', 'core', '') !== '' && preg_match(config::byKey('api::forbidden::method', 'core', ''), $jsonrpc->getMethod())){ - throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__)); + throw new Exception(__('Cette demande n\'est autorisée', __FILE__)); } if(config::byKey('api::allow::method', 'core', '') !== '' && !preg_match(config::byKey('api::allow::method', 'core', ''), $jsonrpc->getMethod())){ - throw new Exception(__('Cette demande n\'est pas autorisée', __FILE__) . ' ' . getClientIp()); + throw new Exception(__('Cette demande n\'est autorisée', __FILE__) . ' ' . getClientIp()); } $params = $jsonrpc->getParams(); @@ -740,7 +740,7 @@ if ($jsonrpc->getMethod() == 'cmd::byId') { $cmd = cmd::byId($params['id']); if (!is_object($cmd)) { - throw new Exception(__('Commande introuvable :', __FILE__) . ' ' . secureXSS($params['id']), -32701); + throw new Exception(__('Cmd introuvable :', __FILE__) . ' ' . secureXSS($params['id']), -32701); } if (is_object($_USER_GLOBAL) && !$cmd->hasRight($_USER_GLOBAL)) { throw new Exception(__('Vous n\'avez pas les droits sur cette commande', __FILE__), -32701); @@ -910,7 +910,7 @@ } if ($params['state'] == 'run') { $scenario->addTag('trigger','api'); - $scenario->addTag('message',__('Scénario exécuté sur appel API', __FILE__)); + $scenario->addTag('message',__('Scénario exécuté sur appel API', __FILE__)); $jsonrpc->makeSuccess($scenario->launch()); } if ($params['state'] == 'enable') { diff --git a/core/class/ajax.class.php b/core/class/ajax.class.php index ca6e996d61..2c3f82932d 100644 --- a/core/class/ajax.class.php +++ b/core/class/ajax.class.php @@ -29,7 +29,7 @@ public static function init($_allowGetAction = array()) { header('Content-Type: application/json'); } if(isset($_GET['action']) && !in_array($_GET['action'], $_allowGetAction)){ - throw new \Exception(__('Méthode non autorisée en GET : ',__FILE__).$_GET['action']); + throw new \Exception(__('Méthode non autorisé en GET : ',__FILE__).$_GET['action']); } } diff --git a/desktop/php/administration.php b/desktop/php/administration.php index 8df9a9f977..bf65d304bd 100644 --- a/desktop/php/administration.php +++ b/desktop/php/administration.php @@ -879,7 +879,7 @@ $v) { echo '
'; - echo ''; + echo ''; echo '
'; echo ' {{Ajouter}}'; echo '
'; @@ -1167,8 +1167,8 @@
-