Beispiel #1
0
        break;
    case 6:
        include ROOT_PATH . "/install/template/step6.php";
        //协议说明
        break;
    case 7:
        include ROOT_PATH . "/data/config.inc.php";
        //配置信息
        $link = mysql_connect($proverbdbhost, $proverbdbuser, $proverbdbpw);
        mysql_query('use `' . $proverbdbname . '`');
        mysql_query('set names ' . $proverbdbcharset);
        if (mysql_error()) {
            echo "<SCRIPT LANGUAGE='JavaScript'>window.location='index.php';</SCRIPT>";
        } else {
            $sql[] = "insert into {$proverbtable_prefix}setting(variable,content) values('site_title','" . addslashes(trim(strip_tags($_POST['site_title']))) . "'),('site_url','" . addslashes(trim(strip_tags($_POST['site_url']))) . "'),('site_charset','utf-8'),('adminpath','admin');";
            $sql[] = "replace INTO `{$proverbtable_prefix}admin` (`username`, `email`, `passwd`,`usertype`) VALUES('" . addslashes(trim(strip_tags($_POST['administr']))) . "', '" . addslashes(trim(strip_tags($_POST['email']))) . "', '" . md52($_POST['adminpassword']) . "', 'adminuser')";
            if (!empty($sql)) {
                foreach ($sql as $v) {
                    mysql_query($v) or die(mysql_error());
                }
            }
            touch(ROOT_PATH . '/data/install.lock');
            include ROOT_PATH . "/install/template/step7.php";
            //协议说明
        }
        break;
    default:
        include ROOT_PATH . "/install/template/step1.php";
        //协议说明
        break;
}
 function account_action()
 {
     if (!$GLOBALS['session']->get('uid')) {
         sheader(url('user', 'login'));
     }
     $container = "and uid=" . $GLOBALS['session']->get('uid');
     if (submitcheck('commit') && !empty($_POST['newpassword'])) {
         if ($_POST['newpassword'] != $_POST['newpassword1']) {
             sheader(url('user', 'account'), 3, '两次密码输入不一致', 'member_redirect');
         } else {
             $user = $this->user->GetOne($container . ' and pwd="' . md52($_POST['password']) . '"');
             if ($user) {
                 $data['pwd'] = md52($_POST['newpassword']);
                 if ($this->user->UpdateData($data, $container)) {
                     sheader(url('user', 'account'), 3, '资料修改成功', 'member_redirect');
                 } else {
                     sheader(url('user', 'account'), 3, '资料修改失败', 'member_redirect');
                 }
             } else {
                 sheader(url('user', 'account'), 3, '资料修改失败,用户不存在', 'member_redirect');
             }
         }
     } else {
         include template('member_account');
     }
 }
