function config_popup() { $vpn = new openvpn(); $config = $vpn->BuildClientconf($_SESSION["uid"]); $tbconfig = explode("\n", $config); $html_logs[] = htmlentities("VPN config -> " . strlen($config) . " bytes length (" . count($tbconfig) . " lines)"); $uid = $_SESSION["uid"]; writelogs("VPN config -> " . strlen($config) . " bytes length (" . count($tbconfig) . " lines)", __FUNCTION__, __FILE__, __LINE__); $sock = new sockets(); if (!$sock->SaveConfigFile($config, "{$uid}.ovpn")) { $html_logs[] = htmlentities("Framework error while saving -> {$uid}.ovpn;" . strlen($config) . " bytes length (" . count($tbconfig) . " lines)"); } writelogs("sockets() OK", __FUNCTION__, __FILE__, __LINE__); //$datas=$sock->getfile('OpenVPNGenerate:'.$uid); $datas = $sock->getFrameWork("openvpn.php?build-vpn-user={$_SESSION["uid"]}&basepath=" . dirname(__FILE__)); $tbl = explode("\n", $datas); $tbl = array_reverse($tbl); while (list($num, $line) = each($tbl)) { if (trim($line) == null) { continue; } $html_logs[] = "<div><code style='font-size:10px;color:black;'>" . htmlentities($line) . "</code></div>"; } if (is_file('ressources/logs/' . $uid . '.zip')) { $download = "\n\t\t<center>\n\t\t\t<a href='ressources/logs/" . $uid . ".zip'><img src='img/download-64.png' title=\"{DOWNLOAD_CONFIG_FILES}\" style='padding:8Px;border:1px solid #055447;margin:3px'></a>\n\t\t</center>\n\t\t"; } $html = "\n\t\n\t{$download}\n\t<H3>{events}</H3>\n\t" . ParagrapheTXT("<div style='width:100%;height:200px;overflow:auto'>" . implode("\n", $html_logs) . "</div>"); $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup() { $user = new user($_SESSION["uid"]); $SenderParams = $user->SenderCanonicalSMTPRelay(); $host = $SenderParams["HOST"]; $auth = $SenderParams["AUTH"]; $edit_b = button("{edit}", "SaveUserSenderTransport()"); $delete_b = button("{edit}", "DeleteUserSenderSettings()"); $users = new usersMenus(); if (!$user->AllowSenderCanonical) { $edit_b = button_hidden(); $delete_b = null; } if ($host != null) { $dom = new DomainsTools(); $arr = $dom->transport_maps_explode($user->AlternateSmtpRelay); } if ($arr[2] == null) { $arr[2] = 25; } $server = $arr[1]; $port = $arr[2]; if (preg_match("#(.+?):(.+)#", $auth, $re)) { $username = $re[1]; $password = $re[2]; } $t = ParagrapheTXT("{sender_user_explain}"); $html = "\n\t\n\t{$t}\n\t<div id='sasltransport'>\n\t<table class=table_form>\n\t<tr>\n\t\t<td class=legend nowrap>{sender_canonical}:</td>\n\t\t<td>" . Field_text("sender_canonical", $user->SenderCanonical) . "</td>\n\t</tr>\n\t\t<tr>\n\t\t<td colspan=2 align=right><br>{$edit_b}</td>\n\t</tr>\n\t</table\t>\n\t\n\t<H3>{smtp_internet_relay_option}</H3>\n\t<table class=table_form>\n\t<tr>\n\t\t<td class=legendl nowrap align='left'>{relay_address}:</td>\n\t\t<td class=legendl nowrap align='left'>{listen_port}:</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . Field_text("relay_address", $server) . "</td>\n\t\t<td>" . Field_text("relay_port", $port, "width:40px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2> </td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legendl nowrap align='left'>{username}:</td>\n\t\t<td class=legendl nowrap align='left'>{password}:</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td>" . Field_text("sasl_username", $username) . "</td>\n\t\t<td>" . Field_password("sasl_password", $password, "") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td><br>{$delete_b}</td>\n\t\t<td><br>{$edit_b}</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function infos_popup() { $users = new user($_SESSION["uid"]); $HASH_ALL_MAILS = $users->HASH_ALL_MAILS; while (list($num, $val) = each($HASH_ALL_MAILS)) { $emails[] = $val; } $tpl = new templates(); echo $tpl->_ENGINE_parse_body(ParagrapheTXT("{email_infos_query}<hr>" . implode(", ", $emails))); }