include_once('ressources/class.ini.inc'); include_once('ressources/class.cyrus.inc'); $users=new usersMenus(); if(!$users->AsPostfixAdministrator){ $tpl=new templates(); $error=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}"); echo "alert('$error')"; die(); } if(isset($_GET["popup"])){popup();exit;} if(isset($_GET["default_directory_size"])){default_directory_size();exit;} if(isset($_GET["current_directory_size"])){current_directory_size();exit;} if(isset($_GET["CyrusMoveToCurrent"])){CyrusMoveToCurrent();exit;} if(isset($_GET["CyrusSaveNewDir"])){CyrusSaveNewDir();exit;} if(isset($_GET["cyruslogs"])){cyruslogs();exit;} js(); function js(){ $tpl=new templates(); $title=$tpl->_ENGINE_parse_body('{cyrus_change_folder}'); $page=CurrentPageName(); $html=" var cyrus_change_folder_tant=0; function cyrus_change_folder_schedule(){ if(!YahooWinOpen()){return;} cyrus_change_folder_tant =cyrus_change_folder_tant+1; if (cyrus_change_folder_tant < 10 ) {
exit; } if (isset($_GET["default_directory_size"])) { default_directory_size(); exit; } if (isset($_GET["current_directory_size"])) { current_directory_size(); exit; } if (isset($_GET["CyrusMoveToCurrent"])) { CyrusMoveToCurrent(); exit; } if (isset($_GET["CyrusSaveNewDir"])) { CyrusSaveNewDir(); exit; } if (isset($_GET["cyruslogs"])) { cyruslogs(); exit; } js(); function js() { $tpl = new templates(); $title = $tpl->_ENGINE_parse_body('{cyrus_change_folder}'); $page = CurrentPageName(); $html = "\nvar cyrus_change_folder_tant=0;\n\nfunction cyrus_change_folder_schedule(){\n\tif(!YahooWinOpen()){return;}\n\tcyrus_change_folder_tant =cyrus_change_folder_tant+1;\n\tif (cyrus_change_folder_tant < 10 ) { \n\t\tsetTimeout(\"cyrus_change_folder_schedule()\",2000);\n } else {\n\t\tcyrus_change_folder_tant= 0;\n\t\tChargeCyrusPartitionDefaultSize();\n\t\tcyrus_change_folder_schedule();\n\t\t \n }\n}\n\n\n\nfunction cyrus_change_folder_load(){\n\tYahooWin('630','{$page}?popup=yes','{$title}');\n}\n\t\nvar x_current_directory_size=function (obj) {\n\ttempvalue=obj.responseText;\n\tdocument.getElementById('current_directory_id').innerHTML=tempvalue;\n\tcyruslogsCheck();\n }\n\nvar x_cyruslogsCheck=function (obj) {\n\ttempvalue=obj.responseText;\n\tdocument.getElementById('cyruslogs').innerHTML=tempvalue;\n }\t \n\t\nvar x_default_directory_size=function (obj) {\n\ttempvalue=obj.responseText;\n\tdocument.getElementById('default_directory_id').innerHTML=tempvalue;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('current_directory_size','yes');\n\tXHR.sendAndLoad('{$page}', 'GET',x_current_directory_size);\t\n }\t\n\t\nfunction ChargeCyrusPartitionDefaultSize(){\n\tdocument.getElementById('default_directory_id').innerHTML='<img src=\"img/wait.gif\">';\n\tdocument.getElementById('current_directory_id').innerHTML='<img src=\"img/wait.gif\">';\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('default_directory_size','yes');\n\tXHR.sendAndLoad('{$page}', 'GET',x_default_directory_size);\n}\n\nfunction cyruslogsCheck(){\n\tdocument.getElementById('cyruslogs').innerHTML='<img src=\"img/wait.gif\">';\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('cyruslogs','yes');\n\tXHR.sendAndLoad('{$page}', 'GET',x_cyruslogsCheck);\n}\n\nvar x_CyrusMoveToCurrent=function (obj) {\n\ttempvalue=obj.responseText;\n\tif(tempvalue.length>0){alert(tempvalue);}\n }\n\nfunction CyrusMoveToCurrent(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('CyrusMoveToCurrent','yes');\n\tXHR.sendAndLoad('{$page}', 'GET',x_CyrusMoveToCurrent);\t\n}\n\nfunction CyrusSaveNewDir(){\n\tvar newtdir=document.getElementById('newtdir').value;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('CyrusSaveNewDir',newtdir);\n\tXHR.sendAndLoad('{$page}', 'GET',x_CyrusMoveToCurrent);\t\n}\n\t\n\n\ncyrus_change_folder_load();"; echo $html; }