/**
  * Adds notifications if there are new theme version available.
  * Runs on time a day
  *
  * @return void
  */
 public static function check_update()
 {
     $lastChecked = (int) option::get('theme_last_checked');
     $temp_version = get_transient('wpzoom_temp_theme_version');
     // force a check if we think theme was updated
     if (!$temp_version) {
         set_transient('wpzoom_temp_theme_version', WPZOOM::$themeVersion);
     } else {
         if (version_compare($temp_version, WPZOOM::$themeVersion, '!=')) {
             $lastChecked = 0;
             set_transient('wpzoom_temp_theme_version', WPZOOM::$themeVersion);
         }
     }
     if ($lastChecked == 0 || $lastChecked + 60 * 60 * 24 < time()) {
         if (self::has_update()) {
             option::set('theme_status', 'needs_update');
         } else {
             option::delete('theme_status');
         }
         option::set('theme_last_checked', time());
     }
     if (option::get('theme_status') == 'needs_update' && current_user_can('update_themes')) {
         add_action('admin_notices', array(__CLASS__, 'notification'));
     }
 }
Esempio n. 2
0
function callback_init()
{
    global $m;
    $m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_ban` (\n`id`  int(255) NOT NULL AUTO_INCREMENT ,\n`uid`  int(255) NOT NULL ,\n`pid`  int(255) NOT NULL ,\n`tieba`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`user`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`date`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' ,\n`nextdo`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' ,\nPRIMARY KEY (`id`)\n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=12\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0;");
    option::set('plugin_wmzz_ban', 'a:2:{s:5:"limit";s:2:"10";s:3:"msg";s:63:"由于你违反了吧规,现在已被本吧管理循环封禁";}');
    cron::set('wmzz_ban', 'plugins/wmzz_ban/wmzz_ban_cron.php', 0, 0, 0);
}
function callback_init()
{
    option::add('wmzz_mailer_title');
    option::add('wmzz_mailer_text');
    option::set('wmzz_mailer_limit', '5');
    option::set('wmzz_mailer_last', '0');
    cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 0, 0, 0);
}
function callback_init()
{
    global $m;
    $m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_zan` (\n`id`  int(255) NOT NULL AUTO_INCREMENT ,\n`uid`  int(255) NOT NULL ,\n`num`  int(255) NULL DEFAULT 0 ,\n`lastdo`  date NOT NULL DEFAULT '0000-00-00' ,\nPRIMARY KEY (`id`, `uid`),\nUNIQUE INDEX `uid` (`uid`) USING BTREE \n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=3\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
    $m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "wmzz_zan_data` (\n`id`  int(255) NOT NULL AUTO_INCREMENT ,\n`uid`  int(255) NOT NULL DEFAULT 0 ,\n`pid`  int(255) NOT NULL DEFAULT 0 ,\n`tieba`  varchar(10000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`remain`  int(255) NOT NULL DEFAULT 0 ,\nPRIMARY KEY (`id`)\n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=7\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
    option::set('plugin_Cloud_Click', 'a:6:{s:3:"num";s:2:"10";s:2:"sp";s:1:"3";s:3:"rem";s:2:"10";s:4:"lmax";s:1:"0";s:4:"cmax";s:1:"0";s:3:"max";s:1:"0";}');
    cron::set('wmzz_zan', 'plugins/Cloud_Click/run.php', 0, 0, 0);
}
Esempio n. 5
0
function callback_init()
{
    //一些初始化数据
    $ary = array('img' => '', 'change' => '0', 'mode' => '0', 'repeat' => '0');
    option::set('mok_bgimg', serialize($ary));
    //上次自动更换日期、上次自动更换时间、现行背景图片
    $ary = array('day' => '0', 'hour' => '0', 'img' => '');
    option::set('mok_bgimg_img', serialize($ary));
    //bing每日壁纸
    option::set('mok_bgimg_bing', serialize(array('img' => '')));
}
Esempio n. 6
0
function callback_init()
{
    $day = option::get('dl_backup_day');
    $email = option::get('dl_backup_email');
    if (empty($day)) {
        option::set('dl_backup_day', 1);
    }
    if (empty($email)) {
        option::set('dl_backup_email', EMAIL);
    }
    cron::set('dl_backup', 'plugins/dl_backup/backup.php', 0, 0, 0);
}
/**
 * 云签到内部计划任务
 * [重新尝试签到出错的贴吧]
 */
function cron_system_sign_retry()
{
    global $i;
    $today = date('Y-m-d');
    $sign_again = unserialize(option::get('cron_sign_again'));
    if ($sign_again['lastdo'] != $today) {
        option::set('cron_sign_again', serialize(array('num' => 0, 'lastdo' => $today)));
    }
    foreach ($i['table'] as $value) {
        misc::DoSign_retry($value);
    }
}
function cron_reg_supervise()
{
    if (option::get('reg_supervise_run') == date('d')) {
        return ok;
    }
    global $m;
    $m->query("DELETE FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `" . DB_PREFIX . "users`.`role` = 'banned'");
    //当天清除昨天未激活用户(建议)
    $m->query("truncate table `" . DB_NAME . "`.`" . DB_PREFIX . "reg`");
    //清除注册ip记录(必须)
    option::set('reg_supervise_run', date('d'));
    return '成功';
}
Esempio n. 9
0
function cron_mok_zdwk()
{
    //如果今天签到过了直接返回日志
    if (option::get('mok_zdwk_run') == date('d')) {
        return option::get('mok_zdwk_log');
    }
    global $m;
    $prefix = DB_PREFIX;
    //选出用户的options和bduss
    $res = $m->query("SELECT {$prefix}users_options.`name` , {$prefix}users_options.`value` , {$prefix}baiduid.`bduss` \nFROM {$prefix}baiduid\nINNER JOIN {$prefix}users_options ON {$prefix}users_options.uid = {$prefix}baiduid.uid\nWHERE {$prefix}users_options.`name` =  'mok_zdwk_wk'\nOR {$prefix}users_options.`name` =  'mok_zdwk_zd'");
    $wk = $zd = 0;
    $bduss = array();
    if ($m->num_rows($res) != 0) {
        while ($row = $res->fetch_array()) {
            //判断该选项是否开启
            if ($row['value'] == 'on') {
                //记录bduss(数量),如果bduss数组内没有该bduss,则加入数组
                if (!in_array($row['bduss'], $bduss)) {
                    $bduss[] = $row['bduss'];
                }
                if ($row['name'] === 'mok_zdwk_wk') {
                    $wk++;
                    $head = array('Accept:*/*', 'Accept-Encoding:gzip, deflate, sdch', 'Accept-Language:zh-CN,zh;q=0.8', 'Connection:keep-alive', 'Host:wenku.baidu.com', 'Referer:http://wenku.baidu.com/task/browse/daily', 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', 'X-Requested-With:XMLHttpRequest');
                    $c = new wcurl('http://wenku.baidu.com/task/submit/signin', $head);
                    $c->addCookie('BDUSS=' . $row['bduss']);
                    $c->exec();
                    $c->close();
                } else {
                    if ($row['name'] === 'mok_zdwk_zd') {
                        $zd++;
                        $c = new wcurl('http://zhidao.baidu.com/');
                        $c->addCookie('BDUSS=' . $row["bduss"]);
                        $stoken = $c->get();
                        $c->close();
                        $stoken = textMiddle($stoken, '"stoken":"', '",');
                        if ($stoken != "") {
                            $c = new wcurl('http://zhidao.baidu.com/submit/user');
                            $c->addCookie('BDUSS=' . $row["bduss"]);
                            $c->post(array('cm' => '100509', 'utdata' => '90,90,102,96,107,101,99,97,96,90,98,103,103,99,127,106,99,99,14138554765830', 'stoken' => $stoken));
                            $c->close();
                        }
                    }
                }
            }
        }
    }
    $log = "知道、文库签到完毕<br/>" . date("Y-m-d H:i:s") . "<br/>共计百度账号: " . count($bduss) . " 个<br/>知道签到: {$zd} 个<br/>文库签到: {$wk} 个";
    option::set('mok_zdwk_run', date('d'));
    option::set('mok_zdwk_log', $log);
    return $log;
}
Esempio n. 10
0
 public function activate()
 {
     if (option::get('wpzoom_activated') != 'yes') {
         option::set('wpzoom_activated', 'yes');
         option::set('wpzoom_activated_time', time());
     } else {
         $activated_time = option::get('wpzoom_activated_time');
         if (time() - $activated_time < 2592000) {
             return;
         }
     }
     option::set('wpzoom_activated_time', time());
     require_once WPZOOM_INC . '/pages/welcome.php';
 }
Esempio n. 11
0
 public static function ajax()
 {
     if ($_POST['type'] == 'framework-notification-hide') {
         option::set('framework_last_checked', time() + 60 * 60 * 48);
         option::delete('framework_status');
         die;
     }
     if ($_POST['type'] == 'theme-notification-hide') {
         option::set('theme_last_checked', time() + 60 * 60 * 48);
         option::delete('theme_status');
         die;
     }
     die;
 }
Esempio n. 12
0
function cron_signtz_mail()
{
    global $m;
    $today = date("Y-m-d");
    $lastday = option::get('haotian_mail');
    if ((time() - 1396281600) % 86400 < 21600) {
        return '未到发送邮件时间';
    }
    if ($today != $lastday) {
        option::set('haotian_mail', $today);
    } else {
        return '今日任务已经执行完毕';
    }
    $query = $m->query("SELECT * FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users`");
    while ($fetch = $m->fetch_array($query)) {
        $mail = $fetch['email'];
        $name = $fetch['name'];
        $id = $fetch['id'];
        if (option::uget('haotian_mail_enable', $id) == 1) {
            $title = "[" . date("Y-m-d") . "] " . SYSTEM_NAME . " - {$name} - 签到报告";
            $query2 = $m->query("SELECT * FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "tieba` WHERE `uid`={$id}");
            $c = 0;
            $content = '<p class="sign_title">' . SYSTEM_NAME . ' - 签到报告</p><p>' . date("Y-m-d") . '<br>站点地址:<a href="' . SYSTEM_URL . '">' . SYSTEM_URL . '</a>' . '<br>若有大量贴吧签到失败,建议您重新设置 Cookie 相关信息</p><table class="result_table"><thead><tr><td style="width: 40px">#</td><td>贴吧</td><td style="width: 75px">状态</td><td style="width: 75px">经验</td></tr></thead><tbody>';
            while ($ff = $m->fetch_array($query2)) {
                $c++;
                $tie8 = $ff['tieba'];
                $status = $ff['status'];
                $content .= "<tr><td>{$c}</td><td><a href=" . '"http://tieba.baidu.com/f?kw=' . urlencode($tie8) . '" target="_blank">' . $tie8 . '</a>' . "</td>";
                if ($status == 0) {
                    $content .= "<td>已签到</td><td>+8</td>";
                } else {
                    $content .= "<td>签到失败</td><td>-</td>";
                }
                $content .= "</tr>";
            }
            $content .= "</tbody></table>";
            $content = '<style type="text/css">div.wrapper * { font: 12px "Microsoft YaHei", arial, helvetica, sans-serif; word-break: break-all; }div.wrapper a { color: #15c; text-decoration: none; }div.wrapper a:active { color: #d14836; }div.wrapper a:hover { text-decoration: underline; }div.wrapper p { line-height: 20px; margin: 0 0 .5em; text-align: center; }div.wrapper .sign_title { font-size: 20px; line-height: 24px; }div.wrapper .result_table { width: 85%; margin: 0 auto; border-spacing: 0; border-collapse: collapse; }div.wrapper .result_table td { padding: 10px 5px; text-align: center; border: 1px solid #dedede; }div.wrapper .result_table tr { background: #d5d5d5; }div.wrapper .result_table tbody tr { background: #efefef; }div.wrapper .result_table tbody tr:nth-child(odd) { background: #fafafa; }</style><div class="wrapper">' . $content . '</div><br><p style="font-size: 12px; color: #9f9f9f; text-align: right; border-top: 1px solid #dedede; padding: 20px 10px 0; margin-top: 25px;">此封邮件来自 百度贴吧云签到<br>Haotian Mail API v0.1, 2014 &copy; <a href="http://ihaotian.me/">Haotian\'s Laboratory</a>.</p>';
            if ($c == 0) {
                continue;
            }
            $x = misc::mail($mail, $title, $content);
            if ($x != true) {
                return '发送失败,错误日志:' . $x;
            }
        }
    }
    return '邮件发送成功!';
}
Esempio n. 13
0
/**
 * [cron_lwl12_resign 修改数据库日期]
 * @return [none]
 */
function cron_lwl12_resign()
{
    $s = unserialize(option::get('plugin_lwl12_resign'));
    date_default_timezone_set('PRC');
    global $m, $i;
    if (date('G') >= $s['hour']) {
        if (date('i') >= $s['min']) {
            if (option::get('plugin_lwl12_resign_lastdate' != date('j'))) {
                echo "OK";
                foreach ($i['table'] as $table) {
                    $m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . $table . "` SET  `lastdo` =  '" . date('Y-m-d', strtotime('-1 day')) . "'", true);
                }
                option::set('plugin_lwl12_resign_lastdate', date('j'));
            }
        }
    }
}
Esempio n. 14
0
function cron_wmzz_mailer()
{
    global $m;
    $check = option::get('wmzz_mailer_check');
    if ($check == '1') {
        $text = option::get('wmzz_mailer_text');
        $title = option::get('wmzz_mailer_title');
        $limit = option::get('wmzz_mailer_limit');
        $last = option::get('wmzz_mailer_last');
        $done = 0;
        $z = $m->query("SELECT * FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users` LIMIT {$last},{$limit}");
        while ($v = $m->fetch_array($z)) {
            $done++;
            misc::mail($v['email'], $title, $text);
        }
        if ($done - $limit <= -1) {
            option::set('wmzz_mailer_check', '0');
            option::set('wmzz_mailer_last', '0');
            cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 1);
            return '所有邮件群发任务于 ' . date('Y-m-d H:m:s') . ' 完成';
        }
        option::set('wmzz_mailer_last', $done + $last);
    }
}
Esempio n. 15
0
function callback_install()
{
    option::set('xy_import_gs', '{百度ID}----BDUSS={百度BDUSS}');
    option::set('xy_import_check', 1);
    option::set('xy_import_refresh', 1);
}
Esempio n. 16
0
    }
    $osq = $m->query("SELECT * FROM  `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE `name` = '{$name}' OR `email` = '{$name}' LIMIT 1");
    if ($m->num_rows($osq) == 0) {
        ReDirect("index.php?mod=login&error_msg=" . urlencode('账户不存在 [ 提示:账户不是昵称,账户可为用户名或者邮箱地址 ]'));
        die;
    }
    $p = $m->fetch_array($osq);
    if (EncodePwd($pw) != $p['pw']) {
        ReDirect("index.php?mod=login&error_msg=" . urlencode('密码错误'));
        die;
    } else {
        doAction('admin_login_3');
        if (isset($_POST['ispersis']) && $_POST['ispersis'] == 1) {
            $cktime = (int) option::get('cktime');
            if (empty($cktime)) {
                option::set('cktime', '999999');
                $cktime = 999999;
            }
            setcookie("uid", $p['id'], time() + $cktime);
            setcookie("pwd", substr(sha1(EncodePwd(EncodePwd($pw))), 4, 32), time() + $cktime);
            ReDirect('index.php');
        } else {
            setcookie("uid", $p['id']);
            setcookie("pwd", substr(sha1(EncodePwd(EncodePwd($pw))), 4, 32));
            ReDirect('index.php');
        }
    }
    doAction('admin_login_2');
} elseif (SYSTEM_PAGE == 'admin:reg') {
    if (defined('ROLE')) {
        ReDirect('index.php');
Esempio n. 17
0
<?php

define('SYSTEM_NO_ERROR', true);
define('SYSTEM_ONLY_CHECK_LOGIN', true);
require '../init.php';
global $m;
error_reporting(0);
if (ROLE == 'admin') {
    option::set('cron_pw', '');
    option::set('sign_sleep', '0');
    cron::add('system_sign', array('file' => 'lib/cron_system_sign.php', 'no' => 0, 'status' => 0, 'freq' => 0, 'lastdo' => 0));
    $m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "users_options` (\n`id`  int(30) NOT NULL AUTO_INCREMENT ,\n`uid`  int(30) NOT NULL ,\n`name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\n`value`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,\nPRIMARY KEY (`id`)\n)\nENGINE=MyISAM\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\nAUTO_INCREMENT=2\nCHECKSUM=0\nROW_FORMAT=DYNAMIC\nDELAY_KEY_WRITE=0\n;");
    $m->query("ALTER TABLE `" . DB_PREFIX . "cron`\nMODIFY COLUMN `name`  varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `id`,\nDROP INDEX `name` ,\nADD UNIQUE INDEX `name` (`name`) ;");
    $m->query("ALTER TABLE `" . DB_PREFIX . "users`\nMODIFY COLUMN `role`  enum('banned','vip','user','admin') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'user' AFTER `email`;");
    unlink(__FILE__);
    msg('您的云签到已成功升级到 V3.4 版本,请立即删除 /setup/update3.3to3.4.php,谢谢');
} else {
    msg('您需要先登录旧版本的云签到,才能继续升级');
}
Esempio n. 18
0
 /**
  * Checks if we are going to make an update and updates current framework to latest version
  */
 public static function update_init()
 {
     global $r;
     if (!isset($_GET['page'])) {
         return;
     }
     $requestedPage = strtolower(strip_tags(trim($_REQUEST['page'])));
     if ($requestedPage != 'wpzoom_update') {
         return;
     }
     $fsmethod = get_filesystem_method();
     $fs = WP_Filesystem();
     if ($fs == false) {
         function framework_update_filesystem_warning()
         {
             $method = get_filesystem_method();
             echo "<p>Failed: Filesystem preventing downloads. ({$method})</p>";
         }
         add_action('admin_notices', 'framework_update_filesystem_warning');
         return;
     }
     if (isset($_POST['wpzoom-update-do'])) {
         $action = strtolower(trim(strip_tags($_POST['wpzoom-update-do'])));
         if ($action == 'update') {
             $fwUrl = 'http://framework.wpzoom.com/wpzoom-framework.zip';
             $fwFile = download_url($fwUrl);
             if (is_wp_error($fwUrl)) {
                 $error = $fwFile->get_error_code();
                 if ($error == 'http_no_url') {
                     $r = "<p>Failed: Invalid URL Provided</p>";
                 } else {
                     $r = "<p>Failed: Upload - {$error}</p>";
                 }
                 function framework_update_warning()
                 {
                     global $r;
                     echo "<p>{$r}</p>";
                 }
                 add_action('admin_notices', 'framework_update_warning');
                 return;
             }
         }
         global $wp_filesystem;
         $to = WPZOOM::get_wpzoom_root();
         $dounzip = unzip_file($fwFile, $to);
         unlink($fwFile);
         if (is_wp_error($dounzip)) {
             $error = $dounzip->get_error_code();
             $data = $dounzip->get_error_data($error);
             if ($error == 'incompatible_archive') {
                 //The source file was not found or is invalid
                 function framework_update_no_archive_warning()
                 {
                     echo "<p>Failed: Incompatible archive</p>";
                 }
                 add_action('admin_notices', 'framework_update_no_archive_warning');
             }
             if ($error == 'empty_archive') {
                 function framework_update_empty_archive_warning()
                 {
                     echo "<p>Failed: Empty Archive</p>";
                 }
                 add_action('admin_notices', 'framework_update_empty_archive_warning');
             }
             if ($error == 'mkdir_failed') {
                 function framework_update_mkdir_warning()
                 {
                     echo "<p>Failed: mkdir Failure</p>";
                 }
                 add_action('admin_notices', 'framework_update_mkdir_warning');
             }
             if ($error == 'copy_failed') {
                 function framework_update_copy_fail_warning()
                 {
                     echo "<p>Failed: Copy Failed</p>";
                 }
                 add_action('admin_notices', 'update_copy_fail_warning');
             }
             return;
         }
         function framework_updated_success()
         {
             echo '<div class="updated fade"><p>New framework successfully downloaded, extracted and updated.</p></div>';
         }
         add_action('admin_notices', 'framework_updated_success');
         remove_action('admin_notices', array('WPZOOM', 'notification'));
         option::delete('framework_status');
         option::set('framework_last_checked', time());
     }
 }
Esempio n. 19
0
<?php

if (!defined('SYSTEM_ROOT')) {
    die('Insufficient Permissions');
}
if (ROLE != 'admin') {
    msg('权限不足!');
}
if (isset($_GET['setting'])) {
    option::set('wmzz_ds_code', htmlspecialchars_decode($_POST['wmzz_ds_code']));
    ReDirect('index.php?mod=admin:setplug&plug=wmzz_ds&ok');
}
Esempio n. 20
0
    die('{"info":"批量导入完成。<br/><br/>匹配行数:[' . $hs . ']<br/>导入成功:[' . $ok . ']<br/>导入失败:[' . $err . ']<br/>更新记录:[' . $up . ']<br/>失效数量:[' . $sx . ']<br/>已存在数:[' . $cf . ']<br/>"' . $info . '}');
}
//基本设置
if (isset($_GET['set'])) {
    if (!empty($_POST['gs'])) {
        $gs = ' ' . $_POST['gs'];
        if (!stristr($gs, '{百度ID}')) {
            die('{"type":"error","emsg":"缺少参数 <strong>{百度ID}</strong> !"}');
        } elseif (!stristr($gs, '{百度BDUSS}')) {
            die('{"type":"error","emsg":"缺少参数 <strong>{百度BDUSS}</strong> !"}');
        }
        $check = !empty($_POST['check']) ? 1 : 0;
        $refresh = !empty($_POST['refresh']) ? 1 : 0;
        option::set('xy_import_gs', $_POST['gs']);
        option::set('xy_import_check', $_POST['check']);
        option::set('xy_import_refresh', $_POST['refresh']);
        die('{"type":"success","regular":"' . urlencode(getgs($_POST['gs'])) . '"}');
    } else {
        die('{"type":"error","emsg":"导入格式不能为空!"}');
    }
}
//删除所有绑定
if (isset($_GET['delete'])) {
    $s = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` where `uid` = '" . UID . "';");
    while ($x = $m->fetch_array($s)) {
        $t = $m->once_fetch_array("SELECT `t` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` where `id` = '" . UID . "';");
        $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . $t['t'] . "` WHERE `uid` = '" . UID . "' and `pid` = '" . $x['id'] . "';");
        $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `uid` = '" . UID . "' and `id` = '" . $x['id'] . "';");
    }
    echo '<script language="JavaScript">alert("删除所有绑定完成。");location.href="index.php?mod=baiduid";</script>';
}
Esempio n. 21
0
', true);
    $m->query('ALTER TABLE `' . DB_PREFIX . $value . '`
MODIFY COLUMN `status`  tinyint(2) UNSIGNED NOT NULL DEFAULT 0 AFTER `no`;
', true);
    $m->query('ALTER TABLE `' . DB_PREFIX . $value . '`
ADD INDEX `latest` (`latest`) USING BTREE ;', true);
}
$m->query('
ALTER TABLE `' . DB_PREFIX . 'baiduid`
MODIFY COLUMN `id`  int(30) UNSIGNED NOT NULL AUTO_INCREMENT FIRST ,
MODIFY COLUMN `uid`  int(30) UNSIGNED NOT NULL AFTER `id`,
ADD INDEX (`name`);
', true);
$m->query('
ALTER TABLE `' . DB_PREFIX . 'cron`
ADD INDEX `name` (`name`) USING BTREE;
', true);
$m->query('ALTER TABLE `' . DB_PREFIX . 'cron`
MODIFY COLUMN `no` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `file`;
', true);
$m->query('ALTER TABLE `' . DB_PREFIX . 'users_options`
ADD INDEX `name` (`name`) USING BTREE ;
', true);
$m->query('ALTER TABLE `' . DB_PREFIX . 'plugins`
ADD `ver` varchar(15) DEFAULT NULL,
ADD `order` int(10) unsigned NOT NULL DEFAULT 0;
', true);
//------------------------------------------------//
//unlink(__FILE__);
option::set('core_version', '4.0');
msg('您的云签到已成功升级到 V4.0 版本,请立即删除 /setup/update3.9to4.0.php,谢谢<br/><br/>若要获取 V4.0 版本新特性,请前往 <a href="http://www.stus8.com/forum.php?mod=viewthread&tid=6411">StusGame GROUP</a> ', SYSTEM_URL);
Esempio n. 22
0
<?php

if (ROLE === 'admin') {
    $doa = empty($_POST['wmzz_anno_doa']) ? array() : $_POST['wmzz_anno_doa'];
    option::set('wmzz_anno_set', htmlspecialchars_decode($_POST['wmzz_anno_set']));
    option::set('wmzz_anno_tpl', htmlspecialchars_decode($_POST['wmzz_anno_tpl']));
    option::set('wmzz_anno_doa', serialize($doa));
    ReDirect('index.php?mod=admin:setplug&plug=wmzz_anno&ok');
}
Esempio n. 23
0
        $dump .= 'SET FOREIGN_KEY_CHECKS=0;' . PHP_EOL;
        $dump .= 'SET time_zone = "+8:00";' . PHP_EOL . PHP_EOL;
        while ($v = $m->fetch_array($e)) {
            $list = $v;
            foreach ($list as $table) {
                $dump .= dataBak($table);
            }
        }
        $dump .= PHP_EOL . '-------------- End --------------';
        $title = SYSTEM_NAME . " " . date('Y-m-d') . " 数据库备份";
        $x = misc::mail($email, $title, "备份文件已附上,请查看附件", array('backup-' . date('Ymd') . '.sql' => $dump));
        if ($x != true) {
            option::set('dl_backup_log', date('Y-m-d H:i:s') . '  数据库备份邮件发送失败!');
            ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&wrong');
        } else {
            option::set('dl_backup_log', date('Y-m-d H:i:s') . '  数据库备份邮件发送成功!');
            ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&success');
        }
    }
}
?>
<h3>自动数据库备份设置</h3><br/>
<form action="index.php?mod=admin:setplug&plug=dl_backup&set" method="post">
	<div class="input-group">
		<span class="input-group-addon">接收备份邮箱</span>
		<input type="email" name="email" class="form-control" value="<?php 
echo option::get('dl_backup_email');
?>
" required/>
	</div><br/>
	<div class="input-group">
Esempio n. 24
0
 /**
  * Handle Ajax calls for option updates.
  *
  * @return void
  */
 public static function ajax_options()
 {
     parse_str($_POST['data'], $data);
     check_ajax_referer('wpzoom-ajax-save', '_ajax_nonce');
     if ($data['misc_import']) {
         option::setupOptions($data['misc_import'], true);
         wp_send_json_success();
     }
     if ($data['misc_import_widgets']) {
         option::setupWidgetOptions($data['misc_import_widgets'], true);
         wp_send_json_success();
     }
     new WPZOOM_Admin_Settings_Sanitization();
     foreach (option::$options as $name => $null) {
         $ignored = array('misc_export', 'misc_export_widgets', 'misc_debug');
         if (in_array($name, $ignored)) {
             continue;
         }
         if (isset($data[$name])) {
             $value = $data[$name];
             if (!is_array($data[$name])) {
                 $value = stripslashes($value);
             }
         } else {
             $value = 'off';
         }
         /*
          * Filter for custom options validators.
          */
         $value = apply_filters('zoom_field_save_' . $name, $value);
         option::set($name, $value);
     }
     do_action('zoom_after_options_save');
     wp_send_json_success();
 }
Esempio n. 25
0
function reg_supervise_yx()
{
    global $m;
    $name = isset($_POST['user']) ? addslashes(strip_tags($_POST['user'])) : '';
    $mail = isset($_POST['mail']) ? addslashes($_POST['mail']) : '';
    $pw = isset($_POST['pw']) ? addslashes(strip_tags($_POST['pw'])) : '';
    $role = 'banned';
    $m->query('INSERT INTO `' . DB_NAME . '`.`' . DB_PREFIX . 'users` (`id`, `name`, `pw`, `email`, `role`, `t`) VALUES (NULL, \'' . $name . '\', \'' . EncodePwd($pw) . '\', \'' . $mail . '\', \'' . $role . '\', \'' . getfreetable() . '\');');
    $ip = $_SERVER['REMOTE_ADDR'];
    setcookie("reg_check", date('d'), time() + 86400);
    $m->query('INSERT INTO `' . DB_NAME . '`.`' . DB_PREFIX . 'reg` (`ip`) VALUES (\'' . $ip . '\');');
    $key = sha1(md5(EncodePwd($pw) . date('Ymd') . option::get(salt)));
    $title = strip_tags(SYSTEM_NAME) . " - 注册验证";
    $text = "你在" . SYSTEM_URL . "   使用IP:" . $ip . "  用此邮箱注册了账号,账号:" . $name . ",密码" . $pw . "<br>点击以下链接完成安全验证,即可正常使用本站服务。如果显示禁止访问,使用浏览器隐身模式再打开链接即可<br><p>本邮件为系统自动发送,请勿回复。如果你没有进行此操作,可能是有人冒用了此邮箱,请不要点击链接</p><br>验证链接(当日有效):" . SYSTEM_URL . "index.php?pub_plugin=reg_supervise" . '&jh' . '&email=' . base64_encode($mail) . '&key=' . $key;
    $x = misc::mail($mail, $title, $text);
    if ($x != true) {
        $m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . "users` SET `role` = 'user' WHERE email = '{$mail}'");
        $js = option::get('reg_jg');
        option::set('reg_jg', $js + 1);
        ReDirect(SYSTEM_URL . 'index.php?pub_plugin=reg_supervise&error_msg=验证邮件发送失败!已为你激活用户!请登录。');
        die;
    } else {
        option::set('reg_jg', 0);
        ReDirect(SYSTEM_URL . 'index.php?pub_plugin=reg_supervise&success_msg=请登录你的邮箱点击确认链接!否则无法登陆本站!');
    }
    die;
}
Esempio n. 26
0
 switch (strip_tags($_GET['setting'])) {
     case 'optim':
         global $m;
         $rs = $m->query("SHOW TABLES FROM `" . DB_NAME . '`');
         while ($row = $m->fetch_row($rs)) {
             $m->query('OPTIMIZE TABLE  `' . DB_NAME . '`.`' . $row[0] . '`');
         }
         break;
     case 'fixdoing':
         option::set('cron_isdoing', 0);
         break;
     case 'reftable':
         option::set('freetable', getfreetable());
         break;
     case 'cron_sign_again':
         option::set('cron_sign_again', '');
         break;
     case 'runsql':
         global $m;
         if (!empty($_POST['sql'])) {
             $sql = str_ireplace('{VAR-DBNAME}', DB_NAME, str_ireplace('{VAR-PREFIX}', DB_PREFIX, $_POST['sql']));
             $m->xquery($sql);
         }
         break;
     case 'backup':
         global $m;
         $list = !empty($_POST['tab']) ? array_map('addslashes', $_POST['tab']) : msg('请至少选择一个需要导出的表');
         $dump = '#Warning: Do not change the comments!!!' . "\n";
         $dump .= '#Tieba-Cloud-Sign Database Backup' . "\n";
         $dump .= '#Version:' . SYSTEM_VER . "\n";
         $dump .= '#Date:' . date('Y-m-d H:m:s') . "\n";
Esempio n. 27
0
         DeleteFile(UPDATE_CACHE);
         msg('错误 - 更新失败:<br/><br/>无法更新文件');
     }
     DeleteFile(UPDATE_CACHE);
     //获取最新的版本号
     $c = new wcurl('http://kenvix.oschina.io/tieba-cloud-sign/');
     $data = json_decode($c->exec(), true);
     $c->close();
     //修改版本号
     option::set('vid', $data['vid']);
     //暂不支持更新脚本
     msg('恭喜您,更新成功!', SYSTEM_URL . 'index.php?mod=admin:update&ok');
     break;
 case 'admin:update:changeServer':
     if (isset($_GET['server'])) {
         option::set('update_server', $_GET['server']);
     }
     break;
 case 'baiduid:getverify':
     global $m;
     if (option::get('bduss_num') == '-1' && ROLE != 'admin') {
         msg('本站禁止绑定新账号');
     }
     if (option::get('bduss_num') != '0' && ISVIP == false) {
         $count = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `uid` = " . UID);
         if ($count['c'] + 1 > option::get('bduss_num')) {
             msg('您当前绑定的账号数已达到管理员设置的上限<br/><br/>您当前已绑定 ' . $count['c'] . ' 个账号,最多只能绑定 ' . option::get('bduss_num') . ' 个账号');
         }
     }
     $name = !empty($_POST['bd_name']) ? $_POST['bd_name'] : die;
     $pw = !empty($_POST['bd_pw']) ? $_POST['bd_pw'] : die;
Esempio n. 28
0
function callback_inactive()
{
    global $m;
    option::set('dl_intive_enable', '');
    $m->query('DROP TABLE `' . DB_NAME . '`.`' . DB_PREFIX . 'dl_invite`');
}
Esempio n. 29
0
function mok_bgimg_header()
{
    global $i;
    $mok_bgimg = unserialize($i['opt']['mok_bgimg']);
    $mok_bgimg_img = unserialize($i['opt']['mok_bgimg_img']);
    $mok_bgimg_bing = unserialize($i['opt']['mok_bgimg_bing']);
    $img = explode("\r\n", $mok_bgimg['img']);
    //图片列表
    if (count($img) > 0 || $mok_bgimg_img['bing'] == '1') {
        //至少要有一张图片或开启bing每日壁纸
        //自动更换
        if ($mok_bgimg['change'] != 0) {
            $change = false;
            //是否更换
            if ($mok_bgimg['change'] == 1) {
                //每天更换
                if ($mok_bgimg_img['day'] != date('d')) {
                    $change = true;
                }
            } elseif ($mok_bgimg['change'] == 2) {
                //每小时更换
                if ($mok_bgimg_img['hour'] != date('H')) {
                    $change = true;
                }
            } elseif ($mok_bgimg['change'] == 3) {
                //每次访问更换
                $change = true;
            }
            if ($change) {
                //记录背景更换时间
                $mok_bgimg_img['day'] = date('d');
                $mok_bgimg_img['hour'] = date('H');
                if ($mok_bgimg['bing'] == '1') {
                    //如果使用bing每日壁纸
                    $c = new wcurl('http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1');
                    $data = json_decode($c->get(), true);
                    $c->close();
                    if (!empty($data['images'][0]['url'])) {
                        option::set('mok_bgimg_bing', serialize(array('img' => $data['images'][0]['url'])));
                        $mok_bgimg_img['img'] = $data['images'][0]['url'];
                    }
                } else {
                    if ($mok_bgimg['mode'] == 0) {
                        //顺序更换
                        $key = array_search($mok_bgimg_img['img'], $img);
                        //在图片列表中寻找当前背景图的序号
                        if ($key !== false) {
                            if (count($img) == $key + 1) {
                                //如果当前图片已经是最后一张
                                $mok_bgimg_img['img'] = $img[0];
                            } else {
                                $mok_bgimg_img['img'] = $img[$key + 1];
                            }
                        } else {
                            //如果在图片列表中没有找到当前背景图,就从第一张背景图开始
                            $mok_bgimg_img['img'] = $img[0];
                        }
                    } elseif ($mok_bgimg['mode'] == 1) {
                        //随机更换
                        $mok_bgimg_img['img'] = $img[mt_rand(0, count($img) - 1)];
                    }
                }
            }
        }
        //第一次安装插件时此值为空,自动使用第一张图
        if ($mok_bgimg_img['img'] == '') {
            $mok_bgimg_img['img'] = $img[0];
        }
        //背景重复
        if ($mok_bgimg['repeat'] == 3 || $mok_bgimg['repeat'] == 4) {
            //静态悬浮
            if ($mok_bgimg['repeat'] == 3) {
                echo '<div id="mok_bgimg" style="width:100%;height:100%;background-size:100% 100%;background-image:url(\'' . $mok_bgimg_img['img'] . '\');position:fixed;"></div>';
            } else {
                echo '<div id="mok_bgimg" style="width:100%;height:100%;background-size:100% auto;background-image:url(\'' . $mok_bgimg_img['img'] . '\');position:fixed;"></div>';
            }
        } else {
            if ($mok_bgimg['repeat'] == 0) {
                //纵向重复
                $tmp[] = 'background-repeat:repeat-y';
            } else {
                $tmp[] = 'background-repeat:no-repeat';
            }
            if ($mok_bgimg['repeat'] == 2) {
                //拉伸全屏
                $tmp[] = 'background-size:100% 100%';
            } else {
                $tmp[] = 'background-size:100% auto';
            }
            $tmp[] = 'background-image:url(' . $mok_bgimg_img['img'] . ')';
            $css = implode(';', $tmp) . ';';
            echo '<style>body {' . $css . '}</style>';
        }
        option::set('mok_bgimg_img', serialize($mok_bgimg_img));
        //保存背景图片和更换时间
        //透明选项
        $css = '<style>';
        if ($mok_bgimg['daohang'] == 1) {
            $css .= '.navbar{background:none !important}';
        }
        if ($mok_bgimg['chengxuxinxi'] == 1) {
            $css .= '.panel{background:none !important}';
        }
        if ($mok_bgimg['yonghuxinxi'] == 1) {
            $css .= '.list-group-item{background:none !important}';
        }
        if ($mok_bgimg['liebiao'] == 1) {
            $css .= '.table-striped>tbody>tr:nth-of-type(odd){background:none !important}';
        }
        if ($mok_bgimg['liebiaoxian'] == 1) {
            $css .= '.table>tbody>tr>td{border-top:none !important}';
        }
        if ($mok_bgimg['tishikuang'] == 1) {
            $css .= '.alert{background:none !important}';
        }
        if ($mok_bgimg['caidan'] == 1) {
            $css .= '.nav>li>a:hover, .nav>li>a:focus{background:none !important}';
        }
        if ($mok_bgimg['shurukuang'] == 1) {
            $css .= '.form-control{background:none !important}';
        }
        if ($mok_bgimg['anniu'] == 1) {
            $css .= '.btn{background:none !important}';
        }
        //字体颜色
        if (!empty($mok_bgimg['c_putong'])) {
            $css .= 'body{color:' . $mok_bgimg['c_putong'] . '}';
        }
        if (!empty($mok_bgimg['c_zuoce'])) {
            $css .= '.container .nav>li>a{color:' . $mok_bgimg['c_zuoce'] . '}';
        }
        if (!empty($mok_bgimg['c_dingbu'])) {
            $css .= '.navbar-default .navbar-nav>li>a,.navbar-default .navbar-brand{color:' . $mok_bgimg['c_dingbu'] . ' !important}';
        }
        if (!empty($mok_bgimg['c_shurukuang'])) {
            $css .= '.form-control{color:' . $mok_bgimg['c_shurukuang'] . '}';
        }
        $css .= '</style>';
        echo $css;
    }
}
Esempio n. 30
0
function callback_inactive()
{
    option::set('yr_reg', '');
}