action.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. <?php
  2. /*
  3. @nom: action
  4. @auteur: Idleman (idleman@idleman.fr)
  5. @description: Page de gestion des évenements non liés a une vue particulière (appels ajax, requetes sans resultats etc...)
  6. */
  7. if(!ini_get('safe_mode')) @set_time_limit(0);
  8. require_once("common.php");
  9. ///@TODO: déplacer dans common.php?
  10. $commandLine = 'cli'==php_sapi_name();
  11. if ($commandLine) {
  12. $action = 'commandLine';
  13. } else {
  14. $action = @$_['action'];
  15. }
  16. ///@TODO: pourquoi ne pas refuser l'accès dès le début ?
  17. Plugin::callHook("action_pre_case", array(&$_,$myUser));
  18. //Execution du code en fonction de l'action
  19. switch ($action){
  20. case 'commandLine':
  21. case 'synchronize':
  22. require_once("SimplePie.class.php");
  23. $syncCode = $configurationManager->get('synchronisationCode');
  24. $syncGradCount = $configurationManager->get('syncGradCount');
  25. if ( false==$myUser
  26. && !$commandLine
  27. && !(isset($_['code'])
  28. && $configurationManager->get('synchronisationCode')!=null
  29. && $_['code']==$configurationManager->get('synchronisationCode')
  30. )
  31. ) {
  32. die(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  33. }
  34. Functions::triggerDirectOutput();
  35. if (!$commandLine){
  36. echo '<html>
  37. <head>
  38. <link rel="stylesheet" href="./templates/'.$theme.'/css/style.css">
  39. </head>
  40. <body>
  41. <div class="sync">';
  42. }
  43. $synchronisationType = $configurationManager->get('synchronisationType');
  44. $synchronisationCustom = array();
  45. Plugin::callHook("action_before_synchronisationtype", array(&$synchronisationCustom,&$synchronisationType,&$commandLine,$configurationManager,$start));
  46. if(isset($synchronisationCustom['type'])){
  47. $feeds = $synchronisationCustom['feeds'];
  48. $syncTypeStr = _t('SYNCHRONISATION_TYPE').' : '._t($synchronisationCustom['type']);
  49. }elseif('graduate'==$synchronisationType){
  50. // sélectionne les 10 plus vieux flux
  51. $feeds = $feedManager->loadAll(null,'lastupdate', $syncGradCount);
  52. $syncTypeStr = _t('SYNCHRONISATION_TYPE').' : '._t('GRADUATE_SYNCHRONISATION');
  53. }else{
  54. // sélectionne tous les flux, triés par le nom
  55. $feeds = $feedManager->populate('name');
  56. $syncTypeStr = _t('SYNCHRONISATION_TYPE').' : '._t('FULL_SYNCHRONISATION');
  57. }
  58. if(!isset($synchronisationCustom['no_normal_synchronize'])){
  59. $feedManager->synchronize($feeds, $syncTypeStr, $commandLine, $configurationManager, $start);
  60. }
  61. break;
  62. case 'readAll':
  63. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  64. $whereClause = array();
  65. $whereClause['unread'] = '1';
  66. if(isset($_['feed']))$whereClause['feed'] = $_['feed'];
  67. if(isset($_['last-event-id']))$whereClause['id'] = '<= ' . $_['last-event-id'];
  68. $eventManager->change(array('unread'=>'0'),$whereClause);
  69. if(!Functions::isAjaxCall()){
  70. header('location: ./index.php');
  71. }
  72. break;
  73. case 'readFolder':
  74. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  75. $feeds = $feedManager->loadAllOnlyColumn('id',array('folder'=>$_['folder']));
  76. foreach($feeds as $feed){
  77. $whereClause['feed'] = $feed->getId();
  78. if(isset($_['last-event-id']))$whereClause['id'] = '<= ' . $_['last-event-id'];
  79. $eventManager->change(array('unread'=>'0'),$whereClause);
  80. }
  81. if (!Functions::isAjaxCall()){
  82. header('location: ./index.php');
  83. }
  84. break;
  85. case 'updateConfiguration':
  86. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  87. //Ajout des préférences et réglages
  88. $configurationManager->put('root',(substr($_['root'], strlen($_['root'])-1)=='/'?$_['root']:$_['root'].'/'));
  89. $configurationManager->put('articleDisplayAnonymous',$_['articleDisplayAnonymous']);
  90. $configurationManager->put('articlePerPages',$_['articlePerPages']);
  91. $configurationManager->put('articleDisplayLink',$_['articleDisplayLink']);
  92. $configurationManager->put('articleDisplayDate',$_['articleDisplayDate']);
  93. $configurationManager->put('articleDisplayAuthor',$_['articleDisplayAuthor']);
  94. $configurationManager->put('articleDisplayHomeSort',$_['articleDisplayHomeSort']);
  95. $configurationManager->put('articleDisplayFolderSort',$_['articleDisplayFolderSort']);
  96. $configurationManager->put('articleDisplayMode',$_['articleDisplayMode']);
  97. $configurationManager->put('synchronisationType',$_['synchronisationType']);
  98. $configurationManager->put('synchronisationEnableCache',$_['synchronisationEnableCache']);
  99. $configurationManager->put('synchronisationForceFeed',$_['synchronisationForceFeed']);
  100. $configurationManager->put('feedMaxEvents',$_['feedMaxEvents']);
  101. $configurationManager->put('language',$_['ChgLanguage']);
  102. $configurationManager->put('theme',$_['ChgTheme']);
  103. $configurationManager->put('otpEnabled',$_['otpEnabled']);
  104. if(trim($_['password'])!='') {
  105. $salt = User::generateSalt();
  106. $userManager->change(array('password'=>User::encrypt($_['password'], $salt)),array('id'=>$myUser->getId()));
  107. /* /!\ En multi-utilisateur, il faudra changer l'information au
  108. niveau du compte lui-même et non au niveau du déploiement comme
  109. ici. C'est ainsi parce que c'est plus efficace de stocker le sel
  110. dans la config que dans le fichier de constantes, difficile à
  111. modifier. */
  112. $oldSalt = $configurationManager->get('cryptographicSalt');
  113. if (empty($oldSalt))
  114. /* Pendant la migration à ce système, les déploiements
  115. ne posséderont pas cette donnée. */
  116. $configurationManager->add('cryptographicSalt', $salt);
  117. else
  118. $configurationManager->change(array('value'=>$salt), array('key'=>'cryptographicSalt'));
  119. }
  120. # Modifications dans la base de données, la portée courante et la sesssion
  121. # @TODO: gérer cela de façon centralisée
  122. $otpSecret = $_['otpSecret'];
  123. if ($myUser->isOtpSecretValid($otpSecret)) {
  124. $userManager->change(array('login'=>$_['login'], 'otpSecret'=>$otpSecret),array('id'=>$myUser->getId()));
  125. $myUser->setLogin($_['login']);
  126. $myUser->setOtpSecret($otpSecret);
  127. $_SESSION['currentUser'] = serialize($myUser);
  128. }
  129. header('location: ./settings.php#preferenceBloc');
  130. break;
  131. case 'purge':
  132. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  133. $eventManager->truncate();
  134. header('location: ./settings.php');
  135. break;
  136. case 'exportFeed':
  137. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  138. /*********************/
  139. /** Export **/
  140. /*********************/
  141. if(isset($_POST['exportButton'])){
  142. $opml = new Opml();
  143. $xmlStream = $opml->export();
  144. header('Content-Description: File Transfer');
  145. header('Content-Type: application/octet-stream');
  146. header('Content-Disposition: attachment; filename=leed-'.date('d-m-Y').'.opml');
  147. header('Content-Transfer-Encoding: binary');
  148. header('Expires: 0');
  149. header('Cache-Control: must-revalidate');
  150. header('Pragma: public');
  151. header('Content-Length: ' . strlen($xmlStream));
  152. /*
  153. //A decommenter dans le cas ou on a des pb avec ie
  154. if(preg_match('/msie|(microsoft internet explorer)/i', $_SERVER['HTTP_USER_AGENT'])){
  155. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  156. header('Pragma: public');
  157. }else{
  158. header('Pragma: no-cache');
  159. }
  160. */
  161. ob_clean();
  162. flush();
  163. echo $xmlStream;
  164. }
  165. break;
  166. case 'importForm':
  167. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  168. echo '<html style="height:auto;"><link rel="stylesheet" href="templates/'.$theme.'/css/style.css">
  169. <body style="height:auto;">
  170. <form action="action.php?action=importFeed" method="POST" enctype="multipart/form-data">
  171. <p>'._t('OPML_FILE').' : <input name="newImport" type="file"/> <button name="importButton">'._t('IMPORT').'</button></p>
  172. <p>'._t('IMPORT_COFFEE_TIME').'</p>
  173. </form>
  174. </body>
  175. </html>
  176. ';
  177. break;
  178. case 'synchronizeForm':
  179. if(isset($myUser) && $myUser!=false){
  180. echo '<link rel="stylesheet" href="templates/'.$theme.'/css/style.css">
  181. <a class="button" href="action.php?action=synchronize">'._t('SYNCHRONIZE_NOW').'</a>
  182. <p>'._t('SYNCHRONIZE_COFFEE_TIME').'</p>
  183. ';
  184. }else{
  185. echo _t('YOU_MUST_BE_CONNECTED_ACTION');
  186. }
  187. break;
  188. case 'changeFolderState':
  189. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  190. $folderManager->change(array('isopen'=>$_['isopen']),array('id'=>$_['id']));
  191. break;
  192. case 'importFeed':
  193. // On ne devrait pas mettre de style ici.
  194. echo "<html>
  195. <style>
  196. a {
  197. color:#F16529;
  198. }
  199. html,body{
  200. font-family:Verdana;
  201. font-size: 11px;
  202. }
  203. .error{
  204. background-color:#C94141;
  205. color:#ffffff;
  206. padding:5px;
  207. border-radius:5px;
  208. margin:10px 0px 10px 0px;
  209. box-shadow: 0 0 3px 0 #810000;
  210. }
  211. .error a{
  212. color:#ffffff;
  213. }
  214. </style>
  215. </style><body>
  216. \n";
  217. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  218. if(!isset($_POST['importButton'])) break;
  219. $opml = new Opml();
  220. echo "<h3>"._t('IMPORT')."</h3><p>"._t('PENDING')."</p>\n";
  221. try {
  222. $errorOutput = $opml->import($_FILES['newImport']['tmp_name']);
  223. } catch (Exception $e) {
  224. $errorOutput = array($e->getMessage());
  225. }
  226. if (empty($errorOutput)) {
  227. echo "<p>"._t('IMPORT_NO_PROBLEM')."</p>\n";
  228. } else {
  229. echo "<div class='error'>"._t('IMPORT_ERROR')."\n";
  230. foreach($errorOutput as $line) {
  231. echo "<p>$line</p>\n";
  232. }
  233. echo "</div>";
  234. }
  235. if (!empty($opml->alreadyKnowns)) {
  236. echo "<h3>"._t('IMPORT_FEED_ALREADY_KNOWN')." : </h3>\n<ul>\n";
  237. foreach($opml->alreadyKnowns as $alreadyKnown) {
  238. foreach($alreadyKnown as &$elt) $elt = htmlspecialchars($elt);
  239. $text = Functions::truncate($alreadyKnown->feedName, 60);
  240. echo "<li><a target='_parent' href='{$alreadyKnown->xmlUrl}'>"
  241. ."{$text}</a></li>\n";
  242. }
  243. echo "</ul>\n";
  244. }
  245. $syncLink = "action.php?action=synchronize&format=html";
  246. echo "<p>";
  247. echo "<a href='$syncLink' style='text-decoration:none;font-size:3em'>"
  248. ."↺</a>";
  249. echo "<a href='$syncLink'>"._t('CLIC_HERE_SYNC_IMPORT')."</a>";
  250. echo "<p></body></html>\n";
  251. break;
  252. case 'addFeed':
  253. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  254. require_once("SimplePie.class.php");
  255. if(!isset($_['newUrl'])) break;
  256. $newFeed = new Feed();
  257. $newFeed->setUrl(Functions::clean_url($_['newUrl']));
  258. if ($newFeed->notRegistered()) {
  259. $newFeed->getInfos();
  260. $newFeed->setFolder(
  261. (isset($_['newUrlCategory'])?$_['newUrlCategory']:1)
  262. );
  263. $newFeed->save();
  264. $enableCache = ($configurationManager->get('synchronisationEnableCache')=='')?0:$configurationManager->get('synchronisationEnableCache');
  265. $forceFeed = ($configurationManager->get('synchronisationForceFeed')=='')?0:$configurationManager->get('synchronisationForceFeed');
  266. $newFeed->parse(time(), $_, $enableCache, $forceFeed);
  267. Plugin::callHook("action_after_addFeed", array(&$newFeed));
  268. } else {
  269. $logger = new Logger('settings');
  270. $logger->appendLogs(_t("FEED_ALREADY_STORED"));
  271. $logger->save();
  272. }
  273. header('location: ./settings.php#manageBloc');
  274. break;
  275. case 'changeFeedFolder':
  276. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  277. if(isset($_['feed'])){
  278. $feedManager->change(array('folder'=>$_['folder']),array('id'=>$_['feed']));
  279. }
  280. header('location: ./settings.php');
  281. break;
  282. case 'removeFeed':
  283. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  284. if(isset($_GET['id'])){
  285. $feedManager->delete(array('id'=>$_['id']));
  286. $eventManager->delete(array('feed'=>$_['id']));
  287. Plugin::callHook("action_after_removeFeed", array($_['id']));
  288. }
  289. header('location: ./settings.php');
  290. break;
  291. case 'addFolder':
  292. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  293. if(isset($_['newFolder'])){
  294. $folder = new Folder();
  295. if($folder->rowCount(array('name'=>$_['newFolder']))==0){
  296. $folder->setParent(-1);
  297. $folder->setIsopen(0);
  298. $folder->setName($_['newFolder']);
  299. $folder->save();
  300. }
  301. }
  302. header('location: ./settings.php');
  303. break;
  304. case 'renameFolder':
  305. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  306. if(isset($_['id'])){
  307. $folderManager->change(array('name'=>$_['name']),array('id'=>$_['id']));
  308. }
  309. break;
  310. case 'renameFeed':
  311. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  312. if(isset($_['id'])){
  313. $feedManager->change(array('name'=>$_['name'],'url'=>Functions::clean_url($_['url'])),array('id'=>$_['id']));
  314. }
  315. break;
  316. case 'removeFolder':
  317. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  318. if(isset($_['id']) && is_numeric($_['id']) && $_['id']>0){
  319. $eventManager->customExecute('DELETE FROM `'.MYSQL_PREFIX.'event` WHERE `'.MYSQL_PREFIX.'event`.`feed` in (SELECT `'.MYSQL_PREFIX.'feed`.`id` FROM `'.MYSQL_PREFIX.'feed` WHERE `'.MYSQL_PREFIX.'feed`.`folder` =\''.intval($_['id']).'\') ;');
  320. $feedManager->delete(array('folder'=>$_['id']));
  321. $folderManager->delete(array('id'=>$_['id']));
  322. }
  323. header('location: ./settings.php');
  324. break;
  325. case 'readContent':
  326. if($myUser==false) {
  327. $response_array['status'] = 'noconnect';
  328. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  329. header('Content-type: application/json');
  330. echo json_encode($response_array);
  331. exit();
  332. }
  333. if(isset($_['id'])){
  334. $event = $eventManager->load(array('id'=>$_['id']));
  335. $eventManager->change(array('unread'=>'0'),array('id'=>$_['id']));
  336. }
  337. break;
  338. case 'unreadContent':
  339. if($myUser==false) {
  340. $response_array['status'] = 'noconnect';
  341. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  342. header('Content-type: application/json');
  343. echo json_encode($response_array);
  344. exit();
  345. }
  346. if(isset($_['id'])){
  347. $event = $eventManager->load(array('id'=>$_['id']));
  348. $eventManager->change(array('unread'=>'1'),array('id'=>$_['id']));
  349. }
  350. break;
  351. case 'addFavorite':
  352. if($myUser==false) {
  353. $response_array['status'] = 'noconnect';
  354. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  355. header('Content-type: application/json');
  356. echo json_encode($response_array);
  357. exit();
  358. }
  359. $eventManager->change(array('favorite'=>'1'),array('id'=>$_['id']));
  360. break;
  361. case 'removeFavorite':
  362. if($myUser==false) {
  363. $response_array['status'] = 'noconnect';
  364. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  365. header('Content-type: application/json');
  366. echo json_encode($response_array);
  367. exit();
  368. }
  369. $eventManager->change(array('favorite'=>'0'),array('id'=>$_['id']));
  370. break;
  371. case 'login':
  372. define('RESET_PASSWORD_FILE', 'resetPassword');
  373. if (file_exists(RESET_PASSWORD_FILE)) {
  374. /* Pour réinitialiser le mot de passe :
  375. * créer le fichier RESET_PASSWORD_FILE vide.
  376. * Le nouveau mot de passe sera celui fourni à la connexion.
  377. */
  378. @unlink(RESET_PASSWORD_FILE);
  379. if (file_exists(RESET_PASSWORD_FILE)) {
  380. $message = 'Unable to remove "'.RESET_PASSWORD_FILE.'"!';
  381. /* Pas supprimable ==> on ne remet pas à zéro */
  382. } else {
  383. $resetPassword = $_['password'];
  384. assert('!empty($resetPassword)');
  385. $tmpUser = User::get($_['login']);
  386. if (false===$tmpUser) {
  387. $message = "Unknown user '{$_['login']}'! No password reset.";
  388. } else {
  389. $tmpUser->resetPassword($resetPassword, $configurationManager->get('cryptographicSalt'));
  390. $message = "User '{$_['login']}' (id={$tmpUser->getId()}) Password reset to '$resetPassword'.";
  391. }
  392. }
  393. error_log($message);
  394. }
  395. if(isset($_['usr'])){
  396. $user = User::existAuthToken($_['usr']);
  397. if($user==false){
  398. exit("error"); //@TODO: traduire
  399. }else{
  400. $_SESSION['currentUser'] = serialize($user);
  401. header('location: ./action.php?action=addFeed&newUrl='.$_['newUrl']);
  402. exit();
  403. }
  404. }else{
  405. $salt = $configurationManager->get('cryptographicSalt');
  406. if (empty($salt)) $salt = '';
  407. $user = $userManager->exist($_['login'],$_['password'],$salt,@$_['otp']);
  408. if($user==false){
  409. header('location: ./index.php?action=wrongLogin');
  410. }else{
  411. $_SESSION['currentUser'] = serialize($user);
  412. if (isset($_['rememberMe'])) $user->setStayConnected();
  413. header('location: ./index.php');
  414. }
  415. exit();
  416. }
  417. break;
  418. case 'changePluginState':
  419. if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
  420. if($_['state']=='0'){
  421. Plugin::enabled($_['plugin']);
  422. }else{
  423. Plugin::disabled($_['plugin']);
  424. }
  425. header('location: ./settings.php#pluginBloc');
  426. break;
  427. case 'logout':
  428. User::delStayConnected();
  429. $_SESSION = array();
  430. session_unset();
  431. session_destroy();
  432. header('location: ./index.php');
  433. break;
  434. case 'displayOnlyUnreadFeedFolder':
  435. if($myUser==false) {
  436. $response_array['status'] = 'noconnect';
  437. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  438. header('Content-type: application/json');
  439. echo json_encode($response_array);
  440. exit();
  441. }
  442. $configurationManager->put('displayOnlyUnreadFeedFolder',$_['displayOnlyUnreadFeedFolder']);
  443. break;
  444. case 'displayFeedIsVerbose':
  445. if($myUser==false) {
  446. $response_array['status'] = 'noconnect';
  447. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  448. header('Content-type: application/json');
  449. echo json_encode($response_array);
  450. exit();
  451. }
  452. // changement du statut isverbose du feed
  453. $feed = new Feed();
  454. $feed = $feed->getById($_['idFeed']);
  455. $feed->setIsverbose(($_['displayFeedIsVerbose']=="0"?1:0));
  456. $feed->save();
  457. break;
  458. case 'optionFeedIsVerbose':
  459. if($myUser==false) {
  460. $response_array['status'] = 'noconnect';
  461. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  462. header('Content-type: application/json');
  463. echo json_encode($response_array);
  464. exit();
  465. }
  466. // changement du statut de l'option
  467. $configurationManager = new Configuration();
  468. $conf = $configurationManager->getAll();
  469. $configurationManager->put('optionFeedIsVerbose',($_['optionFeedIsVerbose']=="0"?0:1));
  470. break;
  471. case 'articleDisplayMode':
  472. if($myUser==false) {
  473. $response_array['status'] = 'noconnect';
  474. $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
  475. header('Content-type: application/json');
  476. echo json_encode($response_array);
  477. exit();
  478. }
  479. // chargement du content de l'article souhaité
  480. $newEvent = new Event();
  481. $event = $newEvent->getById($_['event_id']);
  482. if ($_['articleDisplayMode']=='content'){
  483. //error_log(print_r($_SESSION['events'],true));
  484. $content = $event->getContent();
  485. } else {
  486. $content = $event->getDescription();
  487. }
  488. echo $content;
  489. break;
  490. default:
  491. require_once("SimplePie.class.php");
  492. Plugin::callHook("action_post_case", array(&$_,$myUser));
  493. //exit('0');
  494. break;
  495. //Installation d'un nouveau plugin
  496. case 'installPlugin':
  497. Plugin::install($_['zip']);
  498. break;
  499. case 'getGithubMarket':
  500. $plugin = new Plugin();
  501. $plugin->getGithubMarketRepos();
  502. break;
  503. }
  504. ?>