예제 #1
0
function popup()
{
    $add = Paragraphe('disk-backup-64-add.png', '{CYRUS_ADD_RESOURCES}', '{CYRUS_ADD_RESOURCES_TEXT}', "javascript:Loadjs('automount.php?field=cyrus-ressource');");
    $resources = list_ressource();
    $html = "<H1>{GENERIC_BACKUP}</H1>\n\t<p class=caption>{GENERIC_BACKUP_TEXT}</p>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='top' width=1%>{$add}</td>\n\t\t<td valign='top'>\n\t\t<table style='width:100%' class=table_form>\n\t\t<tr>\n\t\t\t<td valign='middle' class=legend nowrap>{resource}:</td>\n\t\t\t<td>" . Field_text('cyrus-ressource', null, 'width:240px') . "</td>\n\t\t\t<td width=1%><input type='button' OnClick=\"javascript:AddCyrusBackupResource();\" value='{add}&nbsp&raquo;'>\n\t\t</tr>\n\t\t</table>\n\t\t<br>\n\t\t\n\t\t" . RoundedLightWhite("<div id='cyrus-list-res'>{$resources}</div>") . "\n\t\t\n\t</td>\n\t</tr>\n\t</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
예제 #2
0
function popup()
{
    //$add=Paragraphe('disk-backup-64-add.png','{CYRUS_ADD_RESOURCES}','{CYRUS_ADD_RESOURCES_TEXT}',"javascript:Loadjs('automount.php?field=cyrus-ressource');");
    $resources = list_ressource($_GET["automount"]);
    $html = "<H1>{perform_restore}::{$_GET["automount"]}</H1>\n\t<p class=caption>{import_artica_settings_text}</p>\n\t\t<table style='width:100%'>\t\n\t\t<tr>\n\t\t\t<td valign='top' width=1%><img src='img/64-import.png'></td>\n\t\t<td valign='top'>\n\t\t\n\t\t" . RoundedLightWhite("<div id='cyrus-li\t\tst-res' style='width:100%;height:350px;overflow:auto'>{$resources}</div>") . "\n\t\t\n\t</td>\n\t</tr>\n\t</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'artica.backup.index.php,index.troubleshoot.php,automount.php');
}
예제 #3
0
function popup()
{
    $tpl = new templates();
    $users = new usersMenus();
    $page = CurrentPageName();
    $sock = new sockets();
    $CyrusBackupSettings = unserialize(base64_decode($sock->GET_INFO("CyrusBackupNas")));
    if (!is_numeric($CyrusBackupSettings["COMPRESS_ENABLE"])) {
        $CyrusBackupSettings["COMPRESS_ENABLE"] = 1;
    }
    $t = time();
    $DAVFS_INSTALLED = 1;
    if (!$users->DAVFS_INSTALLED) {
        $DAVFS_INSTALLED = 0;
        $error_DAVFS_INSTALLED = "<p class=text-error style='font-size:16px'>{error_davfs_not_installed}</p>";
    }
    $html = "\n\t<div style='font-size:26px;margin-bottom:20px'>{APP_CYRUS_BACKUP}</div>\n\t<div class=explain style='font-size:18px'>{backup_cyrus_mailboxes}</div>\n\t\n\t\t\t\n\t<div style='width:98%' class=form>\n\t\t<div style='font-size:22px;margin-bottom:20px'>{general_settings}:</div>\t\t\t\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{compress_containers}:</td>\n\t\t\t<td>" . Field_checkbox("COMPRESS_ENABLE-{$t}", 1, $CyrusBackupSettings["COMPRESS_ENABLE"]) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{max_containers}:</td>\n\t\t\t<td>" . Field_text("maxcontainer-{$t}", $CyrusBackupSettings["maxcontainer"], "font-size:18px;width:110px") . "</td>\n\t\t</tr>\t\t\t\t\t\t\n\t\t</table>\n\t</div>\n\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t<div style='width:98%' class=form>\t\t\t\n\t<div style='font-size:22px;margin-bottom:20px'>{TAB_WEBDAV} (WebDAV):</div>\n\t{$error_DAVFS_INSTALLED}\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{enable}:</td>\n\t\t<td>" . Field_checkbox("WEBDAV_ENABLE-{$t}", 1, $CyrusBackupSettings["WEBDAV_ENABLE"], "SwitChDAVS{$t}()") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{url}:</td>\n\t\t<td>" . Field_text("WEBDAV_SERVER-{$t}", $CyrusBackupSettings["WEBDAV_SERVER"], "font-size:18px;padding:3px;width:99%") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{web_user}:</td>\n\t\t<td>" . Field_text("WEBDAV_USER-{$t}", $CyrusBackupSettings["WEBDAV_USER"], "font-size:18px;padding:3px;width:70%") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{password}:</td>\n\t\t<td>" . Field_password("WEBDAV_PASSWORD-{$t}", $CyrusBackupSettings["WEBDAV_PASSWORD"], "font-size:18px;padding:3px;width:70%") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{webdav_directory}:</td>\n\t\t<td>" . Field_text("WEBDAV_DIR-{$t}", $CyrusBackupSettings["WEBDAV_DIR"], "font-size:18px;padding:3px;width:90%", null, null, null, false, "SaveCK{$t}(event)") . "</td>\n\t</tr>\t\t\t\n\t</table>\t\n\t</div>\n<div style='width:98%' class=form>\t\t\t\n\t<div style='font-size:22px;margin-bottom:20px'>{NAS_storage}:</div>\t\t\n<table style='width:100%'>\t\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{enable}:</td>\n\t\t<td>" . Field_checkbox("NAS_ENABLE-{$t}", 1, $CyrusBackupSettings["NAS_ENABLE"], "SwitChNAS{$t}()") . "</td>\n\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{hostname}:</td>\n\t\t<td>" . Field_text("hostname-{$t}", $CyrusBackupSettings["hostname"], "font-size:18px;width:99%") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{shared_folder}:</td>\n\t\t<td>" . Field_text("folder-{$t}", $CyrusBackupSettings["folder"], "font-size:18px;width:300px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{username}:</td>\n\t\t<td>" . Field_text("username-{$t}", $CyrusBackupSettings["username"], "font-size:18px;width:200px") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{password}:</td>\n\t\t<td>" . Field_password("password-{$t}", $CyrusBackupSettings["password"], "font-size:18px;width:200px") . "</td>\n\t</tr>\n\t</table>\t\t\t\t\t\n</div>\n\t\t\t\t\t\t\t\t\t\t\n<div style='width:98%' class=form>\t\t\t\n\t<div style='font-size:22px;margin-bottom:20px'>{smtp_notifications}:</div>\t\t\n<table style='width:100%'>\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{enable_smtp_notifications}:</td>\n\t\t<td>" . Field_checkbox("{$t}-notifs", 1, $CyrusBackupSettings["notifs"], "notifsCheck{$t}()") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_server_name}:</strong></td>\n\t\t<td>" . Field_text("smtp_server_name-{$t}", trim($CyrusBackupSettings["smtp_server_name"]), 'font-size:18px;padding:3px;width:250px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_server_port}:</strong></td>\n\t\t<td>" . Field_text("smtp_server_port-{$t}", trim($CyrusBackupSettings["smtp_server_port"]), 'font-size:18px;padding:3px;width:40px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_sender}:</strong></td>\n\t\t<td>" . Field_text("smtp_sender-{$t}", trim($CyrusBackupSettings["smtp_sender"]), 'font-size:18px;padding:3px;width:290px') . "</td>\n\t\t\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_dest}:</strong></td>\n\t\t<td>" . Field_text("smtp_dest-{$t}", trim($CyrusBackupSettings["smtp_dest"]), 'font-size:18px;padding:3px;width:290px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_auth_user}:</strong></td>\n\t\t<td>" . Field_text("smtp_auth_user-{$t}", trim($CyrusBackupSettings["smtp_auth_user"]), 'font-size:18px;padding:3px;width:200px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_auth_passwd}:</strong></td>\n\t\t<td>" . Field_password("smtp_auth_passwd-{$t}", trim($CyrusBackupSettings["smtp_auth_passwd"]), 'font-size:18px;padding:3px;width:200px') . "</td>\n\t\t\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{tls_enabled}:</strong></td>\n\t\t<td>" . Field_checkbox("tls_enabled-{$t}", 1, $CyrusBackupSettings["tls_enabled"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{UseSSL}:</strong></td>\n\t\t<td>" . Field_checkbox("ssl_enabled-{$t}", 1, $CyrusBackupSettings["ssl_enabled"]) . "</td>\n\t</tr>\t\n</table>\n\t</div>\n\t\n\t\t<div style='text-align:right;width:100%'>\n\t\t<hr>" . button("{apply}", " Save{$t}()", "26") . "</div>\t\n\t\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tRefreshTab('main_cyrus_backup');\n}\n\nfunction SaveCK{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n}\n\nfunction SwitChDAVS{$t}(){\n\tvar DAVFS_INSTALLED={$DAVFS_INSTALLED};\n\tdocument.getElementById('WEBDAV_SERVER-{$t}').disabled=true;\n\tdocument.getElementById('WEBDAV_USER-{$t}').disabled=true;\n\tdocument.getElementById('WEBDAV_PASSWORD-{$t}').disabled=true;\n\tdocument.getElementById('WEBDAV_DIR-{$t}').disabled=true;\n\tdocument.getElementById('WEBDAV_ENABLE-{$t}').disabled=true;\n\tif(DAVFS_INSTALLED==0){CheckBoxDesignHidden();return;}\n\tdocument.getElementById('WEBDAV_ENABLE-{$t}').disabled=false;\n\tif(!document.getElementById('WEBDAV_ENABLE-{$t}').checked){CheckBoxDesignHidden();return;}\n\tdocument.getElementById('WEBDAV_SERVER-{$t}').disabled=false;\n\tdocument.getElementById('WEBDAV_USER-{$t}').disabled=false;\n\tdocument.getElementById('WEBDAV_PASSWORD-{$t}').disabled=false;\n\tdocument.getElementById('WEBDAV_DIR-{$t}').disabled=false;\n\tdocument.getElementById('WEBDAV_ENABLE-{$t}').disabled=false;\t\n\tCheckBoxDesignHidden();\n}\n\nfunction SwitChNAS{$t}(){\n\tdocument.getElementById('hostname-{$t}').disabled=true;\n\tdocument.getElementById('folder-{$t}').disabled=true;\n\tdocument.getElementById('username-{$t}').disabled=true;\n\tdocument.getElementById('password-{$t}').disabled=true;\n\tif(!document.getElementById('NAS_ENABLE-{$t}').checked){CheckBoxDesignHidden();return;}\n\tdocument.getElementById('hostname-{$t}').disabled=false;\n\tdocument.getElementById('folder-{$t}').disabled=false;\n\tdocument.getElementById('username-{$t}').disabled=false;\n\tdocument.getElementById('password-{$t}').disabled=false;\n\tCheckBoxDesignHidden();\n\t\n}\nfunction notifsCheck{$t}(){\n\tdocument.getElementById('smtp_auth_passwd-{$t}').disabled=true;\n\tdocument.getElementById('smtp_auth_user-{$t}').disabled=true;\n\tdocument.getElementById('smtp_dest-{$t}').disabled=true;\n\tdocument.getElementById('smtp_sender-{$t}').disabled=true;\n\tdocument.getElementById('smtp_server_port-{$t}').disabled=true;\n\tdocument.getElementById('smtp_server_name-{$t}').disabled=true;\n\tdocument.getElementById('tls_enabled-{$t}').disabled=true;\n\tdocument.getElementById('ssl_enabled-{$t}').disabled=true;\n\n\tif( document.getElementById('{$t}-notifs').checked){\n\t\tdocument.getElementById('smtp_auth_passwd-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_auth_user-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_dest-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_sender-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_server_port-{$t}').disabled=false;\n\t\tdocument.getElementById('smtp_server_name-{$t}').disabled=false;\n\t\tdocument.getElementById('tls_enabled-{$t}').disabled=false;\n\t\tdocument.getElementById('ssl_enabled-{$t}').disabled=false;\n\t}\t\n\t\n\tCheckBoxDesignHidden();\n\t\n}\n\n\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('WEBDAV_ENABLE-{$t}').checked){ XHR.appendData('WEBDAV_ENABLE',1); }else{ XHR.appendData('WEBDAV_ENABLE',0);}\n\tif(document.getElementById('NAS_ENABLE-{$t}').checked){ XHR.appendData('NAS_ENABLE',1); }else{ XHR.appendData('NAS_ENABLE',0);}\n\tif(document.getElementById('COMPRESS_ENABLE-{$t}').checked){ XHR.appendData('COMPRESS_ENABLE',1); }else{ XHR.appendData('COMPRESS_ENABLE',0);}\n\tXHR.appendData('WEBDAV_SERVER',encodeURIComponent(document.getElementById('WEBDAV_SERVER-{$t}').value));\n\tXHR.appendData('WEBDAV_USER',encodeURIComponent(document.getElementById('WEBDAV_USER-{$t}').value));\n\tXHR.appendData('WEBDAV_PASSWORD',encodeURIComponent(document.getElementById('WEBDAV_PASSWORD-{$t}').value));\n\tXHR.appendData('WEBDAV_DIR',encodeURIComponent(document.getElementById('WEBDAV_DIR-{$t}').value));\n\t\n\tXHR.appendData('hostname',encodeURIComponent(document.getElementById('hostname-{$t}').value));\n\tXHR.appendData('folder',encodeURIComponent(document.getElementById('folder-{$t}').value));\n\tXHR.appendData('username',encodeURIComponent(document.getElementById('username-{$t}').value));\n\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\t\n\tvar tls_enabled=0;\n\tvar ssl_enabled=0;\n\tvar notifs=0;\n\t\n\tif(document.getElementById('tls_enabled-{$t}').checked){tls_enabled=1;}\n\tif(document.getElementById('ssl_enabled-{$t}').checked){ssl_enabled=1;}\n\tif(document.getElementById('{$t}-notifs').checked){notifs=1;}\n\tXHR.appendData('smtp_server_name',encodeURIComponent(document.getElementById('smtp_server_name-{$t}').value));\n\tXHR.appendData('smtp_server_port',encodeURIComponent(document.getElementById('smtp_server_port-{$t}').value));\n\tXHR.appendData('smtp_sender',encodeURIComponent(document.getElementById('smtp_sender-{$t}').value));\n\tXHR.appendData('smtp_auth_user',encodeURIComponent(document.getElementById('smtp_auth_user-{$t}').value));\n\tXHR.appendData('smtp_auth_passwd',encodeURIComponent(document.getElementById('smtp_auth_passwd-{$t}').value));\n\t\n\tXHR.appendData('tls_enabled',tls_enabled);\n\tXHR.appendData('ssl_enabled',ssl_enabled);\n\tXHR.appendData('notifs',notifs);\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\n}\nSwitChDAVS{$t}();\t\t\t\t\nSwitChNAS{$t}();\t\t\nnotifsCheck{$t}();\t\t\n</script>\t\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
    return;
    $add = Paragraphe('disk-backup-64-add.png', '{CYRUS_ADD_RESOURCES}', '{CYRUS_ADD_RESOURCES_TEXT}', "javascript:Loadjs('automount.php?field=cyrus-ressource');");
    $resources = list_ressource();
    $html = "<H1></H1>\n\t<p class=caption>{GENERIC_BACKUP_TEXT}</p>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='top' width=1%>{$add}</td>\n\t\t<td valign='top'>\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td valign='middle' class=legend nowrap>{resource}:</td>\n\t\t\t<td>" . Field_text('cyrus-ressource', null, 'width:240px') . "</td>\n\t\t\t<td width=1%><input type='button' OnClick=\"javascript:AddCyrusBackupResource();\" value='{add}&nbsp&raquo;'>\n\t\t</tr>\n\t\t</table>\n\t\t<br>\n\t\t\n\t\t" . RoundedLightWhite("<div id='cyrus-list-res'>{$resources}</div>") . "\n\t\t\n\t</td>\n\t</tr>\n\t</table>";
    echo $tpl->_ENGINE_parse_body($html);
}