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_reminder =
new ilCheckboxInputGUI($lng->txt(
"enable_disk_quota_reminder_mail"),
"enable_disk_quota_reminder_mail");
381 $cb_prop_reminder->setChecked($this->disk_quota_obj->isDiskQuotaReminderMailEnabled());
382 $cb_prop_reminder->setInfo($lng->txt(
'disk_quota_reminder_mail_desc'));
383 $cb_prop->addSubItem($cb_prop_reminder);
386 $cb_prop_summary=
new ilCheckboxInputGUI($lng->txt(
"enable_disk_quota_summary_mail"),
"enable_disk_quota_summary_mail");
388 $cb_prop_summary->setChecked($this->disk_quota_obj->isDiskQuotaSummaryMailEnabled());
389 $cb_prop_summary->setInfo($lng->txt(
'enable_disk_quota_summary_mail_desc'));
390 $cb_prop->addSubItem($cb_prop_summary);
393 $summary_rcpt =
new ilTextInputGUI($lng->txt(
"disk_quota_summary_rctp"),
"disk_quota_summary_rctp");
394 $summary_rcpt->
setValue($this->disk_quota_obj->getSummaryRecipients());
395 $summary_rcpt->setInfo($lng->txt(
'disk_quota_summary_rctp_desc'));
396 $cb_prop_summary->addSubItem($summary_rcpt);
399 $form->addCommandButton(
'saveDiskQuotaSettings', $lng->txt(
'save'));
400 $form->addCommandButton(
'editDiskQuotaSettings', $lng->txt(
'cancel'));
402 $tpl->setContent($form->getHTML());
412 if (! $rbacsystem->checkAccess(
"write",$this->object->getRefId()))
414 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
417 $this->disk_quota_obj->setDiskQuotaEnabled(
$_POST[
'enable_disk_quota'] ==
'1');
418 $this->disk_quota_obj->setDiskQuotaReminderMailEnabled(
$_POST[
'enable_disk_quota_reminder_mail'] ==
'1');
419 $this->disk_quota_obj->isDiskQuotaSummaryMailEnabled(
$_POST[
'enable_disk_quota_summary_mail'] ==
'1');
421 $this->disk_quota_obj->update();
425 $ilCtrl->redirect($this,
"editDiskQuotaSettings");
436 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
438 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
441 $this->tabs_gui->setTabActive(
'disk_quota');
445 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
452 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.disk_quota_report.html');
455 require_once(
"./Services/WebDAV/classes/class.ilDiskQuotaChecker.php");
457 if ($last_update == null)
460 $this->tpl->setVariable(
'LAST_UPDATE_TEXT',$lng->txt(
'disk_quota_report_not_run_yet'));
465 $this->tpl->setVariable(
'LAST_UPDATE_TEXT',$lng->txt(
'last_update').
': '.
ilFormat::formatDate($last_update,
'datetime',
true));
470 if (
$_SESSION[
'quota_usage_filter'] == 0)
475 if (
$_SESSION[
'quota_access_filter'] == 0)
479 $usage_action[1] = $lng->txt(
'all_users');
480 $usage_action[2] = $lng->txt(
'filter_users_without_disk_usage');
481 $usage_action[3] = $lng->txt(
'filter_users_with_disk_usage');
482 $usage_action[4] = $lng->txt(
'filter_users_with_exceeded_disk_quota');
483 $access_action[1] = $lng->txt(
'all_users');
484 $access_action[2] = $lng->txt(
'filter_users_with_access');
485 $access_action[3] = $lng->txt(
'filter_users_without_access');
490 $this->tpl->setCurrentBlock(
"filter");
491 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$lng->txt(
'filter'));
492 $this->tpl->setVariable(
"SELECT_USAGE_FILTER",$select_usage_filter);
493 $this->tpl->setVariable(
"SELECT_ACCESS_FILTER",$select_access_filter);
494 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getLinkTarget($this,
'viewDiskQuotaReport'));
495 $this->tpl->setVariable(
"FILTER_NAME",
'view');
496 $this->tpl->setVariable(
"FILTER_VALUE",$lng->txt(
'apply_filter'));
497 $this->tpl->parseCurrentBlock();
500 $a_tpl =
new ilTemplate(
'tpl.table.html',
true,
true);
501 $a_tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
504 require_once
'./Services/Table/classes/class.ilTableGUI.php';
508 $header_vars = array(
'login',
'firstname',
'lastname',
'email',
'access_until',
'last_login',
'disk_quota',
'disk_usage',
'last_reminder');
509 $tbl->setHeaderNames(
512 $lng->txt(
'firstname'),
513 $lng->txt(
'lastname'),
515 $lng->txt(
'access_until'),
516 $lng->txt(
'last_login'),
517 $lng->txt(
'disk_quota'),
518 $lng->txt(
'disk_usage'),
519 $lng->txt(
'last_reminder')
524 $this->ctrl->getParameterArray($this,
'viewDiskQuotaReport',
false)
527 $tbl->enable(
"numinfo_header");
528 $tbl->setFormName(
"cmd");
529 $tbl->setSelectAllCheckbox(
"id");
532 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
533 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
539 $header_vars[$tbl->getOrderColumn()], $tbl->getOrderDirection());
542 $tbl->setLimit(
$_GET[
"limit"]);
543 $tbl->setOffset(
$_GET[
"offset"]);
544 $tbl->setMaxCount(count(
$data));
547 $tbl->setFooter(
"tblfooter",$lng->txt(
"previous"),$lng->txt(
"next"));
550 $tbl->setTemplate($a_tpl);
554 for ($i = $tbl->getOffset(); $i < count(
$data) && $i < $tbl->getOffset() + $tbl->getLimit(); $i++)
559 foreach ($header_vars as $key)
565 $this->ctrl->setParameterByClass(
"ilobjusergui",
"ref_id",
"7");
566 $this->ctrl->setParameterByClass(
"ilobjusergui",
"obj_id",
$row[
"usr_id"]);
567 $link = $this->ctrl->getLinkTargetByClass(
"ilobjusergui",
"view");
568 $tbl_content_cell =
'<a href="'.$link.
'">'.htmlspecialchars(
$row[$key]).
'</a>';
571 if (
$row[
'role_id'] == SYSTEM_ROLE_ID)
573 $tbl_content_cell =
"<span class=\"smallgreen\">".$lng->txt(
'access_unlimited').
'</span>';
581 if (
$row[
'last_update'] == null)
583 $tbl_content_cell = $lng->txt(
'unknown');
585 else if (
$row[
'disk_usage'] >
$row[
'disk_quota'])
587 $tbl_content_cell =
"<span class=\"smallred\">".ilFormat::formatSize(
$row[$key],
'short').
'</span>';
594 case 'access_until' :
595 if (!
$row[
'active'])
597 $tbl_content_cell =
"<span class=\"smallred\">".$lng->txt(
'inactive').
'</span>';
599 else if (
$row[
'time_limit_unlimited'])
601 $tbl_content_cell =
"<span class=\"smallgreen\">".$lng->txt(
'access_unlimited').
'</span>';
603 else if (
$row[
'expired'])
605 $tbl_content_cell =
"<span class=\"smallred\">".$lng->txt(
'access_expired').
'</span>';
613 case 'last_reminder' :
614 if (
$row[$key] == null)
616 $tbl_content_cell = $lng->txt(
'no_date');
624 $tbl_content_cell = htmlspecialchars(
$row[$key]);
635 $tbl->tpl->setCurrentBlock(
"tbl_content_cell");
636 $tbl->tpl->setVariable(
"TBL_CONTENT_CELL",$tbl_content_cell);
638 $tbl->tpl->parseCurrentBlock();
641 $tbl->tpl->setCurrentBlock(
"tbl_content_row");
643 $tbl->tpl->setVariable(
"ROWCOLOR", $rowcolor);
644 $tbl->tpl->parseCurrentBlock();
651 $this->tpl->setVariable(
"USER_TABLE",$a_tpl->get());
661 if (! $rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
663 $ilErr->raiseError($lng->txt(
"no_permission"),$ilErr->WARNING);
666 $this->tabs_gui->setTabActive(
'disk_quota');
669 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.disk_quota_reminder_mail.html');
670 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
673 $lng->loadLanguageModule(
"meta");
674 $lng->loadLanguageModule(
"mail");
675 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL", $lng->txt(
"disk_quota_reminder_mail"));
676 $this->tpl->setVariable(
"TXT_NEW_USER_ACCOUNT_MAIL_DESC", $lng->txt(
"disk_quota_reminder_mail_desc"));
679 $this->tpl->setVariable(
"TXT_USE_PLACEHOLDERS", $lng->txt(
"mail_nacc_use_placeholder"));
680 $this->tpl->setVariable(
"TXT_MAIL_SALUTATION", $lng->txt(
"mail_nacc_salutation"));
681 $this->tpl->setVariable(
"TXT_FIRST_NAME", $lng->txt(
"firstname"));
682 $this->tpl->setVariable(
"TXT_LAST_NAME", $lng->txt(
"lastname"));
683 $this->tpl->setVariable(
"TXT_EMAIL", $lng->txt(
"email"));
684 $this->tpl->setVariable(
"TXT_LOGIN", $lng->txt(
"mail_nacc_login"));
685 $this->tpl->setVariable(
"TXT_DISK_QUOTA", $lng->txt(
"disk_quota"));
686 $this->tpl->setVariable(
"TXT_DISK_USAGE", $lng->txt(
"disk_usage"));
687 $this->tpl->setVariable(
"TXT_DISK_USAGE_DETAILS", $lng->txt(
"disk_usage_details"));
688 $this->tpl->setVariable(
"TXT_ADMIN_MAIL", $lng->txt(
"mail_nacc_admin_mail"));
689 $this->tpl->setVariable(
"TXT_ILIAS_URL", $lng->txt(
"mail_nacc_ilias_url"));
690 $this->tpl->setVariable(
"TXT_CLIENT_NAME", $lng->txt(
"mail_nacc_client_name"));
692 $langs = $lng->getInstalledLanguages();
693 foreach($langs as $lang_key)
695 $amail = $this->disk_quota_obj->_lookupReminderMailTemplate($lang_key);
696 $this->tpl->setCurrentBlock(
"mail_block");
698 if ($lang_key == $lng->getDefaultLanguage())
700 $add =
" (".$lng->txt(
"default").
")";
702 $this->tpl->setVariable(
"TXT_LANGUAGE",
703 $lng->txt(
"meta_l_".$lang_key).$add);
704 $this->tpl->setVariable(
"TXT_BODY", $lng->txt(
"message_content"));
705 $this->tpl->setVariable(
"TA_BODY",
"body_".$lang_key);
706 $this->tpl->setVariable(
"VAL_BODY",
708 $this->tpl->setVariable(
"TXT_SUBJECT", $lng->txt(
"subject"));
709 $this->tpl->setVariable(
"INPUT_SUBJECT",
"subject_".$lang_key);
710 $this->tpl->setVariable(
"VAL_SUBJECT",
712 $this->tpl->setVariable(
"TXT_SAL_G", $lng->txt(
"mail_salutation_general"));
713 $this->tpl->setVariable(
"INPUT_SAL_G",
"sal_g_".$lang_key);
714 $this->tpl->setVariable(
"VAL_SAL_G",
716 $this->tpl->setVariable(
"TXT_SAL_M", $lng->txt(
"mail_salutation_male"));
717 $this->tpl->setVariable(
"INPUT_SAL_M",
"sal_m_".$lang_key);
718 $this->tpl->setVariable(
"VAL_SAL_M",
720 $this->tpl->setVariable(
"TXT_SAL_F", $lng->txt(
"mail_salutation_female"));
721 $this->tpl->setVariable(
"INPUT_SAL_F",
"sal_f_".$lang_key);
722 $this->tpl->setVariable(
"VAL_SAL_F",
724 $this->tpl->parseCurrentBlock();
726 $this->tpl->setVariable(
"TXT_CANCEL", $lng->txt(
"cancel"));
727 $this->tpl->setVariable(
"TXT_SAVE", $lng->txt(
"save"));
731 $this->ctrl->redirect($this,
"editDiskQuotaSettings");
739 $langs = $lng->getInstalledLanguages();
740 foreach($langs as $lang_key)
742 $this->disk_quota_obj->_writeReminderMailTemplate($lang_key,
749 $this->ctrl->redirect($this,
"editDiskQuotaMailTemplate");