Exemple #1
0
function page_admin_pass_recover()
{
    $email = admin_email();
    $pass = db_result(db_query("SELECT admin_pass FROM settings LIMIT 1"));
    $msg = "Пароль администратора: {$pass}";
    mail_from($email, "пароль администратора", $msg, "no-reply@" . SITE_DOMAIN);
    die_no_template("Пароль выслан на почту администратора.");
}
Exemple #2
0
 public function register_hook()
 {
     $hook = hook();
     $hook->add('UserRegister_Register_before', function ($code) {
         if ($code === 0 && !allowed_register()) {
             return -11;
         }
         return $code;
     });
     switch (site_mode()) {
         case "https":
             if (!is_ssl()) {
                 header("Cache-Control: no-cache, must-revalidate");
                 header("Pragma: no-cache");
                 redirect("https://" . substr(URL_NOW, 6), "header", 301);
             }
             $hook->add('get_url', function () {
                 return site_url_ssl();
             });
             $hook->add("get_file_url", function () {
                 return site_static_url_ssl();
             });
             break;
         case "all":
             if (is_ssl()) {
                 $hook->add('get_url', function () {
                     return site_url_ssl();
                 });
                 $hook->add("get_file_url", function () {
                     return site_static_url_ssl();
                 });
             } else {
                 $hook->add('get_url', function () {
                     return site_url();
                 });
                 $hook->add("get_file_url", function () {
                     return site_static_url();
                 });
             }
             break;
         default:
             if (is_ssl()) {
                 header("Cache-Control: no-cache, must-revalidate");
                 header("Pragma: no-cache");
                 redirect("http://" . substr(URL_NOW, 7), "header", 301);
             }
             $hook->add('get_url', function () {
                 return site_url();
             });
             $hook->add("get_file_url", function () {
                 return site_static_url();
             });
     }
     $hook->add("UserRegister_CodeMsg", function ($msg, $code) {
         if ($code == -11) {
             return _("User register already closed.");
         }
         return $msg;
     });
     if (!login_captcha()) {
         //将验证码检测返回TRUE
         $hook->add("UserLogin_Captcha", function () {
             return true;
         });
     }
     if (email_notice()) {
         $hook->add('UserRegister_Register_success', function ($user_id) {
             lib()->load('MailTemplate');
             $user = User::getUser($user_id);
             $mt = new MailTemplate("new_user_registered.html");
             $mt->setUserInfo($user->getInfo());
             $mt->mailSend(site_title() . " Manager", admin_email());
         });
     }
     if (strtolower(default_avatar_config()) == "gravatar") {
         $hook->add("Avatar_convert", function ($avatar) {
             if (strtolower($avatar) == "{default}") {
                 return "{gravatar}";
             }
             return $avatar;
         });
     }
 }
 * p01-contact for GetSimple - Simply add contact forms in your pages
 *
 * This plugin let you add contact forms in your pages by writing simple tags.
 * You can also define recipients or create your own complex forms.
 *
 * This file is the handle of p01-contact for GetSimple.
 *
 * @link http://nliautaud.fr/wiki/travaux/getsimple_p01-contact Documentation
 * @link http://get-simple.info/extend/plugin/p01-contact/35 Latest Version
 * @author Nicolas Liautaud <*****@*****.**>
 * @package p01-contact
 * @version 0.9.1
 */
require_once GSPLUGINPATH . 'p01-contact/p01-contact.php';
$p01contact = new P01contact();
$p01contact->default_email = admin_email();
$p01contact->default_lang = substr($LANG, 0, 2);
$p01contact->securimage_url = $SITEURL . 'plugins/p01-contact/captcha/';
$thisfile = basename(__FILE__, '.php');
register_plugin($thisfile, 'p01-contact', $p01contact->version, 'Nicolas Liautaud', 'http://nliautaud.fr', 'Simply add contact forms in your pages', 'plugins', 'p01contact_action');
add_filter('content', 'p01contact_filter');
add_action('plugins-sidebar', 'createSideMenu', array($thisfile, 'p01-contact'));
/*
 * Handle for GS content filter (parse GS pages)
 */
function p01contact_filter($contents)
{
    global $p01contact;
    $contents = $p01contact->parse($contents);
    if ($p01contact->settings('debug')) {
        $p01contact->debug();
Exemple #4
0
 /**
  * 获取网站系统参数
  * @return array
  */
 private function getSystemParams()
 {
     return ['site_url' => site_url(), 'site_title' => site_title(), 'site_desc' => site_desc(), 'admin_email' => admin_email(), 'site_time' => date("Y-m-d H:i:s")];
 }
Exemple #5
0
			<div class="col-sm-10">
				<input type="text" name="site_desc" class="form-control" value="<?php 
echo site_desc();
?>
" id="inputSiteDesc" placeholder="一句描述性语句">

				<p class="help-block">用一句详细的话来描述你的网站的特点及特性</p>
			</div>
		</div>
		<div class="form-group">
			<label for="inputAdminEmail" class="col-sm-2 control-label">管理员邮箱</label>

			<div class="col-sm-10">
				<input type="email" name="admin_email" class="form-control" value="<?php 
echo admin_email();
?>
" id="inputAdminEmail"
					   placeholder="邮箱地址">

				<p class="help-block">用于网站的系统提示等通知</p>
			</div>
		</div>
		<div class="form-group">
			<label for="inputSiteMode" class="col-sm-2 control-label">网站模式</label>

			<div class="col-sm-10">
				<select name="site_mode" class="form-control" id="inputSiteMode">
					<?php 
echo html_option(['http' => 'http', 'https' => 'https', 'all' => '兼容两者'], site_mode());
?>