├── README.TXT ├── action-buildcertificate.inc ├── action-certificates.inc ├── action-config.inc ├── action-downloadcertificate.inc ├── action-downloadconfigfile.inc ├── action-newcertificate.inc ├── action-status.inc ├── action-viewcertificate.inc ├── config.inc ├── config.inc.sample ├── configs └── colors.conf ├── downloads └── readme.txt ├── favicon.ico ├── img ├── 1x1.gif └── OpenVPN-small.gif ├── include ├── Smarty │ ├── Config_File.class.php │ ├── Smarty.class.php │ ├── Smarty_Compiler.class.php │ ├── debug.tpl │ ├── index.html │ ├── internals │ │ ├── core.assemble_plugin_filepath.php │ │ ├── core.assign_smarty_interface.php │ │ ├── core.create_dir_structure.php │ │ ├── core.display_debug_console.php │ │ ├── core.get_include_path.php │ │ ├── core.get_microtime.php │ │ ├── core.get_php_resource.php │ │ ├── core.is_secure.php │ │ ├── core.is_trusted.php │ │ ├── core.load_plugins.php │ │ ├── core.load_resource_plugin.php │ │ ├── core.process_cached_inserts.php │ │ ├── core.process_compiled_include.php │ │ ├── core.read_cache_file.php │ │ ├── core.rm_auto.php │ │ ├── core.rmdir.php │ │ ├── core.run_insert_handler.php │ │ ├── core.smarty_include_php.php │ │ ├── core.write_cache_file.php │ │ ├── core.write_compiled_include.php │ │ ├── core.write_compiled_resource.php │ │ └── core.write_file.php │ └── plugins │ │ ├── block.textformat.php │ │ ├── compiler.assign.php │ │ ├── function.assign_debug_info.php │ │ ├── function.config_load.php │ │ ├── function.counter.php │ │ ├── function.cycle.php │ │ ├── function.debug.php │ │ ├── function.eval.php │ │ ├── function.fetch.php │ │ ├── function.html_checkboxes.php │ │ ├── function.html_image.php │ │ ├── function.html_options.php │ │ ├── function.html_radios.php │ │ ├── function.html_select_date.php │ │ ├── function.html_select_time.php │ │ ├── function.html_table.php │ │ ├── function.mailto.php │ │ ├── function.math.php │ │ ├── function.popup.php │ │ ├── function.popup_init.php │ │ ├── index.html │ │ ├── modifier.capitalize.php │ │ ├── modifier.cat.php │ │ ├── modifier.count_characters.php │ │ ├── modifier.count_paragraphs.php │ │ ├── modifier.count_sentences.php │ │ ├── modifier.count_words.php │ │ ├── modifier.date_format.php │ │ ├── modifier.debug_print_var.php │ │ ├── modifier.default.php │ │ ├── modifier.escape.php │ │ ├── modifier.indent.php │ │ ├── modifier.lower.php │ │ ├── modifier.nl2br.php │ │ ├── modifier.regex_replace.php │ │ ├── modifier.replace.php │ │ ├── modifier.spacify.php │ │ ├── modifier.string_format.php │ │ ├── modifier.strip.php │ │ ├── modifier.strip_tags.php │ │ ├── modifier.truncate.php │ │ ├── modifier.upper.php │ │ ├── modifier.wordwrap.php │ │ ├── outputfilter.trimwhitespace.php │ │ ├── resource.userdb.php │ │ ├── resource.var.php │ │ ├── shared.escape_special_chars.php │ │ └── shared.make_timestamp.php ├── functions.inc ├── openssl-functions.inc ├── openvpn-functions.inc └── zip.lib.php ├── index.php ├── info.php ├── plugins └── systemcheck │ ├── action.inc │ ├── action.tpl │ ├── config.inc │ ├── left.tpl │ └── status.tpl ├── templates ├── action-certificates.tpl ├── action-config.tpl ├── action-error.tpl ├── action-newcertificate.tpl ├── action-status.tpl ├── action-viewcertificate.tpl ├── header.tpl ├── left-menu.tpl ├── left-status.tpl ├── menu.tpl └── page.tpl └── templates_c └── dummy /action-buildcertificate.inc: -------------------------------------------------------------------------------- 1 | $PUTcountryName, 28 | 'stateOrProvinceName' => $PUTstateOrProvinceName, 29 | 'localityName' => $PUTlocalityName, 30 | 'organizationName' => $PUTorganizationName, 31 | 'organizationalUnitName' => $PUTorganizationalUnitName, 32 | 'commonName' => $PUTcommonName, 33 | 'emailAddress' => $PUTemailAddress, 34 | 'password' => $PUTpassword 35 | ), 36 | $PUTvalidity 37 | ); 38 | 39 | if ($Result != FALSE) 40 | { 41 | # header ('Location: '. $_SERVER["PHP_SELF"] .'?Action=ViewCertificate&id='. $Result); 42 | html_postredir ($_SERVER["PHP_SELF"] .'?Action=ViewCertificate&id='. $Result); 43 | } 44 | else 45 | { 46 | echo '
'. $Debug .''; 47 | } 48 | ?> 49 | -------------------------------------------------------------------------------- /action-certificates.inc: -------------------------------------------------------------------------------- 1 | assign ('Company_Name', $config['Company_Name']); 23 | $smarty->assign ('Company_Logo', $config['Company_Logo']); 24 | $smarty->assign ('URL_Home_Page', $config['URL_Home_Page']); 25 | $smarty->assign ('title', 'OpenVPN Web GUI : OpenSSL certificates [refreshes every minute]'); 26 | $smarty->assign ('refresh', '60'); 27 | 28 | // Status Bar 29 | $smarty->assign ('Server', $openvpn['Server']); 30 | $smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']); 31 | $smarty->assign ('Certificates', $openssl['Database']); 32 | 33 | // Action 34 | $smarty->assign ('action', 'CERTIFICATES'); 35 | 36 | // Action-Specific 37 | if (isset ($openvpn['Client'])) 38 | $smarty->assign ('Client', $openvpn['Client']); 39 | 40 | // Display 41 | $smarty->assign ('PluginPath', $config['PluginsAbsolutePath']); 42 | $smarty->assign ('Plugins', $config['Plugins']); 43 | $smarty->assign ('Page', 'action-certificates.tpl'); 44 | $smarty->display ('page.tpl'); 45 | //print_r ($GLOBALS); 46 | ?> 47 | -------------------------------------------------------------------------------- /action-config.inc: -------------------------------------------------------------------------------- 1 | assign ('Company_Name', $config['Company_Name']); 22 | $smarty->assign ('Company_Logo', $config['Company_Logo']); 23 | $smarty->assign ('URL_Home_Page', $config['URL_Home_Page']); 24 | $smarty->assign ('title', 'OpenVPN Web GUI : server configuration'); 25 | 26 | // Status Bar 27 | $smarty->assign ('Server', $openvpn['Server']); 28 | $smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']); 29 | 30 | // Action 31 | $smarty->assign ('action', 'CONFIG'); 32 | 33 | // Action-Specific 34 | if (isset ($openvpn['Client'])) 35 | $smarty->assign ('Client', $openvpn['Client']); 36 | if (isset ($openssl['Server'])) 37 | $smarty->assign ('Openssl', $openssl['Server']); 38 | if (isset ($openssl['Database'])) 39 | $smarty->assign ('Certificates', $openssl['Database']); 40 | 41 | // Display 42 | $smarty->assign ('PluginPath', $config['PluginsAbsolutePath']); 43 | $smarty->assign ('Plugins', $config['Plugins']); 44 | $smarty->assign ('Page', 'action-config.tpl'); 45 | $smarty->display ('page.tpl'); 46 | //html_dump ('$config', $config); 47 | ?> 48 | -------------------------------------------------------------------------------- /action-downloadcertificate.inc: -------------------------------------------------------------------------------- 1 | addFile (implode ('', file ($File2zip)), $File2name); 46 | } 47 | } 48 | 49 | // Should we add TA/CA files? 50 | if ($config['Download']['ZIP']['.ca']) { 51 | if (is_file ($config['openssl']['CA']['pub'])) { 52 | $zipData->addFile (implode ('', file ($config['openssl']['CA']['pub'])), 'ca.crt'); 53 | } 54 | } 55 | if ($config['Download']['ZIP']['.ta']) { 56 | if (is_file ($config['openssl']['TA']['pub'])) { 57 | $zipData->addFile (implode ('', file ($config['openssl']['TA']['pub'])), 'ta.key'); 58 | } 59 | } 60 | 61 | // Check and see if we should fix a config file 62 | if ($config['Download']['ZIP']['Config_Generic']) { 63 | if (is_file ($config['Download']['ZIP']['Config_Generici_Loc'])) { 64 | $zipData->addFile (openvpn_config_replace(implode ('', file ($config['Download']['ZIP']['Config_Generici_Loc'])), str_replace_spaces($tmpArray['CN'])), basename($config['Download']['ZIP']['Config_Generici_Loc'])); 65 | } 66 | } 67 | 68 | 69 | // Add the extra files 70 | foreach ($config['Download']['ZIP']['Others'] as $File2zip) 71 | { 72 | if (is_file ('downloads/'. $File2zip)) 73 | $zipData->addFile (implode ('', file ('downloads/'. $File2zip)), $File2zip); 74 | } 75 | 76 | // Flush the ZIP file to the client 77 | html_download_data ($zipData -> file (), str_replace_spaces($tmpArray['CN']) .'_OVPN.zip'); 78 | } 79 | else 80 | { 81 | $sCertificateFile = openssl_get_filename (str_replace_spaces($tmpArray['CN']), $sExt); 82 | if (!$sCertificateFile) { 83 | html_error ("Can't find requested file " . str_replace_spaces($tmpArray['CN'])); 84 | } 85 | 86 | // Download 87 | html_download ($sCertificateFile, str_replace_spaces($tmpArray['CN']) . $sExt); 88 | //html_dump ('$GLOBALS', $GLOBALS); 89 | 90 | //html_error($openssl['Database'][4]['CN']); 91 | //$tmpArray = openssl_get_database_contents($GETidDEC[0]); 92 | //html_error(tmpArray['CN']); 93 | } 94 | 95 | ?> 96 | -------------------------------------------------------------------------------- /action-downloadconfigfile.inc: -------------------------------------------------------------------------------- 1 | Probably it should not be read by anybode except it's owner?"); 63 | else 64 | html_error ("The file '$sFile' does not exist."); 65 | else 66 | html_error ('Wrong ID. Stop hacking.'); 67 | } 68 | else 69 | html_error ('The ID is not defined. Stop hacking.'); 70 | ?> 71 | -------------------------------------------------------------------------------- /action-newcertificate.inc: -------------------------------------------------------------------------------- 1 | assign ('Company_Name', $config['Company_Name']); 23 | $smarty->assign ('Company_Logo', $config['Company_Logo']); 24 | $smarty->assign ('URL_Home_Page', $config['URL_Home_Page']); 25 | $smarty->assign ('title', 'OpenVPN Web GUI : New OpenSSL certificate'); 26 | 27 | // Status Bar 28 | $smarty->assign ('Server', $openvpn['Server']); 29 | $smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']); 30 | 31 | // Action 32 | $smarty->assign ('action', 'CERTIFICATES'); 33 | $smarty->assign ('subaction', 'NEW'); 34 | 35 | // Action-Specific 36 | $smarty->assign ('Default', $config['openssl']['default']); 37 | 38 | // Display 39 | $smarty->assign ('PluginPath', $config['PluginsAbsolutePath']); 40 | $smarty->assign ('Plugins', $config['Plugins']); 41 | $smarty->assign ('Page', 'action-newcertificate.tpl'); 42 | $smarty->display ('page.tpl'); 43 | ?> 44 | -------------------------------------------------------------------------------- /action-status.inc: -------------------------------------------------------------------------------- 1 | assign ('Company_Name', $config['Company_Name']); 19 | $smarty->assign ('Company_Logo', $config['Company_Logo']); 20 | $smarty->assign ('URL_Home_Page', $config['URL_Home_Page']); 21 | $smarty->assign ('title', 'OpenVPN Web GUI : server status [refreshes every minute]'); 22 | $smarty->assign ('refresh', '60'); 23 | 24 | // Status Bar 25 | $smarty->assign ('Server', $openvpn['Server']); 26 | $smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']); 27 | 28 | // Action 29 | $smarty->assign ('action', 'STATUS'); 30 | 31 | // Action-Specific 32 | if (isset ($openvpn['Client'])) 33 | $smarty->assign ('Client', $openvpn['Client']); 34 | 35 | // Display 36 | $smarty->assign ('PluginPath', $config['PluginsAbsolutePath']); 37 | $smarty->assign ('Plugins', $config['Plugins']); 38 | $smarty->assign ('Page', 'action-status.tpl'); 39 | $smarty->display ('page.tpl'); 40 | ?> 41 | -------------------------------------------------------------------------------- /action-viewcertificate.inc: -------------------------------------------------------------------------------- 1 | assign ('Company_Name', $config['Company_Name']); 23 | $smarty->assign ('Company_Logo', $config['Company_Logo']); 24 | $smarty->assign ('URL_Home_Page', $config['URL_Home_Page']); 25 | $smarty->assign ('title', 'OpenVPN Web GUI : OpenSSL certificate'); 26 | 27 | // Status Bar 28 | $smarty->assign ('Server', $openvpn['Server']); 29 | $smarty->assign ('Seconds_Ago', time () - $openvpn['Server']['Time']); 30 | $smarty->assign ('Certificates', $openssl['Database']); 31 | 32 | // Action 33 | $smarty->assign ('action', 'CERTIFICATES'); 34 | $smarty->assign ('subaction', 'VIEW'); 35 | 36 | // Action-Specific 37 | 38 | $GETidDEC = $_GET['id']; 39 | 40 | $tmpArray = openssl_get_database_contents($GETidDEC); 41 | 42 | $tmpArray['ExpDate'] = str_openssldata_to_string ($tmpArray['ExpDate']); 43 | $tmpArray['RevDate'] = str_openssldata_to_string ($tmpArray['RevDate']); 44 | $smarty->assign ('Certificate', $tmpArray); 45 | $smarty->assign ('CertificateFileCRT', openssl_get_filename(str_replace_spaces ($tmpArray['CN']), '.crt')); 46 | $smarty->assign ('CertificateFileKEY', openssl_get_filename(str_replace_spaces ($tmpArray['CN']), '.key')); 47 | $smarty->assign ('CertificateFileCSR', openssl_get_filename(str_replace_spaces ($tmpArray['CN']), '.csr')); 48 | $smarty->assign ('Password', openssl_read_password($GETidDEC, $config['openssl']['passworddb'])); 49 | // Display 50 | $smarty->assign ('PluginPath', $config['PluginsAbsolutePath']); 51 | $smarty->assign ('Plugins', $config['Plugins']); 52 | $smarty->assign ('Page', 'action-viewcertificate.tpl'); 53 | $smarty->display ('page.tpl'); 54 | ?> 55 | -------------------------------------------------------------------------------- /config.inc: -------------------------------------------------------------------------------- 1 | '/etc/openvpn/easy-rsa/2.0/openssl.cnf'); 66 | //'encrypt_key' => 0); 67 | // Change: password database location 68 | $config['openssl']['passworddb'] = $config['openssl']['folder'] .'passwords.db'; 69 | // NEW OPENSSL CERTIFICATE DEFAULTS _________ 70 | 71 | // Change all of them as it is done in your easy-rsa/vars 72 | $config['openssl']['default']['expiration'] = 3560; 73 | $config['openssl']['default']['countryName'] = 'US'; 74 | $config['openssl']['default']['stateOrProvinceName'] = 'Indiana'; 75 | $config['openssl']['default']['localityName'] = 'Indianapolis'; 76 | $config['openssl']['default']['organizationName'] = 'Company Name'; 77 | $config['openssl']['default']['organizationalUnitName'] = 'Please type in plant location'; 78 | $config['openssl']['default']['commonName'] = 'John Doe'; 79 | $config['openssl']['default']['emailAddress'] = '
Smarty Debug Console | |
---|---|
included templates & config files (load time in seconds): | |
{section name=indent loop=$_debug_tpls[templates].depth} {/section}{$_debug_tpls[templates].filename|escape:html}{if isset($_debug_tpls[templates].exec_time)} ({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}{/if} | |
no templates included | |
assigned template variables: | |
{ldelim}${$_debug_keys[vars]}{rdelim} | {$_debug_vals[vars]|@debug_print_var} |
no template variables assigned | |
assigned config file variables (outer template scope): | |
{ldelim}#{$_debug_config_keys[config_vars]}#{rdelim} | {$_debug_config_vals[config_vars]|@debug_print_var} |
no config vars assigned |