- Timestamp:
- Jan 29, 2018, 1:10:45 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lmd/trunk/fuentes/admin-center-ltsp.install/adminroot/uploadiso.php
r6714 r6716 1 1 <?php 2 2 include('./n4d_lib.php'); 3 include("./libphp/cryptojs-aes.php"); 4 3 5 class UploadManager{ 4 6 const ISOSPATH = "/opt/ltsp/isos/"; … … 14 16 $this->ext = $this->file_info['extension']; 15 17 $this->FILES = $FILESTOUPLOAD; 16 $this->user = $ POST['user'];17 $this->password = $ POST['password'];18 $this->user = $this->RSADecrypt($POST['user']); 19 $this->password = $this->RSADecrypt($POST['password']); 18 20 } 19 21 … … 34 36 try{ 35 37 $result = $cliente->execute('validate_user',[$this->user,$this->password]); 36 $groups = array('adm','admin' ,'teachers');38 $groups = array('adm','admin'); 37 39 if(!($result[0] && count(array_intersect($result[1],$groups)) >= 1)){ 38 40 return array("result"=>"False","msg"=>""); … … 50 52 return $result; 51 53 } 54 55 private function RSADecrypt($crypttext){ 56 $priv_key = openssl_pkey_get_private("file:///etc/admin-center/private_key.pem"); 57 openssl_private_decrypt(base64_decode($crypttext), $newsource, $priv_key ); 58 return $newsource; 59 } 52 60 } 53 61 $uploadManager = new UploadManager($_FILES,$_POST);
Note: See TracChangeset
for help on using the changeset viewer.