public function getDefaultQuota(Nette\Security\User $user) { $quota = '100G'; if ($user->isInRole('SO') || $user->isInRole('ZSO') || $user->isInRole('VV')) { $quota = '3T'; } $quotaNumeric = ByteHelper::humanToBytes($quota); return $quotaNumeric; }
public function slozkaEditFormSucceeded(Form $form, $values) { $size = ByteHelper::humanToBytes($values->size); if (empty($values->size) || $size == 0) { $size = NULL; } if (empty($values->id)) { $this->sm->createUserFolder($values->name, $size, $values->comment); } else { //$id = $values->id; //$this->uzivatel->find($id)->update($values); //$this->log->l('uzivatel.edit', $id); } $this->flashMessage('Složka byla úspěšně uložena.', 'success'); $this->redirect('Slozky:'); }
public function renderEdit($id) { $f = $this->folder->find($id); if (!$f) { $this->error("Složka s daným ID neexistuje."); } if (ByteHelper::getDegree($f->name) == 1) { $this->error("Základní složku uživatele nelze sdílet."); } $defaults["folder_id"] = $id; $s = $this->share->findOneBy(array('folder_id' => $id, 'shareType_id' => self::shareType_id)); if ($s) { $defaults["id"] = $s->id; $defaults["ips"] = $s->var; $defaults["export"] = true; } $this['nfsEditForm']->setDefaults($defaults); //$this->template->osoba = $u; $this->template->slozka = $f->name; $this->template->nfsurl = "nas.hkfree.org:" . Model\Share::dataBaseUrl . $f->name . "/"; }
public function renderEdit($id) { $f = $this->folder->find($id); if (!$f) { $this->error("Složka s daným ID neexistuje."); } if (ByteHelper::getDegree($f->name) == 1) { $this->error("Základní složku uživatele nelze sdílet."); } $defaults["folder_id"] = $id; $s = $this->share->findOneBy(array('folder_id' => $id, 'shareType_id' => self::shareType_id)); if ($s) { $defaults["id"] = $s->id; $defaults["username"] = $s->var; $defaults["password"] = $s->var2; $defaults["export"] = true; } $this['ftpEditForm']->setDefaults($defaults); $this->template->slozka = $f->name; //$this->template->osoba = $u; $this->template->ftpurl = "ftp://nas.hkfree.org/"; }