function getData($sql)
{
    $cachefile = md52($sql);
    if (!checkfile($cachefile)) {
        $data = array();
        $query = $GLOBALS['db']->query($sql);
        while ($d = $GLOBALS['db']->fetch_array($query)) {
            $data[] = $d;
        }
        write($cachefile, $data);
        return $data;
    } else {
        return read($cachefile);
    }
}
Beispiel #4
0
 /**
  *添加会员
  */
 function manageusermodify_action()
 {
     $updateid = intval($_REQUEST['updateid']);
     $user_mod = new common('admin');
     $user = array();
     if (submitcheck('commit')) {
         $data['username'] = trim(strip_tags($_POST['username']));
         $data['usertype'] = "adminuser";
         $data['email'] = trim(strip_tags($_POST['email']));
         $author['username'] = $data['username'];
         $author['urlname'] = Pinyin($data['username']);
         $author['email'] = $data['email'];
         $author['created_at'] = time();
         $author['location'] = "";
         if ($updateid > 0) {
             $user = $user_mod->GetOne('and uid=' . $updateid);
             if (!empty($_POST['password'])) {
                 $data['passwd'] = md52($_POST['password']);
                 $author['passwd'] = $data['passwd'];
             }
             if ($user_mod->UpdateData($data, 'and uid=' . $updateid)) {
                 sheader('index.php?con=' . $GLOBALS['setting']['adminpath'] . '&act=manageuser&type=manageuser', 3, '修改成功', 'redirect', true);
             } else {
                 sheader('index.php?con=' . $GLOBALS['setting']['adminpath'] . '&act=manageuser&type=manageuser', 3, '修改失败', 'redirect', true);
             }
         } else {
             $data['passwd'] = md52($_POST['password']);
             $author['passwd'] = $data['passwd'];
             $user_mod->InsertData($data);
             sheader('index.php?con=' . $GLOBALS['setting']['adminpath'] . '&act=manageuser&type=manageuser', 3, '添加成功', 'redirect', true);
         }
     } else {
         if ($updateid) {
             $user_mod->GetOne('and uid=' . $updateid);
         }
         include ROOT_PATH . '/views/admin/manageuser_form.php';
     }
 }
 function siteadd_action()
 {
     if (submitcheck('commit')) {
         $data['sitename'] = trim(strip_tags($_POST['sitename']));
         $data['siteurl'] = trim(strip_tags($_POST['siteurl']));
         $data['siteapi'] = trim(strip_tags($_POST['siteapi']));
         $data['connect_user'] = trim(strip_tags($_POST['people']));
         $data['cityid'] = trim($_POST['cityid']);
         $data['email'] = '*****@*****.**';
         $data['pwd'] = md52(microtime());
         $data['intro'] = '备注为空';
         $data['usertype'] = 'nulluser';
         $data['updatetime'] = time();
         $data['connect_type'] = '联系电话/QQ';
         $data['connect_content'] = trim(strip_tags($_POST['tel'])) . '/' . trim(strip_tags($_POST['qq']));
         if ($this->user->InsertData($data)) {
             sheader(url('index', 'siteadd'), 3, '网站提交成功,请等待管理员审核');
         } else {
             sheader(url('index', 'siteadd'), 3, '网站提交失败');
         }
     } else {
         include template('siteadd');
     }
 }
 function _autoInsertGroup($ids)
 {
     $container = $ids == -1 ? 'and id>0' : 'and id in (' . ($ids ? $ids : 0) . ')';
     $data = $this->tempsite->GetPage(array('isshow' => 0), $container);
     set_time_limit(0);
     foreach ($data as $k => $v) {
         $o = $v['oldprice'] > 0 ? $v['oldprice'] : 1;
         $data[$k]['discount'] = intval($v['nowprice'] * 100 / $v['oldprice']) / 10;
         $newtime = explode('+', $v['lasttime']);
         $startnewtime = explode('+', $v['starttime']);
         $data[$k]['grouptype'] = $grouptype;
         $data[$k]['cityname'] = $v['cityname'] ? $v['cityname'] : '其它';
         $data[$k]['cityid'] = $v['cityname'] ? Pinyin($v['cityname']) : 'qita';
         $lasttime = str_replace('日', '', str_replace('月', '-', str_replace('年', '-', trim($newtime[0]))));
         $lasttime = str_replace('秒', '', str_replace('分', ':', str_replace('时', ':', $lasttime)));
         $starttime = str_replace('日', '', str_replace('月', '-', str_replace('年', '-', trim($startnewtime[0]))));
         $starttime = str_replace('秒', '', str_replace('分', ':', str_replace('时', ':', $starttime)));
         $data[$k]['lasttime'] = strtotime($lasttime) > 0 ? strtotime($lasttime) : $lasttime;
         $data[$k]['starttime'] = strtotime($starttime) > 0 ? strtotime($starttime) : $starttime;
         $data[$k]['ispassed'] = $GLOBALS['setting']['site_allow_passed'] ? 1 : 0;
         if ($v['thumb']) {
             if ($GLOBALS['allowremote']) {
                 $thumb = $this->curl->get($v['thumb']);
                 if ($thumb) {
                     $file = explode('.', $v['thumb']);
                     $dir = 'data/upload/' . date('Y/m');
                     mkdir2(ROOT_PATH . '/' . $dir);
                     $stuff = str_replace('/', '', $file[count($file) - 1]);
                     if (!in_array(substr($stuff, 4), array('jpeg', 'png', 'jpg', 'gif'))) {
                         $stuff = 'jpg';
                     }
                     $file = md52(microtime()) . '.' . $stuff;
                     writefile(ROOT_PATH . '/' . $dir . '/' . $file, $thumb);
                     $data[$k]['thumb'] = $dir . '/' . $file;
                 } else {
                     $data[$k]['thumb'] = $v['thumb'];
                 }
             }
         }
     }
     foreach ($data as $k => $v) {
         $group = $this->group->GetOne('and subject="' . global_addslashes($v['subject']) . '" and siteid=' . $v['siteid']);
         if (!$group) {
             unset($v['id']);
             $this->group->InsertData($v);
         }
     }
     $this->tempsite->DeleteData('1 ' . $container);
     sleep(1);
 }