37 include_once
"classes/class.ilObjectGUI.php";
52 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
53 $this->folderSettings =
new ilSetting(
'fold');
56 require_once
'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
58 $this->disk_quota_obj->read();
70 $next_class = $this->ctrl->getNextClass($this);
71 $cmd = $this->ctrl->getCmd();
75 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
77 $ilias->raiseError($lng->txt(
'no_permission'),$ilias->error_obj->MESSAGE);
82 case 'ilpermissiongui':
83 $this->tabs_gui->setTabActive(
'perm_settings');
84 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
86 $ret =& $this->ctrl->forwardCommand($perm_gui);
92 $cmd =
"editDownloadingSettings";
109 global $rbacsystem, $ilAccess;
111 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
113 $this->tabs_gui->addTarget(
'downloading_settings',
114 $this->ctrl->getLinkTarget($this,
"editDownloadingSettings"),
115 array(
"editDownloadingSettings",
"view"));
117 $this->tabs_gui->addTarget(
'webdav',
118 $this->ctrl->getLinkTarget($this,
"editWebDAVSettings"),
119 array(
"editWebDAVSettings",
"view"));
121 $this->tabs_gui->addTarget(
"disk_quota",
122 $this->ctrl->getLinkTarget($this,
"editDiskQuotaSettings"),
123 array(
"editDiskQuota",
"view"));
125 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
127 $this->tabs_gui->addTarget(
"perm_settings",
128 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
129 array(),
'ilpermissiongui');
138 global $rbacsystem,
$ilErr, $ilTabs;
140 $this->tabs_gui->setTabActive(
'downloading_settings');
142 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
144 $ilErr->raiseError(
$lng->txt(
"no_permission"),$ilErr->WARNING);
149 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
150 require_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
151 require_once(
"./Services/Form/classes/class.ilRadioGroupInputGUI.php");
152 require_once(
"./Services/Form/classes/class.ilRadioOption.php");
153 require_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
156 $form->setFormAction($ilCtrl->getFormAction($this));
157 $form->setTitle($lng->txt(
"settings"));
162 $dl_prop =
new ilCheckboxInputGUI($lng->txt(
"download_with_uploaded_filename"),
"download_with_uploaded_filename");
165 $dl_prop->setChecked($this->object->isDownloadWithUploadedFilename() == 1);
166 $dl_prop->setInfo($lng->txt(
'download_with_uploaded_filename_info'));
167 $form->addItem($dl_prop);
170 $dl_prop =
new ilCheckboxInputGUI($lng->txt(
"enable_download_folder"),
"enable_download_folder");
173 $dl_prop->setChecked($this->folderSettings->get(
"enable_download_folder", 0) == 1);
174 $dl_prop->setInfo($lng->txt(
'enable_download_folder_info'));
175 $form->addItem($dl_prop);
179 $tai_prop =
new ilTextAreaInputGUI($lng->txt(
'inline_file_extensions'),
'inline_file_extensions');
180 $tai_prop->
setValue($this->object->getInlineFileExtensions());
181 $tai_prop->setInfo($lng->txt(
'inline_file_extensions_info'));
182 $tai_prop->setCols(80);
183 $tai_prop->setRows(5);
184 $form->addItem($tai_prop);
188 $form->addCommandButton(
'saveDownloadingSettings', $lng->txt(
'save'));
189 $form->addCommandButton(
'view', $lng->txt(
'cancel'));
191 $tpl->setContent($form->getHTML());
201 if (! $rbacsystem->checkAccess(
"write",$this->object->getRefId()))
203 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
208 $this->
object->update();
210 $this->folderSettings->set(
"enable_download_folder",
$_POST[
"enable_download_folder"] == 1);
213 $ilCtrl->redirect($this,
"editDownloadingSettings");
221 global $rbacsystem,
$ilErr, $ilTabs;
225 $this->tabs_gui->setTabActive(
'webdav');
227 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
229 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
232 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
233 require_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
234 require_once(
"./Services/Form/classes/class.ilRadioGroupInputGUI.php");
235 require_once(
"./Services/Form/classes/class.ilRadioOption.php");
236 require_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
237 require_once(
"./Services/WebDAV/classes/class.ilDAVServer.php");
240 $form->setFormAction($ilCtrl->getFormAction($this));
241 $form->setTitle($lng->txt(
"settings"));
245 $isPearAuthHTTPInstalled = @include_once(
"Auth/HTTP.php");
248 $cb_prop->setChecked($this->object->isWebdavEnabled() && $isPearAuthHTTPInstalled);
249 $cb_prop->setDisabled(! $isPearAuthHTTPInstalled);
250 $cb_prop->setInfo($isPearAuthHTTPInstalled ?
251 sprintf($lng->txt(
'enable_webdav_info'),$ilDAVServer->getMountURI($tree->getRootId(),0,null,null,
true)) :
252 $lng->txt(
'webdav_pear_auth_http_needed')
254 $form->addItem($cb_prop);
257 if ($isPearAuthHTTPInstalled)
259 $rgi_prop =
new ilRadioGroupInputGUI($lng->txt(
'webfolder_instructions'),
'custom_webfolder_instructions_choice');
261 $rgi_prop->addOption(
new ilRadioOption($lng->txt(
'use_customized_instructions'),
'custom'));
262 $rgi_prop->setValue($this->object->isCustomWebfolderInstructionsEnabled() ?
'custom':
'default');
263 $rgi_prop->setDisabled(! $isPearAuthHTTPInstalled);
264 $form->addItem($rgi_prop);
266 $tai_prop->setValue($this->object->getCustomWebfolderInstructions());
267 $tai_prop->setInfo($lng->txt(
"webfolder_instructions_info"));
268 $tai_prop->setCols(80);
269 $tai_prop->setRows(20);
270 $tai_prop->setDisabled(! $isPearAuthHTTPInstalled);
271 $form->addItem($tai_prop);
275 $form->addCommandButton(
'saveWebDAVSettings', $lng->txt(
'save'));
276 $form->addCommandButton(
'view', $lng->txt(
'cancel'));
278 $tpl->setContent($form->getHTML());
288 if (! $rbacsystem->checkAccess(
"write",$this->object->getRefId()))
290 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
293 $this->
object->setWebdavEnabled(
$_POST[
'enable_webdav'] ==
'1');
295 $this->
object->setCustomWebfolderInstructionsEnabled(
$_POST[
'custom_webfolder_instructions_choice']==
'custom');
297 $this->
object->update();
300 $ilCtrl->redirect($this,
"editWebDAVSettings");
309 $this->tpl->setDescription($this->object->getDescription());
321 include_once(
"./Services/COPage/classes/class.ilPageEditorSettings.php");
323 $ilTabs->addSubTabTarget(
"settings",
324 $ilCtrl->getLinkTarget($this,
"editDiskQuotaSettings"),
325 array(
"editDiskQuotaSettings"));
327 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
330 $ilTabs->addSubTabTarget(
"disk_quota_report",
331 $ilCtrl->getLinkTarget($this,
"viewDiskQuotaReport"),
332 array(
"viewDiskQuotaReport"));
335 $ilTabs->addSubTabTarget(
"disk_quota_reminder_mail",
336 $ilCtrl->getLinkTarget($this,
"editDiskQuotaMailTemplate"),
337 array(
"editDiskQuotaMailTemplate"));
339 $ilTabs->setSubTabActive($a_active_subtab);
351 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
353 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
356 $this->tabs_gui->setTabActive(
'disk_quota');
359 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
360 require_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
361 require_once(
"./Services/Form/classes/class.ilRadioGroupInputGUI.php");
362 require_once(
"./Services/Form/classes/class.ilRadioOption.php");
363 require_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
364 require_once(
"./Services/WebDAV/classes/class.ilDAVServer.php");
367 $form->setFormAction($ilCtrl->getFormAction($this));
368 $form->setTitle($lng->txt(
"settings"));
372 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
"enable_disk_quota"),
"enable_disk_quota");
374 $cb_prop->setChecked($this->disk_quota_obj->isDiskQuotaEnabled());
375 $cb_prop->setInfo($lng->txt(
'enable_disk_quota_info'));
376 $form->addItem($cb_prop);
379 $cb_prop =
new ilCheckboxInputGUI($lng->txt(
"enable_disk_quota_reminder_mail"),
"enable_disk_quota_reminder_mail");
381 $cb_prop->setChecked($this->disk_quota_obj->isDiskQuotaReminderMailEnabled());
382 $cb_prop->setInfo($lng->txt(
'disk_quota_reminder_mail_desc'));
383 $form->addItem($cb_prop);
388 $form->addCommandButton(
'saveDiskQuotaSettings', $lng->txt(
'save'));
389 $form->addCommandButton(
'editDiskQuotaSettings', $lng->txt(
'cancel'));
391 $tpl->setContent($form->getHTML());
401 if (! $rbacsystem->checkAccess(
"write",$this->object->getRefId()))
403 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
406 $this->disk_quota_obj->setDiskQuotaEnabled(
$_POST[
'enable_disk_quota'] ==
'1');
407 $this->disk_quota_obj->setDiskQuotaReminderMailEnabled(
$_POST[
'enable_disk_quota_reminder_mail'] ==
'1');
408 $this->disk_quota_obj->update();
412 $ilCtrl->redirect($this,
"editDiskQuotaSettings");
423 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
425 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
428 $this->tabs_gui->setTabActive(
'disk_quota');
432 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
439 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.disk_quota_report.html');
442 require_once(
"./Services/WebDAV/classes/class.ilDiskQuotaChecker.php");
444 if ($last_update == null)
447 $this->tpl->setVariable(
'LAST_UPDATE_TEXT',$lng->txt(
'disk_quota_report_not_run_yet'));
452 $this->tpl->setVariable(
'LAST_UPDATE_TEXT',$lng->txt(
'last_update').
': '.
ilFormat::formatDate($last_update,
'datetime',
true));
457 if (
$_SESSION[
'quota_usage_filter'] == 0)
462 if (
$_SESSION[
'quota_access_filter'] == 0)
466 $usage_action[1] = $lng->txt(
'all_users');
467 $usage_action[2] = $lng->txt(
'filter_users_without_disk_usage');
468 $usage_action[3] = $lng->txt(
'filter_users_with_disk_usage');
469 $usage_action[4] = $lng->txt(
'filter_users_with_exceeded_disk_quota');
470 $access_action[1] = $lng->txt(
'all_users');
471 $access_action[2] = $lng->txt(
'filter_users_with_access');
472 $access_action[3] = $lng->txt(
'filter_users_without_access');
477 $this->tpl->setCurrentBlock(
"filter");
478 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$lng->txt(
'filter'));
479 $this->tpl->setVariable(
"SELECT_USAGE_FILTER",$select_usage_filter);
480 $this->tpl->setVariable(
"SELECT_ACCESS_FILTER",$select_access_filter);
481 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getLinkTarget($this,
'viewDiskQuotaReport'));
482 $this->tpl->setVariable(
"FILTER_NAME",
'view');
483 $this->tpl->setVariable(
"FILTER_VALUE",$lng->txt(
'apply_filter'));
484 $this->tpl->parseCurrentBlock();
487 $a_tpl =
new ilTemplate(
'tpl.table.html',
true,
true);
488 $a_tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
491 require_once
'./Services/Table/classes/class.ilTableGUI.php';
495 $header_vars = array(
'login',
'firstname',
'lastname',
'email',
'access_until',
'last_login',
'disk_quota',
'disk_usage',
'last_reminder');
496 $tbl->setHeaderNames(
499 $lng->txt(
'firstname'),
500 $lng->txt(
'lastname'),
502 $lng->txt(
'access_until'),
503 $lng->txt(
'last_login'),
504 $lng->txt(
'disk_quota'),
505 $lng->txt(
'disk_usage'),
506 $lng->txt(
'last_reminder')
511 $this->ctrl->getParameterArray($this,
'viewDiskQuotaReport',
false)
514 $tbl->enable(
"numinfo_header");
515 $tbl->setFormName(
"cmd");
516 $tbl->setSelectAllCheckbox(
"id");
519 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
520 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
526 $header_vars[$tbl->getOrderColumn()], $tbl->getOrderDirection());
529 $tbl->setLimit(
$_GET[
"limit"]);
530 $tbl->setOffset(
$_GET[
"offset"]);
531 $tbl->setMaxCount(count(
$data));
534 $tbl->setFooter(
"tblfooter",$lng->txt(
"previous"),$lng->txt(
"next"));
537 $tbl->setTemplate($a_tpl);
541 for ($i = $tbl->getOffset(); $i < count(
$data) && $i < $tbl->getOffset() + $tbl->getLimit(); $i++)
546 foreach ($header_vars as
$key)
552 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
553 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$row[
"usr_id"]);
554 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
555 $tbl_content_cell =
'<a href="'.$link.
'">'.htmlspecialchars(
$row[$key]).
'</a>';
558 if (
$row[
'role_id'] == SYSTEM_ROLE_ID)
560 $tbl_content_cell =
"<span class=\"smallgreen\">".$lng->txt(
'access_unlimited').
'</span>';
568 if (
$row[
'last_update'] == null)
570 $tbl_content_cell = $lng->txt(
'unknown');
572 else if (
$row[
'disk_usage'] >
$row[
'disk_quota'])
574 $tbl_content_cell =
"<span class=\"smallred\">".ilFormat::formatSize(
$row[$key],
'short').
'</span>';
581 case 'access_until' :
582 if (!
$row[
'active'])
584 $tbl_content_cell =
"<span class=\"smallred\">".$lng->txt(
'inactive').
'</span>';
586 else if (
$row[
'time_limit_unlimited'])
588 $tbl_content_cell =
"<span class=\"smallgreen\">".$lng->txt(
'access_unlimited').
'</span>';
590 else if (
$row[
'expired'])
592 $tbl_content_cell =
"<span class=\"smallred\">".$lng->txt(
'access_expired').
'</span>';
600 case 'last_reminder' :
601 if (
$row[$key] == null)
603 $tbl_content_cell = $lng->txt(
'no_date');
611 $tbl_content_cell = htmlspecialchars(
$row[$key]);
622 $tbl->tpl->setCurrentBlock(
"tbl_content_cell");
623 $tbl->tpl->setVariable(
"TBL_CONTENT_CELL",$tbl_content_cell);
625 $tbl->tpl->parseCurrentBlock();
628 $tbl->tpl->setCurrentBlock(
"tbl_content_row");
630 $tbl->tpl->setVariable(
"ROWCOLOR", $rowcolor);
631 $tbl->tpl->parseCurrentBlock();
638 $this->tpl->setVariable(
"USER_TABLE",$a_tpl->get());
648 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
650 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
653 $this->tabs_gui->setTabActive(
'disk_quota');
656 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.disk_quota_reminder_mail.html');
657 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
660 $lng->loadLanguageModule(
"meta");
661 $lng->loadLanguageModule(
"mail");
662 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL", $lng->txt(
"disk_quota_reminder_mail"));
663 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL_DESC", $lng->txt(
"disk_quota_reminder_mail_desc"));
666 $this->tpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
667 $this->tpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
668 $this->tpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
669 $this->tpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
670 $this->tpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
671 $this->tpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
672 $this->tpl->setVariable(
"TXT_DISK_QUOTA", $lng->txt(
"disk_quota"));
673 $this->tpl->setVariable(
"TXT_DISK_USAGE", $lng->txt(
"disk_usage"));
674 $this->tpl->setVariable(
"TXT_DISK_USAGE_DETAILS", $lng->txt(
"disk_usage_details"));
675 $this->tpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
676 $this->tpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
677 $this->tpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
679 $langs = $lng->getInstalledLanguages();
680 foreach($langs as $lang_key)
682 $amail = $this->disk_quota_obj->_lookupReminderMailTemplate($lang_key);
683 $this->tpl->setCurrentBlock(
"mail_block");
685 if ($lang_key == $lng->getDefaultLanguage())
687 $add =
" (".$lng->txt(
"default").
")";
689 $this->tpl->setVariable(
"TXT_LANGUAGE",
690 $lng->txt(
"meta_l_".$lang_key).$add);
691 $this->tpl->setVariable(
"TXT_BODY", $lng->txt(
"message_content"));
692 $this->tpl->setVariable(
"TA_BODY",
"body_".$lang_key);
693 $this->tpl->setVariable(
"VAL_BODY",
695 $this->tpl->setVariable(
"TXT_SUBJECT", $lng->txt(
"subject"));
696 $this->tpl->setVariable(
"INPUT_SUBJECT",
"subject_".$lang_key);
697 $this->tpl->setVariable(
"VAL_SUBJECT",
699 $this->tpl->setVariable(
"TXT_SAL_G", $lng->txt(
"mail_salutation_general"));
700 $this->tpl->setVariable(
"INPUT_SAL_G",
"sal_g_".$lang_key);
701 $this->tpl->setVariable(
"VAL_SAL_G",
703 $this->tpl->setVariable(
"TXT_SAL_M", $lng->txt(
"mail_salutation_male"));
704 $this->tpl->setVariable(
"INPUT_SAL_M",
"sal_m_".$lang_key);
705 $this->tpl->setVariable(
"VAL_SAL_M",
707 $this->tpl->setVariable(
"TXT_SAL_F", $lng->txt(
"mail_salutation_female"));
708 $this->tpl->setVariable(
"INPUT_SAL_F",
"sal_f_".$lang_key);
709 $this->tpl->setVariable(
"VAL_SAL_F",
711 $this->tpl->parseCurrentBlock();
713 $this->tpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
714 $this->tpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
718 $this->ctrl->redirect($this,
"editDiskQuotaSettings");
726 $langs = $lng->getInstalledLanguages();
727 foreach($langs as $lang_key)
729 $this->disk_quota_obj->_writeReminderMailTemplate($lang_key,
736 $this->ctrl->redirect($this,
"editDiskQuotaMailTemplate");