Changeset 6714
- Timestamp:
- Jan 29, 2018, 12:25:07 PM (3 years ago)
- Location:
- lmd/trunk/fuentes/admin-center-ltsp.install
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lmd/trunk/fuentes/admin-center-ltsp.install/adminroot/uploadiso.php
r6699 r6714 1 1 <?php 2 include('./n4d_lib.php'); 2 3 class UploadManager{ 3 4 const ISOSPATH = "/opt/ltsp/isos/"; … … 8 9 private $FILES; 9 10 10 function __construct($FILESTOUPLOAD ){11 function __construct($FILESTOUPLOAD,$POST){ 11 12 $this->file_info = pathinfo($FILESTOUPLOAD[self::FORMISONAME]['name']); 12 13 $this->original_name = $this->file_info['filename']; 13 14 $this->ext = $this->file_info['extension']; 14 15 $this->FILES = $FILESTOUPLOAD; 16 $this->user = $POST['user']; 17 $this->password = $POST['password']; 15 18 } 16 19 … … 27 30 } 28 31 public function save_file(){ 32 33 $cliente = new N4D('localhost'); 34 try{ 35 $result = $cliente->execute('validate_user',[$this->user,$this->password]); 36 $groups = array('adm','admin','teachers'); 37 if(!($result[0] && count(array_intersect($result[1],$groups)) >= 1)){ 38 return array("result"=>"False","msg"=>""); 39 } 40 } 41 catch (Exception $e){ 42 return array("result"=>"False","msg"=>$e); 43 } 44 29 45 $target = $this->get_valid_name(); 30 46 $result = ["target"=>$target,"result"=>False]; … … 35 51 } 36 52 } 37 $uploadManager = new UploadManager($_FILES );53 $uploadManager = new UploadManager($_FILES,$_POST); 38 54 $result = $uploadManager->save_file(); 39 55 -
lmd/trunk/fuentes/admin-center-ltsp.install/modul/lliurex-ltsp/src/js/imageManager.js
r6691 r6714 1396 1396 var upload_form = new FormData(); 1397 1397 upload_form.append('isofile',iso_file.files[0]); 1398 upload_form.append('user',sessionStorage.username); 1399 upload_form.append('password',sessionStorage.password); 1398 1400 var req = new XMLHttpRequest(); 1399 1401 var timer;
Note: See TracChangeset
for help on using the changeset viewer.