function wifidog_register($error = null) { if ($GLOBALS["HOTSPOT_DEBUG"]) { ToSyslog("Starting wifidog_register({$error})"); } $t = time(); $page = CurrentPageName(); $tpl = new templates(); $email = $tpl->_ENGINE_parse_body("{email}"); $password = $tpl->_ENGINE_parse_body("{password}"); $submit = $tpl->_ENGINE_parse_body("{submit}"); $register = $tpl->_ENGINE_parse_body("{register}"); $confirm = $tpl->_ENGINE_parse_body("{confirm}"); $password_mismatch = $tpl->javascript_parse_text("{password_mismatch}"); $redirecturi = $_GET["url"]; $t = time(); $wifidog_build_uri = wifidog_build_uri(); $uriext = $wifidog_build_uri[0]; $HiddenFields = $wifidog_build_uri[1]; $cancel = $tpl->_ENGINE_parse_body("{cancel}"); session_start(); unset($_SESSION["HOTSPOT_AUTO_REGISTER"]); $ArticaHotSpotSMTP = SMTP_SETTINGS(); $btsize = $ArticaHotSpotSMTP["SKIN_BUTTON_SIZE"]; $fontsize = $ArticaHotSpotSMTP["SKIN_FONT_SIZE"]; if ($ArticaHotSpotSMTP["ENABLED_SMTP"] == 0) { $email = $tpl->_ENGINE_parse_body("{account}"); } $html = "\n\t\n\t<div style='width:98%' class=form id='form-{$t}'>\n\t\n\t\n\t<form name='register-{$t}' method='post' action='{$page}' class='form-horizontal' style='padding:left:15px'>\n\t<input type='hidden' id='register-member' name='register-member' value='yes'>\n\t{$HiddenFields}\n\t<div style='font-size:32px;font-weight:bold;margin-bottom:15px'>{$register}</div>\t\t\n\t<p style='font-size:{$fontsize}'>{$ArticaHotSpotSMTP["REGISTER_MESSAGE_EXPLAIN"]}</p>\n\t\n\t<label style='font-size:{$fontsize};margin-top:20px' for=\"email-{$t}\" class=legend>{$email}:</label>\n\t\t\n\t<input style='font-size:{$fontsize};width:80%' type=\"text\" class=\"input-block-level\" \n\tplaceholder=\"{$email}\" id=\"email\" name=\"email\" value='{$_REQUEST["email"]}'>\n\t\n\t<label style='font-size:{$fontsize};margin-top:20px' for=\"password\" class=legend>{$password}:</label>\n\t<input style='font-size:{$fontsize};width:80%' type=\"password\" \n\tclass=\"input-block-level\" placeholder=\"{$password}\" id=\"password\" name=\"password\" value='{$_REQUEST["password"]}'>\n\t\t\t \n\t\n\t<label style='font-size:{$fontsize};margin-top:20px' for=\"password2-{$t}\" class=legend>{$password} ({$confirm}):</label>\n\t<input style='font-size:{$fontsize};width:80%' type=\"password\" \n\t\tclass=\"input-block-level\" placeholder=\"{$password} ({$confirm})\" name=\"password2\" \n\t\tid=\"password2\" value='{$_REQUEST["password2"]}'>\n\n\t\n\t<div style='margin-top:20px;text-align:right'>\n\t<a data-loading-text=\"Chargement...\" \n\t\t\t\t\t\t\t\tstyle=\"font-size:{$btsize};text-transform:capitalize\" \n\t\t\t\t\t\t\t\tclass=\"Button2014 Button2014-success Button2014-lg\" \n\t\t\t\t\t\t\t\tid=\"" . time() . "\" \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thref=\"{$page}?wifidog-login&{$uriext}\">« {$cancel} »</a> \n\t<a data-loading-text=\"Chargement...\" \n\t\t\t\t\t\t\t\tstyle=\"font-size:{$btsize};text-transform:capitalize\" \n\t\t\t\t\t\t\t\tclass=\"Button2014 Button2014-success Button2014-lg\" \n\t\t\t\t\t\t\t\tid=\"" . time() . "\" \n\t\t\t\t\t\t\t\tonclick=\"javascript:document.forms['register-{$t}'].submit();document.getElementById('form-{$t}').innerHTML='<center><img src=img/wait_verybig_mini_red.gif></center>';\" \n\t\t\t\t\t\t\t\thref=\"javascript:Blurz()\">« {$submit} »</a>\n\t</div>\n\n</form>\n</div>\t\n<script>\n \$('.input-block-level').keypress(function (e) {\n\t\n\t if (e.which == 13) {\n\t\tdocument.forms['register-{$t}'].submit();\n\t\tdocument.getElementById('form-{$t}').innerHTML='<center><img src=img/wait_verybig_mini_red.gif></center>';\n\t }\n\n});\n\n</script>\n\t\n\t\n\t\n\t"; echo BuildFullPage($html, $error); }
function wifidog_register($error = null) { $ARP = $_REQUEST["mac"]; if ($GLOBALS["HOTSPOT_DEBUG"]) { wifidog_logs("Starting wifidog_register({$error})"); } $t = time(); $cachefile = "{$GLOBALS["CACHEDIR"]}/{$ARP}." . md5($error) . "." . __FUNCTION__ . ".html"; if (is_file($cachefile)) { echo @file_get_contents($cachefile); return; } $page = CurrentPageName(); session_start(); $FieldsCache = "{$GLOBALS["CACHEDIR"]}/FieldsTranslate.db"; if (!is_file($FieldsCache)) { $tpl = new templates(); $email = $tpl->_ENGINE_parse_body("{email}"); $password = $tpl->_ENGINE_parse_body("{password}"); $submit = $tpl->_ENGINE_parse_body("{submit}"); $confirm = $tpl->_ENGINE_parse_body("{confirm}"); $password_mismatch = $tpl->javascript_parse_text("{password_mismatch}"); $cancel = $tpl->_ENGINE_parse_body("{cancel}"); $ARRAY_TRANS["email"] = $email; $ARRAY_TRANS["password"] = $password; $ARRAY_TRANS["submit"] = $submit; $ARRAY_TRANS["confirm"] = $confirm; $ARRAY_TRANS["password_mismatch"] = $password_mismatch; $ARRAY_TRANS["cancel"] = $cancel; @file_put_contents($FieldsCache, serialize($ARRAY_TRANS)); } else { $ARRAY_TRANS = unserialize(@file_get_contents($FieldsCache)); $email = $ARRAY_TRANS["email"]; $password = $ARRAY_TRANS["password"]; $submit = $ARRAY_TRANS["submit"]; $confirm = $ARRAY_TRANS["confirm"]; $password_mismatch = $ARRAY_TRANS["password_mismatch"]; $cancel = $ARRAY_TRANS["cancel"]; } $redirecturi = $_GET["url"]; $t = time(); $wifidog_build_uri = wifidog_build_uri(); $uriext = $wifidog_build_uri[0]; $HiddenFields = $wifidog_build_uri[1]; $wifidog_templates = new wifidog_templates($_SESSION["WIFIDOG_RULES"]); $sock = new wifidog_settings($_SESSION["WIFIDOG_RULES"]); $ArticaHotSpotNowPassword = intval($sock->GET_INFO("ArticaHotSpotNowPassword")); unset($_SESSION["HOTSPOT_AUTO_REGISTER"]); $ENABLED_SMTP = intval($sock->GET_INFO("ENABLED_SMTP")); if ($ENABLED_SMTP == 0) { $email = $tpl->_ENGINE_parse_body("{account}"); } $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN")); $CancelButton = "<div style='margin-top:20px;text-align:right'>\n\t<a data-loading-text=\"Chargement...\" \n\tstyle=\"text-transform:capitalize\" \n\tclass=\"Button2014 Button2014-success Button2014-lg\" \n\tid=\"" . time() . "\" \n\thref=\"{$page}?wifidog-login&{$uriext}\">« {$cancel} »</a> "; if ($ENABLED_SMTP == 1) { if ($ENABLED_REDIRECT_LOGIN == 1) { $CancelButton = null; } } $form_head = null; if ($wifidog_templates->FORM_HEAD != null) { $form_head = "<p>{$wifidog_templates->FORM_HEAD}</p>"; } $html[] = "\n\t<div class=title2>" . $wifidog_templates->char($wifidog_templates->RegisterTitle) . "</div>\n\t<p>" . $wifidog_templates->char($wifidog_templates->REGISTER_MESSAGE_EXPLAIN) . "</p>\n\t<div style='width:98%' class=form id='form-{$t}'>\n\t<form name='register-{$t}' method='post' action='{$page}' class='form-horizontal' style='padding:left:15px'>\n\t{$form_head}\n\t<input type='hidden' id='register-member' name='register-member' value='yes'>\n\t{$HiddenFields}\n\t<table style='width:100%'>\n\t<tr>\n\t<td class=legend>{$email}:</td>\n\t<td><input style='width:80%' type=\"text\" placeholder=\"{$email}\" id=\"email\" name=\"email\" value='{$_REQUEST["email"]}'></td>\n\t</tr>\n\t"; if ($ArticaHotSpotNowPassword == 1) { $html[] = "<input type=\"hidden\" name=\"password2\" value=''><input type=\"hidden\" name=\"password\" id='password' value=''>"; } else { $html[] = "\n\t\t<tr>\n\t\t\t<td class=legend>{$password}:</td>\n\t\t\t<td><input style='width:80%' type=\"password\" placeholder=\"{$password}\" id=\"password\" name=\"password\" value='{$_REQUEST["password"]}'></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{$password} ({$confirm}):</td>\n\t\t\t<td><input style='width:80%' type=\"password\" \n\t\tplaceholder=\"{$password} ({$confirm})\" name=\"password2\" \n\t\tid=\"password2\" value='{$_REQUEST["password2"]}'></td>\n\t\t</tr>\t\t\n\t\t"; } if ($wifidog_templates->REGISTER_GENERIC_PASSWORD == 1) { $html[] = "\n\t\t<tr>\n\t\t<td class=legend>" . $wifidog_templates->char($wifidog_templates->REGISTER_GENERIC_LABEL) . ":</td>\n\t\t<td><input style='width:80%' type=\"text\" id=\"passphrase\" name=\"passphrase\" value=''></td>\n\t\t</tr>"; } $html[] = "<tr><td colspan=2> </td></tr>"; $html[] = "<td colspan=2 align='right' class=ButtonCell>"; $html[] = "{$CancelButton}\n\t\n\t<a data-loading-text=\"Chargement...\" \n\t\t\t\t\t\t\t\tstyle=\"text-transform:capitalize\" \n\t\t\t\t\t\t\t\tclass=\"Button2014 Button2014-success Button2014-lg\" \n\t\t\t\t\t\t\t\tid=\"" . time() . "\" \n\t\t\t\t\t\t\t\tonclick=\"javascript:document.forms['register-{$t}'].submit();document.getElementById('form-{$t}').innerHTML='<center><img src=hotspot.php?imgload=wait_verybig_mini_red.gif></center>';\" \n\t\t\t\t\t\t\t\thref=\"javascript:Blurz()\">« {$submit} »</a>\n\t</td>\n\t</tr>\n\t</table>\n\n</form>\n</div>\t\n<script>\n \$('.input-block-level').keypress(function (e) {\n\t\n\t if (e.which == 13) {\n\t\tdocument.forms['register-{$t}'].submit();\n\t\tdocument.getElementById('form-{$t}').innerHTML='<center><img src='/hotspot.php?imgload=wait_verybig_mini_red.gif'></center>';\n\t }\n\n});\n\n</script>\n\t\n\t\n\t\n\t"; $text = BuildFullPage(@implode("", $html), $error); @file_put_contents($cachefile, $text); echo $text; }