if (@router(2) == false) { exit; } if (router(2) == "insert") { extract($_POST); if (!$_POST) { exit; } $formName = @router(3); requiredField("nome", "Nome", $formName); requiredEmail("email", $formName); requiredField("password", "Senha", $formName); requiredField("passwordRep", "Repita a senha", $formName); passwordComparer("password", "passwordRep", $formName); $consulta = mysql_num_rows(mysql_query("SELECT * FROM sys_admin WHERE email = '" . $email . "'")); if ($consulta == true) { echo jsScript('$(".' . $formName . ' .input-email input").focus();'); echo sweetAlert("Atenção!", "Este e-mail já está cadastrado.", "warning"); } insert(array("nome", "email", "password"), array($nome, $email, md5($password)), "sys_admin"); exit; // Salva cada campo por vez foreach ($_POST as $campo => $valor) { } } if (router(2) == "update") { extract($_POST); if (!$_POST) { exit; } }
function requiredTextarea($field, $nomeExib, $formName) { if (@$_POST["{$field}"] == false) { echo jsScript('$(".' . $formName . ' .input-' . $field . ' textarea").focus();'); echo sweetAlert("Atenção!", "Por favor, preencha o campo ({$nomeExib}).", "error"); exit; } }
/** * 获取编辑器 * * @access public * @param string $fname 表单名称 * @param string $fvalue 表单值 * @param string $nheight 内容高度 * @param string $etype 编辑器类型 * @param string $gtype 获取值类型 * @param string $isfullpage 是否全屏 * @return string */ function SpGetEditor($fname, $fvalue, $nheight = "350", $etype = "Basic", $gtype = "print", $isfullpage = "false", $bbcode = false) { global $cfg_ckeditor_initialized; if (!isset($GLOBALS['cfg_html_editor'])) { $GLOBALS['cfg_html_editor'] = 'fck'; } if ($gtype == "") { $gtype = "print"; } if ($GLOBALS['cfg_html_editor'] == 'fck') { require_once DEDEINC . '/FCKeditor/fckeditor.php'; $fck = new FCKeditor($fname); $fck->BasePath = $GLOBALS['cfg_cmspath'] . '/include/FCKeditor/'; $fck->Width = '100%'; $fck->Height = $nheight; $fck->ToolbarSet = $etype; $fck->Config['FullPage'] = $isfullpage; if ($GLOBALS['cfg_fck_xhtml'] == 'Y') { $fck->Config['EnableXHTML'] = 'true'; $fck->Config['EnableSourceXHTML'] = 'true'; } $fck->Value = $fvalue; if ($gtype == "print") { $fck->Create(); } else { return $fck->CreateHtml(); } } else { if ($GLOBALS['cfg_html_editor'] == 'ckeditor') { require_once DEDEINC . '/ckeditor/ckeditor.php'; $CKEditor = new CKEditor(); $GLOBALS['cfg_cmspath'] = '/cms'; $CKEditor->basePath = $GLOBALS['cfg_cmspath'] . '/include/ckeditor/'; $config = $events = array(); $config['extraPlugins'] = 'dedepage,multipic,addon'; if ($bbcode) { $CKEditor->initialized = true; $config['extraPlugins'] .= ',bbcode'; $config['fontSize_sizes'] = '30/30%;50/50%;100/100%;120/120%;150/150%;200/200%;300/300%'; $config['disableObjectResizing'] = 'true'; $config['smiley_path'] = $GLOBALS['cfg_cmspath'] . '/images/smiley/'; // 获取表情信息 require_once DEDEDATA . '/smiley.data.php'; $jsscript = array(); foreach ($GLOBALS['cfg_smileys'] as $key => $val) { $config['smiley_images'][] = $val[0]; $config['smiley_descriptions'][] = $val[3]; $jsscript[] = '"' . $val[3] . '":"' . $key . '"'; } $jsscript = implode(',', $jsscript); echo jsScript('CKEDITOR.config.ubb_smiley = {' . $jsscript . '}'); } $GLOBALS['tools'] = empty($toolbar[$etype]) ? $GLOBALS['tools'] : $toolbar[$etype]; $config['toolbar'] = $GLOBALS['tools']; $config['height'] = $nheight; $config['skin'] = 'kama'; $CKEditor->returnOutput = TRUE; $code = $CKEditor->editor($fname, $fvalue, $config, $events); if ($gtype == "print") { echo $code; } else { return $code; } } else { /* // ------------------------------------------------------------------------ // 当前版本,暂时取消dedehtml编辑器的支持 // ------------------------------------------------------------------------ require_once(DEDEINC.'/htmledit/dede_editor.php'); $ded = new DedeEditor($fname); $ded->BasePath = $GLOBALS['cfg_cmspath'].'/include/htmledit/' ; $ded->Width = '100%' ; $ded->Height = $nheight ; $ded->ToolbarSet = strtolower($etype); $ded->Value = $fvalue ; if($gtype=="print") { $ded->Create(); } else { return $ded->CreateHtml(); } */ } } }
/** * 获取编辑器 * * @access public * @param string $fname 表单名称 * @param string $fvalue 表单值 * @param string $nheight 内容高度 * @param string $etype 编辑器类型 * @param string $gtype 获取值类型 * @param string $isfullpage 是否全屏 * @return string */ function SpGetEditor($fname, $fvalue, $nheight = "350", $etype = "Basic", $gtype = "print", $isfullpage = "false", $bbcode = false) { global $cfg_ckeditor_initialized, $photo_markup; if (!isset($GLOBALS['cfg_html_editor'])) { $GLOBALS['cfg_html_editor'] = 'fck'; } if ($gtype == "") { $gtype = "print"; } if ($GLOBALS['cfg_html_editor'] == 'fck') { require_once DEDEINC . '/FCKeditor/fckeditor.php'; $fck = new FCKeditor($fname); $fck->BasePath = $GLOBALS['cfg_cmspath'] . '/include/FCKeditor/'; $fck->Width = '100%'; $fck->Height = $nheight; $fck->ToolbarSet = $etype; $fck->Config['FullPage'] = $isfullpage; if ($GLOBALS['cfg_fck_xhtml'] == 'Y') { $fck->Config['EnableXHTML'] = 'true'; $fck->Config['EnableSourceXHTML'] = 'true'; } $fck->Value = $fvalue; if ($gtype == "print") { $fck->Create(); } else { return $fck->CreateHtml(); } } else { if ($GLOBALS['cfg_html_editor'] == 'ckeditor') { require_once DEDEINC . '/ckeditor/ckeditor.php'; $CKEditor = new CKEditor(); $CKEditor->basePath = $GLOBALS['cfg_cmspath'] . '/include/ckeditor/'; $config = $events = array(); $config['extraPlugins'] = 'dedepage,multipic,addon,dewplayer'; if ($bbcode) { $CKEditor->initialized = true; $config['extraPlugins'] .= ',bbcode'; $config['fontSize_sizes'] = '30/30%;50/50%;100/100%;120/120%;150/150%;200/200%;300/300%'; $config['disableObjectResizing'] = 'true'; $config['smiley_path'] = $GLOBALS['cfg_cmspath'] . '/images/smiley/'; // 获取表情信息 require_once DEDEDATA . '/smiley.data.php'; $jsscript = array(); foreach ($GLOBALS['cfg_smileys'] as $key => $val) { $config['smiley_images'][] = $val[0]; $config['smiley_descriptions'][] = $val[3]; $jsscript[] = '"' . $val[3] . '":"' . $key . '"'; } $jsscript = implode(',', $jsscript); echo jsScript('CKEDITOR.config.ubb_smiley = {' . $jsscript . '}'); } $GLOBALS['tools'] = empty($toolbar[$etype]) ? $GLOBALS['tools'] : $toolbar[$etype]; $config['toolbar'] = $GLOBALS['tools']; $config['height'] = $nheight; $config['skin'] = 'kama'; if ($etype == 'Member') { $config['filebrowserImageBrowseUrl'] = 'uploads_select.php'; $config['filebrowserImageUploadUrl'] = 'uploads_add.php?dopost=save&title=editpic'; } if ($photo_markup == 1) { $config['filebrowserImageUploadUrl'] = '../include/dialog/select_images_post.php?ismarkup=1'; $config['iswater'] = 'checked'; } else { $config['filebrowserImageUploadUrl'] = '../include/dialog/select_images_post.php'; $config['iswater'] = ''; } $CKEditor->returnOutput = TRUE; $code = $CKEditor->editor($fname, $fvalue, $config, $events); if ($gtype == "print") { echo $code; } else { return $code; } } else { if ($GLOBALS['cfg_html_editor'] == 'kindeditor') { $fvalue = htmlspecialchars($fvalue); $uploadJson = "../include/dialog/kindeditor_post.php"; $fileManagerJson = "../include/dialog/kindeditor_manager.php"; $allowFileManager = 'true'; $extendconfig = ''; if ($etype == 'Member' || $etype == 'MemberLit' || $etype == 'Diy') { $uploadJson = ""; $fileManagerJson = ""; $allowFileManager = 'false'; $extendconfig = 'allowImageUpload : false,'; $extendconfig .= 'allowFlashUpload : false,'; $extendconfig .= 'allowMediaUpload : false,'; $extendconfig .= 'allowFileUpload : false,'; } $items['Member'] = "[\n\t\t'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'runCode', 'cut', 'copy', 'paste',\n\t\t'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',\n\t\t'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',\n\t\t'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',\n\t\t'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',\n\t\t'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',\n\t\t'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',\n\t\t'anchor', 'link', 'unlink', '|', 'about']"; $items['Small'] = $items['MemberLit'] = $items['Diy'] = "[\n\t\t'source', '|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',\n\t\t'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',\n\t\t'insertunorderedlist', '|', 'emoticons', 'image', 'multiimage', 'link', 'unlink']"; $itemconfig = ''; if (isset($items[$etype])) { $itemconfig = "items :{$items[$etype]},"; } $code = <<<EOT \t<link rel="stylesheet" href="/include/kindeditor/themes/default/default.css" /> \t<link rel="stylesheet" href="/include/kindeditor/plugins/code/prettify.css" /> \t<script src="/include/kindeditor/kindeditor.js"></script> \t<script src="/include/kindeditor/lang/zh_CN.js"></script> \t<script src="/include/kindeditor/plugins/code/prettify.js"></script> \t<script type="text/javascript"> \t\tKindEditor.ready(function(K) { \t\t\tvar editor1 = K.create('textarea[name="{$fname}"]', { \t\t\t\tcssPath : '../include/plugins/code/prettify.css', \t\t\t\tuploadJson : '{$uploadJson}', \t\t\t\tfileManagerJson : '{$fileManagerJson}', \t\t\t\t{$extendconfig} \t\t\t\t{$itemconfig} \t\t\t\tallowFileManager : {$allowFileManager} \t\t\t}); \t\t\tprettyPrint(); \t\t}); \t</script> \t<textarea name="{$fname}" style="height:{$nheight}px;visibility:hidden;width: 100%;">{$fvalue}</textarea> EOT; //echo $reval; if ($gtype == "print") { echo $code; } else { return $code; } } else { /* // ------------------------------------------------------------------------ // 当前版本,暂时取消dedehtml编辑器的支持 // ------------------------------------------------------------------------ require_once(DEDEINC.'/htmledit/dede_editor.php'); $ded = new DedeEditor($fname); $ded->BasePath = $GLOBALS['cfg_cmspath'].'/include/htmledit/' ; $ded->Width = '100%' ; $ded->Height = $nheight ; $ded->ToolbarSet = strtolower($etype); $ded->Value = $fvalue ; if($gtype=="print") { $ded->Create(); } else { return $ded->CreateHtml(); } */ } } } }
<div>Clique no link abaixo para criar uma nova senha:</div> <div> <a href="' . CP . '/view/new-password/' . $token . '" target="_blank"><strong>Criar nova senha</strong></a> </div> <br /> <div> <small>Desconsidere essse e-mail caso não tenha solicitado uma nova senha.</small> </div> '; sendMail($ln->nome, $ln->email, getSys("siteName"), getSys("smtpLogin"), "Recupere sua senha - " . getSys("siteName"), utf8_decode($msg)); echo sweetAlert("Sucesso!", "Você receberá um e-mail com informações para recuperar sua senha.", "success"); echo jsScript("\n\t\t\t\tdocument.getElementById('captcha').src='../system/captcha/captcha.php?'+Math.random();\n\t\t\t\tdocument.formForgot.reset();\n\t\t\t\t"); exit; } else { echo sweetAlert("Erro!", "E-mail não cadastrado no sistema.", "error"); echo jsScript("document.getElementById('captcha').src='../system/captcha/captcha.php?'+Math.random();"); exit; } } if (router(2) == "newPass") { extract($_POST); if ($nosp != "") { exit; } $consulta = mysql_query("SELECT * FROM sys_admin WHERE token = '" . $token . "'"); $result = mysql_num_rows($consulta); if ($result == false) { echo sweetAlert("Erro!", "Link inválido ou fora do prazo de validade.", "error"); exit; } $ln = mysql_fetch_object($consulta);