public static function GetRandStr($len)
 {
     $chars_array = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
     $charsLen = count($chars_array) - 1;
     $outputstr = "";
     for ($i = 0; $i < $len; $i++) {
         $outputstr .= $chars_array[mt_rand(0, $charsLen)];
     }
     if (preg_match("/^\\d*\$/", $outputstr)) {
         GetRandStr($len);
     }
     if (preg_match("/^[a-z]*\$/i", $outputstr)) {
         GetRandStr($len);
     }
     return $outputstr;
 }
Beispiel #2
0
 echo '<script>$("#install").append("管理员信息导入完成!<br />");</script>';
 ob_flush();
 flush();
 //初始化环境变量
 if (!empty($_SERVER['REQUEST_URI'])) {
     $scriptName = $_SERVER['REQUEST_URI'];
 } else {
     $scriptName = $_SERVER['PHP_SELF'];
 }
 $basepath = preg_replace("#\\/install(.*)\$#i", '', $scriptName);
 if (!empty($_SERVER['HTTP_HOST'])) {
     $baseurl = 'http://' . $_SERVER['HTTP_HOST'];
 } else {
     $baseurl = 'http://' . $_SERVER['SERVER_NAME'];
 }
 $authkey = GetRandStr(16);
 //导入网站配置
 //替换安装地址与目录
 $data_str = "INSERT INTO `#@__webconfig` VALUES('1','cfg_webname','网站名称','0','string','我的网站','1');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_weburl','网站地址','0','string','{$baseurl}','2');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_webpath','网站目录','0','string','{$basepath}','3');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_author','网站作者','0','string','','4');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_generator','程序引擎','0','string','HansaCMS','5');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_seotitle','SEO标题','0','string','','6');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_keyword','关键字设置','0','string','','7');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_description','网站描述','0','bstring','','8');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_copyright','版权信息','0','bstring','Copyright © 2010 - 2015 Hansa All Rights Reserved','9');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_hotline','客服热线','0','string','400-800-8888','10');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_icp','备案编号','0','string','','11');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_webswitch','启用站点','0','bool','Y','12');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_switchshow','关闭说明','0','bstring','对不起,网站维护,请稍后登录。<br />网站维护期间对您造成的不便,请谅解!','13');\n\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_upload_img_type','上传图片类型','1','string','gif|png|jpg|bmp','23');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_upload_soft_type','上传软件类型','1','string','zip|gz|rar|iso|doc|xls|ppt|wps|txt','24');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_upload_media_type','上传媒体类型','1','string','swf|flv|mpg|mp3|rm|rmvb|wmv|wma|wav','25');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_max_file_size','上传文件大小','1','string','2097152','26');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_imgresize','自动缩略图方式 <br />(是\"裁切\",否\"填充\")','1','bool','Y','27');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_countcode','流量统计代码','1','bstring','','28');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_qqcode','在线QQ <br />(多个用\",\"分隔)','1','bstring','','29');\n\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_mysql_type','数据库类型(支持mysql和mysqli)','2','string','mysqli','40');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_pagenum','每页显示记录数','2','string','20','41');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_timezone','服务器时区设置','2','string','8','42');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_mobile','自动跳转手机版','2','bool','Y','43');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_member','开启会员功能','2','bool','Y','44');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_oauth','开启一键登录','2','bool','Y','45');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_comment','开启文章评论','2','bool','Y','46');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_maintype','开启二级类别','2','bool','N','47');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_typefold','类别默认折叠','2','bool','N','48');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_quicktool','管理页工具条','2','bool','Y','49');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_diserror','PHP错误显示','2','bool','Y','50');\n\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_isreurl','是否启用伪静态','3','bool','N','60');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_index','首页规则','3','string','index.html','61');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_about','关于我们页','3','string','{about}-{cid}-{page}.html','62');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_news','新闻中心页','3','string','{news}-{cid}-{page}.html','63');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_newsshow','新闻内容页','3','string','{newsshow}-{cid}-{id}-{page}.html','64');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_product','产品展示页','3','string','{product}-{cid}-{page}.html','65');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_productshow','产品内容页','3','string','{productshow}-{cid}-{id}-{page}.html','66');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_case','案例展示页','3','string','{case}-{cid}-{page}.html','67');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_caseshow','案例内容页','3','string','{caseshow}-{cid}-{id}-{page}.html','68');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_join','人才招聘页','3','string','{join}-{page}.html','69');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_joinshow','招聘内容页','3','string','{joinshow}-{id}.html','70');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_message','客户留言页','3','string','{message}-{page}.html','71');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_contact','联系我们页','3','string','{contact}-{cid}-{page}.html','72');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_soft','软件下载页','3','string','{soft}-{cid}-{page}.html','73');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_softshow','软件内容页','3','string','{softshow}-{cid}-{id}-{page}.html','74');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_goods','商品展示页','3','string','{goods}-{cid}-{tid}-{page}.html','75');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_goodsshow','商品内容页','3','string','{goodsshow}-{cid}-{tid}-{id}-{page}.html','76');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_vote','投票内容页','3','string','{vote}-{id}.html','77');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_reurl_custom','自定义规则','3','string','{file}.html','78');\n\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_auth_key','网站标识码','4','string','{$authkey}','90');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_alipay_uname','支付宝帐户','4','string','','91');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_alipay_partner','支付宝合作身份者ID','4','string','','92');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_alipay_key','支付宝安全检验码','4','string','','93');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_qq_appid','QQ登录组件AppID','4','string','','94');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_qq_appkey','QQ登录组件AppKey','4','string','','95');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_weibo_appid','微博登录组件AppID','4','string','','96');\n\t\t\tINSERT INTO `#@__webconfig` VALUES('1','cfg_weibo_appkey','微博登录组件AppKey','4','string','','97');";
 //导入其他安装数据
 $data_file = INSTALL_PATH . '/data/install_data.txt';
 if (filesize($data_file) > 0) {
     $fp = fopen($data_file, 'r');
     while (!feof($fp)) {
         $data_str .= trim(fgets($fp, 512 * 1024));
     }
     fclose($fp);
 }
 $querys = explode(';', ClearBOM($data_str));
 foreach ($querys as $q) {
     if (trim($q) == '') {
Beispiel #3
0
    }
    ?>
		<tr align="left" class="dataTr">
			<td height="60" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php 
    echo $row['id'];
    ?>
" /></td>
			<td><?php 
    echo $row['id'];
    ?>
</td>
			<td><span class="thumbs" style="width:48px;"><img src="../data/avatar/index.php?uid=<?php 
    echo $row['id'];
    ?>
&size=small&rnd=<?php 
    echo GetRandStr();
    ?>
" width="48" height="48" /></span></td>
			<td><?php 
    echo $oauthico . $row['username'];
    ?>
</td>
			<td><?php 
    echo $usergroup;
    if ($row['enteruser'] == 1) {
        echo '<br /><span class="red">认证用户</span>';
    }
    ?>
</td>
			<td class="number"><?php 
    echo GetDateMk($row['logintime']);
Beispiel #4
0
     $tmsg .= "<span class='blue'>正在进行数据备份的初始化工作,请稍后...</span>";
     $doform = "<form name='gonext' method='post' action='?action={$action}'>\n\t\t<input type='hidden' name='dopost' value='backup' />\n\t\t<input type='hidden' name='isstruct' value='{$isstruct}' />\n\t\t<input type='hidden' name='tbname' value='{$tables}' />\n\t\t<input type='hidden' name='nowtable' value='{$tbname['0']}' />\n\t\t<input type='hidden' name='fsize' value='{$fsize}' />\n\t\t<input type='hidden' name='startpos' value='0' />\n\t\t<input type='hidden' name='backup_date' value='{$backup_date}' /></form>\n\t\t{$dojs}";
     PutInfo($tmsg, $doform);
     exit;
 } else {
     $fsn = 0;
     //字段数
     $fields = '';
     //字段名称
     $bakstr = '';
     //备份字符串
     $nowtable = isset($nowtable) ? $nowtable : '';
     //当前表
     $intable = "INSERT INTO `{$nowtable}` VALUES(";
     //备份插入字符串
     $backup_file = "{$backup_dir}/{$nowtable}_{$startpos}_" . GetRandStr() . '.txt';
     //当前备份文件
     //分析表里的字段信息
     $j = 0;
     $dosql->GetTableFields($nowtable);
     while ($r = $dosql->GetFieldObject()) {
         $fields[$j] = trim($r->name);
         $j++;
     }
     $fsn = $j - 1;
     //读取表的内容
     $m = 0;
     $dosql->Execute("SELECT * FROM `{$nowtable}`");
     while ($row = $dosql->GetArray()) {
         if ($m < $startpos) {
             $m++;