home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / email / configuration.php < prev    next >
PHP Script  |  2004-03-08  |  3KB  |  72 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. require("../../Group-Office.php");
  14. require($GO_CONFIG->class_path."imap.class.inc");
  15. require($GO_CONFIG->class_path."email.class.inc");
  16. require($GO_LANGUAGE->get_language_file('email'));
  17. $mail = new imap();
  18. $email = new email();
  19.  
  20. $GO_SECURITY->authenticate();
  21. $GO_MODULES->authenticate('email');
  22.  
  23. $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
  24. $return_to = (isset($_REQUEST['return_to']) && $_REQUEST['return_to'] != '') ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
  25. $link_back = (isset($_REQUEST['link_back']) && $_REQUEST['link_back'] != '') ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
  26.  
  27. if ($task == 'save')
  28. {
  29.     $disable_accounts = isset($_POST['disable_accounts']) ? $_POST['disable_accounts'] : 'false';
  30.     $GO_CONFIG->save_setting('em_disable_accounts', $disable_accounts);
  31.     if ($_POST['close'] == 'true')
  32.     {
  33.         header('Location: '.$return_to);
  34.         exit();
  35.     }
  36. }
  37.  
  38.  
  39. require($GO_THEME->theme_path."header.inc");
  40.  
  41. echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="email_client">';
  42. echo '<input type="hidden" name="task" value="" />';
  43. echo '<input type="hidden" name="close" value="false" />';
  44. echo '<input type="hidden" name="return_to" value="'.$return_to.'" />';
  45. echo '<input type="hidden" name="link_back" value="'.$link_back.'" />';
  46.  
  47. $cfg_tab = new tabtable('configuration', $menu_configuration, '600','300');
  48.  
  49. $cfg_tab->print_head();
  50. $disable_accounts_check = ($GO_CONFIG->get_setting('em_disable_accounts') == 'true') ? true : false;
  51. echo '<br />';
  52. $checkbox = new checkbox('disable_accounts', 'true', $ml_disable_accounts, $disable_accounts_check);
  53. echo '<br /><br />';
  54.  
  55. $button = new button($cmdOk, "javascript:_save('true')");
  56. echo '  ';
  57. $button = new button($cmdApply, "javascript:_save('false')");
  58. echo '  ';
  59. $button = new button($cmdCancel, "javascript:document.location='".$return_to."';");
  60. $cfg_tab->print_foot();
  61. ?>
  62. <script type="text/javascript">
  63. function _save(close)
  64. {
  65.     document.forms[0].close.value=close;
  66.     document.forms[0].task.value='save';
  67.     javascript:document.forms[0].submit();
  68. }
  69. </script>
  70. <?php
  71. require($GO_THEME->theme_path."footer.inc");
  72. ?>