Beispiel #1
0
 static function multiUpload($files, $destination = null, $name = null)
 {
     $result = array();
     if (self::isMultiFile($files)) {
         $arrayFiles = self::normalizeArray($files);
         $i = 0;
         foreach ($arrayFiles as $value) {
             $tmp = new UploadFile($value);
             if ($destination !== null) {
                 $tmp->setDestination($destination);
             }
             if ($name !== null) {
                 $tmp->setName($name);
             }
             $tmp->upload();
             $cod = $tmp->getError();
             $errMsg = $tmp->getError_message();
             $arrayRes = array($cod, $errMsg, $tmp->getDestination(), $tmp->getName() . '.' . $tmp->getExt(), $value['name']);
             array_push($result, $arrayRes);
         }
     } else {
         $tmp = new UploadFile($files);
         if ($destination !== null) {
             $tmp->setDestination($destination);
         }
         if ($name !== null) {
             $tmp->setName($name);
         }
         $tmp->upload();
         $cod = $tmp->getError();
         $errMsg = $tmp->getError_message();
         $arrayRes = array($cod, $errMsg, $tmp->getDestination(), $tmp->getName() . '.' . $tmp->getExt(), $value['name']);
         array_push($result, $arrayRes);
     }
     return $result;
 }
Beispiel #2
0
            $r = $mng->toogleActive(Request::req('pkid'));
        } else {
            $r = "no-tiene-permiso-para-realizar-la-acción";
        }
        break;
    case 'changePass':
        if ($secLevel != 0) {
            $mng->userChangePass();
        } else {
            $r = "no-tiene-permiso-para-realizar-la-acción";
        }
        break;
    case 'uploadImage':
        if ($secLevel != 0) {
            $file = new UploadFile($_FILES['image']);
            $file->setName(Request::req('pkid'));
            $file->setDestination('../img/profiles/');
            $file->upload();
            $r = $file->getError_message();
            Utils::Redirect('./admin.php?op=' . $op . '&r=' . $r);
        } else {
            $r = "no-tiene-permiso-para-realizar-la-acción";
        }
        break;
    case 'reactive':
        $mng->send_activation_mail(Request::req('pkid'));
        break;
    default:
        $r = 'op-error';
}
Utils::Redirect('./admin.php?op=' . $op . '&r=' . $r);